mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
Don't use downstream buffer allocation.
With the new video/x-surface abstraction, we can't rely on having a VA specific sink downstream. Also, there was no particular reason to do that. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
This commit is contained in:
parent
075374cda3
commit
b170d1a982
2 changed files with 3 additions and 55 deletions
|
@ -209,17 +209,12 @@ gst_vaapidecode_step(GstVaapiDecode *decode)
|
||||||
decode
|
decode
|
||||||
);
|
);
|
||||||
|
|
||||||
buffer = NULL;
|
buffer = gst_vaapi_video_buffer_new(decode->display);
|
||||||
ret = gst_pad_alloc_buffer(
|
if (!buffer)
|
||||||
decode->srcpad,
|
|
||||||
0, 0,
|
|
||||||
GST_PAD_CAPS(decode->srcpad),
|
|
||||||
&buffer
|
|
||||||
);
|
|
||||||
if (ret != GST_FLOW_OK || !buffer)
|
|
||||||
goto error_create_buffer;
|
goto error_create_buffer;
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP(buffer) = GST_VAAPI_SURFACE_PROXY_TIMESTAMP(proxy);
|
GST_BUFFER_TIMESTAMP(buffer) = GST_VAAPI_SURFACE_PROXY_TIMESTAMP(proxy);
|
||||||
|
gst_buffer_set_caps(buffer, GST_PAD_CAPS(decode->srcpad));
|
||||||
gst_vaapi_video_buffer_set_surface_proxy(
|
gst_vaapi_video_buffer_set_surface_proxy(
|
||||||
GST_VAAPI_VIDEO_BUFFER(buffer),
|
GST_VAAPI_VIDEO_BUFFER(buffer),
|
||||||
proxy
|
proxy
|
||||||
|
|
|
@ -482,52 +482,6 @@ gst_vaapisink_set_caps(GstBaseSink *base_sink, GstCaps *caps)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
|
||||||
gst_vaapisink_buffer_alloc(
|
|
||||||
GstBaseSink *base_sink,
|
|
||||||
guint64 offset,
|
|
||||||
guint size,
|
|
||||||
GstCaps *caps,
|
|
||||||
GstBuffer **pout_buffer
|
|
||||||
)
|
|
||||||
{
|
|
||||||
GstVaapiSink * const sink = GST_VAAPISINK(base_sink);
|
|
||||||
GstStructure *structure;
|
|
||||||
GstBuffer *buffer;
|
|
||||||
|
|
||||||
if (!gst_vaapi_ensure_display(sink, &sink->display))
|
|
||||||
goto error_ensure_display;
|
|
||||||
|
|
||||||
structure = gst_caps_get_structure(caps, 0);
|
|
||||||
if (!gst_structure_has_name(structure, GST_VAAPI_SURFACE_CAPS_NAME))
|
|
||||||
goto error_invalid_caps;
|
|
||||||
|
|
||||||
buffer = gst_vaapi_video_buffer_new(sink->display);
|
|
||||||
if (!buffer)
|
|
||||||
goto error_create_buffer;
|
|
||||||
|
|
||||||
gst_buffer_set_caps(buffer, caps);
|
|
||||||
*pout_buffer = buffer;
|
|
||||||
return GST_FLOW_OK;
|
|
||||||
|
|
||||||
/* ERRORS */
|
|
||||||
error_ensure_display:
|
|
||||||
{
|
|
||||||
GST_ERROR("failed to ensure display");
|
|
||||||
return GST_FLOW_UNEXPECTED;
|
|
||||||
}
|
|
||||||
error_invalid_caps:
|
|
||||||
{
|
|
||||||
GST_ERROR("failed to validate input caps");
|
|
||||||
return GST_FLOW_UNEXPECTED;
|
|
||||||
}
|
|
||||||
error_create_buffer:
|
|
||||||
{
|
|
||||||
GST_ERROR("failed to create video buffer");
|
|
||||||
return GST_FLOW_UNEXPECTED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#if USE_VAAPISINK_GLX
|
#if USE_VAAPISINK_GLX
|
||||||
static void
|
static void
|
||||||
render_background(GstVaapiSink *sink)
|
render_background(GstVaapiSink *sink)
|
||||||
|
@ -837,7 +791,6 @@ gst_vaapisink_class_init(GstVaapiSinkClass *klass)
|
||||||
basesink_class->start = gst_vaapisink_start;
|
basesink_class->start = gst_vaapisink_start;
|
||||||
basesink_class->stop = gst_vaapisink_stop;
|
basesink_class->stop = gst_vaapisink_stop;
|
||||||
basesink_class->set_caps = gst_vaapisink_set_caps;
|
basesink_class->set_caps = gst_vaapisink_set_caps;
|
||||||
basesink_class->buffer_alloc = gst_vaapisink_buffer_alloc;
|
|
||||||
basesink_class->preroll = gst_vaapisink_show_frame;
|
basesink_class->preroll = gst_vaapisink_show_frame;
|
||||||
basesink_class->render = gst_vaapisink_show_frame;
|
basesink_class->render = gst_vaapisink_show_frame;
|
||||||
basesink_class->query = gst_vaapisink_query;
|
basesink_class->query = gst_vaapisink_query;
|
||||||
|
|
Loading…
Reference in a new issue