[vlc-commits] vout: win32: CommonControl: Allow some controls on UWP/WinRT
Hugo Beauzée-Luyssen
git at videolan.org
Mon Jul 10 18:09:55 CEST 2017
vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Jul 10 18:02:01 2017 +0200| [49db3f70cff87d81a49800a2f7812fc1c583fe4c] | committer: Hugo Beauzée-Luyssen
vout: win32: CommonControl: Allow some controls on UWP/WinRT
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=49db3f70cff87d81a49800a2f7812fc1c583fe4c
---
modules/video_output/win32/common.c | 120 +++++++++++++++++-------------------
1 file changed, 57 insertions(+), 63 deletions(-)
diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index ea1ed75a0f..cc6fac08a2 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -607,11 +607,67 @@ static int CommonControlSetFullscreen(vout_display_t *vd, bool is_fullscreen)
return VLC_SUCCESS;
}
+static void DisableScreensaver(vout_display_t *vd)
+{
+ vout_display_sys_t *sys = vd->sys;
+
+ /* disable screensaver by temporarily changing system settings */
+ sys->i_spi_screensaveactive = 0;
+ if (var_GetBool(vd, "disable-screensaver")) {
+ msg_Dbg(vd, "disabling screen saver");
+ SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0,
+ &sys->i_spi_screensaveactive, 0);
+
+ if (FALSE != sys->i_spi_screensaveactive) {
+ SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, 0, NULL, 0);
+ }
+ }
+}
+
+static void RestoreScreensaver(vout_display_t *vd)
+{
+ vout_display_sys_t *sys = vd->sys;
+
+ /* restore screensaver system settings */
+ if (0 != sys->i_spi_screensaveactive) {
+ SystemParametersInfo(SPI_SETSCREENSAVEACTIVE,
+ sys->i_spi_screensaveactive, NULL, 0);
+ }
+}
+
+#else
+
+void CommonManage(vout_display_t *vd) {
+ UpdateRects(vd, NULL, NULL, false);
+}
+void CommonClean(vout_display_t *vd) {}
+void CommonDisplay(vout_display_t *vd) {}
+void CommonChangeThumbnailClip(vout_display_t *vd, bool show) {}
+#endif
+
int CommonControl(vout_display_t *vd, int query, va_list args)
{
vout_display_sys_t *sys = vd->sys;
switch (query) {
+ case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED: /* const vout_display_cfg_t *p_cfg */
+ case VOUT_DISPLAY_CHANGE_ZOOM: /* const vout_display_cfg_t *p_cfg */
+ case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT: /* const video_format_t *p_source */
+ case VOUT_DISPLAY_CHANGE_SOURCE_CROP: { /* const video_format_t *p_source */
+ const vout_display_cfg_t *cfg;
+
+ if (query == VOUT_DISPLAY_CHANGE_SOURCE_CROP ||
+ query == VOUT_DISPLAY_CHANGE_SOURCE_ASPECT) {
+ const video_format_t *source = va_arg(args, const video_format_t *);
+ cfg = vd->cfg;
+ UpdateRects(vd, cfg, source, true);
+ } else {
+ cfg = va_arg(args, const vout_display_cfg_t *);
+ UpdateRects(vd, cfg, NULL, true);
+ }
+ return VLC_SUCCESS;
+ }
+#if !VLC_WINSTORE_APP
case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE: /* const vout_display_cfg_t *p_cfg */
{ /* Update dimensions */
const vout_display_cfg_t *cfg = va_arg(args, const vout_display_cfg_t *);
@@ -631,23 +687,6 @@ int CommonControl(vout_display_t *vd, int query, va_list args)
UpdateRects(vd, cfg, NULL, false);
return VLC_SUCCESS;
}
- case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED: /* const vout_display_cfg_t *p_cfg */
- case VOUT_DISPLAY_CHANGE_ZOOM: /* const vout_display_cfg_t *p_cfg */
- case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT: /* const video_format_t *p_source */
- case VOUT_DISPLAY_CHANGE_SOURCE_CROP: { /* const video_format_t *p_source */
- const vout_display_cfg_t *cfg;
-
- if (query == VOUT_DISPLAY_CHANGE_SOURCE_CROP ||
- query == VOUT_DISPLAY_CHANGE_SOURCE_ASPECT) {
- const video_format_t *source = va_arg(args, const video_format_t *);
- cfg = vd->cfg;
- UpdateRects(vd, cfg, source, true);
- } else {
- cfg = va_arg(args, const vout_display_cfg_t *);
- UpdateRects(vd, cfg, NULL, true);
- }
- return VLC_SUCCESS;
- }
case VOUT_DISPLAY_CHANGE_WINDOW_STATE: { /* unsigned state */
const unsigned state = va_arg(args, unsigned);
const bool is_on_top = (state & VOUT_WINDOW_STATE_ABOVE) != 0;
@@ -680,53 +719,8 @@ int CommonControl(vout_display_t *vd, int query, va_list args)
return VLC_SUCCESS;
case VOUT_DISPLAY_RESET_PICTURES:
vlc_assert_unreachable();
+#endif
default:
return VLC_EGENERIC;
}
}
-
-static void DisableScreensaver(vout_display_t *vd)
-{
- vout_display_sys_t *sys = vd->sys;
-
- /* disable screensaver by temporarily changing system settings */
- sys->i_spi_screensaveactive = 0;
- if (var_GetBool(vd, "disable-screensaver")) {
- msg_Dbg(vd, "disabling screen saver");
- SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0,
- &sys->i_spi_screensaveactive, 0);
-
- if (FALSE != sys->i_spi_screensaveactive) {
- SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, 0, NULL, 0);
- }
- }
-}
-
-static void RestoreScreensaver(vout_display_t *vd)
-{
- vout_display_sys_t *sys = vd->sys;
-
- /* restore screensaver system settings */
- if (0 != sys->i_spi_screensaveactive) {
- SystemParametersInfo(SPI_SETSCREENSAVEACTIVE,
- sys->i_spi_screensaveactive, NULL, 0);
- }
-}
-
-#else
-
-int CommonControl(vout_display_t *vd, int query, va_list args)
-{
- switch (query) {
- default:
- return VLC_EGENERIC;
- }
-}
-
-void CommonManage(vout_display_t *vd) {
- UpdateRects(vd, NULL, NULL, false);
-}
-void CommonClean(vout_display_t *vd) {}
-void CommonDisplay(vout_display_t *vd) {}
-void CommonChangeThumbnailClip(vout_display_t *vd, bool show) {}
-#endif
More information about the vlc-commits
mailing list