plugin: remove function parameter

The native format parameter in gst_vaapi_find_preferred_caps_feature() can be
saved if the out format is used for both: in and out. Thus the code is more
readable.

https://bugzilla.gnome.org/show_bug.cgi?id=765223
This commit is contained in:
Víctor Manuel Jáquez Leal 2016-04-18 17:28:51 +02:00
parent 79ec3d00ef
commit 2d7d38cb9c
5 changed files with 8 additions and 9 deletions

View file

@ -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;

View file

@ -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);

View file

@ -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;

View file

@ -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

View file

@ -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);