FFmpeg
Loading...
Searching...
No Matches
libcodec2.c File Reference
#include <codec2/codec2.h>
#include "libavutil/channel_layout.h"
#include "libavutil/mem.h"
#include "avcodec.h"
#include "libavutil/opt.h"
#include "codec_internal.h"
#include "decode.h"
#include "encode.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, AVFrame *frame, 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
 
const FFCodec ff_libcodec2_decoder
 
const FFCodec ff_libcodec2_encoder
 

Function Documentation

◆ libcodec2_init_common()

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

Definition at line 52 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 87 of file libcodec2.c.

◆ libcodec2_init_encoder()

static av_cold int libcodec2_init_encoder ( AVCodecContext * avctx)
static

Definition at line 103 of file libcodec2.c.

◆ libcodec2_close()

static av_cold int libcodec2_close ( AVCodecContext * avctx)
static

Definition at line 118 of file libcodec2.c.

◆ libcodec2_decode()

static int libcodec2_decode ( AVCodecContext * avctx,
AVFrame * frame,
int * got_frame_ptr,
AVPacket * pkt )
static

Definition at line 126 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 157 of file libcodec2.c.

Variable Documentation

◆ options

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

Definition at line 38 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,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85

Definition at line 45 of file libcodec2.c.

◆ ff_libcodec2_decoder

const FFCodec ff_libcodec2_decoder
Initial value:
= {
.p.name = "libcodec2",
CODEC_LONG_NAME("codec2 decoder using libcodec2"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF,
.priv_data_size = sizeof(LibCodec2Context),
}
static av_cold void close(AVCodecParserContext *s)
Definition apv_parser.c:197
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
Definition codec.h:94
@ AV_CODEC_ID_CODEC2
Definition codec_id.h:520
@ AVMEDIA_TYPE_AUDIO
Definition avutil.h:201
static int libcodec2_decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *pkt)
Definition libcodec2.c:126
static av_cold int libcodec2_init_decoder(AVCodecContext *avctx)
Definition libcodec2.c:87
static av_cold int libcodec2_close(AVCodecContext *avctx)
Definition libcodec2.c:118

Definition at line 174 of file libcodec2.c.

◆ ff_libcodec2_encoder

const FFCodec ff_libcodec2_encoder
Initial value:
= {
.p.name = "libcodec2",
CODEC_LONG_NAME("codec2 encoder using libcodec2"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.capabilities = AV_CODEC_CAP_DR1 |
.p.priv_class = &libcodec2_enc_class,
.priv_data_size = sizeof(LibCodec2Context),
}
#define CODEC_CH_LAYOUTS(...)
#define CODEC_SAMPLERATES(...)
#define FF_CODEC_ENCODE_CB(func)
#define CODEC_SAMPLEFMTS(...)
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
Definition codec.h:147
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
#define AV_CHANNEL_LAYOUT_MONO
@ AV_SAMPLE_FMT_S16
signed 16 bits
Definition samplefmt.h:58
static av_cold int libcodec2_init_encoder(AVCodecContext *avctx)
Definition libcodec2.c:103
static int libcodec2_encode(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Definition libcodec2.c:157
static const AVClass libcodec2_enc_class
Definition libcodec2.c:45

Definition at line 187 of file libcodec2.c.