mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
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:
parent
d69e01ed20
commit
0c38d700ca
2 changed files with 13 additions and 2 deletions
|
@ -256,6 +256,8 @@ gst_dshowvideosink_set_property (GObject * object, guint prop_id,
|
||||||
break;
|
break;
|
||||||
case PROP_KEEP_ASPECT_RATIO:
|
case PROP_KEEP_ASPECT_RATIO:
|
||||||
sink->keep_aspect_ratio = g_value_get_boolean (value);
|
sink->keep_aspect_ratio = g_value_get_boolean (value);
|
||||||
|
if (sink->renderersupport)
|
||||||
|
sink->renderersupport->SetAspectRatioMode();
|
||||||
break;
|
break;
|
||||||
case PROP_FULL_SCREEN:
|
case PROP_FULL_SCREEN:
|
||||||
sink->full_screen = g_value_get_boolean (value);
|
sink->full_screen = g_value_get_boolean (value);
|
||||||
|
@ -979,13 +981,17 @@ public:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SetAspectRatioMode();
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetAspectRatioMode() {
|
||||||
if (sink->keep_aspect_ratio) {
|
if (sink->keep_aspect_ratio) {
|
||||||
control->SetAspectRatioMode(VMR9ARMode_LetterBox);
|
control->SetAspectRatioMode(VMR9ARMode_LetterBox);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
control->SetAspectRatioMode(VMR9ARMode_None);
|
control->SetAspectRatioMode(VMR9ARMode_None);
|
||||||
}
|
}
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean SetRendererWindow(HWND window) {
|
gboolean SetRendererWindow(HWND window) {
|
||||||
|
@ -1102,13 +1108,17 @@ public:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SetAspectRatioMode();
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetAspectRatioMode() {
|
||||||
if (sink->keep_aspect_ratio) {
|
if (sink->keep_aspect_ratio) {
|
||||||
control->SetAspectRatioMode(VMR_ARMODE_LETTER_BOX);
|
control->SetAspectRatioMode(VMR_ARMODE_LETTER_BOX);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
control->SetAspectRatioMode(VMR_ARMODE_NONE);
|
control->SetAspectRatioMode(VMR_ARMODE_NONE);
|
||||||
}
|
}
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean SetRendererWindow(HWND window) {
|
gboolean SetRendererWindow(HWND window) {
|
||||||
|
|
|
@ -54,6 +54,7 @@ public:
|
||||||
virtual void MoveWindow() = 0;
|
virtual void MoveWindow() = 0;
|
||||||
virtual void DestroyWindow() = 0;
|
virtual void DestroyWindow() = 0;
|
||||||
virtual void DisplayModeChanged() = 0;
|
virtual void DisplayModeChanged() = 0;
|
||||||
|
virtual void SetAspectRatioMode() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstDshowVideoSink
|
struct _GstDshowVideoSink
|
||||||
|
|
Loading…
Reference in a new issue