53 avio_w8(pb, last_block ? 0x81 : 0x01);
60 int last_block,
int bitexact)
69 if (len >= ((1<<24) - 4))
76 bytestream_put_byte(&p, last_block ? 0x84 : 0x04);
77 bytestream_put_be24(&p, len);
94 const char *mimetype =
NULL, *
desc =
"";
96 int i, mimelen, desclen,
type = 0;
103 mimetype = mime->
str;
110 "write an attached picture.\n", st->
index);
113 mimelen = strlen(mimetype);
141 desclen = strlen(desc);
144 avio_wb24(pb, 4 + 4 + mimelen + 4 + desclen + 4 + 4 + 4 + 4 + 4 + pkt->
size);
174 padding = av_clip_uintp2(padding, 24);
214 "audio stream is required.\n");
250 "already present, this muxer will not overwrite it.\n");
333 "attached pictures.\n");
366 av_log(s,
AV_LOG_ERROR,
"Out of memory in packet queue; skipping attached pictures\n");
420 .mime_type =
"audio/x-flac",
421 .extensions =
"flac",
429 .priv_class = &flac_muxer_class,
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_LOG_WARNING
Something somehow does not look correct.
#define LIBAVUTIL_VERSION_INT
static av_cold int init(AVCodecContext *avctx)
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel used by the pixel format described by pixdesc.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int index
stream index in AVFormatContext
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
const char * av_default_item_name(void *ptr)
Return the context name.
int ff_flac_is_native_layout(uint64_t channel_layout)
This struct describes the properties of an encoded stream.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
AVStream ** streams
A list of all streams in the file.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
int flags
Flags modifying the (de)muxer behaviour.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
uint64_t channel_layout
Audio only.
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVDictionary * metadata
Metadata that applies to the whole file.
AVPacket * av_packet_clone(const AVPacket *src)
Create a new packet that references the same data as src.
FLAC (Free Lossless Audio Codec) decoder/demuxer common functions.
uint8_t * av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, int *size)
Get side information from packet.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
enum AVMediaType codec_type
General type of the encoded data.
int extradata_size
Size of the extradata content in bytes.
const CodecMime ff_id3v2_mime_tags[]
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
int void avio_flush(AVIOContext *s)
Force flushing of buffered data.
audio channel layout utility functions
void ffio_fill(AVIOContext *s, int b, int count)
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
static int write_trailer(AVFormatContext *s1)
void avio_wb24(AVIOContext *s, unsigned int val)
#define FLAC_STREAMINFO_SIZE
int ff_flac_write_header(AVIOContext *pb, uint8_t *extradata, int extradata_size, int last_block)
#define AV_EF_EXPLODE
abort decoding on minor error detection
#define FF_ARRAY_ELEMS(a)
int metadata_header_padding
Number of bytes to be written as padding in a metadata header.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format that the extradata buffer was...
AVIOContext * pb
I/O context.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
void avio_w8(AVIOContext *s, int b)
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
Describe the class of an AVClass context structure.
int error_recognition
Error recognition; higher values will detect more errors but may misdetect some more or less valid pa...
int disposition
AV_DISPOSITION_* bit field.
int64_t nb_frames
number of frames in this stream if known or 0
void * priv_data
Format private data.
static void write_header(FFV1Context *f)
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
void avio_wb32(AVIOContext *s, unsigned int val)
AVCodecParameters * codecpar
Codec parameters associated with this stream.
const char *const ff_id3v2_picture_types[21]
This structure stores compressed data.