summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorLionel Landwerlin <llandwerlin@gmail.com>2013-03-14 02:12:34 +0000
committerLionel Landwerlin <llandwerlin@gmail.com>2013-03-18 16:25:07 +0000
commitbc7fa0bce2eae25173c5480af2652f465c04be60 (patch)
tree06b3434c3da898ad5cf7ee8afc87ff89348f316b /examples
parenta49fb5d4310089dd78dfb8821613912e9d641f0e (diff)
downloadclutter-gst-bc7fa0bce2eae25173c5480af2652f465c04be60.tar.gz
examples: video-player: use Aspectratio renderer
Diffstat (limited to 'examples')
-rw-r--r--examples/video-player.c46
1 files changed, 2 insertions, 44 deletions
diff --git a/examples/video-player.c b/examples/video-player.c
index 539ab97..e9435c1 100644
--- a/examples/video-player.c
+++ b/examples/video-player.c
@@ -302,44 +302,6 @@ input_cb (ClutterStage *stage,
}
static void
-size_change (ClutterGstPlayer *player,
- gint base_width,
- gint base_height,
- VideoApp *app)
-{
- ClutterActor *stage = app->stage;
- gfloat new_x, new_y, new_width, new_height;
- gfloat stage_width, stage_height;
- gfloat frame_width, frame_height;
- gdouble frame_aspect, stage_aspect;
-
- frame_width = base_width;
- frame_height = base_height;
-
- clutter_actor_get_size (stage, &stage_width, &stage_height);
-
- frame_aspect = frame_width / frame_height;
- stage_aspect = stage_width / stage_height;
-
- if (stage_aspect < frame_aspect)
- {
- new_width = stage_width;
- new_height = stage_width / frame_aspect;
- }
- else
- {
- new_height = stage_height;
- new_width = stage_height * frame_aspect;
- }
-
- new_x = (stage_width - new_width) / 2;
- new_y = (stage_height - new_height) / 2;
-
- clutter_actor_set_position (app->vactor, new_x, new_y);
- clutter_actor_set_size (app->vactor, new_width, new_height);
-}
-
-static void
position_controls (VideoApp *app,
ClutterActor *controls)
{
@@ -507,7 +469,8 @@ main (int argc, char *argv[])
app = g_new0(VideoApp, 1);
app->stage = stage;
- app->vactor = g_object_new (CLUTTER_GST_TYPE_ACTOR, NULL);
+ app->vactor = g_object_new (CLUTTER_GST_TYPE_ASPECTRATIO, NULL);
+ clutter_actor_set_size (app->vactor, clutter_actor_get_width (stage), clutter_actor_get_height (stage));
app->player = clutter_gst_playback_new ();
clutter_gst_actor_set_player (CLUTTER_GST_ACTOR (app->vactor), CLUTTER_GST_PLAYER (app->player));
@@ -553,11 +516,6 @@ main (int argc, char *argv[])
G_CALLBACK (clutter_main_quit),
NULL);
- /* Handle it ourselves so can scale up for fullscreen better */
- g_signal_connect_after (app->player,
- "size-change",
- G_CALLBACK (size_change), app);
-
/* Load up out video actor */
clutter_gst_playback_set_filename (app->player, uri);