[vlc-devel] [PATCH 7/7] video_output: keep track of the vout modules that can switch stereo modes dynamically

Steve Lhomme robux4 at ycbcr.xyz
Fri Aug 17 11:27:10 CEST 2018


---
 include/vlc_vout_display.h       | 1 +
 src/video_output/display.c       | 1 +
 src/video_output/video_output.c  | 9 +++++++++
 src/video_output/vout_internal.h | 5 +++++
 4 files changed, 16 insertions(+)

diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index afa7ad7888..9b8c3cb140 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 fa64d38bbc..4aca94b869 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 d80f825987..f5385d0d77 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -500,6 +500,15 @@ int vout_GetSnapshot(vout_thread_t *vout,
     return VLC_SUCCESS;
 }
 
+bool vout_CanHandleStereoInput(vout_thread_t *vout, video_multiview_mode_t mode)
+{
+    vlc_mutex_lock(&vout->p->display.lock);
+    vout_display_t *vd = vout->p->display.vd;
+    bool res = vd && vd->info.stereo_modes & (1<<mode);
+    vlc_mutex_unlock(&vout->p->display.lock);
+    return res;
+}
+
 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 ba583e7c8e..fd94c89cff 100644
--- a/src/video_output/vout_internal.h
+++ b/src/video_output/vout_internal.h
@@ -283,6 +283,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 handle the multiview input switch dynamically.
+ */
+bool vout_CanHandleStereoInput(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