[vlc-devel] [PATCH 09/14] mkv: parse the StereoMode element on video tracks

Felix Abecassis felix.abecassis at gmail.com
Tue Sep 9 19:08:28 CEST 2014


---
 modules/demux/mkv/matroska_segment_parse.cpp | 43 +++++++++++++++++++++++++++-
 1 file changed, 42 insertions(+), 1 deletion(-)

diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
index 975b053..33b50a6 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -545,7 +545,48 @@ void matroska_segment_c::ParseTrackEntry( KaxTrackEntry *m )
                 {
                     KaxVideoStereoMode &stereo = *(KaxVideoStereoMode*)l;
 
-                    msg_Dbg( &sys.demuxer, "|   |   |   |   + Track Video Stereo Mode=%u", uint8( stereo ) );
+                    int stereo_mode = uint8( stereo );
+                    msg_Dbg( &sys.demuxer, "|   |   |   |   + Track Video Stereo Mode=%u", stereo_mode );
+
+                    stereo3d_format_t format = stereo3d_format_t();
+                    switch (stereo_mode)
+                    {
+                    case 11:
+                        format.flags = VLC_STEREO3D_SWAP_EYES;
+                    case 1:
+                        format.mode = VLC_STEREO3D_SBS;
+                        break;
+
+                    case 2:
+                        format.flags = VLC_STEREO3D_SWAP_EYES;
+                    case 3:
+                        format.mode = VLC_STEREO3D_TB;
+                        break;
+
+                    case 4:
+                        format.flags = VLC_STEREO3D_SWAP_EYES;
+                    case 5:
+                        format.mode = VLC_STEREO3D_CHECKERBOARD;
+
+                    case 6:
+                        format.flags = VLC_STEREO3D_SWAP_EYES;
+                    case 7:
+                        format.mode = VLC_STEREO3D_ROW;
+                        break;
+
+                    case 8:
+                        format.flags = VLC_STEREO3D_SWAP_EYES;
+                    case 9:
+                        format.mode = VLC_STEREO3D_COL;
+                        break;
+
+                    default:
+                        format.mode = VLC_STEREO3D_2D;
+                        break;
+                    }
+
+                    tk->fmt.video.stereo = format;
+
                 }
                 else if( MKV_IS_ID( l, KaxVideoPixelWidth ) )
                 {
-- 
1.9.1




More information about the vlc-devel mailing list