[FFmpeg-devel] [PATCH] Add EVRCA and SMV codec id

Paul B Mahol onemda at gmail.com
Tue Dec 11 14:10:56 CET 2012


Demuxing files should be possible even if there are
no decoding support in lavc (yet).

Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
 libavcodec/avcodec.h    |  2 ++
 libavcodec/codec_desc.c | 14 ++++++++++++++
 libavformat/isom.c      |  2 ++
 libavformat/qcp.c       |  6 ++----
 4 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index e432040..be06f1c 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -441,6 +441,8 @@ enum AVCodecID {
     AV_CODEC_ID_PAF_AUDIO   = MKBETAG('P','A','F','A'),
     AV_CODEC_ID_OPUS        = MKBETAG('O','P','U','S'),
     AV_CODEC_ID_TAK         = MKBETAG('t','B','a','K'),
+    AV_CODEC_ID_EVRCA       = MKBETAG('s','e','v','c'),
+    AV_CODEC_ID_SMV         = MKBETAG('s','s','m','v'),
 
     /* subtitle codecs */
     AV_CODEC_ID_FIRST_SUBTITLE = 0x17000,          ///< A dummy ID pointing at the start of subtitle codecs.
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 8e8685c..7d39332 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -2321,6 +2321,20 @@ static const AVCodecDescriptor codec_descriptors[] = {
         .long_name = NULL_IF_CONFIG_SMALL("TAK (Tom's lossless Audio Kompressor)"),
         .props     = AV_CODEC_PROP_LOSSLESS,
     },
+    {
+        .id        = AV_CODEC_ID_EVRCA,
+        .type      = AVMEDIA_TYPE_AUDIO,
+        .name      = "evrca",
+        .long_name = NULL_IF_CONFIG_SMALL("EVRC-A (Enhanced Variable Rate Codec, Service Option 3)"),
+        .props     = AV_CODEC_PROP_LOSSY,
+    },
+    {
+        .id        = AV_CODEC_ID_SMV,
+        .type      = AVMEDIA_TYPE_AUDIO,
+        .name      = "smv",
+        .long_name = NULL_IF_CONFIG_SMALL("SMV (Selectable Mode Vocoder)"),
+        .props     = AV_CODEC_PROP_LOSSY,
+    },
 
     /* subtitle codecs */
     {
diff --git a/libavformat/isom.c b/libavformat/isom.c
index 811184b..b3812e4 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -292,6 +292,8 @@ const AVCodecTag ff_codec_movaudio_tags[] = {
     { AV_CODEC_ID_QDMC,            MKTAG('Q', 'D', 'M', 'C') },
     { AV_CODEC_ID_SPEEX,           MKTAG('s', 'p', 'e', 'x') }, /* Flash Media Server */
     { AV_CODEC_ID_WMAV2,           MKTAG('W', 'M', 'A', '2') },
+    { AV_CODEC_ID_EVRCA,           MKTAG('s', 'e', 'v', 'c') }, /* 3GPP2 */
+    { AV_CODEC_ID_SMV,             MKTAG('s', 's', 'm', 'v') }, /* 3GPP2 */
     { AV_CODEC_ID_NONE, 0 },
 };
 
diff --git a/libavformat/qcp.c b/libavformat/qcp.c
index 3cb85fb..9865bbc 100644
--- a/libavformat/qcp.c
+++ b/libavformat/qcp.c
@@ -102,11 +102,9 @@ static int qcp_read_header(AVFormatContext *s)
     if (is_qcelp_13k_guid(buf)) {
         st->codec->codec_id = AV_CODEC_ID_QCELP;
     } else if (!memcmp(buf, guid_evrc, 16)) {
-        av_log(s, AV_LOG_ERROR, "EVRC codec is not supported.\n");
-        return AVERROR_PATCHWELCOME;
+        st->codec->codec_id = AV_CODEC_ID_EVRCA;
     } else if (!memcmp(buf, guid_smv, 16)) {
-        av_log(s, AV_LOG_ERROR, "SMV codec is not supported.\n");
-        return AVERROR_PATCHWELCOME;
+        st->codec->codec_id = AV_CODEC_ID_SMV;
     } else {
         av_log(s, AV_LOG_ERROR, "Unknown codec GUID.\n");
         return AVERROR_INVALIDDATA;
-- 
1.7.11.4



More information about the ffmpeg-devel mailing list