diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index 27ff0626eb..6bf21268e4 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -241,7 +241,7 @@ gst_vaapidecode_update_src_caps (GstVaapiDecode * decode) GstCapsFeatures *features = NULL; GstCaps *allocation_caps; GstVideoInfo *vi; - GstVideoFormat format = GST_VIDEO_FORMAT_NV12; + GstVideoFormat format; GstClockTime latency; gint fps_d, fps_n; guint width, height; @@ -252,9 +252,10 @@ gst_vaapidecode_update_src_caps (GstVaapiDecode * decode) ref_state = decode->input_state; + format = GST_VIDEO_INFO_FORMAT (&decode->decoded_info); feature = gst_vaapi_find_preferred_caps_feature (GST_VIDEO_DECODER_SRC_PAD (vdec), - GST_VIDEO_INFO_FORMAT (&decode->decoded_info), &format); + &format); if (feature == GST_VAAPI_CAPS_FEATURE_NOT_NEGOTIATED) return FALSE; diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c index 16cc449035..5b80a9c51c 100644 --- a/gst/vaapi/gstvaapipluginbase.c +++ b/gst/vaapi/gstvaapipluginbase.c @@ -621,9 +621,7 @@ gst_vaapi_plugin_base_decide_allocation (GstVaapiPluginBase * plugin, goto error_no_caps; if (!feature) - feature = - gst_vaapi_find_preferred_caps_feature (plugin->srcpad, - GST_VIDEO_FORMAT_ENCODED, NULL); + feature = gst_vaapi_find_preferred_caps_feature (plugin->srcpad, NULL); has_video_meta = gst_query_find_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL); diff --git a/gst/vaapi/gstvaapipluginutil.c b/gst/vaapi/gstvaapipluginutil.c index f313d44ff5..50240cb5d8 100644 --- a/gst/vaapi/gstvaapipluginutil.c +++ b/gst/vaapi/gstvaapipluginutil.c @@ -479,7 +479,7 @@ gst_vaapi_find_preferred_format (const GValue * format_list, } GstVaapiCapsFeature -gst_vaapi_find_preferred_caps_feature (GstPad * pad, GstVideoFormat format, +gst_vaapi_find_preferred_caps_feature (GstPad * pad, GstVideoFormat * out_format_ptr) { GstVaapiCapsFeature feature = GST_VAAPI_CAPS_FEATURE_NOT_NEGOTIATED; @@ -548,7 +548,7 @@ gst_vaapi_find_preferred_caps_feature (GstPad * pad, GstVideoFormat format, format_list = gst_structure_get_value (structure, "format"); if (!format_list) goto cleanup; - out_format = gst_vaapi_find_preferred_format (format_list, format); + out_format = gst_vaapi_find_preferred_format (format_list, *out_format_ptr); if (out_format == GST_VIDEO_FORMAT_UNKNOWN) goto cleanup; diff --git a/gst/vaapi/gstvaapipluginutil.h b/gst/vaapi/gstvaapipluginutil.h index 0e62b1f0a9..f1244033c2 100644 --- a/gst/vaapi/gstvaapipluginutil.h +++ b/gst/vaapi/gstvaapipluginutil.h @@ -84,7 +84,7 @@ gst_vaapi_video_format_new_template_caps_with_features (GstVideoFormat format, G_GNUC_INTERNAL GstVaapiCapsFeature -gst_vaapi_find_preferred_caps_feature (GstPad * pad, GstVideoFormat format, +gst_vaapi_find_preferred_caps_feature (GstPad * pad, GstVideoFormat * out_format_ptr); G_GNUC_INTERNAL diff --git a/gst/vaapi/gstvaapipostproc.c b/gst/vaapi/gstvaapipostproc.c index 9d2dac7107..9f066e46cc 100644 --- a/gst/vaapi/gstvaapipostproc.c +++ b/gst/vaapi/gstvaapipostproc.c @@ -1125,7 +1125,7 @@ gst_vaapipostproc_transform_caps_impl (GstBaseTransform * trans, feature = gst_vaapi_find_preferred_caps_feature (GST_BASE_TRANSFORM_SRC_PAD (trans), - out_format, &out_format); + &out_format); gst_video_info_change_format (&vi, out_format, width, height); out_caps = gst_video_info_to_caps (&vi);