libavformat/mp3enc.c File Reference

#include "avformat.h"
#include "avio_internal.h"
#include "id3v1.h"
#include "id3v2.h"
#include "rawenc.h"
#include "libavutil/avstring.h"
#include "libavcodec/mpegaudio.h"
#include "libavcodec/mpegaudiodata.h"
#include "libavcodec/mpegaudiodecheader.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "libavutil/dict.h"

Go to the source code of this file.

Data Structures

struct  MP3Context

Typedefs

typedef struct MP3Context MP3Context

Functions

static int id3v1_set_string (AVFormatContext *s, const char *key, uint8_t *buf, int buf_size)
static int id3v1_create_tag (AVFormatContext *s, uint8_t *buf)
static int mp3_write_trailer (struct AVFormatContext *s)
static void mp3_write_xing (AVFormatContext *s)
static int mp3_write_header (struct AVFormatContext *s)
 Write an ID3v2 header at beginning of stream.

Variables

AVOutputFormat ff_mp2_muxer
static const AVOption options []
static const AVClass mp3_muxer_class
AVOutputFormat ff_mp3_muxer

Typedef Documentation

typedef struct MP3Context MP3Context

Function Documentation

static int id3v1_create_tag ( AVFormatContext s,
uint8_t *  buf 
) [static]

Definition at line 44 of file mp3enc.c.

Referenced by mp3_write_trailer().

static int id3v1_set_string ( AVFormatContext s,
const char *  key,
uint8_t *  buf,
int  buf_size 
) [static]

Definition at line 35 of file mp3enc.c.

Referenced by id3v1_create_tag().

static int mp3_write_header ( struct AVFormatContext s  )  [static]

Write an ID3v2 header at beginning of stream.

Definition at line 185 of file mp3enc.c.

static int mp3_write_trailer ( struct AVFormatContext s  )  [static]

Definition at line 83 of file mp3enc.c.

static void mp3_write_xing ( AVFormatContext s  )  [static]

Definition at line 136 of file mp3enc.c.

Referenced by mp3_write_header().


Variable Documentation

Initial value:
 {
    .name              = "mp2",
    .long_name         = NULL_IF_CONFIG_SMALL("MPEG audio layer 2"),
    .mime_type         = "audio/x-mpeg",
    .extensions        = "mp2,m2a",
    .audio_codec       = CODEC_ID_MP2,
    .video_codec       = CODEC_ID_NONE,
    .write_packet      = ff_raw_write_packet,
    .write_trailer     = mp3_write_trailer,
}

Definition at line 106 of file mp3enc.c.

Initial value:
 {
    .name              = "mp3",
    .long_name         = NULL_IF_CONFIG_SMALL("MPEG audio layer 3"),
    .mime_type         = "audio/x-mpeg",
    .extensions        = "mp3",
    .priv_data_size    = sizeof(MP3Context),
    .audio_codec       = CODEC_ID_MP3,
    .video_codec       = CODEC_ID_NONE,
    .write_header      = mp3_write_header,
    .write_packet      = ff_raw_write_packet,
    .write_trailer     = mp3_write_trailer,
    .flags             = AVFMT_NOTIMESTAMPS,
    .priv_class = &mp3_muxer_class,
}

Definition at line 200 of file mp3enc.c.

const AVClass mp3_muxer_class [static]
Initial value:
 {
    .class_name     = "MP3 muxer",
    .item_name      = av_default_item_name,
    .option         = options,
    .version        = LIBAVUTIL_VERSION_INT,
}

Definition at line 128 of file mp3enc.c.

const AVOption options[] [static]
Initial value:
 {
    { "id3v2_version", "Select ID3v2 version to write. Currently 3 and 4 are supported.",
      0x42, AV_OPT_TYPE_INT, {.dbl = 4}, 3, 4, AV_OPT_FLAG_ENCODING_PARAM},
    { "write_id3v1", "Enable ID3v1 writing. ID3v1 tags are written in UTF-8 which may not be supported by most software.",
      0x42, AV_OPT_TYPE_INT, {.dbl = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
    { NULL },
}

Definition at line 120 of file mp3enc.c.