37 #include "libavutil/channel_layout.h"
38 #include "libavutil/common.h"
56 s->
state = gsm_create();
65 gsm_option(s->
state, GSM_OPT_WAV49, &one);
77 gsm_destroy(s->
state);
89 int buf_size = avpkt->
size;
92 if (buf_size < avctx->block_align) {
103 samples = (int16_t *)frame->
data[0];
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);
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
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...
static int libgsm_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
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.
static av_cold int libgsm_decode_init(AVCodecContext *avctx)
#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. ...
static void libgsm_flush(AVCodecContext *avctx)
Libavcodec external API header.
uint64_t channel_layout
Audio channel layout.
AVCodec ff_libgsm_ms_decoder
AVCodec ff_libgsm_decoder
int frame_size
Number of samples per channel in an audio frame.
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.
static av_cold int libgsm_decode_close(AVCodecContext *avctx)
common internal api header.
static av_cold void flush(AVCodecContext *avctx)
Flush (reset) the frame ID after seeking.
static av_cold int init(AVCodecParserContext *s)
as in Berlin toast format
int channels
number of audio channels
#define AV_CH_LAYOUT_MONO
This structure stores compressed data.
int nb_samples
number of audio samples (per channel) described by this frame
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.