diff options
author | Lionel Landwerlin <llandwerlin@gmail.com> | 2013-07-22 13:31:52 +0100 |
---|---|---|
committer | Lionel Landwerlin <llandwerlin@gmail.com> | 2013-07-22 13:31:52 +0100 |
commit | c23cdfc584b2051c2962673b9078a5c92d9b30a8 (patch) | |
tree | 583b4936958193560c7ac3f06d419a7e47ff8f84 /examples | |
parent | 8b12180346be221cf25216f884d3a8b9f069141f (diff) | |
download | clutter-gst-c23cdfc584b2051c2962673b9078a5c92d9b30a8.tar.gz |
remove ClutterGstActor now replaced by ClutterGstContent
Diffstat (limited to 'examples')
-rw-r--r-- | examples/pieces.js | 12 | ||||
-rw-r--r-- | examples/video-sink-navigation.c | 51 | ||||
-rw-r--r-- | examples/video-sink.c | 12 |
3 files changed, 19 insertions, 56 deletions
diff --git a/examples/pieces.js b/examples/pieces.js index 34606c3..89c5f50 100644 --- a/examples/pieces.js +++ b/examples/pieces.js @@ -33,8 +33,8 @@ const ROWS = 3; const BIT_WIDTH = 200; const BIT_HEIGHT = 200; -if (ARGV.length < 1) - throw "Needs 1 arguments : piece.js videofile"; +//if (ARGV.length < 1) +// throw "Needs 1 arguments : piece.js videofile"; // @@ -115,10 +115,10 @@ let stage = new Clutter.Stage(); stage.set_size(BIT_WIDTH * 3, BIT_HEIGHT * 3); stage.set_user_resizable(true); -let player = new ClutterGst.Playback(); -player.set_filename(ARGV[0]); -player.set_audio_volume(0.25); -//let player = new ClutterGst.Camera(); +//let player = new ClutterGst.Playback(); +//player.set_filename(ARGV[0]); +//player.set_audio_volume(0.25); +let player = new ClutterGst.Camera(); let pieces = new Pieces(ROWS, COLUMNS); for (let i = 0; i < ROWS; i++) { diff --git a/examples/video-sink-navigation.c b/examples/video-sink-navigation.c index 8cf5321..e4d3cc9 100644 --- a/examples/video-sink-navigation.c +++ b/examples/video-sink-navigation.c @@ -28,43 +28,6 @@ #include <clutter-gst/clutter-gst.h> -void -size_change (ClutterActor *actor, - gint width, - gint height, - gpointer user_data) -{ - ClutterActor *stage; - gfloat new_x, new_y, new_width, new_height; - gfloat stage_width, stage_height; - - stage = clutter_actor_get_stage (actor); - if (stage == NULL) - return; - - clutter_actor_get_size (stage, &stage_width, &stage_height); - - new_height = (height * stage_width) / width; - if (new_height <= stage_height) - { - new_width = stage_width; - - new_x = 0; - new_y = (stage_height - new_height) / 2; - } - else - { - new_width = (width * stage_height) / height; - new_height = stage_height; - - new_x = (stage_width - new_width) / 2; - new_y = 0; - } - - clutter_actor_set_position (actor, new_x, new_y); - clutter_actor_set_size (actor, new_width, new_height); -} - int main (int argc, char *argv[]) { @@ -99,11 +62,9 @@ main (int argc, char *argv[]) timeline = clutter_timeline_new (1000); g_object_set(timeline, "loop", TRUE, NULL); - actor = g_object_new (CLUTTER_GST_TYPE_ACTOR, NULL); - - g_signal_connect (actor, - "size-change", - G_CALLBACK (size_change), NULL); + actor = g_object_new (CLUTTER_TYPE_ACTOR, + "content", clutter_gst_content_new (), + NULL); /* Set up pipeline */ pipeline = GST_PIPELINE(gst_pipeline_new (NULL)); @@ -113,13 +74,13 @@ main (int argc, char *argv[]) test = gst_element_factory_make ("navigationtest", NULL); colorspace = gst_element_factory_make ("videoconvert", NULL); - sink = gst_element_factory_make ("cluttersink", NULL); - g_object_set (sink, "actor", actor, NULL); // g_object_set (src , "pattern", 10, NULL); gst_bin_add_many (GST_BIN (pipeline), src, filter, test, colorspace, sink, NULL); - gst_element_link_many (src, filter, test, colorspace, sink, NULL); + gst_element_link_many (src, filter, test, colorspace, + GST_ELEMENT (clutter_gst_content_get_sink (CLUTTER_GST_CONTENT (clutter_actor_get_content (actor)))), + NULL); gst_element_set_state (GST_ELEMENT(pipeline), GST_STATE_PLAYING); /* Resize with the window */ diff --git a/examples/video-sink.c b/examples/video-sink.c index 9fc7ab6..7389a4d 100644 --- a/examples/video-sink.c +++ b/examples/video-sink.c @@ -96,15 +96,17 @@ main (int argc, char *argv[]) timeline = clutter_timeline_new (1000); g_object_set(timeline, "loop", TRUE, NULL); - actor = g_object_new (CLUTTER_GST_TYPE_ACTOR, NULL); - - /* Set up pipeline */ player = clutter_gst_playback_new (); - pipeline = clutter_gst_player_get_pipeline (CLUTTER_GST_PLAYER (player)); - + actor = g_object_new (CLUTTER_TYPE_ACTOR, + "content", g_object_new (CLUTTER_GST_TYPE_CONTENT, + "player", player, NULL), + NULL); g_signal_connect (player, "size-change", G_CALLBACK (size_change), actor); + /* Set up pipeline */ + pipeline = clutter_gst_player_get_pipeline (CLUTTER_GST_PLAYER (player)); + src = gst_element_factory_make ("videotestsrc", NULL); warp = gst_element_factory_make ("warptv", NULL); bin = gst_bin_new ("video-test-source"); |