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

demux: libmp4: add quicktime pnot movie preview atoms

parent a8d12d85
......@@ -3429,6 +3429,20 @@ static void MP4_FreeBox_tfra( MP4_Box_t *p_box )
FREENULL( p_box->data.p_tfra->p_sample_number );
}
static int MP4_ReadBox_pnot( stream_t *p_stream, MP4_Box_t *p_box )
{
if ( p_box->i_size != 20 )
return 0;
MP4_READBOX_ENTER( MP4_Box_data_pnot_t );
MP4_GET4BYTES( p_box->data.p_pnot->i_date );
uint16_t i_version;
MP4_GET2BYTES( i_version );
if ( i_version != 0 )
MP4_READBOX_EXIT( 0 );
MP4_GETFOURCC( p_box->data.p_pnot->i_type );
MP4_GET2BYTES( p_box->data.p_pnot->i_index );
MP4_READBOX_EXIT( 1 );
}
/* For generic */
static int MP4_ReadBox_default( stream_t *p_stream, MP4_Box_t *p_box )
......@@ -3567,6 +3581,11 @@ static const struct
{ ATOM_pasp, MP4_ReadBox_pasp, MP4_FreeBox_Common, 0 },
{ ATOM_keys, MP4_ReadBox_keys, MP4_FreeBox_keys, ATOM_meta },
/* Quicktime preview atoms, all at root */
{ ATOM_pnot, MP4_ReadBox_pnot, MP4_FreeBox_Common, 0 },
{ ATOM_pict, MP4_ReadBox_Binary, MP4_FreeBox_Binary, 0 },
{ ATOM_PICT, MP4_ReadBox_Binary, MP4_FreeBox_Binary, 0 },
/* Nothing to do with this box */
{ ATOM_mdat, MP4_ReadBoxSkip, MP4_FreeBox_Common, 0 },
{ ATOM_skip, MP4_ReadBoxSkip, MP4_FreeBox_Common, 0 },
......
......@@ -54,6 +54,11 @@
#define ATOM_wide VLC_FOURCC( 'w', 'i', 'd', 'e' )
#define ATOM_binm VLC_FOURCC( 0x82, 0x82, 0x7f, 0x7d ) /* binary Computer Graphics Metafile */
/* Quicktime preview */
#define ATOM_pnot VLC_FOURCC( 'p', 'n', 'o', 't' )
#define ATOM_pict VLC_FOURCC( 'p', 'i', 'c', 't' )
#define ATOM_PICT VLC_FOURCC( 'P', 'I', 'C', 'T' )
#define ATOM_data VLC_FOURCC( 'd', 'a', 't', 'a' )
#define ATOM_trak VLC_FOURCC( 't', 'r', 'a', 'k' )
......@@ -1020,6 +1025,13 @@ typedef struct MP4_Box_data_trun_s
} MP4_Box_data_trun_t;
typedef struct
{
uint32_t i_date;
uint32_t i_type;
uint16_t i_index;
} MP4_Box_data_pnot_t;
typedef struct
{
char *psz_text;
......@@ -1429,6 +1441,7 @@ typedef union MP4_Box_data_s
MP4_Box_data_rmqu_t *p_rmqu;
MP4_Box_data_rmvc_t *p_rmvc;
MP4_Box_data_pnot_t *p_pnot;
MP4_Box_data_chpl_t *p_chpl;
MP4_Box_data_tref_generic_t *p_tref_generic;
......
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