Restore the gst_vaapi_{surface,image,subpicture}_get_id() interfaces.

This commit is contained in:
gb 2010-03-25 09:49:17 +00:00
parent e4775c4e16
commit 1703ef2aca
8 changed files with 64 additions and 3 deletions

View 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>

View file

@ -504,6 +504,23 @@ gst_vaapi_image_new_with_image(GstVaapiDisplay *display, VAImage *va_image)
return 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

View 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);

View file

@ -217,6 +217,22 @@ gst_vaapi_subpicture_new(GstVaapiImage *image)
NULL);
}
/**
* 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

View 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);

View file

@ -305,6 +305,22 @@ gst_vaapi_surface_new(
NULL);
}
/**
* 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

View 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);

View 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])