diff options
author | Lionel Landwerlin <llandwerlin@gmail.com> | 2013-02-12 18:07:27 +0000 |
---|---|---|
committer | Lionel Landwerlin <llandwerlin@gmail.com> | 2013-03-18 16:24:19 +0000 |
commit | 43c904845e0e804b48f1dc5d800ad097c5d938f0 (patch) | |
tree | 9f5f324f680a892d1064c46084a8952ac40f8067 /examples/video-sink.c | |
parent | 9e4ca9594d72592ce370fef7c4365d7a52f32e1b (diff) | |
download | clutter-gst-43c904845e0e804b48f1dc5d800ad097c5d938f0.tar.gz |
Break API and concepts around VideoTexture
Diffstat (limited to 'examples/video-sink.c')
-rw-r--r-- | examples/video-sink.c | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/examples/video-sink.c b/examples/video-sink.c index 82030d7..9fc7ab6 100644 --- a/examples/video-sink.c +++ b/examples/video-sink.c @@ -29,10 +29,10 @@ #include <clutter-gst/clutter-gst.h> 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; @@ -68,14 +68,14 @@ size_change (ClutterActor *actor, int main (int argc, char *argv[]) { - ClutterTimeline *timeline; - ClutterActor *stage; - ClutterActor *actor; - GstPipeline *pipeline; - GstElement *src; - GstElement *warp; - GstElement *colorspace; - GstElement *sink; + ClutterTimeline *timeline; + ClutterActor *stage; + ClutterActor *actor; + GstElement *src; + GstElement *warp; + GstElement *bin; + GstElement *pipeline; + ClutterGstPlayback *player; if (argc < 1) { @@ -98,24 +98,23 @@ 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)); + player = clutter_gst_playback_new (); + pipeline = clutter_gst_player_get_pipeline (CLUTTER_GST_PLAYER (player)); + + g_signal_connect (player, "size-change", + G_CALLBACK (size_change), actor); src = gst_element_factory_make ("videotestsrc", NULL); warp = gst_element_factory_make ("warptv", NULL); - colorspace = gst_element_factory_make ("videoconvert", NULL); - sink = gst_element_factory_make ("cluttersink", NULL); - g_object_set (sink, "actor", actor, NULL); + bin = gst_bin_new ("video-test-source"); + + gst_bin_add_many (GST_BIN (bin), src, warp, NULL); + gst_element_link_many (src, warp, NULL); - // g_object_set (src , "pattern", 10, NULL); + g_object_set (pipeline, "source", bin); - gst_bin_add_many (GST_BIN (pipeline), src, warp, colorspace, sink, NULL); - gst_element_link_many (src, warp, colorspace, sink, NULL); - gst_element_set_state (GST_ELEMENT(pipeline), GST_STATE_PLAYING); + clutter_gst_player_set_playing (CLUTTER_GST_PLAYER (player), TRUE); /* start the timeline */ clutter_timeline_start (timeline); |