FFmpeg
Data Structures | Macros | Functions | Variables
libtwolame.c File Reference
#include <twolame.h>
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "encode.h"
#include "internal.h"
#include "mpegaudio.h"

Go to the source code of this file.

Data Structures

struct  TWOLAMEContext
 

Macros

#define OFFSET(x)   offsetof(TWOLAMEContext, x)
 
#define AE   AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static av_cold int twolame_encode_close (AVCodecContext *avctx)
 
static av_cold int twolame_encode_init (AVCodecContext *avctx)
 
static int twolame_encode_frame (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
 

Variables

static const AVOption options []
 
static const AVClass twolame_class
 
static const FFCodecDefault twolame_defaults []
 
static const int twolame_samplerates []
 
const FFCodec ff_libtwolame_encoder
 

Detailed Description

Interface to libtwolame for mp2 encoding.

Definition in file libtwolame.c.

Macro Definition Documentation

◆ OFFSET

#define OFFSET (   x)    offsetof(TWOLAMEContext, x)

Definition at line 178 of file libtwolame.c.

◆ AE

Definition at line 179 of file libtwolame.c.

Function Documentation

◆ twolame_encode_close()

static av_cold int twolame_encode_close ( AVCodecContext avctx)
static

Definition at line 53 of file libtwolame.c.

Referenced by twolame_encode_init().

◆ twolame_encode_init()

static av_cold int twolame_encode_init ( AVCodecContext avctx)
static

Definition at line 60 of file libtwolame.c.

◆ twolame_encode_frame()

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

Definition at line 110 of file libtwolame.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "mode", "Mpeg Mode", OFFSET(mode), AV_OPT_TYPE_INT, { .i64 = TWOLAME_AUTO_MODE }, TWOLAME_AUTO_MODE, TWOLAME_MONO, AE, "mode"},
{ "auto", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = TWOLAME_AUTO_MODE }, 0, 0, AE, "mode" },
{ "stereo", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = TWOLAME_STEREO }, 0, 0, AE, "mode" },
{ "joint_stereo", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = TWOLAME_JOINT_STEREO }, 0, 0, AE, "mode" },
{ "dual_channel", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = TWOLAME_DUAL_CHANNEL }, 0, 0, AE, "mode" },
{ "mono", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = TWOLAME_MONO }, 0, 0, AE, "mode" },
{ "psymodel", "Psychoacoustic Model", OFFSET(psymodel), AV_OPT_TYPE_INT, { .i64 = 3 }, -1, 4, AE},
{ "energy_levels","enable energy levels", OFFSET(energy), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AE},
{ "error_protection","enable CRC error protection", OFFSET(error_protection), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AE},
{ "copyright", "set MPEG Audio Copyright flag", OFFSET(copyright), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AE},
{ "original", "set MPEG Audio Original flag", OFFSET(original), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AE},
{ "verbosity", "set library optput level (0-10)", OFFSET(verbosity), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 10, AE},
{ NULL },
}

Definition at line 180 of file libtwolame.c.

◆ twolame_class

const AVClass twolame_class
static
Initial value:
= {
.class_name = "libtwolame encoder",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 196 of file libtwolame.c.

◆ twolame_defaults

const FFCodecDefault twolame_defaults[]
static
Initial value:
= {
{ "b", "0" },
{ NULL },
}

Definition at line 203 of file libtwolame.c.

◆ twolame_samplerates

const int twolame_samplerates[]
static
Initial value:
= {
16000, 22050, 24000, 32000, 44100, 48000, 0
}

Definition at line 208 of file libtwolame.c.

◆ ff_libtwolame_encoder

const FFCodec ff_libtwolame_encoder

Definition at line 212 of file libtwolame.c.

LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
options
static const AVOption options[]
Definition: libtwolame.c:180
OFFSET
#define OFFSET(x)
Definition: libtwolame.c:178
AE
#define AE
Definition: libtwolame.c:179
mode
mode
Definition: ebur128.h:83
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:234