mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-13 10:55:34 +00:00
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:
parent
79ec3d00ef
commit
2d7d38cb9c
5 changed files with 8 additions and 9 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue