[vlc-commits] libvlc: media: add multiview in libvlc_video_track_t

Zhao Zhili git at videolan.org
Fri Apr 13 12:57:43 CEST 2018


vlc | branch: master | Zhao Zhili <quinkblack at foxmail.com> | Thu Apr 12 20:43:14 2018 +0800| [072ed69179a77e6867a082d193c063fb5fe615fe] | committer: Thomas Guillem

libvlc: media: add multiview in libvlc_video_track_t

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=072ed69179a77e6867a082d193c063fb5fe615fe
---

 include/vlc/libvlc_media.h | 25 +++++++++++++++++++++++++
 lib/media.c                | 14 ++++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/include/vlc/libvlc_media.h b/include/vlc/libvlc_media.h
index 383f366b69..ec4778f78f 100644
--- a/include/vlc/libvlc_media.h
+++ b/include/vlc/libvlc_media.h
@@ -205,6 +205,30 @@ typedef struct libvlc_video_viewpoint_t
     float f_field_of_view; /**< field of view in degrees ]0;180[ (default 80.)*/
 } libvlc_video_viewpoint_t;
 
+typedef enum libvlc_video_multiview_t
+{
+    /* No stereoscopy: 2D picture. */
+    libvlc_video_multiview_2d,
+
+    /* Side-by-side */
+    libvlc_video_multiview_stereo_sbs,
+
+    /* Top-bottom */
+    libvlc_video_multiview_stereo_tb,
+
+    /* Row sequential */
+    libvlc_video_multiview_stereo_row,
+
+    /* Column sequential */
+    libvlc_video_multiview_stereo_col,
+
+    /* Frame sequential */
+    libvlc_video_multiview_stereo_frame,
+
+    /* Checkerboard pattern */
+    libvlc_video_multiview_stereo_checkerboard
+} libvlc_video_multiview_t;
+
 typedef struct libvlc_video_track_t
 {
     unsigned    i_height;
@@ -217,6 +241,7 @@ typedef struct libvlc_video_track_t
     libvlc_video_orient_t       i_orientation;
     libvlc_video_projection_t   i_projection;
     libvlc_video_viewpoint_t    pose; /**< Initial view point */
+    libvlc_video_multiview_t    i_multiview;
 } libvlc_video_track_t;
 
 typedef struct libvlc_subtitle_track_t
diff --git a/lib/media.c b/lib/media.c
index 58881e315f..2b32f9d337 100644
--- a/lib/media.c
+++ b/lib/media.c
@@ -123,6 +123,16 @@ static_assert(
     PROJECTION_MODE_CUBEMAP_LAYOUT_STANDARD == (int) libvlc_video_projection_cubemap_layout_standard,
     "Mismatch between libvlc_video_projection_t and video_projection_mode_t" );
 
+static_assert(
+    MULTIVIEW_2D                    == (int) libvlc_video_multiview_2d &&
+    MULTIVIEW_STEREO_SBS            == (int) libvlc_video_multiview_stereo_sbs &&
+    MULTIVIEW_STEREO_TB             == (int) libvlc_video_multiview_stereo_tb &&
+    MULTIVIEW_STEREO_ROW            == (int) libvlc_video_multiview_stereo_row &&
+    MULTIVIEW_STEREO_COL            == (int) libvlc_video_multiview_stereo_col &&
+    MULTIVIEW_STEREO_FRAME          == (int) libvlc_video_multiview_stereo_frame &&
+    MULTIVIEW_STEREO_CHECKERBOARD   == (int) libvlc_video_multiview_stereo_checkerboard,
+    "Mismatch between libvlc_video_multiview_t and video_multiview_mode_t");
+
 static libvlc_media_list_t *media_get_subitems( libvlc_media_t * p_md,
                                                 bool b_create )
 {
@@ -1038,6 +1048,10 @@ libvlc_media_tracks_get( libvlc_media_t *p_md, libvlc_media_track_t *** pp_es )
             p_mes->video->pose.f_pitch = p_es->video.pose.pitch;
             p_mes->video->pose.f_roll = p_es->video.pose.roll;
             p_mes->video->pose.f_field_of_view = p_es->video.pose.fov;
+
+            assert( p_es->video.multiview_mode >= MULTIVIEW_2D &&
+                    p_es->video.multiview_mode <= MULTIVIEW_STEREO_CHECKERBOARD );
+            p_mes->video->i_multiview = (int) p_es->video.multiview_mode;
             break;
         case AUDIO_ES:
             p_mes->i_type = libvlc_track_audio;



More information about the vlc-commits mailing list