libtwolame.c File Reference

Interface to libtwolame for mp2 encoding. More...

#include <twolame.h>
#include "libavutil/opt.h"
#include "avcodec.h"
#include "internal.h"
#include "mpegaudio.h"
Include dependency graph for libtwolame.c:

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
 

Typedefs

typedef struct TWOLAMEContext TWOLAMEContext
 

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 libtwolame_class
 
AVCodec ff_libtwolame_encoder
 

Detailed Description

Interface to libtwolame for mp2 encoding.

Definition in file libtwolame.c.

Macro Definition Documentation

Definition at line 153 of file libtwolame.c.

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

Definition at line 152 of file libtwolame.c.

Typedef Documentation

Function Documentation

static av_cold int twolame_encode_close ( AVCodecContext avctx)
static

Definition at line 47 of file libtwolame.c.

Referenced by twolame_encode_init().

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

Definition at line 91 of file libtwolame.c.

static av_cold int twolame_encode_init ( AVCodecContext avctx)
static

Definition at line 54 of file libtwolame.c.

Variable Documentation

AVCodec ff_libtwolame_encoder
Initial value:
= {
.name = "libtwolame",
.priv_data_size = sizeof(TWOLAMEContext),
.capabilities = CODEC_CAP_DELAY,
.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO,
0 },
.supported_samplerates = (const int[]){ 16000, 22050, 24000, 32000, 44100, 48000, 0 },
.long_name = NULL_IF_CONFIG_SMALL("libtwolame MP2 (MPEG audio layer 2)"),
.priv_class = &libtwolame_class,
}
static av_cold int twolame_encode_init(AVCodecContext *avctx)
Definition: libtwolame.c:54
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
#define AV_CH_LAYOUT_STEREO
signed 16 bits
Definition: samplefmt.h:52
struct TWOLAMEContext TWOLAMEContext
float, planar
Definition: samplefmt.h:60
#define CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static const AVClass libtwolame_class
Definition: libtwolame.c:169
static void close(AVCodecParserContext *s)
Definition: h264_parser.c:375
static int twolame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Definition: libtwolame.c:91
static av_cold int twolame_encode_close(AVCodecContext *avctx)
Definition: libtwolame.c:47
AVSampleFormat
Audio Sample Formats.
Definition: samplefmt.h:49
signed 16 bits, planar
Definition: samplefmt.h:58
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:700
#define AV_CH_LAYOUT_MONO

Definition at line 176 of file libtwolame.c.

const AVClass libtwolame_class
static
Initial value:
= {
.class_name = "libtwolame encoder",
.item_name = av_default_item_name,
.option = options,
}
av_default_item_name
static const AVOption options[]
Definition: libtwolame.c:154
LIBAVUTIL_VERSION_INT
Definition: eval.c:55

Definition at line 169 of file libtwolame.c.

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},
{ NULL },
}
or the Software in violation of any applicable export control laws in any jurisdiction Except as provided by mandatorily applicable UPF has no obligation to provide you with source code to the Software In the event Software contains any source unless expressly licensed for other it is provided solely for reference purposes pursuant to the terms of this License Source code may not be redistributed unless expressly provided for in this License INTELLECTUAL AND INDUSTRIAL PROPERTY RIGHTS Title to Software and all associated intellectual and industrial property rights is retained by UPF and or its licensors UPF warrants that the copyright in the Software is owned by it or licensed to it and that it has the power and authority to grant the Licence You shall keep intact all copyright
#define AE
Definition: libtwolame.c:153
mode
Definition: f_perms.c:27
NULL
Definition: eval.c:55
#define OFFSET(x)
Definition: libtwolame.c:152

Definition at line 154 of file libtwolame.c.