static void
gst_vaapi_object_destroy_cb(gpointer object, gpointer user_data)
{
- g_print("Destroying GstVaapiObject %p\n", object);
+ g_print("destroying GstVaapiObject %p\n", object);
}
int
main(int argc, char *argv[])
{
- GstVaapiDisplay *display;
- GstVaapiSurface *surface;
- GstVaapiSurface *surfaces[MAX_SURFACES];
- GstVaapiVideoPool *pool;
- GstCaps *caps;
- gint i;
+ GstVaapiDisplay *display;
+ GstVaapiSurface *surface;
+ GstVaapiID surface_id;
+ GstVaapiSurface *surfaces[MAX_SURFACES];
+ GstVaapiVideoPool *pool;
+ GstCaps *caps;
+ gint i;
static const GstVaapiChromaType chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420;
static const guint width = 320;
surface = gst_vaapi_surface_new(display, chroma_type, width, height);
if (!surface)
g_error("could not create Gst/VA surface");
+
+ /* This also tests for the GstVaapiParamSpecID */
+ g_object_get(G_OBJECT(surface), "id", &surface_id, NULL);
+ 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));
+
g_object_unref(surface);
caps = gst_caps_new_simple(
surface = gst_vaapi_video_pool_get_object(pool);
if (!surface)
g_error("could not allocate Gst/VA surface from pool");
- g_print("created surface 0x%08x from pool\n",
- gst_vaapi_surface_get_id(surface));
+ g_print("created surface %" GST_VAAPI_ID_FORMAT " from pool\n",
+ GST_VAAPI_ID_ARGS(gst_vaapi_surface_get_id(surface)));
surfaces[i] = surface;
}
surfaces[i] = gst_vaapi_video_pool_get_object(pool);
if (!surfaces[i])
g_error("could not re-allocate Gst/VA surface%d from pool", i);
- g_print("created surface 0x%08x from pool (realloc)\n",
- gst_vaapi_surface_get_id(surfaces[i]));
+ g_print("created surface %" GST_VAAPI_ID_FORMAT " from pool (realloc)\n",
+ GST_VAAPI_ID_ARGS(gst_vaapi_surface_get_id(surfaces[i])));
}
if (surface == surfaces[0])