[cheese/noflicker: 2/4] webcam: set force-aspect-ratio property on the videosink



commit 6a9a371795c9dc4e7e3a9c9c0e595496501e4498
Author: Filippo Argiolas <filippo argiolas gmail com>
Date:   Sun May 24 12:44:56 2009 +0200

    webcam: set force-aspect-ratio property on the videosink
    
    Almost every available gstreamer videosink can display black bars around
    the video keeping its aspect ratio. Enable it if available.
    Black bars look a lot nicer than the grey color of the underlying
    gtkwindow displayed with the aspectframe.
---
 src/cheese-webcam.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/cheese-webcam.c b/src/cheese-webcam.c
index 8bed865..c948d22 100644
--- a/src/cheese-webcam.c
+++ b/src/cheese-webcam.c
@@ -159,6 +159,10 @@ cheese_webcam_set_x_overlay (CheeseWebcam *webcam)
   GstXOverlay *overlay = GST_X_OVERLAY (gst_bin_get_by_interface (GST_BIN (priv->pipeline),
                                                                   GST_TYPE_X_OVERLAY));
 
+  if (g_object_class_find_property (G_OBJECT_GET_CLASS (overlay),
+                                    "force-aspect-ratio"))
+    g_object_set (G_OBJECT (overlay), "force-aspect-ratio", TRUE, NULL);
+
   gst_x_overlay_set_xwindow_id (overlay, GDK_WINDOW_XWINDOW (priv->video_window->window));
 }
 



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