4 * Copyright (C) 2017 Aurelien Jacobs <aurel@gnuage.org>
6 * This file is part of FFmpeg.
8 * FFmpeg is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * FFmpeg is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
35 const uint8_t *
data,
size_t len)
37 static const int sample_rates[4] = { 16000, 32000, 44100, 48000 };
57 sr = (
data[1] >> 6) & 0x03;
58 blocks = (((
data[1] >> 4) & 0x03) + 1) << 2;
80 const uint8_t **poutbuf,
int *poutbuf_size,
81 const uint8_t *buf,
int buf_size)
116 *poutbuf_size = buf_size;
static int parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
static av_cold void close(AVCodecParserContext *s)
#define PARSER_FLAG_COMPLETE_FRAMES
static const int sample_rates[]
void av_channel_layout_uninit(AVChannelLayout *channel_layout)
Free any allocated data in the channel layout and reset the channel count to 0.
@ AV_CHANNEL_ORDER_UNSPEC
Only the channel count is specified, without any further information about the channel order.
av_cold void ff_parse_close(AVCodecParserContext *s)
int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size)
Combine the (truncated) bitstream to a complete frame.
#define PARSER_CODEC_LIST(...)
const FFCodecParser ff_sbc_parser
SBC common definitions for the encoder and decoder.
#define SBC_MODE_JOINT_STEREO
#define SBC_MODE_DUAL_CHANNEL
static int sbc_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
static int sbc_parse_header(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t *data, size_t len)
enum AVChannelOrder order
Channel order used in this layout.
int nb_channels
Number of channels in this layout.
main external API structure.
AVChannelLayout ch_layout
Audio channel layout.
int sample_rate
samples per second
int frame_size
Number of samples per channel in an audio frame.