[vlc-commits] demux: mp4: add support for FFV1 v2 (fix #13131)
Francois Cartegnie
git at videolan.org
Tue Dec 30 16:25:43 CET 2014
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Dec 30 16:19:03 2014 +0100| [4e523f3df5f3c1c215e35ebc282303c33982fc7c] | committer: Francois Cartegnie
demux: mp4: add support for FFV1 v2 (fix #13131)
V2 has global tables, and then needs it to be passed as
extradata IV.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4e523f3df5f3c1c215e35ebc282303c33982fc7c
---
modules/demux/mp4/essetup.c | 16 ++++++++++++++++
modules/demux/mp4/libmp4.c | 2 ++
modules/demux/mp4/libmp4.h | 2 ++
3 files changed, 20 insertions(+)
diff --git a/modules/demux/mp4/essetup.c b/modules/demux/mp4/essetup.c
index 2ffacbe..842744a 100644
--- a/modules/demux/mp4/essetup.c
+++ b/modules/demux/mp4/essetup.c
@@ -265,6 +265,22 @@ int SetupVideoES( demux_t *p_demux, mp4_track_t *p_track, MP4_Box_t *p_sample )
break;
}
+ case VLC_CODEC_FFV1:
+ {
+ MP4_Box_t *p_binary = MP4_BoxGet( p_sample, "glbl" );
+ if( p_binary && BOXDATA(p_binary) && BOXDATA(p_binary)->i_blob )
+ {
+ p_track->fmt.p_extra = malloc( BOXDATA(p_binary)->i_blob );
+ if( p_track->fmt.p_extra )
+ {
+ p_track->fmt.i_extra = BOXDATA(p_binary)->i_blob;
+ memcpy( p_track->fmt.p_extra, BOXDATA(p_binary)->p_blob,
+ p_track->fmt.i_extra );
+ }
+ }
+ break;
+ }
+
case VLC_FOURCC( 'v', 'c', '-', '1' ):
{
MP4_Box_t *p_dvc1 = MP4_BoxGet( p_sample, "dvc1" );
diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index d3263cd..08c669c 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -3666,6 +3666,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_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 },
{ ATOM_pasp, MP4_ReadBox_pasp, MP4_FreeBox_Common, 0 },
@@ -3738,6 +3739,7 @@ static const struct
{ ATOM_3ivd, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_3VID, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_3vid, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
+ { ATOM_FFV1, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_mjpa, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_mjpb, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_qdrw, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
diff --git a/modules/demux/mp4/libmp4.h b/modules/demux/mp4/libmp4.h
index f00d17c..0486ed9 100644
--- a/modules/demux/mp4/libmp4.h
+++ b/modules/demux/mp4/libmp4.h
@@ -178,6 +178,7 @@
#define ATOM_3ivd VLC_FOURCC( '3', 'i', 'v', 'd' )
#define ATOM_3VID VLC_FOURCC( '3', 'V', 'I', 'D' )
#define ATOM_3vid VLC_FOURCC( '3', 'v', 'i', 'd' )
+#define ATOM_FFV1 VLC_FOURCC( 'F', 'F', 'V', '1' )
#define ATOM_h263 VLC_FOURCC( 'h', '2', '6', '3' )
#define ATOM_s263 VLC_FOURCC( 's', '2', '6', '3' )
#define ATOM_DIVX VLC_FOURCC( 'D', 'I', 'V', 'X' )
@@ -198,6 +199,7 @@
#define ATOM_avcC VLC_FOURCC( 'a', 'v', 'c', 'C' )
#define ATOM_m4ds VLC_FOURCC( 'm', '4', 'd', 's' )
+#define ATOM_glbl VLC_FOURCC( 'g', 'l', 'b', 'l' )
#define ATOM_hvcC VLC_FOURCC( 'h', 'v', 'c', 'C' )
#define ATOM_dvc VLC_FOURCC( 'd', 'v', 'c', ' ' )
More information about the vlc-commits
mailing list