FFmpeg
Data Structures | Macros | Functions | Variables
adtsenc.c File Reference
#include "libavcodec/get_bits.h"
#include "libavcodec/put_bits.h"
#include "libavcodec/codec_id.h"
#include "libavcodec/codec_par.h"
#include "libavcodec/packet.h"
#include "libavcodec/mpeg4audio.h"
#include "libavcodec/mpeg4audio_copy_pce.h"
#include "libavutil/opt.h"
#include "avformat.h"
#include "apetag.h"
#include "id3v2.h"
#include "mux.h"

Go to the source code of this file.

Data Structures

struct  ADTSContext
 

Macros

#define ADTS_HEADER_SIZE   7
 
#define ADTS_MAX_FRAME_BYTES   ((1 << 14) - 1)
 
#define ENC   AV_OPT_FLAG_ENCODING_PARAM
 
#define OFFSET(obj)   offsetof(ADTSContext, obj)
 

Functions

static int adts_decode_extradata (AVFormatContext *s, ADTSContext *adts, const uint8_t *buf, int size)
 
static int adts_init (AVFormatContext *s)
 
static int adts_write_header (AVFormatContext *s)
 
static int adts_write_frame_header (AVFormatContext *s, ADTSContext *ctx, uint8_t *buf, int size, int pce_size)
 
static int adts_write_packet (AVFormatContext *s, AVPacket *pkt)
 
static int adts_write_trailer (AVFormatContext *s)
 

Variables

static const AVOption options []
 
static const AVClass adts_muxer_class
 
const FFOutputFormat ff_adts_muxer
 

Macro Definition Documentation

◆ ADTS_HEADER_SIZE

#define ADTS_HEADER_SIZE   7

Definition at line 36 of file adtsenc.c.

◆ ADTS_MAX_FRAME_BYTES

#define ADTS_MAX_FRAME_BYTES   ((1 << 14) - 1)

Definition at line 51 of file adtsenc.c.

◆ ENC

#define ENC   AV_OPT_FLAG_ENCODING_PARAM

Definition at line 216 of file adtsenc.c.

◆ OFFSET

#define OFFSET (   obj)    offsetof(ADTSContext, obj)

Definition at line 217 of file adtsenc.c.

Function Documentation

◆ adts_decode_extradata()

static int adts_decode_extradata ( AVFormatContext s,
ADTSContext adts,
const uint8_t *  buf,
int  size 
)
static

Definition at line 53 of file adtsenc.c.

Referenced by adts_init(), and adts_write_packet().

◆ adts_init()

static int adts_init ( AVFormatContext s)
static

Definition at line 104 of file adtsenc.c.

◆ adts_write_header()

static int adts_write_header ( AVFormatContext s)
static

Definition at line 116 of file adtsenc.c.

◆ adts_write_frame_header()

static int adts_write_frame_header ( AVFormatContext s,
ADTSContext ctx,
uint8_t *  buf,
int  size,
int  pce_size 
)
static

Definition at line 126 of file adtsenc.c.

Referenced by adts_write_packet().

◆ adts_write_packet()

static int adts_write_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 164 of file adtsenc.c.

◆ adts_write_trailer()

static int adts_write_trailer ( AVFormatContext s)
static

Definition at line 206 of file adtsenc.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "write_id3v2", "Enable ID3v2 tag writing", OFFSET(id3v2tag), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, ENC},
{ "write_apetag", "Enable APE tag writing", OFFSET(apetag), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, ENC},
{ "write_mpeg2", "Set MPEG version to MPEG-2", OFFSET(mpeg_id), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, ENC},
{ NULL },
}

Definition at line 218 of file adtsenc.c.

◆ adts_muxer_class

const AVClass adts_muxer_class
static
Initial value:
= {
.class_name = "ADTS muxer",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 225 of file adtsenc.c.

◆ ff_adts_muxer

const FFOutputFormat ff_adts_muxer
Initial value:
= {
.p.name = "adts",
.p.long_name = NULL_IF_CONFIG_SMALL("ADTS AAC (Advanced Audio Coding)"),
.p.mime_type = "audio/aac",
.p.extensions = "aac,adts",
.priv_data_size = sizeof(ADTSContext),
.p.audio_codec = AV_CODEC_ID_AAC,
.p.video_codec = AV_CODEC_ID_NONE,
.p.subtitle_codec = AV_CODEC_ID_NONE,
.flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
.init = adts_init,
.write_header = adts_write_header,
.write_packet = adts_write_packet,
.write_trailer = adts_write_trailer,
.p.priv_class = &adts_muxer_class,
.p.flags = AVFMT_NOTIMESTAMPS,
}

Definition at line 232 of file adtsenc.c.

adts_write_trailer
static int adts_write_trailer(AVFormatContext *s)
Definition: adtsenc.c:206
adts_init
static int adts_init(AVFormatContext *s)
Definition: adtsenc.c:104
AVFMT_NOTIMESTAMPS
#define AVFMT_NOTIMESTAMPS
Format does not need / have any timestamps.
Definition: avformat.h:479
FF_OFMT_FLAG_ONLY_DEFAULT_CODECS
#define FF_OFMT_FLAG_ONLY_DEFAULT_CODECS
If this flag is set, then the only permitted audio/video/subtitle codec ids are AVOutputFormat....
Definition: mux.h:59
options
static const AVOption options[]
Definition: adtsenc.c:218
adts_write_packet
static int adts_write_packet(AVFormatContext *s, AVPacket *pkt)
Definition: adtsenc.c:164
adts_write_header
static int adts_write_header(AVFormatContext *s)
Definition: adtsenc.c:116
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
ENC
#define ENC
Definition: adtsenc.c:216
AV_CODEC_ID_AAC
@ AV_CODEC_ID_AAC
Definition: codec_id.h:442
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:50
FF_OFMT_FLAG_MAX_ONE_OF_EACH
#define FF_OFMT_FLAG_MAX_ONE_OF_EACH
If this flag is set, it indicates that for each codec type whose corresponding default codec (i....
Definition: mux.h:50
adts_muxer_class
static const AVClass adts_muxer_class
Definition: adtsenc.c:225
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:251
OFFSET
#define OFFSET(obj)
Definition: adtsenc.c:217
ADTSContext
Definition: adtsenc.c:38