FFmpeg
Data Structures | Macros | Functions | Variables
liblc3enc.c File Reference
#include <lc3.h>
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "libavutil/mem.h"
#include "avcodec.h"
#include "codec.h"
#include "codec_internal.h"
#include "encode.h"

Go to the source code of this file.

Data Structures

struct  LibLC3EncOpts
 
struct  LibLC3EncContext
 

Macros

#define ENCODER_MAX_CHANNELS   2
 
#define OFFSET(x)   offsetof(LibLC3EncContext, opts.x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static av_cold int liblc3_encode_init (AVCodecContext *avctx)
 
static av_cold int liblc3_encode_close (AVCodecContext *avctx)
 
static int liblc3_encode (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet_ptr)
 

Variables

static const AVOption options []
 
class {
      class_name = "liblc3 encoder"
 
      item_name = av_default_item_name
 
      option = options
 
      version = LIBAVUTIL_VERSION_INT
 
}; 
 
const FFCodec ff_liblc3_encoder
 

Macro Definition Documentation

◆ ENCODER_MAX_CHANNELS

#define ENCODER_MAX_CHANNELS   2

Definition at line 31 of file liblc3enc.c.

◆ OFFSET

#define OFFSET (   x)    offsetof(LibLC3EncContext, opts.x)

Definition at line 179 of file liblc3enc.c.

◆ FLAGS

Definition at line 180 of file liblc3enc.c.

Function Documentation

◆ liblc3_encode_init()

static av_cold int liblc3_encode_init ( AVCodecContext avctx)
static

Definition at line 48 of file liblc3enc.c.

◆ liblc3_encode_close()

static av_cold int liblc3_encode_close ( AVCodecContext avctx)
static

Definition at line 125 of file liblc3enc.c.

◆ liblc3_encode()

static int liblc3_encode ( AVCodecContext avctx,
AVPacket pkt,
const AVFrame frame,
int *  got_packet_ptr 
)
static

Definition at line 134 of file liblc3enc.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "frame_duration", "Duration of a frame in milliseconds",
OFFSET(frame_duration), AV_OPT_TYPE_FLOAT,
{ .dbl = 10.0 }, 2.5, 10.0, FLAGS },
{ "high_resolution", "Enable High-Resolution mode (48 KHz or 96 KHz)",
{ .i64 = 0 }, 0, 1, FLAGS },
{ NULL }
}

Definition at line 181 of file liblc3enc.c.

◆ class_name

class_name = "liblc3 encoder"
private

Definition at line 192 of file liblc3enc.c.

◆ item_name

item_name = av_default_item_name
private

Definition at line 193 of file liblc3enc.c.

◆ option

option = options
private

Definition at line 194 of file liblc3enc.c.

◆ version

version = LIBAVUTIL_VERSION_INT
private

Definition at line 195 of file liblc3enc.c.

◆ @154

const { ... }

◆ ff_liblc3_encoder

const FFCodec ff_liblc3_encoder
Initial value:
= {
.p.name = "liblc3",
CODEC_LONG_NAME("LC3 (Low Complexity Communication Codec)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_LC3,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.p.supported_samplerates = (const int [])
{ 96000, 48000, 32000, 24000, 16000, 8000, 0 },
.p.sample_fmts = (const enum AVSampleFormat[])
.p.priv_class = &class,
.p.wrapper_name = "liblc3",
.priv_data_size = sizeof(LibLC3EncContext),
}

Definition at line 198 of file liblc3enc.c.

AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:66
LibLC3EncContext
Definition: liblc3enc.c:38
AV_CODEC_ID_LC3
@ AV_CODEC_ID_LC3
Definition: codec_id.h:552
FF_CODEC_ENCODE_CB
#define FF_CODEC_ENCODE_CB(func)
Definition: codec_internal.h:320
FLAGS
#define FLAGS
Definition: liblc3enc.c:180
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
liblc3_encode_init
static av_cold int liblc3_encode_init(AVCodecContext *avctx)
Definition: liblc3enc.c:48
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
liblc3_encode_close
static av_cold int liblc3_encode_close(AVCodecContext *avctx)
Definition: liblc3enc.c:125
NULL
#define NULL
Definition: coverity.c:32
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
OFFSET
#define OFFSET(x)
Definition: liblc3enc.c:179
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Underlying C type is float.
Definition: opt.h:271
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
AV_CODEC_CAP_DELAY
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: codec.h:76
liblc3_encode
static int liblc3_encode(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet_ptr)
Definition: liblc3enc.c:134
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition: opt.h:327