diff options
author | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2020-01-17 16:19:52 +0100 |
---|---|---|
committer | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2020-01-19 15:14:14 +0000 |
commit | 73159cdc5d82484176e0fac9d410a4045c3856b5 (patch) | |
tree | f1778a5b0abcecabed747ac8c1e02811da7b8ae8 /gst | |
parent | 9f627ef2344f5d9f50d53eafc61c0615b6bf3a90 (diff) |
vaapih264enc: accept baseline as constrained baseline compatible
Diffstat (limited to 'gst')
-rw-r--r-- | gst/vaapi/gstvaapiencode_h264.c | 8 | ||||
-rw-r--r-- | gst/vaapi/gstvaapipluginutil.c | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/gst/vaapi/gstvaapiencode_h264.c b/gst/vaapi/gstvaapiencode_h264.c index 98badf42..72aeac5e 100644 --- a/gst/vaapi/gstvaapiencode_h264.c +++ b/gst/vaapi/gstvaapiencode_h264.c @@ -295,6 +295,12 @@ gst_vaapiencode_h264_set_config (GstVaapiEncode * base_encode) if (profile == GST_VAAPI_PROFILE_UNKNOWN) goto fail; + /* if allwed caps request baseline (which is deprecated), the + * encoder will try with constrained baseline which is + * compatible. */ + if (profile == GST_VAAPI_PROFILE_H264_BASELINE) + profile = GST_VAAPI_PROFILE_H264_CONSTRAINED_BASELINE; + tmp_caps = gst_caps_from_string (GST_CODEC_CAPS); gst_caps_set_simple (tmp_caps, "profile", G_TYPE_STRING, gst_vaapi_profile_get_name (profile), NULL); @@ -381,6 +387,8 @@ retry: if (!gst_caps_can_intersect (allowed_caps, tmp_caps)) { if (profile == GST_VAAPI_PROFILE_H264_CONSTRAINED_BASELINE) { profile = GST_VAAPI_PROFILE_H264_BASELINE; + GST_INFO ("user might requested baseline profile, " + "trying constrained-baseline instead"); goto retry; } } else { diff --git a/gst/vaapi/gstvaapipluginutil.c b/gst/vaapi/gstvaapipluginutil.c index 4db9b779..87ab5757 100644 --- a/gst/vaapi/gstvaapipluginutil.c +++ b/gst/vaapi/gstvaapipluginutil.c @@ -1043,6 +1043,8 @@ gst_vaapi_h26x_encoder_get_profiles_from_caps (GstCaps * caps, const gchar *str = g_value_get_string (value); if (str) { profile = func (str); + if (profile == GST_VAAPI_PROFILE_H264_BASELINE) + profile = GST_VAAPI_PROFILE_H264_CONSTRAINED_BASELINE; if (profile != GST_VAAPI_PROFILE_UNKNOWN) g_array_append_val (profiles, profile); } |