[vlc-commits] mp4: support iods atom

Jean-Baptiste Kempf git at videolan.org
Thu Aug 25 01:30:22 CEST 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Aug 25 01:29:34 2011 +0200| [245aa5862555d70e49c7d1659fee253ab3483465] | committer: Jean-Baptiste Kempf

mp4: support iods atom

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

 modules/demux/mp4/libmp4.c |   35 +++++++++++++++++++++++++++++++++++
 modules/demux/mp4/libmp4.h |   15 +++++++++++++++
 2 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 039fc59..831406e 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -2648,6 +2648,40 @@ static int MP4_ReadBox_meta( stream_t *p_stream, MP4_Box_t *p_box )
     return MP4_ReadBoxContainerRaw( p_stream, p_box );
 }
 
+static int MP4_ReadBox_iods( stream_t *p_stream, MP4_Box_t *p_box )
+{
+    char i_unused;
+
+    MP4_READBOX_ENTER( MP4_Box_data_iods_t );
+    MP4_GETVERSIONFLAGS( p_box->data.p_iods );
+
+    MP4_GET1BYTE( i_unused ); /* tag */
+    MP4_GET1BYTE( i_unused ); /* length */
+
+    MP4_GET2BYTES( p_box->data.p_iods->i_object_descriptor ); /* 10bits, 6 other bits
+                                                              are used for other flags */
+    MP4_GET1BYTE( p_box->data.p_iods->i_OD_profile_level );
+    MP4_GET1BYTE( p_box->data.p_iods->i_scene_profile_level );
+    MP4_GET1BYTE( p_box->data.p_iods->i_audio_profile_level );
+    MP4_GET1BYTE( p_box->data.p_iods->i_visual_profile_level );
+    MP4_GET1BYTE( p_box->data.p_iods->i_graphics_profile_level );
+
+#ifdef MP4_VERBOSE
+    msg_Dbg( p_stream,
+             "read box: \"iods\" objectDescriptorId: %i, OD: %i, scene: %i, audio: %i, "
+             "visual: %i, graphics: %i",
+             p_box->data.p_iods->i_object_descriptor >> 6,
+             p_box->data.p_iods->i_OD_profile_level,
+             p_box->data.p_iods->i_scene_profile_level,
+             p_box->data.p_iods->i_audio_profile_level,
+             p_box->data.p_iods->i_visual_profile_level,
+             p_box->data.p_iods->i_graphics_profile_level );
+#endif
+
+    MP4_READBOX_EXIT( 1 );
+}
+
+
 /* For generic */
 static int MP4_ReadBox_default( stream_t *p_stream, MP4_Box_t *p_box )
 {
@@ -2760,6 +2794,7 @@ static const struct
     { FOURCC_enda,    MP4_ReadBox_enda,         MP4_FreeBox_Common },
     { FOURCC_gnre,    MP4_ReadBox_gnre,         MP4_FreeBox_Common },
     { FOURCC_trkn,    MP4_ReadBox_trkn,         MP4_FreeBox_Common },
+    { FOURCC_iods,    MP4_ReadBox_iods,         MP4_FreeBox_Common },
 
     /* Nothing to do with this box */
     { FOURCC_mdat,    MP4_ReadBoxSkip,          MP4_FreeBox_Common },
diff --git a/modules/demux/mp4/libmp4.h b/modules/demux/mp4/libmp4.h
index be71f45..902e6a4 100644
--- a/modules/demux/mp4/libmp4.h
+++ b/modules/demux/mp4/libmp4.h
@@ -958,6 +958,20 @@ typedef struct
 
 } MP4_Box_data_trkn_t;
 
+typedef struct
+{
+    uint8_t  i_version;
+    uint32_t i_flags;
+
+    uint16_t i_object_descriptor;
+    uint8_t i_OD_profile_level;
+    uint8_t i_scene_profile_level;
+    uint8_t i_audio_profile_level;
+    uint8_t i_visual_profile_level;
+    uint8_t i_graphics_profile_level;
+
+} MP4_Box_data_iods_t;
+
 /*
 typedef struct MP4_Box_data__s
 {
@@ -998,6 +1012,7 @@ typedef union MP4_Box_data_s
     MP4_Box_data_enda_t *p_enda;
     MP4_Box_data_gnre_t *p_gnre;
     MP4_Box_data_trkn_t *p_trkn;
+    MP4_Box_data_iods_t *p_iods;
 
     MP4_Box_data_stsz_t *p_stsz;
     MP4_Box_data_stz2_t *p_stz2;



More information about the vlc-commits mailing list