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

demux: libmp4: add binary generic atom

parent a372720f
......@@ -2858,6 +2858,28 @@ static void MP4_FreeBox_String( MP4_Box_t *p_box )
FREENULL( p_box->data.p_string->psz_text );
}
static int MP4_ReadBox_Binary( stream_t *p_stream, MP4_Box_t *p_box )
{
MP4_READBOX_ENTER( MP4_Box_data_binary_t );
i_read = __MIN( i_read, UINT32_MAX );
if ( i_read > 0 )
{
p_box->data.p_binary->p_blob = malloc( i_read );
if ( p_box->data.p_binary->p_blob )
{
memcpy( p_box->data.p_binary->p_blob, p_peek, i_read );
p_box->data.p_binary->i_blob = i_read;
}
}
MP4_READBOX_EXIT( 1 );
}
static void MP4_FreeBox_Binary( MP4_Box_t *p_box )
{
FREENULL( p_box->data.p_binary->p_blob );
p_box->data.p_binary->i_blob = 0;
}
static int MP4_ReadBox_data( stream_t *p_stream, MP4_Box_t *p_box )
{
MP4_READBOX_ENTER( MP4_Box_data_data_t );
......
......@@ -1026,6 +1026,12 @@ typedef struct
} MP4_Box_data_string_t;
typedef struct
{
uint8_t *p_blob;
uint32_t i_blob;
} MP4_Box_data_binary_t;
typedef struct
{
uint32_t i_entry_count;
......@@ -1435,6 +1441,7 @@ typedef union MP4_Box_data_s
/* for generic handlers */
MP4_Box_data_string_t *p_string;
MP4_Box_data_binary_t *p_binary;
MP4_Box_data_data_t *p_data;
void *p_payload; /* for unknow type */
......
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