FFmpeg  4.0
Data Structures | Functions | Variables
libcodec2.c File Reference
#include <codec2/codec2.h>
#include "avcodec.h"
#include "libavutil/opt.h"
#include "internal.h"
#include "codec2utils.h"

Go to the source code of this file.

Data Structures

struct  LibCodec2Context
 

Functions

static av_cold int libcodec2_init_common (AVCodecContext *avctx, int mode)
 
static av_cold int libcodec2_init_decoder (AVCodecContext *avctx)
 
static av_cold int libcodec2_init_encoder (AVCodecContext *avctx)
 
static av_cold int libcodec2_close (AVCodecContext *avctx)
 
static int libcodec2_decode (AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *pkt)
 
static int libcodec2_encode (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
 

Variables

static const AVOption options []
 
static const AVClass libcodec2_enc_class
 
static const AVClass libcodec2_dec_class
 
AVCodec ff_libcodec2_decoder
 
AVCodec ff_libcodec2_encoder
 

Function Documentation

◆ libcodec2_init_common()

static av_cold int libcodec2_init_common ( AVCodecContext avctx,
int  mode 
)
static

Definition at line 54 of file libcodec2.c.

Referenced by libcodec2_init_decoder(), and libcodec2_init_encoder().

◆ libcodec2_init_decoder()

static av_cold int libcodec2_init_decoder ( AVCodecContext avctx)
static

Definition at line 89 of file libcodec2.c.

◆ libcodec2_init_encoder()

static av_cold int libcodec2_init_encoder ( AVCodecContext avctx)
static

Definition at line 105 of file libcodec2.c.

◆ libcodec2_close()

static av_cold int libcodec2_close ( AVCodecContext avctx)
static

Definition at line 128 of file libcodec2.c.

◆ libcodec2_decode()

static int libcodec2_decode ( AVCodecContext avctx,
void data,
int got_frame_ptr,
AVPacket pkt 
)
static

Definition at line 136 of file libcodec2.c.

◆ libcodec2_encode()

static int libcodec2_encode ( AVCodecContext avctx,
AVPacket avpkt,
const AVFrame frame,
int got_packet_ptr 
)
static

Definition at line 166 of file libcodec2.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ NULL },
}
#define NULL
Definition: coverity.c:32
#define AV_OPT_FLAG_AUDIO_PARAM
Definition: opt.h:278
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
Definition: opt.h:276
#define AVPRIV_CODEC2_AVOPTIONS(desc, classname, min_val, default_val, option_flags)
Definition: codec2utils.h:36

Definition at line 34 of file libcodec2.c.

◆ libcodec2_enc_class

const AVClass libcodec2_enc_class
static
Initial value:
= {
.class_name = "libcodec2 encoder",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:191
static const AVOption options[]
Definition: libcodec2.c:34

Definition at line 41 of file libcodec2.c.

◆ libcodec2_dec_class

const AVClass libcodec2_dec_class
static
Initial value:
= {
.class_name = "libcodec2 decoder",
.item_name = av_default_item_name,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:191

Definition at line 48 of file libcodec2.c.

◆ ff_libcodec2_decoder

AVCodec ff_libcodec2_decoder
Initial value:
= {
.name = "libcodec2",
.long_name = NULL_IF_CONFIG_SMALL("codec2 decoder using libcodec2"),
.priv_data_size = sizeof(LibCodec2Context),
.close = libcodec2_close,
.capabilities = 0,
.supported_samplerates = (const int[]){ 8000, 0 },
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE },
.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 },
.priv_class = &libcodec2_dec_class,
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static const AVClass libcodec2_dec_class
Definition: libcodec2.c:48
static int libcodec2_decode(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *pkt)
Definition: libcodec2.c:136
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:42
static av_cold int libcodec2_init_decoder(AVCodecContext *avctx)
Definition: libcodec2.c:89
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
static av_cold int libcodec2_close(AVCodecContext *avctx)
Definition: libcodec2.c:128
signed 16 bits
Definition: samplefmt.h:61
#define AV_CH_LAYOUT_MONO

Definition at line 183 of file libcodec2.c.

◆ ff_libcodec2_encoder

AVCodec ff_libcodec2_encoder
Initial value:
= {
.name = "libcodec2",
.long_name = NULL_IF_CONFIG_SMALL("codec2 encoder using libcodec2"),
.priv_data_size = sizeof(LibCodec2Context),
.close = libcodec2_close,
.encode2 = libcodec2_encode,
.capabilities = 0,
.supported_samplerates = (const int[]){ 8000, 0 },
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE },
.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 },
.priv_class = &libcodec2_enc_class,
}
static int libcodec2_encode(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Definition: libcodec2.c:166
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
static av_cold int libcodec2_close(AVCodecContext *avctx)
Definition: libcodec2.c:128
static av_cold int libcodec2_init_encoder(AVCodecContext *avctx)
Definition: libcodec2.c:105
signed 16 bits
Definition: samplefmt.h:61
static const AVClass libcodec2_enc_class
Definition: libcodec2.c:41
#define AV_CH_LAYOUT_MONO

Definition at line 199 of file libcodec2.c.