Go to the documentation of this file.
54 avio_w8(pb, last_block ? 0x81 : 0x01);
61 int last_block,
int bitexact)
69 if (
len >= ((1<<24) - 4))
72 avio_w8(pb, last_block ? 0x84 : 0x04);
86 const char *mimetype =
NULL, *
desc =
"";
88 int i, mimelen, desclen,
type = 0, blocklen;
102 "write an attached picture.\n", st->
index);
105 mimelen = strlen(mimetype);
116 if ((
c->attached_types & (1 <<
type)) & 0x6) {
128 c->attached_types |= (1 <<
type);
133 desclen = strlen(
desc);
135 blocklen = 4 + 4 + mimelen + 4 + desclen + 4 + 4 + 4 + 4 + 4 +
pkt->
size;
136 if (blocklen >= 1<<24) {
167 int i,
ret, padding =
s->metadata_header_padding;
174 for (
i = 0;
i <
s->nb_streams;
i++) {
206 c->audio_stream_idx = -1;
207 for (
i = 0;
i <
s->nb_streams;
i++) {
212 "audio stream is required.\n");
215 par =
s->streams[
i]->codecpar;
216 c->audio_stream_idx =
i;
224 }
else if (!
c->write_header) {
234 if (
c->audio_stream_idx < 0) {
248 "already present, this muxer will not overwrite it.\n");
252 av_dict_set(&
s->metadata,
"WAVEFORMATEXTENSIBLE_CHANNEL_MASK", buf, 0);
265 if (!
c->write_header)
273 if (!
c->waiting_pics)
290 c->updated_streaminfo = 1;
323 if (
c->waiting_pics) {
325 "attached pictures.\n");
329 if (!
c->write_header || !
c->updated_streaminfo)
350 for (
unsigned i = 0;
i <
s->nb_streams;
i++)
360 if (
c->waiting_pics) {
376 if (!
c->waiting_pics ||
394 if (!
c->waiting_pics &&
418 .mime_type =
"audio/x-flac",
419 .extensions =
"flac",
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
#define AV_LOG_WARNING
Something somehow does not look correct.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
static av_cold int init(AVCodecContext *avctx)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
enum AVMediaType codec_type
General type of the encoded data.
uint8_t * av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, buffer_size_t *size)
This struct describes the properties of an encoded stream.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel used by the pixel format described by pixdesc.
int ff_flac_is_native_layout(uint64_t channel_layout)
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_ARRAY_ELEMS(a)
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
AVCodecParameters * codecpar
Codec parameters associated with this stream.
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
static int write_trailer(AVFormatContext *s1)
const char * av_default_item_name(void *ptr)
Return the context name.
#define FLAC_STREAMINFO_SIZE
void avio_w8(AVIOContext *s, int b)
int av_packet_ref(AVPacket *dst, const AVPacket *src)
Setup a new reference to the data described by a given packet.
#define AV_EF_EXPLODE
abort decoding on minor error detection
const char *const ff_id3v2_picture_types[21]
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
const CodecMime ff_id3v2_mime_tags[]
int64_t nb_frames
number of frames in this stream if known or 0
int extradata_size
Size of the extradata content in bytes.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
void avio_wb32(AVIOContext *s, unsigned int val)
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
uint8_t streaminfo[FLAC_STREAMINFO_SIZE]
int disposition
AV_DISPOSITION_* bit field.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
int avpriv_packet_list_get(PacketList **pkt_buffer, PacketList **pkt_buffer_end, AVPacket *pkt)
Remove the oldest AVPacket in the list and return it.
int index
stream index in AVFormatContext
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
@ AV_PKT_DATA_NEW_EXTRADATA
The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format that the extradata buffer was...
int ff_flac_write_header(AVIOContext *pb, const uint8_t *extradata, int extradata_size, int last_block)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
void avio_wb24(AVIOContext *s, unsigned int val)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
uint64_t channel_layout
Audio only.
void ffio_fill(AVIOContext *s, int b, int count)
#define flags(name, subs,...)
static void write_header(FFV1Context *f)
int avpriv_packet_list_put(PacketList **packet_buffer, PacketList **plast_pktl, AVPacket *pkt, int(*copy)(AVPacket *dst, const AVPacket *src), int flags)
Append an AVPacket to the list.
void avpriv_packet_list_free(PacketList **pkt_buf, PacketList **pkt_buf_end)
Wipe the list and unref all the packets in it.
AVPacket * av_packet_clone(const AVPacket *src)
Create a new packet that references the same data as src.