dshowvideosink: Update renderer aspect ratio after force-aspect-ratio property update.

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.
This commit is contained in:
Philippe Normand 2010-07-01 10:56:19 +02:00 committed by Sebastian Dröge
parent d69e01ed20
commit 0c38d700ca
2 changed files with 13 additions and 2 deletions

View 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) {

View file

@ -54,6 +54,7 @@ public:
virtual void MoveWindow() = 0;
virtual void DestroyWindow() = 0;
virtual void DisplayModeChanged() = 0;
virtual void SetAspectRatioMode() = 0;
};
struct _GstDshowVideoSink