[FFmpeg-cvslog] Merge commit '604fbb3132e88727e496c96c92cfe02748c25a1a'

James Almer git at videolan.org
Thu Oct 26 21:23:18 EEST 2017


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Thu Oct 26 14:50:36 2017 -0300| [4bb09bf5a04af7a76f8bb514edf7e755066b81cd] | committer: James Almer

Merge commit '604fbb3132e88727e496c96c92cfe02748c25a1a'

* commit '604fbb3132e88727e496c96c92cfe02748c25a1a':
  mov: Move code shared with CAF to a separate file

Merged-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4bb09bf5a04af7a76f8bb514edf7e755066b81cd
---

 libavformat/Makefile   |  5 ++---
 libavformat/isom.h     | 15 ++++++++++++++-
 libavformat/mov.c      | 36 ------------------------------------
 libavformat/mov_esds.c | 43 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 59 insertions(+), 40 deletions(-)

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 8111b4ca6a..591a14b978 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -120,8 +120,7 @@ OBJS-$(CONFIG_BOA_DEMUXER)               += boadec.o
 OBJS-$(CONFIG_BFSTM_DEMUXER)             += brstm.o
 OBJS-$(CONFIG_BRSTM_DEMUXER)             += brstm.o
 OBJS-$(CONFIG_C93_DEMUXER)               += c93.o voc_packet.o vocdec.o voc.o
-OBJS-$(CONFIG_CAF_DEMUXER)               += cafdec.o caf.o mov.o mov_chan.o \
-                                            replaygain.o
+OBJS-$(CONFIG_CAF_DEMUXER)               += cafdec.o caf.o mov_chan.o mov_esds.o
 OBJS-$(CONFIG_CAF_MUXER)                 += cafenc.o caf.o riff.o
 OBJS-$(CONFIG_CAVSVIDEO_DEMUXER)         += cavsvideodec.o rawdec.o
 OBJS-$(CONFIG_CAVSVIDEO_MUXER)           += rawenc.o
@@ -292,7 +291,7 @@ OBJS-$(CONFIG_MLV_DEMUXER)               += mlvdec.o riffdec.o
 OBJS-$(CONFIG_MM_DEMUXER)                += mm.o
 OBJS-$(CONFIG_MMF_DEMUXER)               += mmf.o
 OBJS-$(CONFIG_MMF_MUXER)                 += mmf.o rawenc.o
-OBJS-$(CONFIG_MOV_DEMUXER)               += mov.o mov_chan.o replaygain.o
+OBJS-$(CONFIG_MOV_DEMUXER)               += mov.o mov_chan.o mov_esds.o replaygain.o
 OBJS-$(CONFIG_MOV_MUXER)                 += movenc.o avc.o hevc.o vpcc.o \
                                             movenchint.o mov_chan.o rtp.o \
                                             movenccenc.o rawutils.o
diff --git a/libavformat/isom.h b/libavformat/isom.h
index 395d20d25c..ff08f5d090 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -336,7 +336,6 @@ void ff_mp4_parse_es_descr(AVIOContext *pb, int *es_id);
 
 
 int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb);
-enum AVCodecID ff_mov_get_lpcm_codec_id(int bps, int flags);
 
 int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries);
 void ff_mov_write_chan(AVIOContext *pb, int64_t channel_layout);
@@ -345,4 +344,18 @@ void ff_mov_write_chan(AVIOContext *pb, int64_t channel_layout);
 #define FF_MOV_FLAG_MFRA_DTS 1
 #define FF_MOV_FLAG_MFRA_PTS 2
 
+/**
+ * Compute codec id for 'lpcm' tag.
+ * See CoreAudioTypes and AudioStreamBasicDescription at Apple.
+ */
+static inline enum AVCodecID ff_mov_get_lpcm_codec_id(int bps, int flags)
+{
+    /* lpcm flags:
+     * 0x1 = float
+     * 0x2 = big-endian
+     * 0x4 = signed
+     */
+    return ff_get_pcm_codec_id(bps, flags & 1, flags & 2, flags & 4 ? -1 : 0);
+}
+
 #endif /* AVFORMAT_ISOM_H */
