[FFmpeg-devel,v3,12/25] avformat/movenc, isom: support metadata in mp4 files

Submitted by erkki.seppala.ext@nokia.com on Sept. 19, 2016, 1:25 p.m.

Details

Message ID 1474291548-17810-13-git-send-email-erkki.seppala.ext@nokia.com
State New
Headers show

Commit Message

erkki.seppala.ext@nokia.com Sept. 19, 2016, 1:25 p.m.
This involves adding a new tag to the ff_mp4_obj_type table as well as
modifying mp4_get_codec_tag to return 'meta' for AV_CODEC_ID_META.

Signed-off-by: Erkki Seppälä <erkki.seppala.ext@nokia.com>
Signed-off-by: OZOPlayer <OZOPL@nokia.com>
---
 libavformat/isom.c   | 1 +
 libavformat/movenc.c | 1 +
 2 files changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/libavformat/isom.c b/libavformat/isom.c
index 473700f..9fb96ef 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -66,6 +66,7 @@  const AVCodecTag ff_mp4_obj_type[] = {
     { AV_CODEC_ID_QCELP       , 0xE1 },
     { AV_CODEC_ID_MPEG4SYSTEMS, 0x01 },
     { AV_CODEC_ID_MPEG4SYSTEMS, 0x02 },
+    { AV_CODEC_ID_META        , 0x03 },
     { AV_CODEC_ID_NONE        ,    0 },
 };
 
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 84a6940..2c933d4 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1175,6 +1175,7 @@  static int mp4_get_codec_tag(AVFormatContext *s, MOVTrack *track)
     else if (track->par->codec_type == AVMEDIA_TYPE_VIDEO)  tag = MKTAG('m','p','4','v');
     else if (track->par->codec_type == AVMEDIA_TYPE_AUDIO)  tag = MKTAG('m','p','4','a');
     else if (track->par->codec_id == AV_CODEC_ID_DVD_SUBTITLE)  tag = MKTAG('m','p','4','s');
+    else if (track->par->codec_id == AV_CODEC_ID_META)       tag = MKTAG('m','e','t','a');
 
     return tag;
 }