37 #include "libavutil/channel_layout.h"
38 #include "libavutil/common.h"
82 gsm_option(avctx->
priv_data, GSM_OPT_WAV49, &one);
98 gsm_signal *samples = (gsm_signal *)frame->
data[0];
118 #if CONFIG_LIBGSM_ENCODER
131 #if CONFIG_LIBGSM_MS_ENCODER
132 AVCodec ff_libgsm_ms_encoder = {
158 s->
state = gsm_create();
167 gsm_option(s->
state, GSM_OPT_WAV49, &one);
179 gsm_destroy(s->
state);
185 int *got_frame_ptr,
AVPacket *avpkt)
191 int buf_size = avpkt->
size;
194 if (buf_size < avctx->block_align) {
203 samples = (int16_t *)frame->
data[0];
206 if ((ret = gsm_decode(s->
state, buf, samples)) < 0)
221 gsm_destroy(s->
state);
222 s->
state = gsm_create();
224 gsm_option(s->
state, GSM_OPT_WAV49, &one);
227 #if CONFIG_LIBGSM_DECODER
241 #if CONFIG_LIBGSM_MS_DECODER
242 AVCodec ff_libgsm_ms_decoder = {
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size)
Check AVPacket size and/or allocate data.
This structure describes decoded (raw) audio or video data.
static av_cold int init(AVCodecContext *avctx)
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
if((e=av_dict_get(options,"", NULL, AV_DICT_IGNORE_SUFFIX)))
enum AVSampleFormat sample_fmt
audio sample format
const char * name
Name of the codec implementation.
#define GSM_MS_BLOCK_SIZE
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Libavcodec external API header.
uint64_t channel_layout
Audio channel layout.
static av_cold int libgsm_encode_close(AVCodecContext *avctx)
int bit_rate
the average bitrate
static av_cold int libgsm_decode_close(AVCodecContext *avctx)
static void flush(AVCodecContext *avctx)
int frame_size
Number of samples per channel in an audio frame.
AVSampleFormat
Audio Sample Formats.
int sample_rate
samples per second
main external API structure.
static void close(AVCodecParserContext *s)
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
#define FF_COMPLIANCE_UNOFFICIAL
Allow unofficial extensions.
static void libgsm_flush(AVCodecContext *avctx)
common internal api header.
static av_cold int libgsm_encode_init(AVCodecContext *avctx)
static int libgsm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
static av_cold int libgsm_decode_init(AVCodecContext *avctx)
#define AVERROR_INVALIDDATA
static int libgsm_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
as in Berlin toast format
int channels
number of audio channels
static int decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
#define AV_CH_LAYOUT_MONO
This structure stores compressed data.
int nb_samples
number of audio samples (per channel) described by this frame
int strict_std_compliance
strictly follow the standard (MPEG4, ...).
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.