FFmpeg
Classes | Macros | Typedefs | Variables
libmp3lame.c File Reference

Interface to libmp3lame for mp3 encoding. More...

#include <lame/lame.h>
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "libavutil/float_dsp.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "audio_frame_queue.h"
#include "internal.h"
#include "mpegaudio.h"
#include "mpegaudiodecheader.h"

Classes

struct  LAMEContext
 

Macros

#define BUFFER_SIZE   (7200 + 2 * MPA_FRAME_SIZE + MPA_FRAME_SIZE / 4+1000)
 
#define ENCODE_BUFFER(func, buf_type, buf_name)
 
#define OFFSET(x)   offsetof(LAMEContext, x)
 
#define AE   AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 

Typedefs

typedef struct LAMEContext LAMEContext
 

Variables

AVCodec ff_libmp3lame_encoder
 

Detailed Description

Interface to libmp3lame for mp3 encoding.

Macro Definition Documentation

§ ENCODE_BUFFER

#define ENCODE_BUFFER (   func,
  buf_type,
  buf_name 
)
Value:
do { \
lame_result = func(s->gfp, \
(const buf_type *)buf_name[0], \
(const buf_type *)buf_name[1], frame->nb_samples, \
s->buffer + s->buffer_index, \
s->buffer_size - s->buffer_index); \
} while (0)

Variable Documentation

§ ff_libmp3lame_encoder

AVCodec ff_libmp3lame_encoder
Initial value:
= {
.name = "libmp3lame",
.long_name = NULL_IF_CONFIG_SMALL("libmp3lame MP3 (MPEG audio layer 3)"),
.type = AVMEDIA_TYPE_AUDIO,
.priv_data_size = sizeof(LAMEContext),
.init = mp3lame_encode_init,
.encode2 = mp3lame_encode_frame,
.close = mp3lame_encode_close,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P,
AV_SAMPLE_FMT_NONE },
.supported_samplerates = libmp3lame_sample_rates,
.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO,
AV_CH_LAYOUT_STEREO,
0 },
.priv_class = &libmp3lame_class,
.defaults = libmp3lame_defaults,
.wrapper_name = "libmp3lame",
}
float, planar
Definition: samplefmt.h:69
#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: avcodec.h:984
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
preferred ID for decoding MPEG audio layer 1, 2 or 3
Definition: avcodec.h:552
#define AV_CODEC_CAP_SMALL_LAST_FRAME
Codec can be fed a final frame with a smaller size.
Definition: avcodec.h:989
signed 32 bits, planar
Definition: samplefmt.h:68
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
Definition: libmp3lame.c:43
signed 16 bits, planar
Definition: samplefmt.h:67