Go to the documentation of this file.
44 int i, cnum,
h, m,
s, ms, keylen = strlen(
key);
51 if (sscanf(
val,
"%02d:%02d:%02d.%03d", &
h, &m, &
s, &ms) < 4)
55 ms + 1000 * (
s + 60 * (m + 60 *
h)),
74 const uint8_t *buf,
int size)
91 const uint8_t *buf, uint32_t
size,
92 int *updates,
int parse_picture)
94 char *t = (
char*)buf, *v = memchr(t,
'=',
size);
119 if (!
av_strcasecmp(t,
"METADATA_BLOCK_PICTURE") && parse_picture) {
149 const uint8_t *buf,
int size,
152 const uint8_t *p = buf;
153 const uint8_t *end = buf +
size;
162 s = bytestream_get_le32(&p);
164 if (end - p - 4 <
s ||
s < 0)
169 n = bytestream_get_le32(&p);
171 while (end - p >= 4 && n > 0) {
172 s = bytestream_get_le32(&p);
174 if (end - p <
s ||
s < 0)
189 "truncated comment header, %i comments not found\n", n);
228 buf_len =
len +
len / 255 + 64;
236 memset(*buf,
'\0', buf_len);
242 for (
i = 0;
i < 3;
i++) {
254 struct ogg *
ogg =
s->priv_data;
260 for (
i = 0;
i < 3;
i++)
267 struct ogg *
ogg =
s->priv_data;
297 struct ogg *
ogg =
s->priv_data;
314 if (os->
psize < 1 || pkt_type > 5)
317 if (priv->
packet[pkt_type >> 1])
319 if (pkt_type > 1 && !priv->
packet[0] || pkt_type > 3 && !priv->
packet[1])
322 priv->
len[pkt_type >> 1] = os->
psize;
324 if (!priv->
packet[pkt_type >> 1])
327 const uint8_t *p = os->
buf + os->
pstart + 7;
328 unsigned blocksize, bs0, bs1;
335 if (bytestream_get_le32(&p) != 0)
345 srate = bytestream_get_le32(&p);
350 blocksize = bytestream_get_byte(&p);
351 bs0 = blocksize & 15;
352 bs1 = blocksize >> 4;
356 if (bs0 < 6 || bs1 > 13)
359 if (bytestream_get_byte(&p) != 1)
379 if (new_len >= 16 && new_len < os->psize) {
381 priv->
packet[1][new_len - 1] = 1;
382 priv->
len[1] = new_len;
411 struct ogg *
ogg =
s->priv_data;
425 uint8_t *last_pkt = os->
buf + os->
pstart;
426 uint8_t *next_pkt = last_pkt;
440 last_pkt = next_pkt = next_pkt + os->
psize;
441 for (; seg < os->
nsegs; seg++) {
452 last_pkt = next_pkt + os->
segments[seg];
465 s->streams[idx]->duration -=
s->streams[idx]->start_time;
506 .
magic =
"\001vorbis",
AVChapter * avpriv_new_chapter(AVFormatContext *s, int64_t id, AVRational time_base, int64_t start, int64_t end, const char *title)
Add a new chapter.
#define AV_LOG_WARNING
Something somehow does not look correct.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
void av_vorbis_parse_free(AVVorbisParseContext **s)
Free the parser and everything associated with it.
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.
unsigned int nb_chapters
Number of chapters in AVChapter array.
int ff_replaygain_export(AVStream *st, AVDictionary *metadata)
Parse replaygain tags and export them as per-stream side data.
int av_vorbis_parse_frame_flags(AVVorbisParseContext *s, const uint8_t *buf, int buf_size, int *flags)
Get the duration for a Vorbis packet.
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
int ff_vorbis_stream_comment(AVFormatContext *as, AVStream *st, const uint8_t *buf, int size)
Parse Vorbis comments and add metadata to an AVStream.
#define AV_DICT_APPEND
If the entry already exists, append to it.
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
int nb_channels
Number of channels in this layout.
static int ogm_chapter(AVFormatContext *as, const uint8_t *key, const uint8_t *val)
void * av_memdup(const void *p, size_t size)
Duplicate a buffer with av_malloc().
#define AV_BASE64_DECODE_SIZE(x)
Calculate the output size in bytes needed to decode a base64 string with length x to a data buffer.
static double val(void *priv, double ch)
int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m, const uint8_t *buf, int size, int parse_picture)
Parse Vorbis comments.
static int vorbis_parse_single_comment(AVFormatContext *as, AVDictionary **m, const uint8_t *buf, uint32_t size, int *updates, int parse_picture)
This function temporarily modifies the (const qualified) input buffer and reverts its changes before ...
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define AV_PKT_FLAG_CORRUPT
The packet content is corrupted.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
#define VORBIS_FLAG_COMMENT
const struct ogg_codec ff_vorbis_codec
unsigned char * packet[3]
AVCodecParameters * codecpar
Codec parameters associated with this stream.
#define PTRDIFF_SPECIFIER
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Rational number (pair of numerator and denominator).
int av_base64_decode(uint8_t *out, const char *in_str, int out_size)
Decode a base64-encoded string.
AVChannelLayout ch_layout
Audio only.
struct ogg_stream * streams
int sample_rate
Audio only.
int ff_flac_parse_picture(AVFormatContext *s, uint8_t **bufp, int buf_size, int truncate_workaround)
Parse a FLAC METADATA_BLOCK_PICTURE.
int extradata_size
Size of the extradata content in bytes.
static void vorbis_cleanup(AVFormatContext *s, int idx)
int av_strncasecmp(const char *a, const char *b, size_t n)
Locale-independent case-insensitive compare.
int av_reallocp(void *ptr, size_t size)
Allocate, reallocate, or free a block of memory through a pointer to a pointer.
#define AV_NOPTS_VALUE
Undefined timestamp value.
int event_flags
Flags indicating events happening on the stream, a combination of AVSTREAM_EVENT_FLAG_*.
unsigned int av_xiphlacing(unsigned char *s, unsigned int v)
Encode extradata length to a buffer.
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 offset
uint8_t * av_packet_pack_dictionary(AVDictionary *dict, size_t *size)
Pack a dictionary for use in side_data.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
#define AV_LOG_INFO
Standard information.
static int vorbis_update_metadata(AVFormatContext *s, int idx)
#define i(width, name, range_min, range_max)
int64_t id
unique ID to identify the chapter
static int vorbis_header(AVFormatContext *s, int idx)
static int vorbis_packet(AVFormatContext *s, int idx)
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
AVVorbisParseContext * vp
AVVorbisParseContext * av_vorbis_parse_init(const uint8_t *extradata, int extradata_size)
Allocate and initialize the Vorbis parser using headers in the extradata.
#define AV_INPUT_BUFFER_PADDING_SIZE
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
void av_vorbis_parse_reset(AVVorbisParseContext *s)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
Copyright (C) 2005 Michael Ahlberg, Måns Rullgård.
#define flags(name, subs,...)
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int end_trimming
set the number of packets to drop from the end
static void BS_FUNC() skip(BSCTX *bc, unsigned int n)
Skip n bits in the buffer.
void * av_realloc(void *ptr, size_t size)
Allocate, reallocate, or free a block of memory.
static int fixup_vorbis_headers(AVFormatContext *as, struct oggvorbis_private *priv, uint8_t **buf)