summaryrefslogtreecommitdiff
path: root/tests/test-yuv-upload.c
diff options
context:
space:
mode:
authorLionel Landwerlin <llandwerlin@gmail.com>2013-04-14 18:23:28 +0200
committerLionel Landwerlin <llandwerlin@gmail.com>2013-04-25 16:33:33 +0100
commitab09d2bc6cafcb4b4db3c3c838cf3fd50d961dff (patch)
treee27b3fbff0aa63348c2f0243668b0fb19177109c /tests/test-yuv-upload.c
parent9a540099a323f580cd848322f6524bac860ca719 (diff)
downloadclutter-gst-ab09d2bc6cafcb4b4db3c3c838cf3fd50d961dff.tar.gz
introduce ClutterGstPipeline to allow custom Gstreamer pipelines to feed Actors
Diffstat (limited to 'tests/test-yuv-upload.c')
-rw-r--r--tests/test-yuv-upload.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/test-yuv-upload.c b/tests/test-yuv-upload.c
index 66668c4..1a451bf 100644
--- a/tests/test-yuv-upload.c
+++ b/tests/test-yuv-upload.c
@@ -53,10 +53,10 @@ static GOptionEntry options[] =
};
void
-size_change (ClutterActor *actor,
- gint width,
- gint height,
- gpointer user_data)
+size_change (ClutterGstPlayer *player,
+ gint width,
+ gint height,
+ ClutterActor *actor)
{
ClutterActor *stage;
gfloat new_x, new_y, new_width, new_height;
@@ -101,9 +101,7 @@ main (int argc, char *argv[])
GstElement *capsfilter;
GstElement *sink;
GstCaps *caps;
-
- if (!g_thread_supported ())
- g_thread_init (NULL);
+ ClutterGstPlayer *player;
result = clutter_gst_init_with_args (&argc,
&argv,
@@ -124,17 +122,12 @@ main (int argc, char *argv[])
actor = g_object_new (CLUTTER_GST_TYPE_ACTOR, NULL);
- g_signal_connect (actor,
- "size-change",
- G_CALLBACK (size_change), NULL);
-
/* Set up pipeline */
pipeline = GST_PIPELINE(gst_pipeline_new (NULL));
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, "actor", actor, NULL);
+ sink = clutter_gst_create_video_sink ();
/* make videotestsrc spit the format we want */
caps = gst_caps_new_simple ("video/x-raw",
@@ -150,6 +143,13 @@ main (int argc, char *argv[])
g_critical("Could not link elements");
gst_element_set_state (GST_ELEMENT(pipeline), GST_STATE_PLAYING);
+ player = CLUTTER_GST_PLAYER (g_object_new (CLUTTER_GST_TYPE_PIPELINE,
+ "video-sink", sink, NULL));
+ clutter_gst_actor_set_player (CLUTTER_GST_ACTOR (actor), player);
+ g_signal_connect (player,
+ "size-change",
+ G_CALLBACK (size_change), actor);
+
clutter_actor_add_child (stage, actor);
/* clutter_actor_set_opacity (texture, 0x11); */
clutter_actor_show (stage);