[vlc-commits] demux: mp4: handle av1C

Francois Cartegnie git at videolan.org
Wed Oct 17 15:22:19 CEST 2018


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Jul 19 13:43:18 2018 +0200| [c6c60331c3dc5d68639505ef9edbf7119eb7b4de] | committer: Tristan Matthews

demux: mp4: handle av1C

(cherry picked from commit 2f9a15c3028c901a4973535281d22e561f7bac2a)

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

 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 4b921e726e..58c68b5f47 100644
--- a/modules/demux/mp4/essetup.c
+++ b/modules/demux/mp4/essetup.c
@@ -594,6 +594,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 a3a01f762e..c760018225 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -4473,6 +4473,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 },
@@ -4606,6 +4607,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 d3b0c95c85..b8a7a87a1e 100644
--- a/modules/demux/mp4/libmp4.h
+++ b/modules/demux/mp4/libmp4.h
@@ -243,8 +243,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