[FFmpeg-devel] [PATCH] PSMF audio support, trac ticket #3233
James Almer
jamrial at gmail.com
Tue Dec 2 03:02:50 CET 2014
On 01/12/14 10:31 PM, Michael Niedermayer wrote:
> On Tue, Dec 02, 2014 at 01:13:56AM +0100, Maxim Polijakowski wrote:
>> Hello crews,
>>
>> attached patch enables PSMF audio demuxing/decoding. As suggested by
>> Carl Eugen Hoyos, mpeg.c has been extended to identify ATRAC3+
>> streams inside of PSMF files. Additionally, a ATRAC3+ parser has
>> been implemented in order to extract Atrac3+ frames from
>> PRIVATE_STREAM_1 packets.
>>
>> It works well for these samples: http://samples.ffmpeg.org/PSMF
>>
>> The code is not perfect and can be surely improved a lot. I hope
>> though that my work goes in the right direction :))
>>
>> Best regards
>> Maxim
>
>> libavcodec/Makefile | 1
>> libavcodec/allcodecs.c | 1
>> libavcodec/atrac3plus_parser.c | 153 +++++++++++++++++++++++++++++++++++++++++
>> libavformat/mpeg.c | 27 ++++++-
>> 4 files changed, 181 insertions(+), 1 deletion(-)
>> edf831c5b273b61c8a09c3c0c669d81727b3d87e 0002-mpeg-add-experimental-support-for-PSMF-audio.patch
>> From 9fef4512d8e5e7e8cc93a8c108d67811931cc05c Mon Sep 17 00:00:00 2001
>> From: Maxim Poliakovski <maximumspatium at googlemail.com>
>> Date: Mon, 24 Nov 2014 01:20:21 +0100
>> Subject: [PATCH 2/2] mpeg: add experimental support for PSMF audio.
>>
>> ---
>> libavcodec/Makefile | 1 +
>> libavcodec/allcodecs.c | 1 +
>> libavcodec/atrac3plus_parser.c | 153 +++++++++++++++++++++++++++++++++++++++++
>> libavformat/mpeg.c | 27 +++++++-
>> 4 files changed, 181 insertions(+), 1 deletion(-)
>> create mode 100644 libavcodec/atrac3plus_parser.c
>>
>> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
>> index fa0f53d..c9520d7 100644
>> --- a/libavcodec/Makefile
>> +++ b/libavcodec/Makefile
>> @@ -775,6 +775,7 @@ OBJS-$(CONFIG_AAC_LATM_PARSER) += latm_parser.o
>> OBJS-$(CONFIG_AC3_PARSER) += ac3_parser.o ac3tab.o \
>> aac_ac3_parser.o
>> OBJS-$(CONFIG_ADX_PARSER) += adx_parser.o adx.o
>> +OBJS-$(CONFIG_ATRAC3P_PARSER) += atrac3plus_parser.o
>> OBJS-$(CONFIG_BMP_PARSER) += bmp_parser.o
>> OBJS-$(CONFIG_CAVSVIDEO_PARSER) += cavs_parser.o
>> OBJS-$(CONFIG_COOK_PARSER) += cook_parser.o
>> diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
>> index 0d39d33..a5a44af 100644
>> --- a/libavcodec/allcodecs.c
>> +++ b/libavcodec/allcodecs.c
>> @@ -544,6 +544,7 @@ void avcodec_register_all(void)
>> REGISTER_PARSER(AAC_LATM, aac_latm);
>> REGISTER_PARSER(AC3, ac3);
>> REGISTER_PARSER(ADX, adx);
>> + REGISTER_PARSER(ATRAC3P, atrac3p);
>> REGISTER_PARSER(BMP, bmp);
>> REGISTER_PARSER(CAVSVIDEO, cavsvideo);
>> REGISTER_PARSER(COOK, cook);
>> diff --git a/libavcodec/atrac3plus_parser.c b/libavcodec/atrac3plus_parser.c
>> new file mode 100644
>> index 0000000..01fcad4
>> --- /dev/null
>> +++ b/libavcodec/atrac3plus_parser.c
>> @@ -0,0 +1,153 @@
>> +/*
>> + * Copyright (C) 2014 Maxim Poliakovski
>> + *
>> + * 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 "parser.h"
>> +#include "get_bits.h"
>
>> +#include "libavformat/oma.h"
>
> libavformat can use things from libavcodec but
> libavcodec cannot use things from libavformat as it doesnt depend on
> it, libavcodec can be used alone without libavformat
> so some things may need to be moved to libavcodec in a seperate patch
> before this
The four oma tables could be moved to the header, or their prefix changed to avpriv_.
They are small enough that the former is probably a better option, though.
More information about the ffmpeg-devel
mailing list