dshowvideosink: Update renderer aspect ratio after force-aspect-ratio property update.
authorPhilippe Normand <pnormand@igalia.com>
Thu, 1 Jul 2010 08:56:19 +0000 (10:56 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 7 Jul 2010 05:44:20 +0000 (07:44 +0200)
A new virtual method has been added to the RendererSupport class. It
is called during the initial renderer configuration and each time the
force-aspect-ratio property of the sink is updated.

Fixes bug #623272.

sys/dshowvideosink/dshowvideosink.cpp
sys/dshowvideosink/dshowvideosink.h

index ab9aecd..7a14664 100644 (file)
@@ -256,6 +256,8 @@ gst_dshowvideosink_set_property (GObject * object, guint prop_id,
       break;
     case PROP_KEEP_ASPECT_RATIO:
       sink->keep_aspect_ratio = g_value_get_boolean (value);
+      if (sink->renderersupport)
+        sink->renderersupport->SetAspectRatioMode();
       break;
     case PROP_FULL_SCREEN:
       sink->full_screen = g_value_get_boolean (value);
@@ -979,13 +981,17 @@ public:
       return FALSE;
     }
 
+    SetAspectRatioMode();
+    return TRUE;
+  }
+
+  void SetAspectRatioMode() {
     if (sink->keep_aspect_ratio) {
       control->SetAspectRatioMode(VMR9ARMode_LetterBox);
     }
     else {
       control->SetAspectRatioMode(VMR9ARMode_None);
     }
-    return TRUE;
   }
 
   gboolean SetRendererWindow(HWND window) {
@@ -1102,13 +1108,17 @@ public:
       return FALSE;
     }
 
+    SetAspectRatioMode();
+    return TRUE;
+  }
+
+  void SetAspectRatioMode() {
     if (sink->keep_aspect_ratio) {
       control->SetAspectRatioMode(VMR_ARMODE_LETTER_BOX);
     }
     else {
       control->SetAspectRatioMode(VMR_ARMODE_NONE);
     }
-    return TRUE;
   }
 
   gboolean SetRendererWindow(HWND window) {
index 9c9d073..8b60087 100644 (file)
@@ -54,6 +54,7 @@ public:
   virtual void MoveWindow() = 0;
   virtual void DestroyWindow() = 0;
   virtual void DisplayModeChanged() = 0;
+  virtual void SetAspectRatioMode() = 0;
 };
 
 struct _GstDshowVideoSink