diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2013-05-07 11:45:10 +0200 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2013-05-07 18:19:03 +0200 |
commit | da403b62d0023b370c5def46f8af76df6384f69e (patch) | |
tree | e847f848683d7063c1de4fcdd73b67a300c0aa52 /tests/test-surfaces.c | |
parent | 98bee4240fc9b57e94524c3a68a0c4b5eaa3c538 (diff) | |
download | gst-vaapi-da403b62d0023b370c5def46f8af76df6384f69e.tar.gz |
tests: cope with new GstVaapiMiniObject objects.
Diffstat (limited to 'tests/test-surfaces.c')
-rw-r--r-- | tests/test-surfaces.c | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/tests/test-surfaces.c b/tests/test-surfaces.c index a5b5f69f..806f8f31 100644 --- a/tests/test-surfaces.c +++ b/tests/test-surfaces.c @@ -26,12 +26,6 @@ #define MAX_SURFACES 4 -static void -gst_vaapi_object_destroy_cb(gpointer object, gpointer user_data) -{ - g_print("destroying GstVaapiObject %p\n", object); -} - int main(int argc, char *argv[]) { @@ -58,14 +52,11 @@ main(int argc, char *argv[]) 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"); + surface_id = gst_vaapi_surface_get_id(surface); g_print("created surface %" GST_VAAPI_ID_FORMAT "\n", GST_VAAPI_ID_ARGS(surface_id)); - g_object_unref(surface); + gst_vaapi_object_unref(surface); caps = gst_caps_new_simple( GST_VAAPI_SURFACE_CAPS_NAME, @@ -91,7 +82,7 @@ main(int argc, char *argv[]) } /* Check the pool doesn't return the last free'd surface */ - surface = g_object_ref(surfaces[1]); + surface = gst_vaapi_object_ref(surfaces[1]); for (i = 0; i < 2; i++) gst_vaapi_video_pool_put_object(pool, surfaces[i]); @@ -114,20 +105,11 @@ main(int argc, char *argv[]) surfaces[i] = NULL; } - g_signal_connect( - G_OBJECT(surface), - "destroy", - G_CALLBACK(gst_vaapi_object_destroy_cb), NULL - ); - /* Unref in random order to check objects are correctly refcounted */ - g_print("unref display\n"); - g_object_unref(display); + gst_vaapi_display_unref(display); gst_caps_unref(caps); - g_print("unref pool\n"); - g_object_unref(pool); - g_print("unref surface\n"); - g_object_unref(surface); + gst_vaapi_video_pool_unref(pool); + gst_vaapi_object_unref(surface); video_output_exit(); return 0; } |