New refcounting policy. All getters return a reference, not a copy. So the user shall...
authorgb <gb@5584edef-b1fe-4b99-b61b-dd2bab72e969>
Thu, 11 Mar 2010 12:30:12 +0000 (12:30 +0000)
committergb <gb@5584edef-b1fe-4b99-b61b-dd2bab72e969>
Thu, 11 Mar 2010 12:30:12 +0000 (12:30 +0000)
gst-libs/gst/vaapi/gstvaapiimage.c
gst-libs/gst/vaapi/gstvaapisubpicture.c
gst-libs/gst/vaapi/gstvaapisurface.c

index fdc99f2e99d47a2d7a237bab3b4018ebad65ef0d..fa97e4da0844d40dea097f913c79c27bb685ed94 100644 (file)
@@ -123,7 +123,7 @@ gst_vaapi_image_set_property(
 
     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);
@@ -148,12 +148,11 @@ gst_vaapi_image_get_property(
     GParamSpec *pspec
 )
 {
-    GstVaapiImage        * const image = GST_VAAPI_IMAGE(object);
-    GstVaapiImagePrivate * const priv  = image->priv;
+    GstVaapiImage * const image = GST_VAAPI_IMAGE(object);
 
     switch (prop_id) {
     case PROP_DISPLAY:
-        g_value_set_pointer(value, g_object_ref(priv->display));
+        g_value_set_pointer(value, gst_vaapi_image_get_display(image));
         break;
     case PROP_IMAGE_ID:
         g_value_set_uint(value, gst_vaapi_image_get_id(image));
@@ -296,7 +295,7 @@ gst_vaapi_image_get_display(GstVaapiImage *image)
 {
     g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), NULL);
 
-    return g_object_ref(image->priv->display);
+    return image->priv->display;
 }
 
 guint
index 5ea5660bd32d8378741f137e7135d366dfa66ba4..4c6c4f42d49e53fe25942771b62b3bb5b7775dbd 100644 (file)
@@ -60,7 +60,6 @@ gst_vaapi_subpicture_destroy(GstVaapiSubpicture *subpicture)
                 gst_vaapi_display_get_display(display),
                 priv->subpicture_id
             );
-            g_object_unref(display);
             if (!vaapi_check_status(status, "vaDestroySubpicture()"))
                 g_warning("failed to destroy subpicture 0x%08x\n",
                           priv->subpicture_id);
@@ -94,7 +93,6 @@ gst_vaapi_subpicture_create(GstVaapiSubpicture *subpicture)
         gst_vaapi_image_get_id(priv->image),
         &subpicture_id
     );
-    g_object_unref(display);
     if (!vaapi_check_status(status, "vaCreateSubpicture()"))
         return FALSE;
 
@@ -218,7 +216,7 @@ gst_vaapi_subpicture_get_image(GstVaapiSubpicture *subpicture)
 {
     g_return_val_if_fail(GST_VAAPI_IS_SUBPICTURE(subpicture), NULL);
 
-    return g_object_ref(subpicture->priv->image);
+    return subpicture->priv->image;
 }
 
 void
index d3b68cf22f4b2529e56c8c2779e3133ffd7a178c..efc971999c5be83b23fc93fdb0cc45dd1d53d6ce 100644 (file)
@@ -138,8 +138,7 @@ gst_vaapi_surface_get_property(GObject    *object,
 
     switch (prop_id) {
     case PROP_DISPLAY:
-        /* gst_vaapi_surface_get_display() already refs the object */
-        g_value_take_object(value, gst_vaapi_surface_get_display(surface));
+        g_value_set_object(value, gst_vaapi_surface_get_display(surface));
         break;
     case PROP_SURFACE_ID:
         g_value_set_uint(value, gst_vaapi_surface_get_id(surface));
@@ -272,7 +271,7 @@ 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);
+    return surface->priv->display;
 }
 
 guint