[clutter-gst] examples: camera-player: use given size from the player



commit 8b12180346be221cf25216f884d3a8b9f069141f
Author: Lionel Landwerlin <llandwerlin gmail com>
Date:   Mon Jul 8 12:05:49 2013 +0100

    examples: camera-player: use given size from the player

 examples/camera-player.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)
---
diff --git a/examples/camera-player.c b/examples/camera-player.c
index e5e25a1..4bd50a6 100644
--- a/examples/camera-player.c
+++ b/examples/camera-player.c
@@ -322,17 +322,10 @@ size_change (ClutterGstPlayer *player,
   ClutterActor *stage = app->stage;
   gfloat new_x, new_y, new_width, new_height;
   gfloat stage_width, stage_height;
-  gfloat frame_width, frame_height;
 
   clutter_actor_get_size (stage, &stage_width, &stage_height);
 
-  /* 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_content_get_preferred_size (clutter_actor_get_content (app->camera_actor),
-                                      &frame_width, &frame_height);
-
-  new_height = (frame_height * stage_width) / frame_width;
+  new_height = (base_height * stage_width) / base_width;
   if (new_height <= stage_height)
     {
       new_width = stage_width;
@@ -342,7 +335,7 @@ size_change (ClutterGstPlayer *player,
     }
   else
     {
-      new_width  = (frame_width * stage_height) / frame_height;
+      new_width  = (base_width * stage_height) / base_height;
       new_height = stage_height;
 
       new_x = (stage_width - new_width) / 2;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]