[vlc-commits] demux: mp4: handle av1C

Francois Cartegnie git at videolan.org
Thu Jul 19 13:52:23 CEST 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Jul 19 13:43:18 2018 +0200| [2f9a15c3028c901a4973535281d22e561f7bac2a] | committer: Francois Cartegnie

demux: mp4: handle av1C

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2f9a15c3028c901a4973535281d22e561f7bac2a
---

 modules/demux/mp4/essetup.c | 17 +++++++++++++++++
 modules/demux/mp4/libmp4.c  |  2 ++
 modules/demux/mp4/libmp4.h  |  2 ++
 3 files changed, 21 insertions(+)

diff --git a/modules/demux/mp4/essetup.c b/modules/demux/mp4/essetup.c
index 373f1eab51..463247886c 100644
--- a/modules/demux/mp4/essetup.c
+++ b/modules/demux/mp4/essetup.c
@@ -601,6 +601,23 @@ int SetupVideoES( demux_t *p_demux, mp4_track_t *p_track, MP4_Box_t *p_sample )
             break;
         }
 
+        case ATOM_av01:
+        {
+            static_assert(ATOM_av01 == VLC_CODEC_AV1, "VLC_CODEC_AV1 != ATOM_av01");
+            MP4_Box_t *p_av1C = MP4_BoxGet( p_sample, "av1C" );
+            if( p_av1C && p_av1C->data.p_binary && p_av1C->data.p_binary->i_blob )
+            {
+                p_track->fmt.p_extra = malloc( p_av1C->data.p_binary->i_blob );
+                if( p_track->fmt.p_extra )
+                {
+                    p_track->fmt.i_extra = p_av1C->data.p_binary->i_blob;
+                    memcpy( p_track->fmt.p_extra, p_av1C->data.p_binary->p_blob,
+                            p_av1C->data.p_binary->i_blob );
+                }
+            }
+            break;
+        }
+
         /* avc1: send avcC (h264 without annexe B, ie without start code)*/
         case VLC_FOURCC( 'a', 'v', 'c', '3' ):
         case VLC_FOURCC( 'a', 'v', 'c', '1' ):
diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 621cd07b8a..222376fea8 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -4714,6 +4714,7 @@ static const struct
     { ATOM_dcom,    MP4_ReadBox_dcom,         0 },
     { ATOM_dfLa,    MP4_ReadBox_Binary,       ATOM_fLaC },
     { ATOM_cmvd,    MP4_ReadBox_cmvd,         0 },
+    { ATOM_av1C,    MP4_ReadBox_Binary,       ATOM_av01 },
     { ATOM_avcC,    MP4_ReadBox_avcC,         ATOM_avc1 },
     { ATOM_avcC,    MP4_ReadBox_avcC,         ATOM_avc3 },
     { ATOM_hvcC,    MP4_ReadBox_Binary,       0 },
@@ -4850,6 +4851,7 @@ static const struct
 
     { ATOM_jpeg,    MP4_ReadBox_sample_vide,  ATOM_stsd },
     { ATOM_vc1,     MP4_ReadBox_sample_vide,  ATOM_stsd },
+    { ATOM_av01,    MP4_ReadBox_sample_vide,  ATOM_stsd },
     { ATOM_avc1,    MP4_ReadBox_sample_vide,  ATOM_stsd },
     { ATOM_avc3,    MP4_ReadBox_sample_vide,  ATOM_stsd },
 
diff --git a/modules/demux/mp4/libmp4.h b/modules/demux/mp4/libmp4.h
index c8e997dd9c..199a855360 100644
--- a/modules/demux/mp4/libmp4.h
+++ b/modules/demux/mp4/libmp4.h
@@ -254,8 +254,10 @@ typedef int64_t stime_t;
 #define ATOM_WMV3 VLC_FOURCC( 'W', 'M', 'V', '3' )
 #define ATOM_WVC1 VLC_FOURCC( 'W', 'V', 'C', '1' )
 
+#define ATOM_av01 VLC_FOURCC( 'a', 'v', '0', '1' )
 #define ATOM_avc1 VLC_FOURCC( 'a', 'v', 'c', '1' )
 #define ATOM_avc3 VLC_FOURCC( 'a', 'v', 'c', '3' )
+#define ATOM_av1C VLC_FOURCC( 'a', 'v', '1', 'C' )
 #define ATOM_avcC VLC_FOURCC( 'a', 'v', 'c', 'C' )
 #define ATOM_vpcC VLC_FOURCC( 'v', 'p', 'c', 'C' )
 #define ATOM_m4ds VLC_FOURCC( 'm', '4', 'd', 's' )



More information about the vlc-commits mailing list