Commit 18784872 authored by François Cartegnie's avatar François Cartegnie 🤞
Browse files

demux: libmp4: add load atom

parent b6fce7e2
......@@ -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 },
......
......@@ -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;
......
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