mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
vaapipostproc: handle video sub-buffers.
Intermediate elements may produce a sub-buffer from a valid GstVaapiVideoBuffer for non raw YUV cases. Make sure vaapipostproc now understands those buffers.
This commit is contained in:
parent
098eb2624e
commit
936d8b8fc6
1 changed files with 14 additions and 1 deletions
|
@ -255,7 +255,7 @@ gst_vaapipostproc_stop(GstVaapiPostproc *postproc)
|
|||
static GstFlowReturn
|
||||
gst_vaapipostproc_process(GstVaapiPostproc *postproc, GstBuffer *buf)
|
||||
{
|
||||
GstVaapiVideoBuffer *vbuf = GST_VAAPI_VIDEO_BUFFER(buf);
|
||||
GstVaapiVideoBuffer *vbuf;
|
||||
GstVaapiSurfaceProxy *proxy;
|
||||
GstClockTime timestamp;
|
||||
GstFlowReturn ret;
|
||||
|
@ -263,6 +263,13 @@ gst_vaapipostproc_process(GstVaapiPostproc *postproc, GstBuffer *buf)
|
|||
guint outbuf_flags, flags;
|
||||
gboolean interlaced, tff;
|
||||
|
||||
if (GST_VAAPI_IS_VIDEO_BUFFER(buf))
|
||||
vbuf = GST_VAAPI_VIDEO_BUFFER(buf);
|
||||
else if (GST_VAAPI_IS_VIDEO_BUFFER(buf->parent))
|
||||
vbuf = GST_VAAPI_VIDEO_BUFFER(buf->parent);
|
||||
else
|
||||
goto error_invalid_buffer;
|
||||
|
||||
flags = gst_vaapi_video_buffer_get_render_flags(vbuf);
|
||||
|
||||
/* Deinterlacing disabled, push frame */
|
||||
|
@ -328,6 +335,12 @@ gst_vaapipostproc_process(GstVaapiPostproc *postproc, GstBuffer *buf)
|
|||
return GST_FLOW_OK;
|
||||
|
||||
/* ERRORS */
|
||||
error_invalid_buffer:
|
||||
{
|
||||
GST_ERROR("failed to receive a valid video buffer");
|
||||
gst_buffer_unref(buf);
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
}
|
||||
error_create_buffer:
|
||||
{
|
||||
GST_ERROR("failed to create output buffer");
|
||||
|
|
Loading…
Reference in a new issue