[vlc-devel] [PATCH 1/4] video_output: use a control call to set the wallpaper mode change to the display
Steve Lhomme
robux4 at ycbcr.xyz
Fri Aug 17 11:08:49 CEST 2018
---
include/vlc_vout_display.h | 3 +++
include/vlc_vout_wrapper.h | 1 +
src/video_output/control.h | 1 +
src/video_output/display.c | 5 +++++
src/video_output/video_output.c | 16 ++++++++++++++++
src/video_output/vout_internal.h | 1 +
src/video_output/vout_intf.c | 1 +
7 files changed, 28 insertions(+)
diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index 86eb1bced0..afa7ad7888 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -184,6 +184,9 @@ enum {
/* VR navigation */
VOUT_DISPLAY_EVENT_VIEWPOINT_MOVED,
+
+ /* Go/Leave Wallpaper mode */
+ VOUT_DISPLAY_EVENT_SET_WALLPAPER,
};
/**
diff --git a/include/vlc_vout_wrapper.h b/include/vlc_vout_wrapper.h
index a394bd4d70..79649b1ce4 100644
--- a/include/vlc_vout_wrapper.h
+++ b/include/vlc_vout_wrapper.h
@@ -92,6 +92,7 @@ void vout_SetDisplayAspect(vout_display_t *, unsigned num, unsigned den);
void vout_SetDisplayCrop(vout_display_t *, unsigned num, unsigned den,
unsigned left, unsigned top, int right, int bottom);
void vout_SetDisplayViewpoint(vout_display_t *, const vlc_viewpoint_t *);
+void vout_SetDisplayWallpaper(vout_display_t *, bool);
#endif /* VLC_VOUT_WRAPPER_H */
diff --git a/src/video_output/control.h b/src/video_output/control.h
index 9be9f64b3e..c3ac798c9f 100644
--- a/src/video_output/control.h
+++ b/src/video_output/control.h
@@ -56,6 +56,7 @@ enum {
VOUT_CONTROL_CROP_RATIO, /* pair */
VOUT_CONTROL_CROP_WINDOW, /* window */
VOUT_CONTROL_VIEWPOINT, /* viewpoint */
+ VOUT_CONTROL_WALLPAPER, /* boolean */
};
typedef struct {
diff --git a/src/video_output/display.c b/src/video_output/display.c
index b0c0fdbb3e..2bfc5b1547 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -947,6 +947,11 @@ void vout_SetDisplayViewpoint(vout_display_t *vd,
}
}
+void vout_SetDisplayWallpaper(vout_display_t *vd, bool set)
+{
+ vout_display_Control(vd, VOUT_DISPLAY_EVENT_SET_WALLPAPER, &set);
+}
+
static vout_display_t *DisplayNew(vout_thread_t *vout,
const video_format_t *source,
const vout_display_state_t *state,
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index da8022a8f3..e91fa0d772 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -638,6 +638,14 @@ void vout_ControlChangeViewpoint(vout_thread_t *vout,
vout_control_Push(&vout->p->control, &cmd);
}
+void vout_ControlChangeWallpaper(vout_thread_t *vout, bool set)
+{
+ vout_control_cmd_t cmd;
+ vout_control_cmd_Init(&cmd, VOUT_CONTROL_WALLPAPER);
+ cmd.boolean = set;
+ vout_control_Push(&vout->p->control, &cmd);
+}
+
/* */
static void VoutGetDisplayCfg(vout_thread_t *vout, vout_display_cfg_t *cfg)
{
@@ -1470,6 +1478,11 @@ static void ThreadExecuteViewpoint(vout_thread_t *vout,
vout_SetDisplayViewpoint(vout->p->display.vd, p_viewpoint);
}
+static void ThreadExecuteWallpaper(vout_thread_t *vout, bool set)
+{
+ vout_SetDisplayWallpaper(vout->p->display.vd, set);
+}
+
static int ThreadStart(vout_thread_t *vout, vout_display_state_t *state)
{
vlc_mouse_Init(&vout->p->mouse);
@@ -1728,6 +1741,9 @@ static int ThreadControl(vout_thread_t *vout, vout_control_cmd_t cmd)
case VOUT_CONTROL_VIEWPOINT:
ThreadExecuteViewpoint(vout, &cmd.viewpoint);
break;
+ case VOUT_CONTROL_WALLPAPER:
+ ThreadExecuteWallpaper(vout, cmd.boolean);
+ break;
default:
break;
}
diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h
index 8eaac0dee9..c1a1d6ac5a 100644
--- a/src/video_output/vout_internal.h
+++ b/src/video_output/vout_internal.h
@@ -208,6 +208,7 @@ void vout_ControlChangeSubSources(vout_thread_t *, const char *);
void vout_ControlChangeSubFilters(vout_thread_t *, const char *);
void vout_ControlChangeSubMargin(vout_thread_t *, int);
void vout_ControlChangeViewpoint( vout_thread_t *, const vlc_viewpoint_t *);
+void vout_ControlChangeWallpaper( vout_thread_t *, bool);
/* */
void vout_IntfInit( vout_thread_t * );
diff --git a/src/video_output/vout_intf.c b/src/video_output/vout_intf.c
index 8c7b4571d6..fb96ea08bf 100644
--- a/src/video_output/vout_intf.c
+++ b/src/video_output/vout_intf.c
@@ -531,6 +531,7 @@ static int WallPaperCallback( vlc_object_t *obj, char const *name,
var_TriggerCallback( obj, "fullscreen" );
var_TriggerCallback( obj, "video-on-top" );
}
+ vout_ControlChangeWallpaper(vout, cur.b_bool );
(void) name; (void) prev; (void) data;
return VLC_SUCCESS;
}
--
2.17.0
More information about the vlc-devel
mailing list