Commit 7a362078 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: libmp4: handle btrt atom

parent 5ee57b86
...@@ -3325,6 +3325,20 @@ static int MP4_ReadBox_iods( stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -3325,6 +3325,20 @@ static int MP4_ReadBox_iods( stream_t *p_stream, MP4_Box_t *p_box )
MP4_READBOX_EXIT( 1 ); MP4_READBOX_EXIT( 1 );
} }
static int MP4_ReadBox_btrt( stream_t *p_stream, MP4_Box_t *p_box )
{
MP4_READBOX_ENTER( MP4_Box_data_btrt_t, NULL );
if(i_read != 12)
MP4_READBOX_EXIT( 0 );
MP4_GET4BYTES( p_box->data.p_btrt->i_buffer_size );
MP4_GET4BYTES( p_box->data.p_btrt->i_max_bitrate );
MP4_GET4BYTES( p_box->data.p_btrt->i_avg_bitrate );
MP4_READBOX_EXIT( 1 );
}
static int MP4_ReadBox_pasp( stream_t *p_stream, MP4_Box_t *p_box ) static int MP4_ReadBox_pasp( stream_t *p_stream, MP4_Box_t *p_box )
{ {
MP4_READBOX_ENTER( MP4_Box_data_pasp_t, NULL ); MP4_READBOX_ENTER( MP4_Box_data_pasp_t, NULL );
...@@ -3731,6 +3745,7 @@ static const struct ...@@ -3731,6 +3745,7 @@ static const struct
{ ATOM_enda, MP4_ReadBox_enda, 0 }, { ATOM_enda, MP4_ReadBox_enda, 0 },
{ ATOM_iods, MP4_ReadBox_iods, 0 }, { ATOM_iods, MP4_ReadBox_iods, 0 },
{ ATOM_pasp, MP4_ReadBox_pasp, 0 }, { ATOM_pasp, MP4_ReadBox_pasp, 0 },
{ ATOM_btrt, MP4_ReadBox_btrt, 0 }, /* codecs bitrate stsd/????/btrt */
{ ATOM_keys, MP4_ReadBox_keys, ATOM_meta }, { ATOM_keys, MP4_ReadBox_keys, ATOM_meta },
/* Quicktime preview atoms, all at root */ /* Quicktime preview atoms, all at root */
......
...@@ -132,6 +132,7 @@ typedef int64_t stime_t; ...@@ -132,6 +132,7 @@ typedef int64_t stime_t;
#define ATOM_mpod VLC_FOURCC( 'm', 'p', 'o', 'd' ) #define ATOM_mpod VLC_FOURCC( 'm', 'p', 'o', 'd' )
#define ATOM_hnti VLC_FOURCC( 'h', 'n', 't', 'i' ) #define ATOM_hnti VLC_FOURCC( 'h', 'n', 't', 'i' )
#define ATOM_rtp VLC_FOURCC( 'r', 't', 'p', ' ' ) #define ATOM_rtp VLC_FOURCC( 'r', 't', 'p', ' ' )
#define ATOM_btrt VLC_FOURCC( 'b', 't', 'r', 't' )
#define ATOM_esds VLC_FOURCC( 'e', 's', 'd', 's' ) #define ATOM_esds VLC_FOURCC( 'e', 's', 'd', 's' )
...@@ -1283,6 +1284,13 @@ typedef struct ...@@ -1283,6 +1284,13 @@ typedef struct
} MP4_Box_data_iods_t; } MP4_Box_data_iods_t;
typedef struct
{
uint32_t i_buffer_size;
uint32_t i_max_bitrate;
uint32_t i_avg_bitrate;
} MP4_Box_data_btrt_t;
typedef struct typedef struct
{ {
uint32_t i_horizontal_spacing; uint32_t i_horizontal_spacing;
...@@ -1443,6 +1451,7 @@ typedef union MP4_Box_data_s ...@@ -1443,6 +1451,7 @@ typedef union MP4_Box_data_s
MP4_Box_data_enda_t *p_enda; MP4_Box_data_enda_t *p_enda;
MP4_Box_data_keys_t *p_keys; MP4_Box_data_keys_t *p_keys;
MP4_Box_data_iods_t *p_iods; MP4_Box_data_iods_t *p_iods;
MP4_Box_data_btrt_t *p_btrt;
MP4_Box_data_pasp_t *p_pasp; MP4_Box_data_pasp_t *p_pasp;
MP4_Box_data_trex_t *p_trex; MP4_Box_data_trex_t *p_trex;
MP4_Box_data_mehd_t *p_mehd; MP4_Box_data_mehd_t *p_mehd;
......
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