Add helper to get GstVaapiDisplay from a surface.
authorgb <gb@5584edef-b1fe-4b99-b61b-dd2bab72e969>
Fri, 5 Mar 2010 10:04:55 +0000 (10:04 +0000)
committergb <gb@5584edef-b1fe-4b99-b61b-dd2bab72e969>
Fri, 5 Mar 2010 10:04:55 +0000 (10:04 +0000)
gst-libs/gst/vaapi/gstvaapisurface.c
gst-libs/gst/vaapi/gstvaapisurface.h

index 2f52850..c6ff1c1 100644 (file)
@@ -111,7 +111,7 @@ gst_vaapi_surface_set_property(GObject      *object,
 
     switch (prop_id) {
     case PROP_DISPLAY:
-        priv->display = g_object_ref(g_value_get_pointer(value));
+        priv->display = g_object_ref(g_value_get_object(value));
         break;
     case PROP_WIDTH:
         priv->width = g_value_get_uint(value);
@@ -139,7 +139,8 @@ gst_vaapi_surface_get_property(GObject    *object,
 
     switch (prop_id) {
     case PROP_DISPLAY:
-        g_value_set_pointer(value, g_object_ref(priv->display));
+        /* gst_vaapi_surface_get_display() already refs the object */
+        g_value_take_object(value, gst_vaapi_surface_get_display(surface));
         break;
     case PROP_SURFACE_ID:
         g_value_set_uint(value, gst_vaapi_surface_get_id(surface));
@@ -283,6 +284,14 @@ gst_vaapi_surface_get_id(GstVaapiSurface *surface)
     return priv->surface_id;
 }
 
+GstVaapiDisplay *
+gst_vaapi_surface_get_display(GstVaapiSurface *surface)
+{
+    g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), NULL);
+
+    return g_object_ref(surface->priv->display);
+}
+
 guint
 gst_vaapi_surface_get_width(GstVaapiSurface *surface)
 {
index cbbd1ba..7d8f276 100644 (file)
@@ -77,6 +77,9 @@ gst_vaapi_surface_new(GstVaapiDisplay *display,
 VASurfaceID
 gst_vaapi_surface_get_id(GstVaapiSurface *surface);
 
+GstVaapiDisplay *
+gst_vaapi_surface_get_display(GstVaapiSurface *surface);
+
 guint
 gst_vaapi_surface_get_width(GstVaapiSurface *surface);