Commit d0aad165 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: libmp4: read heif ispe

parent 558c6691
...@@ -4495,6 +4495,24 @@ static int MP4_ReadBox_pitm( stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -4495,6 +4495,24 @@ static int MP4_ReadBox_pitm( stream_t *p_stream, MP4_Box_t *p_box )
MP4_READBOX_EXIT( 1 ); MP4_READBOX_EXIT( 1 );
} }
static int MP4_ReadBox_ispe( stream_t *p_stream, MP4_Box_t *p_box )
{
MP4_READBOX_ENTER( MP4_Box_data_ispe_t, NULL );
MP4_Box_data_ispe_t *p_data = p_box->data.p_ispe;
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_READBOX_EXIT( 0 );
MP4_GET4BYTES( p_data->i_width );
MP4_GET4BYTES( p_data->i_height );
MP4_READBOX_EXIT( 1 );
}
/* For generic */ /* For generic */
static int MP4_ReadBox_default( stream_t *p_stream, MP4_Box_t *p_box ) static int MP4_ReadBox_default( stream_t *p_stream, MP4_Box_t *p_box )
{ {
...@@ -4979,6 +4997,11 @@ static const struct ...@@ -4979,6 +4997,11 @@ static const struct
{ ATOM_infe, MP4_ReadBox_infe, ATOM_iinf }, { ATOM_infe, MP4_ReadBox_infe, ATOM_iinf },
{ ATOM_pitm, MP4_ReadBox_pitm, ATOM_meta }, { ATOM_pitm, MP4_ReadBox_pitm, ATOM_meta },
/* HEIF specific meta references */
{ ATOM_iprp, MP4_ReadBoxContainer, ATOM_meta },
{ ATOM_ipco, MP4_ReadBoxContainer, ATOM_iprp },
{ ATOM_ispe, MP4_ReadBox_ispe, ATOM_ipco },
/* Last entry */ /* Last entry */
{ 0, MP4_ReadBox_default, 0 } { 0, MP4_ReadBox_default, 0 }
}; };
......
...@@ -401,6 +401,10 @@ typedef int64_t stime_t; ...@@ -401,6 +401,10 @@ typedef int64_t stime_t;
#define ATOM_iinf VLC_FOURCC('i','i','n','f') #define ATOM_iinf VLC_FOURCC('i','i','n','f')
#define ATOM_infe VLC_FOURCC('i','n','f','e') #define ATOM_infe VLC_FOURCC('i','n','f','e')
#define ATOM_pitm VLC_FOURCC('p','i','t','m') #define ATOM_pitm VLC_FOURCC('p','i','t','m')
/* HEIF specific meta */
#define ATOM_iprp VLC_FOURCC('i','p','r','p')
#define ATOM_ipco VLC_FOURCC('i','p','c','o')
#define ATOM_ispe VLC_FOURCC('i','s','p','e')
#define HANDLER_mdta VLC_FOURCC('m', 'd', 't', 'a') #define HANDLER_mdta VLC_FOURCC('m', 'd', 't', 'a')
#define HANDLER_mdir VLC_FOURCC('m', 'd', 'i', 'r') #define HANDLER_mdir VLC_FOURCC('m', 'd', 'i', 'r')
...@@ -408,6 +412,9 @@ typedef int64_t stime_t; ...@@ -408,6 +412,9 @@ typedef int64_t stime_t;
#define SAMPLEGROUP_rap VLC_FOURCC('r', 'a', 'p', ' ') #define SAMPLEGROUP_rap VLC_FOURCC('r', 'a', 'p', ' ')
/* HEIF Specific */
#define HANDLER_pict VLC_FOURCC('p', 'i', 'c', 't')
/* Do you want some debug information on all read boxes ? */ /* Do you want some debug information on all read boxes ? */
#ifndef NDEBUG #ifndef NDEBUG
# define MP4_VERBOSE 1 # define MP4_VERBOSE 1
...@@ -1672,6 +1679,12 @@ typedef struct ...@@ -1672,6 +1679,12 @@ typedef struct
uint32_t i_item_id; uint32_t i_item_id;
} MP4_Box_data_pitm_t; } MP4_Box_data_pitm_t;
typedef struct
{
uint32_t i_width;
uint32_t i_height;
} MP4_Box_data_ispe_t;
/* /*
typedef struct MP4_Box_data__s typedef struct MP4_Box_data__s
{ {
...@@ -1790,6 +1803,7 @@ typedef union MP4_Box_data_s ...@@ -1790,6 +1803,7 @@ typedef union MP4_Box_data_s
MP4_Box_data_iinf_t *p_iinf; MP4_Box_data_iinf_t *p_iinf;
MP4_Box_data_infe_t *p_infe; MP4_Box_data_infe_t *p_infe;
MP4_Box_data_pitm_t *p_pitm; MP4_Box_data_pitm_t *p_pitm;
MP4_Box_data_ispe_t *p_ispe; /* heif */
/* for generic handlers */ /* for generic handlers */
MP4_Box_data_binary_t *p_binary; 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