Restore the gst_vaapi_{surface,image,subpicture}_get_id() interfaces.
authorgb <gb@5584edef-b1fe-4b99-b61b-dd2bab72e969>
Thu, 25 Mar 2010 09:49:17 +0000 (09:49 +0000)
committergb <gb@5584edef-b1fe-4b99-b61b-dd2bab72e969>
Thu, 25 Mar 2010 09:49:17 +0000 (09:49 +0000)
docs/reference/libs/libs-sections.txt
gst-libs/gst/vaapi/gstvaapiimage.c
gst-libs/gst/vaapi/gstvaapiimage.h
gst-libs/gst/vaapi/gstvaapisubpicture.c
gst-libs/gst/vaapi/gstvaapisubpicture.h
gst-libs/gst/vaapi/gstvaapisurface.c
gst-libs/gst/vaapi/gstvaapisurface.h
tests/test-surfaces.c

index b5a1ddf..2c11866 100644 (file)
@@ -236,6 +236,7 @@ GstVaapiImage
 GstVaapiImageClass
 gst_vaapi_image_new
 gst_vaapi_image_new_with_image
+gst_vaapi_image_get_id
 gst_vaapi_image_get_image
 gst_vaapi_image_get_format
 gst_vaapi_image_get_width
@@ -268,6 +269,7 @@ GstVaapiSurfaceRenderFlags
 GstVaapiSurface
 GstVaapiSurfaceClass
 gst_vaapi_surface_new
+gst_vaapi_surface_get_id
 gst_vaapi_surface_get_chroma_type
 gst_vaapi_surface_get_width
 gst_vaapi_surface_get_height
@@ -294,6 +296,7 @@ GST_VAAPI_SURFACE_GET_CLASS
 GstVaapiSubpicture
 GstVaapiSubpictureClass
 gst_vaapi_subpicture_new
+gst_vaapi_subpicture_get_id
 gst_vaapi_subpicture_get_image
 gst_vaapi_subpicture_set_image
 <SUBSECTION Standard>
index b637484..d993ef8 100644 (file)
@@ -505,6 +505,23 @@ gst_vaapi_image_new_with_image(GstVaapiDisplay *display, VAImage *va_image)
 }
 
 /**
+ * gst_vaapi_image_get_id:
+ * @image: a #GstVaapiImage
+ *
+ * Returns the underlying VAImageID of the @image.
+ *
+ * Return value: the underlying VA image id
+ */
+VAImageID
+gst_vaapi_image_get_id(GstVaapiImage *image)
+{
+    g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), VA_INVALID_ID);
+    g_return_val_if_fail(image->priv->is_constructed, VA_INVALID_ID);
+
+    return GST_VAAPI_OBJECT_ID(image);
+}
+
+/**
  * gst_vaapi_image_get_image:
  * @image: a #GstVaapiImage
  * @va_image: a VA image
index f333c1a..d153267 100644 (file)
@@ -116,6 +116,9 @@ gst_vaapi_image_new(
 GstVaapiImage *
 gst_vaapi_image_new_with_image(GstVaapiDisplay *display, VAImage *va_image);
 
+VAImageID
+gst_vaapi_image_get_id(GstVaapiImage *image);
+
 gboolean
 gst_vaapi_image_get_image(GstVaapiImage *image, VAImage *va_image);
 
index d3047c4..a015042 100644 (file)
@@ -218,6 +218,22 @@ gst_vaapi_subpicture_new(GstVaapiImage *image)
 }
 
 /**
+ * gst_vaapi_subpicture_get_id:
+ * @subpicture: a #GstVaapiSubpicture
+ *
+ * Returns the underlying VASubpictureID of the @subpicture.
+ *
+ * Return value: the underlying VA subpicture id
+ */
+VASubpictureID
+gst_vaapi_subpicture_get_id(GstVaapiSubpicture *subpicture)
+{
+    g_return_val_if_fail(GST_VAAPI_IS_SUBPICTURE(subpicture), VA_INVALID_ID);
+
+    return GST_VAAPI_OBJECT_ID(subpicture);
+}
+
+/**
  * gst_vaapi_subpicture_get_image:
  * @subpicture: a #GstVaapiSubpicture
  *
index 3103fc3..7c4b125 100644 (file)
@@ -83,6 +83,9 @@ gst_vaapi_subpicture_get_type(void);
 GstVaapiSubpicture *
 gst_vaapi_subpicture_new(GstVaapiImage *image);
 
+VASubpictureID
+gst_vaapi_subpicture_get_id(GstVaapiSubpicture *subpicture);
+
 GstVaapiImage *
 gst_vaapi_subpicture_get_image(GstVaapiSubpicture *subpicture);
 
index 58026d3..2a26eaa 100644 (file)
@@ -306,6 +306,22 @@ gst_vaapi_surface_new(
 }
 
 /**
+ * gst_vaapi_surface_get_id:
+ * @surface: a #GstVaapiSurface
+ *
+ * Returns the underlying VASurfaceID of the @surface.
+ *
+ * Return value: the underlying VA surface id
+ */
+VASurfaceID
+gst_vaapi_surface_get_id(GstVaapiSurface *surface)
+{
+    g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), VA_INVALID_SURFACE);
+
+    return GST_VAAPI_OBJECT_ID(surface);
+}
+
+/**
  * gst_vaapi_surface_get_chroma_type:
  * @surface: a #GstVaapiSurface
  *
index a0e4379..db92955 100644 (file)
@@ -133,6 +133,9 @@ gst_vaapi_surface_new(
     guint               height
 );
 
+VASurfaceID
+gst_vaapi_surface_get_id(GstVaapiSurface *surface);
+
 GstVaapiChromaType
 gst_vaapi_surface_get_chroma_type(GstVaapiSurface *surface);
 
index ef8d277..9332391 100644 (file)
@@ -57,7 +57,7 @@ main(int argc, char *argv[])
 
     /* This also tests for the GstVaapiParamSpecID */
     g_object_get(G_OBJECT(surface), "id", &surface_id, NULL);
-    if (surface_id != gst_vaapi_object_get_id(GST_VAAPI_OBJECT(surface)))
+    if (surface_id != gst_vaapi_surface_get_id(surface))
         g_error("could not retrieve the native surface ID");
     g_print("created surface %" GST_VAAPI_ID_FORMAT "\n",
             GST_VAAPI_ID_ARGS(surface_id));
@@ -82,7 +82,7 @@ main(int argc, char *argv[])
         if (!surface)
             g_error("could not allocate Gst/VA surface from pool");
         g_print("created surface %" GST_VAAPI_ID_FORMAT " from pool\n",
-                GST_VAAPI_ID_ARGS(gst_vaapi_object_get_id(GST_VAAPI_OBJECT(surface))));
+                GST_VAAPI_ID_ARGS(gst_vaapi_surface_get_id(surface)));
         surfaces[i] = surface;
     }
 
@@ -97,7 +97,7 @@ main(int argc, char *argv[])
         if (!surfaces[i])
             g_error("could not re-allocate Gst/VA surface%d from pool", i);
         g_print("created surface %" GST_VAAPI_ID_FORMAT " from pool (realloc)\n",
-                GST_VAAPI_ID_ARGS(gst_vaapi_object_get_id(GST_VAAPI_OBJECT(surfaces[i]))));
+                GST_VAAPI_ID_ARGS(gst_vaapi_surface_get_id(surfaces[i])));
     }
 
     if (surface == surfaces[0])