From 45b4ba7df713f6396cf057e9bc4b8472b9b2fa71 Mon Sep 17 00:00:00 2001 From: Zhao Halley Date: Thu, 18 Apr 2013 19:49:42 +0800 Subject: [PATCH] vaapisink: ensure the uploader is setup for upstream allocated buffers. In GStreamer 0.10 builds, make sure that the GstVaapiUploader helper is setup in case upstream elements allocate buffers themselves without honouring our GstVaapiSink::bufer_alloc() hook. In particular, this fixes support for OGG video streams with WebKit. https://bugzilla.gnome.org/show_bug.cgi?id=703934 Signed-off-by: Gwenole Beauchesne --- gst/vaapi/gstvaapisink.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gst/vaapi/gstvaapisink.c b/gst/vaapi/gstvaapisink.c index 868ab1b50b..ae39a516e5 100644 --- a/gst/vaapi/gstvaapisink.c +++ b/gst/vaapi/gstvaapisink.c @@ -776,6 +776,16 @@ gst_vaapisink_set_caps(GstBaseSink *base_sink, GstCaps *caps) if (!gst_vaapisink_ensure_display(sink)) return FALSE; +#if !GST_CHECK_VERSION(1,0,0) + if (sink->use_video_raw) { + /* Ensure the uploader is set up for upstream allocated buffers */ + if (!gst_vaapi_uploader_ensure_display(sink->uploader, sink->display)) + return FALSE; + if (!gst_vaapi_uploader_ensure_caps(sink->uploader, caps, NULL)) + return FALSE; + } +#endif + gst_vaapisink_ensure_rotation(sink, FALSE); gst_vaapisink_ensure_window_size(sink, &win_width, &win_height);