summaryrefslogtreecommitdiff
path: root/gst/vaapi/gstvaapivideobuffer.c
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2013-08-26 17:14:33 +0200
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2013-08-26 17:14:33 +0200
commit771071a4e593e231d111d835ca82e07a57555251 (patch)
treecf7ea184e73a671b98c4f0be7e3c83ef49fb0638 /gst/vaapi/gstvaapivideobuffer.c
parent292b2f51b4233b75f6f94e0d55d78dc593b261b1 (diff)
decode: fix creation of GLX video buffers for GStreamer 0.10.
Fix creation of GstVaapiVideoBuffer objects (i) to have that type for real; and (ii) to correctly extract the GstSurfaceConverter from the video buffer object meta. This fixes support for cluttersink with GStreamer 0.10 builds.
Diffstat (limited to 'gst/vaapi/gstvaapivideobuffer.c')
-rw-r--r--gst/vaapi/gstvaapivideobuffer.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gst/vaapi/gstvaapivideobuffer.c b/gst/vaapi/gstvaapivideobuffer.c
index 583f49ff..19926d30 100644
--- a/gst/vaapi/gstvaapivideobuffer.c
+++ b/gst/vaapi/gstvaapivideobuffer.c
@@ -198,8 +198,6 @@ typedef struct _GstVaapiVideoBufferClass GstVaapiVideoBufferClass;
struct _GstVaapiVideoBuffer {
/*< private >*/
GstSurfaceBuffer parent_instance;
-
- GstVaapiVideoMeta *meta;
};
/**
@@ -226,11 +224,14 @@ static GstSurfaceConverter *
gst_vaapi_video_buffer_create_converter(GstSurfaceBuffer *surface,
const gchar *type, GValue *dest)
{
- GstVaapiVideoBuffer * const vbuffer = GST_VAAPI_VIDEO_BUFFER(surface);
+ GstVaapiVideoMeta * const meta =
+ gst_buffer_get_vaapi_video_meta(GST_BUFFER(surface));
GstSurfaceConverterCreateFunc func;
+ g_return_val_if_fail(meta != NULL, NULL);
+
func = (GstSurfaceConverterCreateFunc)
- gst_vaapi_video_meta_get_surface_converter(vbuffer->meta);
+ gst_vaapi_video_meta_get_surface_converter(meta);
return func ? func(surface, type, dest) : NULL;
}
@@ -252,7 +253,7 @@ gst_vaapi_video_buffer_init(GstVaapiVideoBuffer *buffer)
static inline GstBuffer *
gst_surface_buffer_new(void)
{
- return GST_BUFFER_CAST(gst_mini_object_new(GST_TYPE_SURFACE_BUFFER));
+ return GST_BUFFER_CAST(gst_mini_object_new(GST_VAAPI_TYPE_VIDEO_BUFFER));
}
#endif