mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 19:20:35 +00:00
vaapipostproc: improve heuristics for detecting native VA surfaces.
Use the new gst_caps_has_vaapi_surface() helper function to detect whether the sink pad caps contain native VA surfaces, or not, i.e. no raw video caps. Also rename is_raw_yuv to get_va_surfaces to make the variable more explicit as we just want a way to differentiate raw video caps from VA surfaces actually.
This commit is contained in:
parent
6d8c5221b2
commit
d82e6a8866
2 changed files with 5 additions and 4 deletions
|
@ -830,7 +830,7 @@ gst_vaapipostproc_update_sink_caps(GstVaapiPostproc *postproc, GstCaps *caps,
|
|||
gst_util_uint64_scale(GST_SECOND, GST_VIDEO_INFO_FPS_D(&vi),
|
||||
(1 + deinterlace) * GST_VIDEO_INFO_FPS_N(&vi)) : 0;
|
||||
|
||||
postproc->is_raw_yuv = GST_VIDEO_INFO_IS_YUV(&vi);
|
||||
postproc->get_va_surfaces = gst_caps_has_vaapi_surface(caps);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -1098,7 +1098,7 @@ gst_vaapipostproc_transform_size(GstBaseTransform *trans,
|
|||
{
|
||||
GstVaapiPostproc * const postproc = GST_VAAPIPOSTPROC(trans);
|
||||
|
||||
if (direction == GST_PAD_SINK || !postproc->is_raw_yuv)
|
||||
if (direction == GST_PAD_SINK || postproc->get_va_surfaces)
|
||||
*othersize = 0;
|
||||
else
|
||||
*othersize = size;
|
||||
|
@ -1237,7 +1237,7 @@ gst_vaapipostproc_propose_allocation(GstBaseTransform *trans,
|
|||
GstVaapiPluginBase * const plugin = GST_VAAPI_PLUGIN_BASE(trans);
|
||||
|
||||
/* Let vaapidecode allocate the video buffers */
|
||||
if (!postproc->is_raw_yuv)
|
||||
if (postproc->get_va_surfaces)
|
||||
return FALSE;
|
||||
if (!gst_vaapi_plugin_base_propose_allocation(plugin, query))
|
||||
return FALSE;
|
||||
|
@ -1587,6 +1587,7 @@ gst_vaapipostproc_init(GstVaapiPostproc *postproc)
|
|||
postproc->deinterlace_method = DEFAULT_DEINTERLACE_METHOD;
|
||||
postproc->field_duration = GST_CLOCK_TIME_NONE;
|
||||
postproc->keep_aspect = TRUE;
|
||||
postproc->get_va_surfaces = TRUE;
|
||||
|
||||
gst_video_info_init(&postproc->sinkpad_info);
|
||||
gst_video_info_init(&postproc->srcpad_info);
|
||||
|
|
|
@ -166,7 +166,7 @@ struct _GstVaapiPostproc {
|
|||
gfloat brightness;
|
||||
gfloat contrast;
|
||||
|
||||
guint is_raw_yuv : 1;
|
||||
guint get_va_surfaces : 1;
|
||||
guint use_vpp : 1;
|
||||
guint keep_aspect : 1;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue