FFmpeg
Data Structures | Functions | Variables
flacenc.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavcodec/flac.h"
#include "libavcodec/packet_internal.h"
#include "avformat.h"
#include "avio_internal.h"
#include "flacenc.h"
#include "id3v2.h"
#include "internal.h"
#include "mux.h"
#include "version.h"
#include "vorbiscomment.h"

Go to the source code of this file.

Data Structures

struct  FlacMuxerContext
 

Functions

static int flac_write_block_padding (AVIOContext *pb, unsigned int n_padding_bytes, int last_block)
 
static int flac_write_block_comment (AVIOContext *pb, AVDictionary **m, int last_block, int bitexact)
 
static int flac_write_picture (struct AVFormatContext *s, AVPacket *pkt)
 
static int flac_finish_header (struct AVFormatContext *s)
 
static int flac_init (struct AVFormatContext *s)
 
static int flac_write_header (struct AVFormatContext *s)
 
static int flac_write_audio_packet (struct AVFormatContext *s, AVPacket *pkt)
 
static int flac_queue_flush (AVFormatContext *s)
 
static int flac_write_trailer (struct AVFormatContext *s)
 
static void flac_deinit (struct AVFormatContext *s)
 
static int flac_write_packet (struct AVFormatContext *s, AVPacket *pkt)
 

Variables

static const AVOption flacenc_options []
 
static const AVClass flac_muxer_class
 
const FFOutputFormat ff_flac_muxer
 

Function Documentation

◆ flac_write_block_padding()

static int flac_write_block_padding ( AVIOContext pb,
unsigned int  n_padding_bytes,
int  last_block 
)
static

Definition at line 54 of file flacenc.c.

Referenced by flac_finish_header().

◆ flac_write_block_comment()

static int flac_write_block_comment ( AVIOContext pb,
AVDictionary **  m,
int  last_block,
int  bitexact 
)
static

Definition at line 63 of file flacenc.c.

Referenced by flac_finish_header().

◆ flac_write_picture()

static int flac_write_picture ( struct AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 82 of file flacenc.c.

Referenced by flac_finish_header().

◆ flac_finish_header()

static int flac_finish_header ( struct AVFormatContext s)
static

Definition at line 168 of file flacenc.c.

Referenced by flac_queue_flush(), and flac_write_header().

◆ flac_init()

static int flac_init ( struct AVFormatContext s)
static

Definition at line 203 of file flacenc.c.

◆ flac_write_header()

static int flac_write_header ( struct AVFormatContext s)
static

Definition at line 262 of file flacenc.c.

◆ flac_write_audio_packet()

static int flac_write_audio_packet ( struct AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 282 of file flacenc.c.

Referenced by flac_queue_flush(), and flac_write_packet().

◆ flac_queue_flush()

static int flac_queue_flush ( AVFormatContext s)
static

Definition at line 301 of file flacenc.c.

Referenced by flac_write_packet(), and flac_write_trailer().

◆ flac_write_trailer()

static int flac_write_trailer ( struct AVFormatContext s)
static

Definition at line 320 of file flacenc.c.

◆ flac_deinit()

static void flac_deinit ( struct AVFormatContext s)
static

Definition at line 348 of file flacenc.c.

◆ flac_write_packet()

static int flac_write_packet ( struct AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 357 of file flacenc.c.

Variable Documentation

◆ flacenc_options

const AVOption flacenc_options[]
static
Initial value:
= {
{ "write_header", "Write the file header", 0x42, AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM },
{ NULL },
}

Definition at line 405 of file flacenc.c.

◆ flac_muxer_class

const AVClass flac_muxer_class
static
Initial value:
= {
.class_name = "flac muxer",
.item_name = av_default_item_name,
.option = flacenc_options,
}

Definition at line 410 of file flacenc.c.

◆ ff_flac_muxer

const FFOutputFormat ff_flac_muxer
Initial value:
= {
.p.name = "flac",
.p.long_name = NULL_IF_CONFIG_SMALL("raw FLAC"),
.priv_data_size = sizeof(FlacMuxerContext),
.p.mime_type = "audio/x-flac",
.p.extensions = "flac",
.p.audio_codec = AV_CODEC_ID_FLAC,
.p.video_codec = AV_CODEC_ID_PNG,
.init = flac_init,
.write_header = flac_write_header,
.write_packet = flac_write_packet,
.write_trailer = flac_write_trailer,
.deinit = flac_deinit,
.p.flags = AVFMT_NOTIMESTAMPS,
.p.priv_class = &flac_muxer_class,
}

Definition at line 417 of file flacenc.c.

flac_init
static int flac_init(struct AVFormatContext *s)
Definition: flacenc.c:203
AVFMT_NOTIMESTAMPS
#define AVFMT_NOTIMESTAMPS
Format does not need / have any timestamps.
Definition: avformat.h:479
flac_write_header
static int flac_write_header(struct AVFormatContext *s)
Definition: flacenc.c:262
AV_CODEC_ID_FLAC
@ AV_CODEC_ID_FLAC
Definition: codec_id.h:458
flac_deinit
static void flac_deinit(struct AVFormatContext *s)
Definition: flacenc.c:348
flac_muxer_class
static const AVClass flac_muxer_class
Definition: flacenc.c:410
AV_CODEC_ID_PNG
@ AV_CODEC_ID_PNG
Definition: codec_id.h:113
flac_write_packet
static int flac_write_packet(struct AVFormatContext *s, AVPacket *pkt)
Definition: flacenc.c:357
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
AV_OPT_FLAG_ENCODING_PARAM
#define AV_OPT_FLAG_ENCODING_PARAM
A generic parameter which can be set by the user for muxing or encoding.
Definition: opt.h:352
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
flacenc_options
static const AVOption flacenc_options[]
Definition: flacenc.c:405
FlacMuxerContext
Definition: flacenc.c:38
flac_write_trailer
static int flac_write_trailer(struct AVFormatContext *s)
Definition: flacenc.c:320
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition: opt.h:327