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/video-sink-navigation.c | |
parent | 8b12180346be221cf25216f884d3a8b9f069141f (diff) | |
download | clutter-gst-c23cdfc584b2051c2962673b9078a5c92d9b30a8.tar.gz |
remove ClutterGstActor now replaced by ClutterGstContent
Diffstat (limited to 'examples/video-sink-navigation.c')
-rw-r--r-- | examples/video-sink-navigation.c | 51 |
1 files changed, 6 insertions, 45 deletions
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 */ |