[vlc-devel] [PATCH] libvlc: media: add multiview in libvlc_video_track_t

Thomas Guillem thomas at gllm.fr
Fri Apr 13 13:08:43 CEST 2018



On Fri, Apr 13, 2018, at 13:00, Rémi Denis-Courmont wrote:
> Le 12 avril 2018 15:43:14 GMT+03:00, Zhao Zhili <quinkblack at foxmail.com> 
> a écrit :
> >---
> > 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 383f366..ec4778f 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 58881e3..2b32f9d 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;
> >-- 
> >2.9.5
> >
> >_______________________________________________
> >vlc-devel mailing list
> >To unsubscribe or modify your subscription options:
> >https://mailman.videolan.org/listinfo/vlc-devel
> 
> Nihao,
> 
> Are you sure this works with Doxygen? I don't recall such syntax.

Indeed, fixed now.

> -- 
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser 
> ma brièveté.
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list