diff options
Diffstat (limited to 'examples/camera-player.c')
-rw-r--r-- | examples/camera-player.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/examples/camera-player.c b/examples/camera-player.c index e601d50..e5e25a1 100644 --- a/examples/camera-player.c +++ b/examples/camera-player.c @@ -329,9 +329,8 @@ size_change (ClutterGstPlayer *player, /* base_width and base_height are the actual dimensions of the buffers before * taking the pixel aspect ratio into account. We need to get the actual * size of the texture to display */ - clutter_actor_get_preferred_size (app->camera_actor, - NULL, NULL, - &frame_width, &frame_height); + clutter_content_get_preferred_size (clutter_actor_get_content (app->camera_actor), + &frame_width, &frame_height); new_height = (frame_height * stage_width) / frame_width; if (new_height <= stage_height) @@ -386,7 +385,6 @@ main (int argc, char *argv[]) app = g_new0(CameraApp, 1); app->stage = stage; - app->camera_actor = clutter_gst_aspectratio_new (); app->camera_player = clutter_gst_camera_new (); if (app->camera_player == NULL) @@ -395,6 +393,13 @@ main (int argc, char *argv[]) return EXIT_FAILURE; } + app->camera_actor = g_object_new (CLUTTER_TYPE_ACTOR, + "content", g_object_new (CLUTTER_GST_TYPE_ASPECTRATIO, + "player", app->camera_player, + NULL), + NULL); + + app->camera_devices = clutter_gst_camera_get_camera_devices (app->camera_player); if (!app->camera_devices) { @@ -429,10 +434,6 @@ main (int argc, char *argv[]) "size-change", G_CALLBACK (size_change), app); - - clutter_gst_actor_set_player (CLUTTER_GST_ACTOR (app->camera_actor), - CLUTTER_GST_PLAYER (app->camera_player)); - /* Add control UI to stage */ clutter_actor_add_child (stage, app->camera_actor); |