aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-20 22:18:26 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-20 22:18:26 +0200
commit3194ab78a6c4ea0a4c60c91c4d0ea34028ca408f (patch)
tree13f41910a7e4feec8d64182bf3b6772d88236098 /libavcodec
parent9b1f776d751472e8a376b412d02a96a35044e2a0 (diff)
parentb0e9edc44f1722787adacbff9aa60343206a58c0 (diff)
downloadffmpeg-3194ab78a6c4ea0a4c60c91c4d0ea34028ca408f.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: avcodec: add a cook parser to get subpacket duration FATE: allow lavf tests to alter input parameters FATE: replace the acodec-pcm_s24daud test with an enc_dec_pcm checksum test FATE: replace the acodec-g726 test with 4 new encode/decode tests FATE: replace current g722 encoding tests with an encode/decode test FATE: add a pattern rule for generating asynth wav files FATE: optionally write a WAVE header in audiogen avutil: add audio fifo buffer Conflicts: doc/APIchanges libavcodec/version.h libavutil/avutil.h tests/Makefile tests/codec-regression.sh tests/fate/voice.mak tests/lavf-regression.sh tests/ref/acodec/g722 tests/ref/acodec/g726 tests/ref/acodec/pcm_s24daud tests/ref/lavf/dv_fmt tests/ref/lavf/gxf tests/ref/lavf/mxf tests/ref/lavf/mxf_d10 tests/ref/seek/lavf_dv Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/Makefile1
-rw-r--r--libavcodec/allcodecs.c1
-rw-r--r--libavcodec/cook_parser.c59
-rw-r--r--libavcodec/version.h4
4 files changed, 63 insertions, 2 deletions
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index d7179c2233..e336917231 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -679,6 +679,7 @@ OBJS-$(CONFIG_AC3_PARSER) += ac3_parser.o ac3tab.o \
aac_ac3_parser.o
OBJS-$(CONFIG_ADX_PARSER) += adx_parser.o adx.o
OBJS-$(CONFIG_CAVSVIDEO_PARSER) += cavs_parser.o
+OBJS-$(CONFIG_COOK_PARSER) += cook_parser.o
OBJS-$(CONFIG_DCA_PARSER) += dca_parser.o
OBJS-$(CONFIG_DIRAC_PARSER) += dirac_parser.o
OBJS-$(CONFIG_DNXHD_PARSER) += dnxhd_parser.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 4a24d3199d..c8a6621818 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -437,6 +437,7 @@ void avcodec_register_all(void)
REGISTER_PARSER (AC3, ac3);
REGISTER_PARSER (ADX, adx);
REGISTER_PARSER (CAVSVIDEO, cavsvideo);
+ REGISTER_PARSER (COOK, cook);
REGISTER_PARSER (DCA, dca);
REGISTER_PARSER (DIRAC, dirac);
REGISTER_PARSER (DNXHD, dnxhd);
diff --git a/libavcodec/cook_parser.c b/libavcodec/cook_parser.c
new file mode 100644
index 0000000000..c16f7c8a5f
--- /dev/null
+++ b/libavcodec/cook_parser.c
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com>
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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,
+ * 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
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Cook audio parser
+ *
+ * Determines subpacket duration from extradata.
+ */
+
+#include <stdint.h>
+
+#include "libavutil/intreadwrite.h"
+#include "parser.h"
+
+typedef struct CookParseContext {
+ int duration;
+} CookParseContext;
+
+static int cook_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
+ const uint8_t **poutbuf, int *poutbuf_size,
+ const uint8_t *buf, int buf_size)
+{
+ CookParseContext *s = s1->priv_data;
+
+ if (s->duration)
+ s1->duration = s->duration;
+ else if (avctx->extradata && avctx->extradata_size >= 8 && avctx->channels)
+ s->duration = AV_RB16(avctx->extradata + 4) / avctx->channels;
+
+ /* always return the full packet. this parser isn't doing any splitting or
+ combining, only setting packet duration */
+ *poutbuf = buf;
+ *poutbuf_size = buf_size;
+ return buf_size;
+}
+
+AVCodecParser ff_cook_parser = {
+ .codec_ids = { CODEC_ID_COOK },
+ .priv_data_size = sizeof(CookParseContext),
+ .parser_parse = cook_parse,
+};
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 2429eb5e64..1a549ba63c 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -27,8 +27,8 @@
*/
#define LIBAVCODEC_VERSION_MAJOR 54
-#define LIBAVCODEC_VERSION_MINOR 14
-#define LIBAVCODEC_VERSION_MICRO 101
+#define LIBAVCODEC_VERSION_MINOR 15
+#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \