diff options
author | Andre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk> | 2012-10-16 21:05:30 -0300 |
---|---|---|
committer | Lionel Landwerlin <llandwerlin@gmail.com> | 2013-03-18 16:24:18 +0000 |
commit | 97b1e5ad8c4cabe68553bf4138b1ae5d12535ec3 (patch) | |
tree | b9218e153642e0383286543caf872e4e88975466 /tests | |
parent | f06364ba5aa6792a9aee2cbd984dcfe73973ebb7 (diff) | |
download | clutter-gst-97b1e5ad8c4cabe68553bf4138b1ae5d12535ec3.tar.gz |
Do not use deprecated ClutterTexture.
- Remove ClutterGstVideoTexture to be replaced by ClutterGstVideoActor.
- Make cluttersink/autocluttersink gstreamer elements accept a ClutterGstActor instead of a
ClutterTexture for painting.
- This patch temporarily disable examples/video-player and some tests requiring
ClutterGstVideoTexture.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 33 | ||||
-rw-r--r-- | tests/test-alpha.c | 39 | ||||
-rw-r--r-- | tests/test-rgb-upload.c | 23 | ||||
-rw-r--r-- | tests/test-yuv-upload.c | 23 |
4 files changed, 54 insertions, 64 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 59fc3ba..9c4df22 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,11 +1,16 @@ NULL = # +#noinst_PROGRAMS = \ +# test-alpha \ +# test-rgb-upload \ +# test-start-stop \ +# test-yuv-upload \ +# test-video-texture-new-unref-loop \ +# $(NULL) noinst_PROGRAMS = \ test-alpha \ test-rgb-upload \ - test-start-stop \ test-yuv-upload \ - test-video-texture-new-unref-loop \ $(NULL) INCLUDES = -I$(top_srcdir) \ @@ -26,12 +31,12 @@ test_rgb_upload_LDFLAGS = \ $(GST_LIBS) \ $(top_builddir)/clutter-gst/libclutter-gst-@CLUTTER_GST_MAJORMINOR@.la -test_start_stop_SOURCES = test-start-stop.c -test_start_stop_CFLAGS = $(CLUTTER_GST_CFLAGS) $(GST_CFLAGS) -test_start_stop_LDFLAGS = \ - $(CLUTTER_GST_LIBS) \ - $(GST_LIBS) \ - $(top_builddir)/clutter-gst/libclutter-gst-@CLUTTER_GST_MAJORMINOR@.la +#test_start_stop_SOURCES = test-start-stop.c +#test_start_stop_CFLAGS = $(CLUTTER_GST_CFLAGS) $(GST_CFLAGS) +#test_start_stop_LDFLAGS = \ +# $(CLUTTER_GST_LIBS) \ +# $(GST_LIBS) \ +# $(top_builddir)/clutter-gst/libclutter-gst-@CLUTTER_GST_MAJORMINOR@.la test_yuv_upload_SOURCES = test-yuv-upload.c test_yuv_upload_CFLAGS = $(CLUTTER_GST_CFLAGS) $(GST_CFLAGS) @@ -40,9 +45,9 @@ test_yuv_upload_LDFLAGS = \ $(GST_LIBS) \ $(top_builddir)/clutter-gst/libclutter-gst-@CLUTTER_GST_MAJORMINOR@.la -test_video_texture_new_unref_loop_SOURCES = test-video-texture-new-unref-loop.c -test_video_texture_new_unref_loop_CFLAGS = $(CLUTTER_GST_CFLAGS) $(GST_CFLAGS) -test_video_texture_new_unref_loop_LDFLAGS = \ - $(CLUTTER_GST_LIBS) \ - $(GST_LIBS) \ - $(top_builddir)/clutter-gst/libclutter-gst-@CLUTTER_GST_MAJORMINOR@.la +#test_video_texture_new_unref_loop_SOURCES = test-video-texture-new-unref-loop.c +#test_video_texture_new_unref_loop_CFLAGS = $(CLUTTER_GST_CFLAGS) $(GST_CFLAGS) +#test_video_texture_new_unref_loop_LDFLAGS = \ +# $(CLUTTER_GST_LIBS) \ +# $(GST_LIBS) \ +# $(top_builddir)/clutter-gst/libclutter-gst-@CLUTTER_GST_MAJORMINOR@.la diff --git a/tests/test-alpha.c b/tests/test-alpha.c index 359ba0a..4f54315 100644 --- a/tests/test-alpha.c +++ b/tests/test-alpha.c @@ -66,7 +66,7 @@ parse_fourcc (const gchar *fourcc) } void -size_change (ClutterTexture *texture, +size_change (ClutterActor *actor, gint width, gint height, gpointer user_data) @@ -75,7 +75,7 @@ size_change (ClutterTexture *texture, gfloat new_x, new_y, new_width, new_height; gfloat stage_width, stage_height; - stage = clutter_actor_get_stage (CLUTTER_ACTOR (texture)); + stage = clutter_actor_get_stage (actor); if (stage == NULL) return; @@ -98,8 +98,8 @@ size_change (ClutterTexture *texture, new_y = 0; } - clutter_actor_set_position (CLUTTER_ACTOR (texture), new_x, new_y); - clutter_actor_set_size (CLUTTER_ACTOR (texture), new_width, new_height); + clutter_actor_set_position (actor, new_x, new_y); + clutter_actor_set_size (actor, new_width, new_height); } int @@ -112,7 +112,7 @@ main (int argc, char *argv[]) const ClutterColor rectangle_color = { 96, 0, 0, 255}; const ClutterRect rectangle_geom = { {110, 70}, {100, 100}}; ClutterActor *stage; - ClutterActor *texture; + ClutterActor *actor; ClutterActor *rectangle; ClutterTransition *animation; @@ -127,7 +127,7 @@ main (int argc, char *argv[]) result = clutter_gst_init_with_args (&argc, &argv, - " - Test alpha with video textures", + " - Test alpha with video actors", options, NULL, &error); @@ -153,15 +153,10 @@ main (int argc, char *argv[]) rectangle_geom.size.width, rectangle_geom.size.height); - /* We need to set certain props on the target texture currently for - * efficient/corrent playback onto the texture (which sucks a bit) - */ - texture = g_object_new (CLUTTER_TYPE_TEXTURE, - "disable-slicing", TRUE, - NULL); - clutter_actor_set_opacity (texture, 0); + actor = g_object_new (CLUTTER_GST_TYPE_ACTOR, NULL); + clutter_actor_set_opacity (actor, 0); - g_signal_connect (CLUTTER_TEXTURE (texture), + g_signal_connect (actor, "size-change", G_CALLBACK (size_change), NULL); @@ -172,7 +167,7 @@ main (int argc, char *argv[]) g_object_set (G_OBJECT (src), "pattern", 1, NULL); capsfilter = gst_element_factory_make ("capsfilter", NULL); sink = gst_element_factory_make ("cluttersink", NULL); - g_object_set (G_OBJECT (sink), "texture", CLUTTER_TEXTURE (texture), NULL); + g_object_set (G_OBJECT (sink), "actor", actor, NULL); /* make videotestsrc spit the format we want */ if (g_strcmp0 (opt_fourcc, "RGB ") == 0) @@ -204,18 +199,18 @@ main (int argc, char *argv[]) gst_element_set_state (GST_ELEMENT(pipeline), GST_STATE_PLAYING); clutter_actor_add_child (stage, rectangle); - clutter_actor_add_child (stage, texture); + clutter_actor_add_child (stage, actor); clutter_actor_show (stage); - clutter_actor_save_easing_state (texture); - clutter_actor_set_easing_mode (texture, CLUTTER_LINEAR); - clutter_actor_set_easing_duration (texture, 6000); + clutter_actor_save_easing_state (actor); + clutter_actor_set_easing_mode (actor, CLUTTER_LINEAR); + clutter_actor_set_easing_duration (actor, 6000); - clutter_actor_set_opacity (texture, 0xff); + clutter_actor_set_opacity (actor, 0xff); - clutter_actor_restore_easing_state (texture); + clutter_actor_restore_easing_state (actor); - animation = clutter_actor_get_transition (texture, "opacity"); + animation = clutter_actor_get_transition (actor, "opacity"); clutter_timeline_set_repeat_count (CLUTTER_TIMELINE (animation), -1); clutter_main(); diff --git a/tests/test-rgb-upload.c b/tests/test-rgb-upload.c index aeccf8f..3dcbd55 100644 --- a/tests/test-rgb-upload.c +++ b/tests/test-rgb-upload.c @@ -64,7 +64,7 @@ static GOptionEntry options[] = }; void -size_change (ClutterTexture *texture, +size_change (ClutterActor *actor, gint width, gint height, gpointer user_data) @@ -73,7 +73,7 @@ size_change (ClutterTexture *texture, gfloat new_x, new_y, new_width, new_height; gfloat stage_width, stage_height; - stage = clutter_actor_get_stage (CLUTTER_ACTOR (texture)); + stage = clutter_actor_get_stage (actor); if (stage == NULL) return; @@ -96,8 +96,8 @@ size_change (ClutterTexture *texture, new_y = 0; } - clutter_actor_set_position (CLUTTER_ACTOR (texture), new_x, new_y); - clutter_actor_set_size (CLUTTER_ACTOR (texture), new_width, new_height); + clutter_actor_set_position (actor, new_x, new_y); + clutter_actor_set_size (actor, new_width, new_height); } int @@ -106,7 +106,7 @@ main (int argc, char *argv[]) GError *error = NULL; gboolean result; ClutterActor *stage; - ClutterActor *texture; + ClutterActor *actor; GstPipeline *pipeline; GstElement *src; GstElement *capsfilter; @@ -135,14 +135,9 @@ main (int argc, char *argv[]) stage = clutter_stage_new (); clutter_actor_set_size (CLUTTER_ACTOR (stage), 320.0f, 240.0f); - /* We need to set certain props on the target texture currently for - * efficient/corrent playback onto the texture (which sucks a bit) - */ - texture = g_object_new (CLUTTER_TYPE_TEXTURE, - "disable-slicing", TRUE, - NULL); + actor = g_object_new (CLUTTER_GST_TYPE_ACTOR, NULL); - g_signal_connect (CLUTTER_TEXTURE (texture), + g_signal_connect (actor, "size-change", G_CALLBACK (size_change), NULL); @@ -152,7 +147,7 @@ main (int argc, char *argv[]) src = gst_element_factory_make ("videotestsrc", NULL); capsfilter = gst_element_factory_make ("capsfilter", NULL); sink = gst_element_factory_make ("cluttersink", NULL); - g_object_set (sink, "texture", CLUTTER_TEXTURE (texture), NULL); + g_object_set (sink, "actor", actor, NULL); format = gst_video_format_from_masks(opt_depth, opt_bpp, G_BIG_ENDIAN, 0xff0000, @@ -173,7 +168,7 @@ main (int argc, char *argv[]) g_critical("Could not link elements"); gst_element_set_state (GST_ELEMENT(pipeline), GST_STATE_PLAYING); - clutter_actor_add_child (stage, texture); + clutter_actor_add_child (stage, actor); clutter_actor_show (stage); clutter_main(); diff --git a/tests/test-yuv-upload.c b/tests/test-yuv-upload.c index 682733e..66668c4 100644 --- a/tests/test-yuv-upload.c +++ b/tests/test-yuv-upload.c @@ -53,7 +53,7 @@ static GOptionEntry options[] = }; void -size_change (ClutterTexture *texture, +size_change (ClutterActor *actor, gint width, gint height, gpointer user_data) @@ -62,7 +62,7 @@ size_change (ClutterTexture *texture, gfloat new_x, new_y, new_width, new_height; gfloat stage_width, stage_height; - stage = clutter_actor_get_stage (CLUTTER_ACTOR (texture)); + stage = clutter_actor_get_stage (actor); if (stage == NULL) return; @@ -85,8 +85,8 @@ size_change (ClutterTexture *texture, new_y = 0; } - clutter_actor_set_position (CLUTTER_ACTOR (texture), new_x, new_y); - clutter_actor_set_size (CLUTTER_ACTOR (texture), new_width, new_height); + clutter_actor_set_position (actor, new_x, new_y); + clutter_actor_set_size (actor, new_width, new_height); } int @@ -95,7 +95,7 @@ main (int argc, char *argv[]) GError *error = NULL; gboolean result; ClutterActor *stage; - ClutterActor *texture; + ClutterActor *actor; GstPipeline *pipeline; GstElement *src; GstElement *capsfilter; @@ -122,14 +122,9 @@ main (int argc, char *argv[]) stage = clutter_stage_new (); clutter_actor_set_size (CLUTTER_ACTOR(stage), 320.0f, 240.0f); - /* We need to set certain props on the target texture currently for - * efficient/corrent playback onto the texture (which sucks a bit) - */ - texture = g_object_new (CLUTTER_TYPE_TEXTURE, - "disable-slicing", TRUE, - NULL); + actor = g_object_new (CLUTTER_GST_TYPE_ACTOR, NULL); - g_signal_connect (CLUTTER_TEXTURE (texture), + g_signal_connect (actor, "size-change", G_CALLBACK (size_change), NULL); @@ -139,7 +134,7 @@ main (int argc, char *argv[]) src = gst_element_factory_make ("videotestsrc", NULL); capsfilter = gst_element_factory_make ("capsfilter", NULL); sink = gst_element_factory_make ("cluttersink", NULL); - g_object_set (sink, "texture", CLUTTER_TEXTURE (texture), NULL); + g_object_set (sink, "actor", actor, NULL); /* make videotestsrc spit the format we want */ caps = gst_caps_new_simple ("video/x-raw", @@ -155,7 +150,7 @@ main (int argc, char *argv[]) g_critical("Could not link elements"); gst_element_set_state (GST_ELEMENT(pipeline), GST_STATE_PLAYING); - clutter_actor_add_child (stage, texture); + clutter_actor_add_child (stage, actor); /* clutter_actor_set_opacity (texture, 0x11); */ clutter_actor_show (stage); |