Go to the documentation of this file.
31 #include "config_components.h"
59 s->state = gsm_create();
68 gsm_option(
s->state, GSM_OPT_WAV49, &one);
80 gsm_destroy(
s->state);
90 uint8_t *buf = avpkt->
data;
91 int buf_size = avpkt->
size;
94 if (buf_size < avctx->block_align) {
106 if ((
ret = gsm_decode(
s->state, buf,
samples)) < 0)
121 gsm_destroy(
s->state);
122 s->state = gsm_create();
124 gsm_option(
s->state, GSM_OPT_WAV49, &one);
127 #if CONFIG_LIBGSM_DECODER
134 .p.wrapper_name =
"libgsm",
143 #if CONFIG_LIBGSM_MS_DECODER
145 .
p.
name =
"libgsm_ms",
150 .p.wrapper_name =
"libgsm",
int frame_size
Number of samples per channel in an audio frame.
int sample_rate
samples per second
This structure describes decoded (raw) audio or video data.
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
AVCodec p
The public AVCodec.
AVChannelLayout ch_layout
Audio channel layout.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const FFCodec ff_libgsm_decoder
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
#define GSM_MS_BLOCK_SIZE
const FFCodec ff_libgsm_ms_decoder
@ AV_CODEC_ID_GSM
as in Berlin toast format
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
int(* init)(AVBSFContext *ctx)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
An AVChannelLayout holds information about the channel layout of audio data.
enum AVSampleFormat sample_fmt
audio sample format
static void libgsm_flush(AVCodecContext *avctx)
int nb_samples
number of audio samples (per channel) described by this frame
#define i(width, name, range_min, range_max)
@ AV_SAMPLE_FMT_S16
signed 16 bits
const char * name
Name of the codec implementation.
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs.
static av_cold int libgsm_decode_init(AVCodecContext *avctx)
static av_cold int libgsm_decode_close(AVCodecContext *avctx)
main external API structure.
void av_channel_layout_uninit(AVChannelLayout *channel_layout)
Free any allocated data in the channel layout and reset the channel count to 0.
Filter the word “frame” indicates either a video frame or a group of audio samples
#define AV_CHANNEL_LAYOUT_MONO
This structure stores compressed data.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int libgsm_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)