[vlc-commits] demux: libmp4: add binary generic atom
Francois Cartegnie
git at videolan.org
Mon Oct 20 00:26:22 CEST 2014
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Oct 19 18:28:09 2014 +0200| [a8d12d85e811f3dc2e46809bcbc41ade25d9679f] | committer: Francois Cartegnie
demux: libmp4: add binary generic atom
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a8d12d85e811f3dc2e46809bcbc41ade25d9679f
---
modules/demux/mp4/libmp4.c | 22 ++++++++++++++++++++++
modules/demux/mp4/libmp4.h | 7 +++++++
2 files changed, 29 insertions(+)
diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 1594757..802a348 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -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 );
diff --git a/modules/demux/mp4/libmp4.h b/modules/demux/mp4/libmp4.h
index 1dc52b5..efd3774 100644
--- a/modules/demux/mp4/libmp4.h
+++ b/modules/demux/mp4/libmp4.h
@@ -1028,6 +1028,12 @@ typedef struct
typedef struct
{
+ uint8_t *p_blob;
+ uint32_t i_blob;
+} MP4_Box_data_binary_t;
+
+typedef struct
+{
uint32_t i_entry_count;
uint32_t *i_track_ID;
@@ -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 */
More information about the vlc-commits
mailing list