[vlc-devel] [PATCH] [RFC} video_output: keep track of the vout modules that can switch stereo modes dynamically
Steve Lhomme
robux4 at ycbcr.xyz
Tue Aug 14 16:59:29 CEST 2018
---
include/vlc_vout_display.h | 1 +
src/video_output/display.c | 1 +
src/video_output/video_output.c | 6 ++++++
src/video_output/vout_internal.h | 5 +++++
4 files changed, 13 insertions(+)
diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index 86eb1bced0..830cbf053f 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -112,6 +112,7 @@ typedef struct {
bool is_slow; /* The picture memory has slow read/write */
bool has_double_click; /* Is double-click generated */
bool has_pictures_invalid; /* Will VOUT_DISPLAY_EVENT_PICTURES_INVALID be used */
+ int stereo_modes; /* bitmask of multiview modes supported dynamically */
const vlc_fourcc_t *subpicture_chromas; /* List of supported chromas for subpicture rendering. */
} vout_display_info_t;
diff --git a/src/video_output/display.c b/src/video_output/display.c
index b0c0fdbb3e..a06b441d7f 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -93,6 +93,7 @@ static vout_display_t *vout_display_New(vlc_object_t *obj,
vd->info.has_double_click = false;
vd->info.has_pictures_invalid = false;
vd->info.subpicture_chromas = NULL;
+ vd->info.stereo_modes = (1 << MULTIVIEW_2D);
vd->cfg = cfg;
vd->pool = NULL;
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index da8022a8f3..c998f5e453 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -498,6 +498,12 @@ int vout_GetSnapshot(vout_thread_t *vout,
return VLC_SUCCESS;
}
+bool vout_CanHandleStereoMode(vout_thread_t *vout, video_multiview_mode_t mode)
+{
+ vout_display_t *vd = vout->p->display.vd;
+ return vd && vd->info.stereo_modes & (1<<mode);
+}
+
void vout_ChangeAspectRatio( vout_thread_t *p_vout,
unsigned int i_num, unsigned int i_den )
{
diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h
index 8eaac0dee9..a3f472026a 100644
--- a/src/video_output/vout_internal.h
+++ b/src/video_output/vout_internal.h
@@ -280,6 +280,11 @@ void vout_DisplayTitle( vout_thread_t *p_vout, const char *psz_title );
*/
bool vout_IsEmpty( vout_thread_t *p_vout );
+/**
+ * Returns true if the vout can switch to the multiview mode dynamically.
+ */
+bool vout_CanHandleStereoMode(vout_thread_t *, video_multiview_mode_t);
+
void vout_SetSpuHighlight( vout_thread_t *p_vout, const vlc_spu_highlight_t * );
#endif
--
2.17.0
More information about the vlc-devel
mailing list