67 gsm_option(avctx->
priv_data, GSM_OPT_WAV49, &one);
87 unsigned char *frame,
int buf_size,
void *
data) {
89 if(buf_size < avctx->block_align)
return 0;
147 s->
state = gsm_create();
156 gsm_option(s->
state, GSM_OPT_WAV49, &one);
171 gsm_destroy(s->
state);
177 int *got_frame_ptr,
AVPacket *avpkt)
181 uint8_t *buf = avpkt->
data;
182 int buf_size = avpkt->
size;
185 if (buf_size < avctx->block_align) {
199 if ((ret = gsm_decode(s->
state, buf, samples)) < 0)
215 gsm_destroy(s->
state);
216 s->
state = gsm_create();
218 gsm_option(s->
state, GSM_OPT_WAV49, &one);
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
AVFrame * coded_frame
the picture in the bitstream
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
enum AVSampleFormat sample_fmt
audio sample format
#define GSM_MS_BLOCK_SIZE
static int init(AVCodecParserContext *s)
#define FF_COMPLIANCE_UNOFFICIAL
Allow unofficial extensions.
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
AVCodec ff_libgsm_ms_encoder
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
AVCodec ff_libgsm_encoder
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
static av_cold int libgsm_encode_close(AVCodecContext *avctx)
AVFrame * avcodec_alloc_frame(void)
Allocate an AVFrame and set its fields to default values.
int bit_rate
the average bitrate
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame)
AVCodec ff_libgsm_ms_decoder
as in Berlin toast format
static av_cold int libgsm_decode_close(AVCodecContext *avctx)
int frame_size
Samples per packet, initialized when calling 'init'.
int sample_rate
samples per second
main external API structure.
static void close(AVCodecParserContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static void libgsm_flush(AVCodecContext *avctx)
common internal api header.
static av_cold int libgsm_encode_init(AVCodecContext *avctx)
static av_cold void flush(AVCodecContext *avctx)
Flush (reset) the frame ID after seeking.
AVSampleFormat
all in native-endian format
static av_cold int libgsm_decode_init(AVCodecContext *avctx)
static int libgsm_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
int channels
number of audio channels
int key_frame
1 -> keyframe, 0-> not
struct LibGSMDecodeContext LibGSMDecodeContext
void avcodec_get_frame_defaults(AVFrame *pic)
Set the fields of the given AVFrame to default values.
AVCodec ff_libgsm_decoder
int nb_samples
number of audio samples (per channel) described by this frame
int strict_std_compliance
strictly follow the standard (MPEG4, ...).
static int libgsm_encode_frame(AVCodecContext *avctx, unsigned char *frame, int buf_size, void *data)