]> git.sesse.net Git - vlc/commitdiff
mkv.cpp: get ready to support pixel cropping (top/bottom/left/right) when it will...
authorSteve Lhomme <robux@videolan.org>
Thu, 27 Oct 2005 19:23:47 +0000 (19:23 +0000)
committerSteve Lhomme <robux@videolan.org>
Thu, 27 Oct 2005 19:23:47 +0000 (19:23 +0000)
modules/demux/mkv.cpp

index a42217d6e540b71ff7d57150ba861310e04e4c52..045dbaea95c17084e6889803aef7a6c9de44f4f1 100644 (file)
@@ -569,6 +569,8 @@ static vlc_fourcc_t __GetFOURCC( uint8_t *p )
  *****************************************************************************/
 typedef struct
 {
+//    ~mkv_track_t();
+
     vlc_bool_t   b_default;
     vlc_bool_t   b_enabled;
     unsigned int i_number;
@@ -4288,7 +4290,7 @@ void matroska_segment_c::ParseTrackEntry( KaxTrackEntry *m )
             tk->f_fps = 0.0;
 
             tk->fmt.video.i_frame_rate_base = (unsigned int)(tk->i_default_duration / 1000);
-            tk->fmt.video.i_frame_rate = 1000000;     
+            tk->fmt.video.i_frame_rate = 1000000;
             
             for( j = 0; j < tkv->ListSize(); j++ )
             {
@@ -4310,14 +4312,14 @@ void matroska_segment_c::ParseTrackEntry( KaxTrackEntry *m )
                 {
                     KaxVideoPixelWidth &vwidth = *(KaxVideoPixelWidth*)l;
 
-                    tk->fmt.video.i_width = uint16( vwidth );
+                    tk->fmt.video.i_width += uint16( vwidth );
                     msg_Dbg( &sys.demuxer, "|   |   |   |   + width=%d", uint16( vwidth ) );
                 }
                 else if( MKV_IS_ID( l, KaxVideoPixelHeight ) )
                 {
                     KaxVideoPixelWidth &vheight = *(KaxVideoPixelWidth*)l;
 
-                    tk->fmt.video.i_height = uint16( vheight );
+                    tk->fmt.video.i_height += uint16( vheight );
                     msg_Dbg( &sys.demuxer, "|   |   |   |   + height=%d", uint16( vheight ) );
                 }
                 else if( MKV_IS_ID( l, KaxVideoDisplayWidth ) )
@@ -4334,6 +4336,36 @@ void matroska_segment_c::ParseTrackEntry( KaxTrackEntry *m )
                     tk->fmt.video.i_visible_height = uint16( vheight );
                     msg_Dbg( &sys.demuxer, "|   |   |   |   + display height=%d", uint16( vheight ) );
                 }
+                else if( MKV_IS_ID( l, KaxVideoPixelCropBottom ) )
+                {
+                    KaxVideoPixelCropBottom &cropval = *(KaxVideoPixelCropBottom*)l;
+
+                    tk->fmt.video.i_height -= uint16( cropval );
+                    msg_Dbg( &sys.demuxer, "|   |   |   |   + crop pixel bottom=%d", uint16( cropval ) );
+                }
+                else if( MKV_IS_ID( l, KaxVideoPixelCropTop ) )
+                {
+                    KaxVideoPixelCropTop &cropval = *(KaxVideoPixelCropTop*)l;
+
+                    tk->fmt.video.i_height -= uint16( cropval );
+                    tk->fmt.video.i_y_offset += uint16( cropval );
+                    msg_Dbg( &sys.demuxer, "|   |   |   |   + crop pixel top=%d", uint16( cropval ) );
+                }
+                else if( MKV_IS_ID( l, KaxVideoPixelCropRight ) )
+                {
+                    KaxVideoPixelCropRight &cropval = *(KaxVideoPixelCropRight*)l;
+
+                    tk->fmt.video.i_width -= uint16( cropval );
+                    msg_Dbg( &sys.demuxer, "|   |   |   |   + crop pixel right=%d", uint16( cropval ) );
+                }
+                else if( MKV_IS_ID( l, KaxVideoPixelCropLeft ) )
+                {
+                    KaxVideoPixelCropLeft &cropval = *(KaxVideoPixelCropLeft*)l;
+
+                    tk->fmt.video.i_width -= uint16( cropval );
+                    tk->fmt.video.i_x_offset += uint16( cropval );
+                    msg_Dbg( &sys.demuxer, "|   |   |   |   + crop pixel left=%d", uint16( cropval ) );
+                }
                 else if( MKV_IS_ID( l, KaxVideoFrameRate ) )
                 {
                     KaxVideoFrameRate &vfps = *(KaxVideoFrameRate*)l;