[vlc-commits] demux: libmp4: add load atom

Francois Cartegnie git at videolan.org
Mon Oct 20 16:42:51 CEST 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Oct 20 13:14:59 2014 +0200| [187848727a37a6629f5ae38f58c94e6cabb9570e] | committer: Francois Cartegnie

demux: libmp4: add load atom

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

 modules/demux/mp4/libmp4.c |   12 ++++++++++++
 modules/demux/mp4/libmp4.h |   10 ++++++++++
 2 files changed, 22 insertions(+)

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 3802c5f..0cfdd8f 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -906,6 +906,17 @@ static int MP4_ReadBox_tkhd(  stream_t *p_stream, MP4_Box_t *p_box )
     MP4_READBOX_EXIT( 1 );
 }
 
+static int MP4_ReadBox_load( stream_t *p_stream, MP4_Box_t *p_box )
+{
+    if ( p_box->i_size != 24 )
+        return 0;
+    MP4_READBOX_ENTER( MP4_Box_data_load_t );
+    MP4_GET4BYTES( p_box->data.p_load->i_start_time );
+    MP4_GET4BYTES( p_box->data.p_load->i_duration );
+    MP4_GET4BYTES( p_box->data.p_load->i_flags );
+    MP4_GET4BYTES( p_box->data.p_load->i_hints );
+    MP4_READBOX_EXIT( 1 );
+}
 
 static int MP4_ReadBox_mdhd( stream_t *p_stream, MP4_Box_t *p_box )
 {
@@ -3543,6 +3554,7 @@ static const struct
     { ATOM_mvhd,    MP4_ReadBox_mvhd,         MP4_FreeBox_Common, ATOM_moov },
     { ATOM_mvhd,    MP4_ReadBox_mvhd,         MP4_FreeBox_Common, ATOM_foov },
     { ATOM_tkhd,    MP4_ReadBox_tkhd,         MP4_FreeBox_Common, ATOM_trak },
+    { ATOM_load,    MP4_ReadBox_load,         MP4_FreeBox_Common, ATOM_trak },
     { ATOM_mdhd,    MP4_ReadBox_mdhd,         MP4_FreeBox_Common, ATOM_mdia },
     { ATOM_hdlr,    MP4_ReadBox_hdlr,         MP4_FreeBox_hdlr,   ATOM_mdia },
     { ATOM_hdlr,    MP4_ReadBox_hdlr,         MP4_FreeBox_hdlr,   ATOM_meta },
diff --git a/modules/demux/mp4/libmp4.h b/modules/demux/mp4/libmp4.h
index 347dbfe..b88739a 100644
--- a/modules/demux/mp4/libmp4.h
+++ b/modules/demux/mp4/libmp4.h
@@ -65,6 +65,7 @@
 #define ATOM_mvhd VLC_FOURCC( 'm', 'v', 'h', 'd' )
 #define ATOM_tkhd VLC_FOURCC( 't', 'k', 'h', 'd' )
 #define ATOM_tref VLC_FOURCC( 't', 'r', 'e', 'f' )
+#define ATOM_load VLC_FOURCC( 'l', 'o', 'a', 'd' )
 #define ATOM_mdia VLC_FOURCC( 'm', 'd', 'i', 'a' )
 #define ATOM_mdhd VLC_FOURCC( 'm', 'd', 'h', 'd' )
 #define ATOM_hdlr VLC_FOURCC( 'h', 'd', 'l', 'r' )
@@ -417,6 +418,14 @@ typedef struct MP4_Box_data_tkhd_s
 
 } MP4_Box_data_tkhd_t;
 
+typedef struct
+{
+    uint32_t i_start_time;
+    int32_t  i_duration;
+    uint32_t i_flags;
+    uint32_t i_hints;
+} MP4_Box_data_load_t;
+
 typedef struct MP4_Box_data_mdhd_s
 {
     uint8_t  i_version;
@@ -1411,6 +1420,7 @@ typedef union MP4_Box_data_s
     MP4_Box_data_mehd_t *p_mehd;
     MP4_Box_data_sdtp_t *p_sdtp;
     MP4_Box_data_tsel_t *p_tsel;
+    MP4_Box_data_load_t *p_load;
 
     MP4_Box_data_tfra_t *p_tfra;
     MP4_Box_data_mfro_t *p_mfro;



More information about the vlc-commits mailing list