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

demux: libmp4: parse fiel extension atom

parent 94b41252
......@@ -1871,6 +1871,30 @@ static int MP4_ReadBox_dvc1( stream_t *p_stream, MP4_Box_t *p_box )
MP4_READBOX_EXIT( 1 );
}
static int MP4_ReadBox_fiel( stream_t *p_stream, MP4_Box_t *p_box )
{
MP4_Box_data_fiel_t *p_fiel;
MP4_READBOX_ENTER( MP4_Box_data_fiel_t );
p_fiel = p_box->data.p_fiel;
if(i_read < 2)
MP4_READBOX_EXIT( 0 );
if(p_peek[0] == 2) /* Interlaced */
{
/*
* 0 – There is only one field.
* 1 – T is displayed earliest, T is stored first in the file.
* 6 – B is displayed earliest, B is stored first in the file.
* 9 – B is displayed earliest, T is stored first in the file.
* 14 – T is displayed earliest, B is stored first in the file.
*/
if(p_peek[1] == 1 || p_peek[1] == 9)
p_fiel->i_flags = BLOCK_FLAG_TOP_FIELD_FIRST;
else if(p_peek[1] == 6 || p_peek[1] == 14)
p_fiel->i_flags = BLOCK_FLAG_BOTTOM_FIELD_FIRST;
}
MP4_READBOX_EXIT( 1 );
}
static int MP4_ReadBox_enda( stream_t *p_stream, MP4_Box_t *p_box )
{
MP4_Box_data_enda_t *p_enda;
......@@ -3673,6 +3697,7 @@ static const struct
{ ATOM_dac3, MP4_ReadBox_dac3, MP4_FreeBox_Common, 0 },
{ ATOM_dec3, MP4_ReadBox_dec3, MP4_FreeBox_Common, 0 },
{ ATOM_dvc1, MP4_ReadBox_dvc1, MP4_FreeBox_Common, 0 },
{ ATOM_fiel, MP4_ReadBox_fiel, MP4_FreeBox_Common, 0 },
{ ATOM_glbl, MP4_ReadBox_Binary, MP4_FreeBox_Binary, ATOM_FFV1 },
{ ATOM_enda, MP4_ReadBox_enda, MP4_FreeBox_Common, 0 },
{ ATOM_iods, MP4_ReadBox_iods, MP4_FreeBox_Common, 0 },
......
......@@ -199,6 +199,7 @@
#define ATOM_avcC VLC_FOURCC( 'a', 'v', 'c', 'C' )
#define ATOM_m4ds VLC_FOURCC( 'm', '4', 'd', 's' )
#define ATOM_fiel VLC_FOURCC( 'f', 'i', 'e', 'l' )
#define ATOM_glbl VLC_FOURCC( 'g', 'l', 'b', 'l' )
#define ATOM_hvcC VLC_FOURCC( 'h', 'v', 'c', 'C' )
......@@ -1224,6 +1225,11 @@ typedef struct
} MP4_Box_data_dvc1_t;
typedef struct
{
uint32_t i_flags;
} MP4_Box_data_fiel_t;
typedef struct
{
uint16_t i_little_endian;
......@@ -1414,6 +1420,7 @@ typedef union MP4_Box_data_s
MP4_Box_data_dac3_t *p_dac3;
MP4_Box_data_dec3_t *p_dec3;
MP4_Box_data_dvc1_t *p_dvc1;
MP4_Box_data_fiel_t *p_fiel;
MP4_Box_data_chan_t *p_chan;
MP4_Box_data_enda_t *p_enda;
MP4_Box_data_keys_t *p_keys;
......
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