Commit 558c6691 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: libmp4: read box pitm

parent f999c3a0
......@@ -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 }
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment