57 avio_w8(pb, last_block ? 0x81 : 0x01);
64 int last_block,
int bitexact)
74 if (
len >= ((1<<24) - 4))
77 avio_w8(pb, last_block ? 0x84 : 0x04);
91 const char *mimetype =
NULL, *
desc =
"";
93 int i, mimelen, desclen,
type = 0, blocklen;
100 mimetype = mime->
str;
107 "write an attached picture.\n", st->
index);
110 mimelen = strlen(mimetype);
121 if ((
c->attached_types & (1 <<
type)) & 0x6) {
133 c->attached_types |= (1 <<
type);
138 desclen = strlen(
desc);
140 blocklen = 4 + 4 + mimelen + 4 + desclen + 4 + 4 + 4 + 4 + 4 +
pkt->size;
141 if (blocklen >= 1<<24) {
172 int i, ret, padding =
s->metadata_header_padding;
179 for (
i = 0;
i <
s->nb_streams;
i++) {
211 c->audio_stream_idx = -1;
212 for (
i = 0;
i <
s->nb_streams;
i++) {
217 "audio stream is required.\n");
220 par =
s->streams[
i]->codecpar;
221 c->audio_stream_idx =
i;
229 }
else if (!
c->write_header) {
239 if (
c->audio_stream_idx < 0) {
253 "already present, this muxer will not overwrite it.\n");
257 av_dict_set(&
s->metadata,
"WAVEFORMATEXTENSIBLE_CHANNEL_MASK", buf, 0);
270 if (!
c->write_header)
278 if (!
c->waiting_pics)
288 size_t streaminfo_size;
295 c->updated_streaminfo = 1;
313 while (
c->queue.head) {
328 if (
c->waiting_pics) {
330 "attached pictures.\n");
334 if (!
c->write_header || !
c->updated_streaminfo)
355 for (
unsigned i = 0;
i <
s->nb_streams;
i++)
364 if (
pkt->stream_index ==
c->audio_stream_idx) {
365 if (
c->waiting_pics) {
381 if (!
c->waiting_pics ||
388 " ignoring.\n",
pkt->stream_index);
399 if (!
c->waiting_pics &&
413 .class_name =
"flac muxer",
423 .p.mime_type =
"audio/x-flac",
424 .p.extensions =
"flac",
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
void avio_w8(AVIOContext *s, int b)
void avio_wb32(AVIOContext *s, unsigned int val)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
void avio_wb24(AVIOContext *s, unsigned int val)
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
void ffio_fill(AVIOContext *s, int b, int64_t count)
#define i(width, name, range_min, range_max)
Public libavutil channel layout APIs header.
#define AV_EF_EXPLODE
abort decoding on minor error detection
static void write_header(FFV1Context *f)
FLAC (Free Lossless Audio Codec) common stuff.
#define FLAC_STREAMINFO_SIZE
int ff_flac_write_header(AVIOContext *pb, const uint8_t *extradata, int extradata_size, int last_block)
int ff_flac_is_native_layout(uint64_t channel_layout)
#define AV_OPT_FLAG_ENCODING_PARAM
A generic parameter which can be set by the user for muxing or encoding.
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
@ 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...
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
AVPacket * av_packet_clone(const AVPacket *src)
Create a new packet that references the same data as src.
uint8_t * av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, size_t *size)
Get side information from packet.
@ AV_CHANNEL_ORDER_NATIVE
The native channel order, i.e.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const char * av_default_item_name(void *ptr)
Return the context name.
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
#define LIBAVUTIL_VERSION_INT
const char *const ff_id3v2_picture_types[21]
const CodecMime ff_id3v2_mime_tags[]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel used by the pixel format described by pixdesc.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define FF_ARRAY_ELEMS(a)
enum AVChannelOrder order
Channel order used in this layout.
uint64_t mask
This member must be used for AV_CHANNEL_ORDER_NATIVE, and may be used for AV_CHANNEL_ORDER_AMBISONIC ...
union AVChannelLayout::@162063043056170047076125117143030261346263330336 u
Details about which channels are present in this layout.
Describe the class of an AVClass context structure.
This struct describes the properties of an encoded stream.
int extradata_size
Size of the extradata content in bytes.
int height
The height of the video frame in pixels.
AVChannelLayout ch_layout
The channel layout and number of channels.
int width
The width of the video frame in pixels.
enum AVMediaType codec_type
General type of the encoded data.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
This structure stores compressed data.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int64_t nb_frames
number of frames in this stream if known or 0
int index
stream index in AVFormatContext
int disposition
Stream disposition - a combination of AV_DISPOSITION_* flags.
AVPacket * pkt
Used to hold temporary packets for the generic demuxing code.
uint8_t streaminfo[FLAC_STREAMINFO_SIZE]