diff --git a/libavformat/mov.c b/libavformat/mov.c
index a5177e8f91..2ee67561e4 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -767,28 +767,6 @@ static int mov_read_hdlr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb)
-{
-    AVStream *st;
-    int tag;
-
-    if (fc->nb_streams < 1)
-        return 0;
-    st = fc->streams[fc->nb_streams-1];
-
-    avio_rb32(pb); /* version + flags */
-    ff_mp4_read_descr(fc, pb, &tag);
-    if (tag == MP4ESDescrTag) {
-        ff_mp4_parse_es_descr(pb, NULL);
-    } else
-        avio_rb16(pb); /* ID */
-
-    ff_mp4_read_descr(fc, pb, &tag);
-    if (tag == MP4DecConfigDescrTag)
-        ff_mp4_read_dec_config_descr(fc, st, pb);
-    return 0;
-}
-
 static int mov_read_esds(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     return ff_mov_read_esds(c->fc, pb);
@@ -2013,20 +1991,6 @@ static int mov_read_stco(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     return 0;
 }
 
-/**
- * Compute codec id for 'lpcm' tag.
- * See CoreAudioTypes and AudioStreamBasicDescription at Apple.
- */
-enum AVCodecID ff_mov_get_lpcm_codec_id(int bps, int flags)
-{
-    /* lpcm flags:
-     * 0x1 = float
-     * 0x2 = big-endian
-     * 0x4 = signed
-     */
-    return ff_get_pcm_codec_id(bps, flags & 1, flags & 2, flags & 4 ? -1 : 0);
-}
-
 static int mov_codec_id(AVStream *st, uint32_t format)
 {
     int id = ff_codec_get_id(ff_codec_movaudio_tags, format);
diff --git a/libavformat/mov_esds.c b/libavformat/mov_esds.c
new file mode 100644
index 0000000000..2ecf03742f
--- /dev/null
+++ b/libavformat/mov_esds.c
@@ -0,0 +1,43 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avformat.h"
+#include "avio.h"
+#include "isom.h"
+
+int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb)
+{
+    AVStream *st;
+    int tag;
+
+    if (fc->nb_streams < 1)
+        return 0;
+    st = fc->streams[fc->nb_streams-1];
+
+    avio_rb32(pb); /* version + flags */
+    ff_mp4_read_descr(fc, pb, &tag);
+    if (tag == MP4ESDescrTag) {
+        ff_mp4_parse_es_descr(pb, NULL);
+    } else
+        avio_rb16(pb); /* ID */
+
+    ff_mp4_read_descr(fc, pb, &tag);
+    if (tag == MP4DecConfigDescrTag)
+        ff_mp4_read_dec_config_descr(fc, st, pb);
+    return 0;
+}


======================================================================

diff --cc libavformat/Makefile
index 8111b4ca6a,7b1df9342c..591a14b978
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@@ -112,17 -91,9 +112,16 @@@ OBJS-$(CONFIG_AVS_DEMUXER
  OBJS-$(CONFIG_BETHSOFTVID_DEMUXER)       += bethsoftvid.o
  OBJS-$(CONFIG_BFI_DEMUXER)               += bfi.o
  OBJS-$(CONFIG_BINK_DEMUXER)              += bink.o
 +OBJS-$(CONFIG_BINTEXT_DEMUXER)           += bintext.o sauce.o
 +OBJS-$(CONFIG_BIT_DEMUXER)               += bit.o
 +OBJS-$(CONFIG_BIT_MUXER)                 += bit.o
  OBJS-$(CONFIG_BMV_DEMUXER)               += bmv.o
 -OBJS-$(CONFIG_C93_DEMUXER)               += c93.o voc_packet.o voc.o
 +OBJS-$(CONFIG_BOA_DEMUXER)               += boadec.o
 +OBJS-$(CONFIG_BFSTM_DEMUXER)             += brstm.o
 +OBJS-$(CONFIG_BRSTM_DEMUXER)             += brstm.o
 +OBJS-$(CONFIG_C93_DEMUXER)               += c93.o voc_packet.o vocdec.o voc.o
- OBJS-$(CONFIG_CAF_DEMUXER)               += cafdec.o caf.o mov.o mov_chan.o \
-                                             replaygain.o
+ OBJS-$(CONFIG_CAF_DEMUXER)               += cafdec.o caf.o mov_chan.o mov_esds.o
 +OBJS-$(CONFIG_CAF_MUXER)                 += cafenc.o caf.o riff.o
  OBJS-$(CONFIG_CAVSVIDEO_DEMUXER)         += cavsvideodec.o rawdec.o
  OBJS-$(CONFIG_CAVSVIDEO_MUXER)           += rawenc.o
  OBJS-$(CONFIG_CDG_DEMUXER)               += cdg.o
@@@ -277,25 -183,18 +276,25 @@@ OBJS-$(CONFIG_MATROSKA_DEMUXER
                                              flac_picture.o replaygain.o
  OBJS-$(CONFIG_MATROSKA_MUXER)            += matroskaenc.o matroska.o \
                                              avc.o hevc.o \
 -                                            flacenc_header.o avlanguage.o vorbiscomment.o wv.o
 -OBJS-$(CONFIG_MD5_MUXER)                 += md5enc.o
 +                                            flacenc_header.o avlanguage.o vorbiscomment.o wv.o \
 +                                            webmdashenc.o webm_chunk.o
 +OBJS-$(CONFIG_MD5_MUXER)                 += hashenc.o
 +OBJS-$(CONFIG_MGSTS_DEMUXER)             += mgsts.o
 +OBJS-$(CONFIG_MICRODVD_DEMUXER)          += microdvddec.o subtitles.o
 +OBJS-$(CONFIG_MICRODVD_MUXER)            += microdvdenc.o
 +OBJS-$(CONFIG_MJPEG_2000_DEMUXER)        += rawdec.o mj2kdec.o
  OBJS-$(CONFIG_MJPEG_DEMUXER)             += rawdec.o
  OBJS-$(CONFIG_MJPEG_MUXER)               += rawenc.o
 -OBJS-$(CONFIG_MLP_DEMUXER)               += rawdec.o
 +OBJS-$(CONFIG_MLP_DEMUXER)               += rawdec.o mlpdec.o
  OBJS-$(CONFIG_MLP_MUXER)                 += rawenc.o
 +OBJS-$(CONFIG_MLV_DEMUXER)               += mlvdec.o riffdec.o
  OBJS-$(CONFIG_MM_DEMUXER)                += mm.o
 -OBJS-$(CONFIG_MMF_DEMUXER)               += mmf.o pcm.o
 -OBJS-$(CONFIG_MMF_MUXER)                 += mmf.o
 +OBJS-$(CONFIG_MMF_DEMUXER)               += mmf.o
 +OBJS-$(CONFIG_MMF_MUXER)                 += mmf.o rawenc.o
- OBJS-$(CONFIG_MOV_DEMUXER)               += mov.o mov_chan.o replaygain.o
+ OBJS-$(CONFIG_MOV_DEMUXER)               += mov.o mov_chan.o mov_esds.o replaygain.o
 -OBJS-$(CONFIG_MOV_MUXER)                 += movenc.o avc.o hevc.o \
 -                                            movenchint.o mov_chan.o
 +OBJS-$(CONFIG_MOV_MUXER)                 += movenc.o avc.o hevc.o vpcc.o \
 +                                            movenchint.o mov_chan.o rtp.o \
 +                                            movenccenc.o rawutils.o
  OBJS-$(CONFIG_MP2_MUXER)                 += rawenc.o
  OBJS-$(CONFIG_MP3_DEMUXER)               += mp3dec.o replaygain.o
  OBJS-$(CONFIG_MP3_MUXER)                 += mp3enc.o rawenc.o id3v2enc.o
diff --cc libavformat/isom.h
index 395d20d25c,2a7486d7ba..ff08f5d090
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@@ -336,13 -239,21 +336,26 @@@ void ff_mp4_parse_es_descr(AVIOContext 
  
  
  int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb);
- enum AVCodecID ff_mov_get_lpcm_codec_id(int bps, int flags);
  
  int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries);
 +void ff_mov_write_chan(AVIOContext *pb, int64_t channel_layout);
 +
 +#define FF_MOV_FLAG_MFRA_AUTO -1
 +#define FF_MOV_FLAG_MFRA_DTS 1
 +#define FF_MOV_FLAG_MFRA_PTS 2
  
+ /**
+  * Compute codec id for 'lpcm' tag.
+  * See CoreAudioTypes and AudioStreamBasicDescription at Apple.
+  */
+ static inline enum AVCodecID ff_mov_get_lpcm_codec_id(int bps, int flags)
+ {
+     /* lpcm flags:
+      * 0x1 = float
+      * 0x2 = big-endian
+      * 0x4 = signed
+      */
+     return ff_get_pcm_codec_id(bps, flags & 1, flags & 2, flags & 4 ? -1 : 0);
+ }
+ 
  #endif /* AVFORMAT_ISOM_H */
diff --cc libavformat/mov_esds.c
index 0000000000,b195f1ae7a..2ecf03742f
mode 000000,100644..100644
--- a/libavformat/mov_esds.c
+++ b/libavformat/mov_esds.c
@@@ -1,0 -1,43 +1,43 @@@
+ /*
 - * This file is part of Libav.
++ * This file is part of FFmpeg.
+  *
 - * Libav is free software; you can redistribute it and/or
++ * FFmpeg is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU Lesser General Public
+  * License as published by the Free Software Foundation; either
+  * version 2.1 of the License, or (at your option) any later version.
+  *
 - * Libav is distributed in the hope that it will be useful,
++ * FFmpeg is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
 - * License along with Libav; if not, write to the Free Software
++ * License along with FFmpeg; if not, write to the Free Software
+  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+  */
+ 
+ #include "avformat.h"
+ #include "avio.h"
+ #include "isom.h"
+ 
+ int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb)
+ {
+     AVStream *st;
+     int tag;
+ 
+     if (fc->nb_streams < 1)
+         return 0;
+     st = fc->streams[fc->nb_streams-1];
+ 
+     avio_rb32(pb); /* version + flags */
+     ff_mp4_read_descr(fc, pb, &tag);
+     if (tag == MP4ESDescrTag) {
+         ff_mp4_parse_es_descr(pb, NULL);
+     } else
+         avio_rb16(pb); /* ID */
+ 
+     ff_mp4_read_descr(fc, pb, &tag);
+     if (tag == MP4DecConfigDescrTag)
+         ff_mp4_read_dec_config_descr(fc, st, pb);
+     return 0;
+ }



More information about the ffmpeg-cvslog mailing list