FFmpeg  4.4.6
flacenc.c
Go to the documentation of this file.
1 /*
2  * raw FLAC muxer
3  * Copyright (c) 2006-2009 Justin Ruggles
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
23 #include "libavutil/opt.h"
24 #include "libavutil/pixdesc.h"
25 #include "libavcodec/flac.h"
27 #include "avformat.h"
28 #include "avio_internal.h"
29 #include "flacenc.h"
30 #include "id3v2.h"
31 #include "internal.h"
32 #include "vorbiscomment.h"
33 
34 
35 typedef struct FlacMuxerContext {
36  const AVClass *class;
38 
41  /* audio packets are queued here until we get all the attached pictures */
43 
44  /* updated streaminfo sent by the encoder at the end */
47 
48  unsigned attached_types;
50 
51 static int flac_write_block_padding(AVIOContext *pb, unsigned int n_padding_bytes,
52  int last_block)
53 {
54  avio_w8(pb, last_block ? 0x81 : 0x01);
55  avio_wb24(pb, n_padding_bytes);
56  ffio_fill(pb, 0, n_padding_bytes);
57  return 0;
58 }
59 
61  int last_block, int bitexact)
62 {
63  const char *vendor = bitexact ? "ffmpeg" : LIBAVFORMAT_IDENT;
64  int64_t len;
65 
67 
68  len = ff_vorbiscomment_length(*m, vendor, NULL, 0);
69  if (len >= ((1<<24) - 4))
70  return AVERROR(EINVAL);
71 
72  avio_w8(pb, last_block ? 0x84 : 0x04);
73  avio_wb24(pb, len);
74  ff_vorbiscomment_write(pb, *m, vendor, NULL, 0);
75 
76  return 0;
77 }
78 
80 {
81  FlacMuxerContext *c = s->priv_data;
82  AVIOContext *pb = s->pb;
83  const AVPixFmtDescriptor *pixdesc;
84  const CodecMime *mime = ff_id3v2_mime_tags;
86  const char *mimetype = NULL, *desc = "";
87  const AVStream *st = s->streams[pkt->stream_index];
88  int i, mimelen, desclen, type = 0, blocklen;
89 
90  if (!pkt->data)
91  return 0;
92 
93  while (mime->id != AV_CODEC_ID_NONE) {
94  if (mime->id == st->codecpar->codec_id) {
95  mimetype = mime->str;
96  break;
97  }
98  mime++;
99  }
100  if (!mimetype) {
101  av_log(s, AV_LOG_ERROR, "No mimetype is known for stream %d, cannot "
102  "write an attached picture.\n", st->index);
103  return AVERROR(EINVAL);
104  }
105  mimelen = strlen(mimetype);
106 
107  /* get the picture type */
108  e = av_dict_get(st->metadata, "comment", NULL, 0);
109  for (i = 0; e && i < FF_ARRAY_ELEMS(ff_id3v2_picture_types); i++) {
111  type = i;
112  break;
113  }
114  }
115 
116  if ((c->attached_types & (1 << type)) & 0x6) {
117  av_log(s, AV_LOG_ERROR, "Duplicate attachment for type '%s'\n", ff_id3v2_picture_types[type]);
118  return AVERROR(EINVAL);
119  }
120 
121  if (type == 1 && (st->codecpar->codec_id != AV_CODEC_ID_PNG ||
122  st->codecpar->width != 32 ||
123  st->codecpar->height != 32)) {
124  av_log(s, AV_LOG_ERROR, "File icon attachment must be a 32x32 PNG");
125  return AVERROR(EINVAL);
126  }
127 
128  c->attached_types |= (1 << type);
129 
130  /* get the description */
131  if ((e = av_dict_get(st->metadata, "title", NULL, 0)))
132  desc = e->value;
133  desclen = strlen(desc);
134 
135  blocklen = 4 + 4 + mimelen + 4 + desclen + 4 + 4 + 4 + 4 + 4 + pkt->size;
136  if (blocklen >= 1<<24) {
137  av_log(s, AV_LOG_ERROR, "Picture block too big %d >= %d\n", blocklen, 1<<24);
138  return AVERROR(EINVAL);
139  }
140 
141  avio_w8(pb, 0x06);
142  avio_wb24(pb, blocklen);
143 
144  avio_wb32(pb, type);
145 
146  avio_wb32(pb, mimelen);
147  avio_write(pb, mimetype, mimelen);
148 
149  avio_wb32(pb, desclen);
150  avio_write(pb, desc, desclen);
151 
152  avio_wb32(pb, st->codecpar->width);
153  avio_wb32(pb, st->codecpar->height);
154  if ((pixdesc = av_pix_fmt_desc_get(st->codecpar->format)))
155  avio_wb32(pb, av_get_bits_per_pixel(pixdesc));
156  else
157  avio_wb32(pb, 0);
158  avio_wb32(pb, 0);
159 
160  avio_wb32(pb, pkt->size);
161  avio_write(pb, pkt->data, pkt->size);
162  return 0;
163 }
164 
166 {
167  int i, ret, padding = s->metadata_header_padding;
168  if (padding < 0)
169  padding = 8192;
170  /* The FLAC specification states that 24 bits are used to represent the
171  * size of a metadata block so we must clip this value to 2^24-1. */
172  padding = av_clip_uintp2(padding, 24);
173 
174  for (i = 0; i < s->nb_streams; i++) {
175  AVStream *st = s->streams[i];
176  AVPacket *pkt = st->priv_data;
177  if (!pkt)
178  continue;
179  ret = flac_write_picture(s, pkt);
181  if (ret < 0 && (s->error_recognition & AV_EF_EXPLODE))
182  return ret;
183  }
184 
185  ret = flac_write_block_comment(s->pb, &s->metadata, !padding,
186  s->flags & AVFMT_FLAG_BITEXACT);
187  if (ret)
188  return ret;
189 
190  /* The command line flac encoder defaults to placing a seekpoint
191  * every 10s. So one might add padding to allow that later
192  * but there seems to be no simple way to get the duration here.
193  * So just add the amount requested by the user. */
194  if (padding)
195  flac_write_block_padding(s->pb, padding, 1);
196 
197  return 0;
198 }
199 
200 static int flac_init(struct AVFormatContext *s)
201 {
202  AVCodecParameters *par;
203  FlacMuxerContext *c = s->priv_data;
204  int i;
205 
206  c->audio_stream_idx = -1;
207  for (i = 0; i < s->nb_streams; i++) {
208  AVStream *st = s->streams[i];
209  if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
210  if (c->audio_stream_idx >= 0 || st->codecpar->codec_id != AV_CODEC_ID_FLAC) {
211  av_log(s, AV_LOG_ERROR, "Invalid audio stream. Exactly one FLAC "
212  "audio stream is required.\n");
213  return AVERROR(EINVAL);
214  }
215  par = s->streams[i]->codecpar;
216  c->audio_stream_idx = i;
217  } else if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
219  av_log(s, AV_LOG_WARNING, "Video stream #%d is not an attached picture. Ignoring\n", i);
220  continue;
221  } else if (st->codecpar->codec_id == AV_CODEC_ID_GIF) {
222  av_log(s, AV_LOG_ERROR, "GIF image support is not implemented.\n");
223  return AVERROR_PATCHWELCOME;
224  } else if (!c->write_header) {
225  av_log(s, AV_LOG_ERROR, "Can't write attached pictures without a header.\n");
226  return AVERROR(EINVAL);
227  }
228  c->waiting_pics++;
229  } else {
230  av_log(s, AV_LOG_ERROR, "Only audio streams and pictures are allowed in FLAC.\n");
231  return AVERROR(EINVAL);
232  }
233  }
234  if (c->audio_stream_idx < 0) {
235  av_log(s, AV_LOG_ERROR, "No audio stream present.\n");
236  return AVERROR(EINVAL);
237  }
238 
239  /* add the channel layout tag */
240  if (par->channel_layout &&
241  !(par->channel_layout & ~0x3ffffULL) &&
243  AVDictionaryEntry *chmask = av_dict_get(s->metadata, "WAVEFORMATEXTENSIBLE_CHANNEL_MASK",
244  NULL, 0);
245 
246  if (chmask) {
247  av_log(s, AV_LOG_WARNING, "A WAVEFORMATEXTENSIBLE_CHANNEL_MASK is "
248  "already present, this muxer will not overwrite it.\n");
249  } else {
250  uint8_t buf[32];
251  snprintf(buf, sizeof(buf), "0x%"PRIx64, par->channel_layout);
252  av_dict_set(&s->metadata, "WAVEFORMATEXTENSIBLE_CHANNEL_MASK", buf, 0);
253  }
254  }
255 
256  return 0;
257 }
258 
260 {
261  FlacMuxerContext *c = s->priv_data;
262  AVCodecParameters *par = s->streams[c->audio_stream_idx]->codecpar;
263  int ret;
264 
265  if (!c->write_header)
266  return 0;
267 
268  ret = ff_flac_write_header(s->pb, par->extradata,
269  par->extradata_size, 0);
270  if (ret < 0)
271  return ret;
272 
273  if (!c->waiting_pics)
274  ret = flac_finish_header(s);
275 
276  return ret;
277 }
278 
280 {
281  FlacMuxerContext *c = s->priv_data;
282  uint8_t *streaminfo;
283  buffer_size_t streaminfo_size;
284 
285  /* check for updated streaminfo */
287  &streaminfo_size);
288  if (streaminfo && streaminfo_size == FLAC_STREAMINFO_SIZE) {
289  memcpy(c->streaminfo, streaminfo, FLAC_STREAMINFO_SIZE);
290  c->updated_streaminfo = 1;
291  }
292 
293  if (pkt->size)
294  avio_write(s->pb, pkt->data, pkt->size);
295  return 0;
296 }
297 
299 {
300  FlacMuxerContext *c = s->priv_data;
301  AVPacket pkt;
302  int ret, write = 1;
303 
304  ret = flac_finish_header(s);
305  if (ret < 0)
306  write = 0;
307 
308  while (c->queue) {
309  avpriv_packet_list_get(&c->queue, &c->queue_end, &pkt);
310  if (write && (ret = flac_write_audio_packet(s, &pkt)) < 0)
311  write = 0;
313  }
314  return ret;
315 }
316 
318 {
319  AVIOContext *pb = s->pb;
320  int64_t file_size;
321  FlacMuxerContext *c = s->priv_data;
322 
323  if (c->waiting_pics) {
324  av_log(s, AV_LOG_WARNING, "No packets were sent for some of the "
325  "attached pictures.\n");
327  }
328 
329  if (!c->write_header || !c->updated_streaminfo)
330  return 0;
331 
332  if (pb->seekable & AVIO_SEEKABLE_NORMAL) {
333  /* rewrite the STREAMINFO header block data */
334  file_size = avio_tell(pb);
335  avio_seek(pb, 8, SEEK_SET);
336  avio_write(pb, c->streaminfo, FLAC_STREAMINFO_SIZE);
337  avio_seek(pb, file_size, SEEK_SET);
338  } else {
339  av_log(s, AV_LOG_WARNING, "unable to rewrite FLAC header.\n");
340  }
341 
342  return 0;
343 }
344 
345 static void flac_deinit(struct AVFormatContext *s)
346 {
347  FlacMuxerContext *c = s->priv_data;
348 
349  avpriv_packet_list_free(&c->queue, &c->queue_end);
350  for (unsigned i = 0; i < s->nb_streams; i++)
351  av_packet_free((AVPacket **)&s->streams[i]->priv_data);
352 }
353 
355 {
356  FlacMuxerContext *c = s->priv_data;
357  int ret;
358 
359  if (pkt->stream_index == c->audio_stream_idx) {
360  if (c->waiting_pics) {
361  /* buffer audio packets until we get all the pictures */
362  ret = avpriv_packet_list_put(&c->queue, &c->queue_end, pkt, av_packet_ref, 0);
363  if (ret < 0) {
364  av_log(s, AV_LOG_ERROR, "Out of memory in packet queue; skipping attached pictures\n");
365  c->waiting_pics = 0;
366  ret = flac_queue_flush(s);
367  if (ret < 0)
368  return ret;
369  return flac_write_audio_packet(s, pkt);
370  }
371  } else
372  return flac_write_audio_packet(s, pkt);
373  } else {
374  AVStream *st = s->streams[pkt->stream_index];
375 
376  if (!c->waiting_pics ||
378  return 0;
379 
380  /* warn only once for each stream */
381  if (st->nb_frames == 1) {
382  av_log(s, AV_LOG_WARNING, "Got more than one picture in stream %d,"
383  " ignoring.\n", pkt->stream_index);
384  }
385  if (st->nb_frames >= 1)
386  return 0;
387 
389  if (!st->priv_data)
390  av_log(s, AV_LOG_ERROR, "Out of memory queueing an attached picture; skipping\n");
391  c->waiting_pics--;
392 
393  /* flush the buffered audio packets */
394  if (!c->waiting_pics &&
395  (ret = flac_queue_flush(s)) < 0)
396  return ret;
397  }
398 
399  return 0;
400 }
401 
402 static const AVOption flacenc_options[] = {
403  { "write_header", "Write the file header", offsetof(FlacMuxerContext, write_header), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM },
404  { NULL },
405 };
406 
407 static const AVClass flac_muxer_class = {
408  .class_name = "flac muxer",
409  .item_name = av_default_item_name,
410  .option = flacenc_options,
411  .version = LIBAVUTIL_VERSION_INT,
412 };
413 
415  .name = "flac",
416  .long_name = NULL_IF_CONFIG_SMALL("raw FLAC"),
417  .priv_data_size = sizeof(FlacMuxerContext),
418  .mime_type = "audio/x-flac",
419  .extensions = "flac",
420  .audio_codec = AV_CODEC_ID_FLAC,
421  .video_codec = AV_CODEC_ID_PNG,
422  .init = flac_init,
426  .deinit = flac_deinit,
428  .priv_class = &flac_muxer_class,
429 };
uint8_t
#define AV_EF_EXPLODE
abort decoding on minor error detection
Definition: avcodec.h:1660
Main libavformat public API header.
#define AVFMT_FLAG_BITEXACT
When muxing, try to avoid writing any random/volatile data to the output.
Definition: avformat.h:1380
#define AV_DISPOSITION_ATTACHED_PIC
The stream is stored in the file as an attached picture/"cover art" (e.g.
Definition: avformat.h:841
#define AVFMT_NOTIMESTAMPS
Format does not need / have any timestamps.
Definition: avformat.h:462
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
Definition: aviobuf.c:253
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
Definition: avio.h:40
void avio_w8(AVIOContext *s, int b)
Definition: aviobuf.c:203
void avio_wb32(AVIOContext *s, unsigned int val)
Definition: aviobuf.c:383
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
Definition: avio.h:557
void avio_wb24(AVIOContext *s, unsigned int val)
Definition: aviobuf.c:473
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
Definition: aviobuf.c:225
void ffio_fill(AVIOContext *s, int b, int count)
Definition: aviobuf.c:211
void avpriv_packet_list_free(PacketList **pkt_buf, PacketList **pkt_buf_end)
Wipe the list and unref all the packets in it.
Definition: avpacket.c:806
int avpriv_packet_list_get(PacketList **pkt_buffer, PacketList **pkt_buffer_end, AVPacket *pkt)
Remove the oldest AVPacket in the list and return it.
Definition: avpacket.c:790
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.
Definition: avpacket.c:753
uint8_t * av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, buffer_size_t *size)
Definition: avpacket.c:368
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:31
#define flags(name, subs,...)
Definition: cbs_av1.c:572
#define s(width, name)
Definition: cbs_vp9.c:257
audio channel layout utility functions
#define av_clip_uintp2
Definition: common.h:146
#define NULL
Definition: coverity.c:32
long long int64_t
Definition: coverity.c:34
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
Definition: ffmpeg.c:730
static void write_header(FFV1Context *f)
Definition: ffv1enc.c:346
FLAC (Free Lossless Audio Codec) decoder/demuxer common functions.
#define FLAC_STREAMINFO_SIZE
Definition: flac.h:34
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)
@ AV_OPT_TYPE_BOOL
Definition: opt.h:242
@ AV_CODEC_ID_PNG
Definition: codec_id.h:110
@ AV_CODEC_ID_GIF
Definition: codec_id.h:146
@ AV_CODEC_ID_NONE
Definition: codec_id.h:47
@ AV_CODEC_ID_FLAC
Definition: codec_id.h:436
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
Definition: avpacket.c:75
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
Definition: avpacket.c:634
AVPacket * av_packet_clone(const AVPacket *src)
Create a new packet that references the same data as src.
Definition: avpacket.c:677
int av_packet_ref(AVPacket *dst, const AVPacket *src)
Setup a new reference to the data described by a given packet.
Definition: avpacket.c:641
@ 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...
Definition: packet.h:55
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
Definition: dict.c:70
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
Definition: dict.c:40
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Definition: error.h:62
#define AVERROR(e)
Definition: error.h:43
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:200
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:194
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
Definition: avstring.c:215
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
cl_device_type type
const char *const ff_id3v2_picture_types[21]
Definition: id3v2.c:107
const CodecMime ff_id3v2_mime_tags[]
Definition: id3v2.c:131
int i
Definition: input.c:407
static int flac_init(struct AVFormatContext *s)
Definition: flacenc.c:200
static int flac_write_audio_packet(struct AVFormatContext *s, AVPacket *pkt)
Definition: flacenc.c:279
static int flac_finish_header(struct AVFormatContext *s)
Definition: flacenc.c:165
static const AVOption flacenc_options[]
Definition: flacenc.c:402
static int flac_write_packet(struct AVFormatContext *s, AVPacket *pkt)
Definition: flacenc.c:354
static void flac_deinit(struct AVFormatContext *s)
Definition: flacenc.c:345
static int flac_write_picture(struct AVFormatContext *s, AVPacket *pkt)
Definition: flacenc.c:79
static int flac_write_block_padding(AVIOContext *pb, unsigned int n_padding_bytes, int last_block)
Definition: flacenc.c:51
static int flac_queue_flush(AVFormatContext *s)
Definition: flacenc.c:298
static int flac_write_block_comment(AVIOContext *pb, AVDictionary **m, int last_block, int bitexact)
Definition: flacenc.c:60
static int flac_write_trailer(struct AVFormatContext *s)
Definition: flacenc.c:317
static const AVClass flac_muxer_class
Definition: flacenc.c:407
static int flac_write_header(struct AVFormatContext *s)
Definition: flacenc.c:259
AVOutputFormat ff_flac_muxer
Definition: flacenc.c:414
void ff_metadata_conv(AVDictionary **pm, const AVMetadataConv *d_conv, const AVMetadataConv *s_conv)
Definition: metadata.c:26
#define LIBAVFORMAT_IDENT
Definition: version.h:46
common internal API header
int buffer_size_t
Definition: internal.h:306
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
const char * desc
Definition: libsvtav1.c:79
AVOptions.
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
Definition: opt.h:278
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel used by the pixel format described by pixdesc.
Definition: pixdesc.c:2525
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2573
#define FF_ARRAY_ELEMS(a)
#define snprintf
Definition: snprintf.h:34
Describe the class of an AVClass context structure.
Definition: log.h:67
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
Definition: log.h:72
This struct describes the properties of an encoded stream.
Definition: codec_par.h:52
int extradata_size
Size of the extradata content in bytes.
Definition: codec_par.h:78
uint64_t channel_layout
Audio only.
Definition: codec_par.h:162
int width
Video only.
Definition: codec_par.h:126
enum AVMediaType codec_type
General type of the encoded data.
Definition: codec_par.h:56
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
Definition: codec_par.h:74
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
Definition: codec_par.h:60
char * value
Definition: dict.h:83
Format I/O context.
Definition: avformat.h:1232
Bytestream IO Context.
Definition: avio.h:161
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
Definition: avio.h:260
AVOption.
Definition: opt.h:248
const char * name
Definition: avformat.h:491
This structure stores compressed data.
Definition: packet.h:346
int stream_index
Definition: packet.h:371
int size
Definition: packet.h:370
uint8_t * data
Definition: packet.h:369
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:81
Stream structure.
Definition: avformat.h:873
AVCodecParameters * codecpar
Codec parameters associated with this stream.
Definition: avformat.h:1038
int64_t nb_frames
number of frames in this stream if known or 0
Definition: avformat.h:924
AVDictionary * metadata
Definition: avformat.h:937
void * priv_data
Definition: avformat.h:888
int index
stream index in AVFormatContext
Definition: avformat.h:874
int disposition
AV_DISPOSITION_* bit field.
Definition: avformat.h:926
char str[32]
Definition: internal.h:48
enum AVCodecID id
Definition: internal.h:49
int write_header
Definition: flacenc.c:37
int updated_streaminfo
Definition: flacenc.c:46
uint8_t streaminfo[FLAC_STREAMINFO_SIZE]
Definition: flacenc.c:45
PacketList * queue_end
Definition: flacenc.c:42
unsigned attached_types
Definition: flacenc.c:48
PacketList * queue
Definition: flacenc.c:42
int audio_stream_idx
Definition: flacenc.c:39
int waiting_pics
Definition: flacenc.c:40
#define av_log(a,...)
AVPacket * pkt
Definition: movenc.c:59
static int write_trailer(AVFormatContext *s1)
Definition: v4l2enc.c:98
int len
int ff_vorbiscomment_write(AVIOContext *pb, const AVDictionary *m, const char *vendor_string, AVChapter **chapters, unsigned int nb_chapters)
Write a VorbisComment into an AVIOContext.
Definition: vorbiscomment.c:65
const AVMetadataConv ff_vorbiscomment_metadata_conv[]
VorbisComment metadata conversion mapping.
Definition: vorbiscomment.c:33
int64_t ff_vorbiscomment_length(const AVDictionary *m, const char *vendor_string, AVChapter **chapters, unsigned int nb_chapters)
Calculate the length in bytes of a VorbisComment.
Definition: vorbiscomment.c:41
static double c[64]