[vlc-commits] demux: libmp4: read box pitm
Francois Cartegnie
git at videolan.org
Tue Mar 13 19:09:34 CET 2018
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Mar 9 12:48:36 2018 +0100| [558c66917cb1623215585752a14fbf8c83ef0214] | committer: Francois Cartegnie
demux: libmp4: read box pitm
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=558c66917cb1623215585752a14fbf8c83ef0214
---
modules/demux/mp4/libmp4.c | 19 +++++++++++++++++++
modules/demux/mp4/libmp4.h | 7 +++++++
2 files changed, 26 insertions(+)
diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index c8c27111b6..9820f022b6 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -4477,6 +4477,24 @@ static int MP4_ReadBox_infe( stream_t *p_stream, MP4_Box_t *p_box )
MP4_READBOX_EXIT( 1 );
}
+static int MP4_ReadBox_pitm( stream_t *p_stream, MP4_Box_t *p_box )
+{
+ MP4_READBOX_ENTER( MP4_Box_data_pitm_t, NULL );
+ MP4_Box_data_pitm_t *p_data = p_box->data.p_pitm;
+
+ uint8_t i_version;
+ uint32_t i_flags;
+ MP4_GET1BYTE( i_version );
+ MP4_GET3BYTES( i_flags ); VLC_UNUSED(i_flags);
+
+ if( i_version == 0 )
+ MP4_GET2BYTES( p_data->i_item_id );
+ else
+ MP4_GET4BYTES( p_data->i_item_id );
+
+ MP4_READBOX_EXIT( 1 );
+}
+
/* For generic */
static int MP4_ReadBox_default( stream_t *p_stream, MP4_Box_t *p_box )
{
@@ -4959,6 +4977,7 @@ static const struct
{ ATOM_iloc, MP4_ReadBox_iloc, ATOM_meta },
{ ATOM_iinf, MP4_ReadBox_iinf, ATOM_meta },
{ ATOM_infe, MP4_ReadBox_infe, ATOM_iinf },
+ { ATOM_pitm, MP4_ReadBox_pitm, ATOM_meta },
/* Last entry */
{ 0, MP4_ReadBox_default, 0 }
diff --git a/modules/demux/mp4/libmp4.h b/modules/demux/mp4/libmp4.h
index e088c1cdf2..9a37cdb1ec 100644
--- a/modules/demux/mp4/libmp4.h
+++ b/modules/demux/mp4/libmp4.h
@@ -400,6 +400,7 @@ typedef int64_t stime_t;
#define ATOM_iloc VLC_FOURCC('i','l','o','c')
#define ATOM_iinf VLC_FOURCC('i','i','n','f')
#define ATOM_infe VLC_FOURCC('i','n','f','e')
+#define ATOM_pitm VLC_FOURCC('p','i','t','m')
#define HANDLER_mdta VLC_FOURCC('m', 'd', 't', 'a')
#define HANDLER_mdir VLC_FOURCC('m', 'd', 'i', 'r')
@@ -1666,6 +1667,11 @@ typedef struct
char *psz_item_uri_type;
} MP4_Box_data_infe_t;
+typedef struct
+{
+ uint32_t i_item_id;
+} MP4_Box_data_pitm_t;
+
/*
typedef struct MP4_Box_data__s
{
@@ -1783,6 +1789,7 @@ typedef union MP4_Box_data_s
MP4_Box_data_iloc_t *p_iloc;
MP4_Box_data_iinf_t *p_iinf;
MP4_Box_data_infe_t *p_infe;
+ MP4_Box_data_pitm_t *p_pitm;
/* for generic handlers */
MP4_Box_data_binary_t *p_binary;
More information about the vlc-commits
mailing list