669 if (
avio_seek(pb, last_pos + 1, SEEK_SET) < 0)
718 int max_size, uint64_t *number)
731 "Read error at pos. %"PRIu64
" (0x%"PRIx64
")\n",
740 if (read > max_size) {
743 "Invalid EBML number size tag 0x%02x at pos %"PRIu64
" (0x%"PRIx64
")\n",
751 total = (total << 8) |
avio_r8(pb);
767 if (res > 0 && *number + 1 == 1ULL << (7 * res))
768 *number = 0xffffffffffffffULL;
786 *num = (*num << 8) |
avio_r8(pb);
809 *num = (*num << 8) |
avio_r8(pb);
926 *num = unum - ((1LL << (7 * res - 1)) - 1);
935 uint32_t
id,
void *
data)
938 for (i = 0; syntax[i].
id; i++)
939 if (
id == syntax[i].
id)
972 for (i = 0; syntax[i].
id; i++)
973 switch (syntax[i].
type) {
975 *(uint64_t *) ((
char *) data + syntax[i].
data_offset) = syntax[i].def.
u;
978 *(
double *) ((
char *) data + syntax[i].data_offset) = syntax[i].
def.
f;
983 if (syntax[i].def.
s) {
1048 uint32_t
id = syntax->
id;
1060 list->
elem = newelem;
1070 if (max_lengths[syntax->
type] && length > max_lengths[syntax->
type]) {
1072 "Invalid length 0x%"PRIx64
" > 0x%"PRIx64
" for syntax element %i\n",
1073 length, max_lengths[syntax->
type], syntax->
type);
1078 switch (syntax->
type) {
1129 for (i = 0; syntax[i].
id; i++) {
1130 void *data_off = (
char *) data + syntax[i].data_offset;
1131 switch (syntax[i].
type) {
1141 if (syntax[i].list_elem_size) {
1143 char *ptr = list->
elem;
1144 for (j = 0; j < list->
nb_elem;
1162 int len_mask = 0x80,
size = 1,
n = 1, i;
1170 while (
size <= 8 && !(total & len_mask)) {
1176 total &= (len_mask - 1);
1178 total = (total << 8) | p->
buf[4 +
n++];
1190 if (total < probelen)
1192 for (
n = 4 +
size;
n <= 4 +
size + total - probelen;
n++)
1208 if (tracks[i].num == num)
1220 int isize = *buf_size;
1223 int pkt_size = isize;
1227 if (pkt_size >= 10000000
U)
1230 switch (encodings[0].compression.algo) {
1236 if (header_size && !header) {
1244 pkt_size = isize + header_size;
1249 memcpy(pkt_data, header, header_size);
1250 memcpy(pkt_data + header_size, data, isize);
1256 olen = pkt_size *= 3;
1262 pkt_data = newpktdata;
1275 z_stream zstream = { 0 };
1276 if (inflateInit(&zstream) != Z_OK)
1278 zstream.next_in =
data;
1279 zstream.avail_in = isize;
1284 inflateEnd(&zstream);
1288 pkt_data = newpktdata;
1289 zstream.avail_out = pkt_size - zstream.total_out;
1290 zstream.next_out = pkt_data + zstream.total_out;
1291 result = inflate(&zstream, Z_NO_FLUSH);
1292 }
while (result == Z_OK && pkt_size < 10000000);
1293 pkt_size = zstream.total_out;
1294 inflateEnd(&zstream);
1295 if (result != Z_STREAM_END) {
1296 if (result == Z_MEM_ERROR)
1308 bz_stream bzstream = { 0 };
1309 if (BZ2_bzDecompressInit(&bzstream, 0, 0) != BZ_OK)
1311 bzstream.next_in =
data;
1312 bzstream.avail_in = isize;
1317 BZ2_bzDecompressEnd(&bzstream);
1321 pkt_data = newpktdata;
1322 bzstream.avail_out = pkt_size - bzstream.total_out_lo32;
1323 bzstream.next_out = pkt_data + bzstream.total_out_lo32;
1324 result = BZ2_bzDecompress(&bzstream);
1325 }
while (result == BZ_OK && pkt_size < 10000000);
1326 pkt_size = bzstream.total_out_lo32;
1327 BZ2_bzDecompressEnd(&bzstream);
1328 if (result != BZ_STREAM_END) {
1329 if (result == BZ_MEM_ERROR)
1343 *buf_size = pkt_size;
1358 for (i = 0; i < list->
nb_elem; i++) {
1359 const char *lang = tags[i].
lang &&
1360 strcmp(tags[i].lang,
"und") ? tags[i].
lang :
NULL;
1362 if (!tags[i].
name) {
1367 snprintf(key,
sizeof(key),
"%s/%s", prefix, tags[i].name);
1370 if (tags[i].def || !lang) {
1372 if (tags[i].sub.nb_elem)
1379 if (tags[i].sub.nb_elem)
1393 if (tags[i].target.attachuid) {
1396 if (attachment[j].
uid == tags[i].target.attachuid &&
1399 &attachment[j].stream->metadata,
NULL);
1400 }
else if (tags[i].target.chapteruid) {
1403 if (chapter[j].
uid == tags[i].target.chapteruid &&
1406 &chapter[j].chapter->metadata,
NULL);
1407 }
else if (tags[i].target.trackuid) {
1410 if (track[j].
uid == tags[i].target.trackuid && track[j].
stream)
1412 &track[j].stream->metadata,
NULL);
1423 uint32_t level_up = matroska->
level_up;
1437 "Max EBML element depth (%d) reached, "
1442 level.
length = (uint64_t) -1;
1447 ret =
ebml_parse(matroska, matroska_segment, matroska);
1452 if (length == (uint64_t) -1)
1474 for (i = 0; i < seekhead_list->
nb_elem; i++) {
1476 uint32_t
id = seekheads[i].
id;
1477 uint64_t pos = seekheads[i].
pos;
1480 if (!elem || elem->
parsed)
1503 uint64_t index_scale = 1;
1509 index_list = &matroska->
index;
1510 index = index_list->
elem;
1516 for (i = 0; i < index_list->
nb_elem; i++) {
1519 for (j = 0; j < pos_list->
nb_elem; j++) {
1522 if (track && track->stream)
1525 index[i].
time / index_scale, 0, 0,
1552 static const char *
const aac_profiles[] = {
"MAIN",
"LC",
"SSR" };
1555 for (profile = 0; profile <
FF_ARRAY_ELEMS(aac_profiles); profile++)
1556 if (strstr(codec_id, aac_profiles[profile]))
1575 time_t creation_time = date_utc / 1000000000 + 978307200;
1576 struct tm tmpbuf, *ptm =
gmtime_r(&creation_time, &tmpbuf);
1578 if (strftime(buffer,
sizeof(buffer),
"%Y-%m-%d %H:%M:%S", ptm))
1579 av_dict_set(metadata,
"creation_time", buffer, 0);
1603 int block_last, block_type, block_size;
1609 if (block_size > size)
1618 chmask =
av_dict_get(dict,
"WAVEFORMATEXTENSIBLE_CHANNEL_MASK",
NULL, 0);
1621 if (!mask || mask & ~0x3ffffULL) {
1623 "Invalid value of WAVEFORMATEXTENSIBLE_CHANNEL_MASK\n");
1651 int extradata_size = 0;
1652 int extradata_offset = 0;
1653 uint32_t fourcc = 0;
1655 char* key_id_base64 =
NULL;
1664 "Unknown or unsupported track type %"PRIu64
"\n",
1684 if (encodings_list->
nb_elem > 1) {
1686 "Multiple combined encodings not supported");
1687 }
else if (encodings_list->
nb_elem == 1) {
1688 if (encodings[0].
type) {
1689 if (encodings[0].encryption.key_id.size > 0) {
1692 const int b64_size =
AV_BASE64_SIZE(encodings[0].encryption.key_id.size);
1694 if (key_id_base64 ==
NULL)
1698 encodings[0].encryption.key_id.data,
1701 encodings[0].
scope = 0;
1703 "Unsupported encoding type");
1716 encodings[0].
scope = 0;
1718 "Unsupported encoding type");
1728 "Failed to decode codec private data\n");
1750 if (key_id_base64) {
1756 if (!strcmp(track->
codec_id,
"V_MS/VFW/FOURCC") &&
1767 extradata_offset = 40;
1768 }
else if (!strcmp(track->
codec_id,
"A_MS/ACM") &&
1780 }
else if (!strcmp(track->
codec_id,
"A_QUICKTIME")
1789 }
else if (!strcmp(track->
codec_id,
"V_QUICKTIME") &&
1804 "mov FourCC not found %s.\n", buf);
1839 extradata[0] = (profile << 3) | ((sri & 0x0E) >> 1);
1840 extradata[1] = ((sri & 0x01) << 7) | (track->
audio.
channels << 3);
1841 if (strstr(track->
codec_id,
"SBR")) {
1843 extradata[2] = 0x56;
1844 extradata[3] = 0xE5;
1845 extradata[4] = 0x80 | (sri << 3);
1858 AV_WB32(extradata, extradata_size);
1859 memcpy(&extradata[4],
"alac", 4);
1864 extradata_size = 30;
1884 extradata_offset = 26;
1920 static const int sipr_bit_rate[4] = { 6504, 8496, 5000, 16000 };
1925 extradata_offset = 78;
1938 "Unknown/unsupported AVCodecID %s.\n", track->
codec_id);
1943 1000 * 1000 * 1000);
1952 if (strcmp(track->language,
"und"))
1956 if (track->flag_default)
1958 if (track->flag_forced)
1965 }
else if (track->codec_priv.data && track->codec_priv.size > 0) {
1969 track->codec_priv.data + extradata_offset,
1970 track->codec_priv.size);
1986 st->
codec->
width * track->video.display_height,
1991 if (track->default_duration) {
1993 1000000000, track->default_duration, 30000);
1994 #if FF_API_R_FRAME_RATE
2006 if (track->video.alpha_mode)
2010 for (j=0; j < track->operation.combine_planes.nb_elem; j++) {
2014 snprintf(buf,
sizeof(buf),
"%s_%d",
2017 if (planes[j].
uid == tracks[k].
uid && tracks[k].stream) {
2019 "stereo_mode", buf, 0);
2025 track->video.stereo_mode != 10 && track->video.stereo_mode != 12) {
2038 if (track->codec_delay > 0) {
2043 if (track->seek_preroll > 0) {
2052 if (!strcmp(track->codec_id,
"D_WEBVTT/CAPTIONS")) {
2054 }
else if (!strcmp(track->codec_id,
"D_WEBVTT/DESCRIPTIONS")) {
2056 }
else if (!strcmp(track->codec_id,
"D_WEBVTT/METADATA")) {
2062 matroska->contains_ssa = 1;
2076 uint64_t max_start = 0;
2091 ebml.
max_size >
sizeof(uint64_t) ||
2095 "EBML header using unsupported features\n"
2096 "(EBML version %"PRIu64
", doctype %s, doc version %"PRIu64
")\n",
2102 "EBML header using unsupported features\n"
2103 "(EBML version %"PRIu64
", doctype %s, doc version %"PRIu64
")\n",
2120 res =
ebml_parse(matroska, matroska_segments, matroska);
2127 res =
ebml_parse(matroska, matroska_segment, matroska);
2146 attachments = attachments_list->
elem;
2147 for (j = 0; j < attachments_list->
nb_elem; j++) {
2148 if (!(attachments[j].filename && attachments[j].mime &&
2149 attachments[j].bin.data && attachments[j].
bin.
size > 0)) {
2167 attachments[j].
stream = st;
2197 chapters = chapters_list->
elem;
2198 for (i = 0; i < chapters_list->
nb_elem; i++)
2200 (max_start == 0 || chapters[i].
start > max_start)) {
2204 chapters[i].
start, chapters[i].
end,
2206 if (chapters[i].chapter) {
2208 "title", chapters[i].
title, 0);
2210 max_start = chapters[i].
start;
2238 matroska->
packets = newpackets;
2268 int *buf_size,
int type,
2269 uint32_t **lace_buf,
int *laces)
2271 int res = 0,
n,
size = *buf_size;
2273 uint32_t *lace_size;
2281 *lace_buf[0] =
size;
2289 lace_size =
av_mallocz(*laces *
sizeof(
int));
2298 for (
n = 0; res == 0 &&
n < *laces - 1;
n++) {
2300 if (size <= total) {
2306 lace_size[
n] +=
temp;
2313 if (size <= total) {
2318 lace_size[
n] = size - total;
2323 if (size % (*laces)) {
2327 for (
n = 0;
n < *laces;
n++)
2328 lace_size[
n] = size / *laces;
2336 if (n < 0 || num > INT_MAX) {
2338 "EBML block data error\n");
2344 total = lace_size[0] = num;
2345 for (
n = 1; res == 0 &&
n < *laces - 1;
n++) {
2349 if (r < 0 || lace_size[
n - 1] + snum > (uint64_t)INT_MAX) {
2351 "EBML block data error\n");
2357 lace_size[
n] = lace_size[
n - 1] + snum;
2358 total += lace_size[
n];
2360 if (size <= total) {
2364 lace_size[*laces - 1] = size - total;
2370 *lace_buf = lace_size;
2393 if (size < cfs * h / 2) {
2395 "Corrupt int4 RM-style audio packet size\n");
2398 for (x = 0; x < h / 2; x++)
2399 memcpy(track->
audio.
buf + x * 2 * w + y * cfs,
2400 data + x * cfs, cfs);
2404 "Corrupt sipr RM-style audio packet size\n");
2407 memcpy(track->
audio.
buf + y * w, data, w);
2409 if (size < sps * w / sps || h<=0 || w%sps) {
2411 "Corrupt generic RM-style audio packet size\n");
2414 for (x = 0; x < w / sps; x++)
2416 sps * (h * x + ((h + 1) / 2) * (y & 1) + (y >> 1)),
2417 data + x * sps, sps);
2463 if (srclen < 12 || track->stream->codec->extradata_size < 2)
2472 while (srclen >= 8) {
2478 uint32_t crc =
AV_RL32(src + 4);
2482 multiblock = (flags & 0x1800) != 0x1800;
2494 if (blocksize > srclen) {
2499 tmp =
av_realloc(dst, dstlen + blocksize + 32);
2505 dstlen += blocksize + 32;
2508 AV_WL32(dst + offset + 4, blocksize + 24);
2509 AV_WL16(dst + offset + 8, ver);
2510 AV_WL16(dst + offset + 10, 0);
2511 AV_WL32(dst + offset + 12, 0);
2512 AV_WL32(dst + offset + 16, 0);
2513 AV_WL32(dst + offset + 20, samples);
2514 AV_WL32(dst + offset + 24, flags);
2515 AV_WL32(dst + offset + 28, crc);
2516 memcpy(dst + offset + 32, src, blocksize);
2519 srclen -= blocksize;
2520 offset += blocksize + 32;
2543 int id_len, settings_len, text_len;
2551 q = data + data_len;
2556 if (*p ==
'\r' || *p ==
'\n') {
2565 if (p >= q || *p !=
'\n')
2572 if (*p ==
'\r' || *p ==
'\n') {
2573 settings_len = p - settings;
2581 if (p >= q || *p !=
'\n')
2587 while (text_len > 0) {
2588 const int len = text_len - 1;
2590 if (c !=
'\r' && c !=
'\n')
2607 memcpy(pkt->
data, text, text_len);
2617 memcpy(buf,
id, id_len);
2620 if (settings_len > 0) {
2628 memcpy(buf, settings, settings_len);
2635 pkt->
pts = timecode;
2652 uint64_t timecode, uint64_t lace_duration,
2654 uint8_t *additional, uint64_t additional_id,
int additional_size,
2655 int64_t discard_padding)
2662 if (encodings && !encodings->
type && encodings->
scope & 1) {
2673 "Error parsing a wavpack block.\n");
2676 if (pkt_data != data)
2687 if (pkt_data != data)
2700 bytestream_put_be32(&buf, pkt_size);
2701 bytestream_put_be32(&buf,
MKBETAG(
'i',
'c',
'p',
'f'));
2704 memcpy(pkt->
data + offset, pkt_data, pkt_size);
2706 if (pkt_data != data)
2712 if (additional_size > 0) {
2715 additional_size + 8);
2721 AV_WB64(side_data, additional_id);
2722 memcpy(side_data + 8, additional, additional_size);
2725 if (discard_padding) {
2741 pkt->
dts = timecode;
2743 pkt->
pts = timecode;
2758 lace_duration <= INT_MAX) {
2775 if (pkt_data != data)
2781 int size, int64_t pos, uint64_t cluster_time,
2783 uint8_t *additional, uint64_t additional_id,
int additional_size,
2784 int64_t cluster_pos, int64_t discard_padding)
2791 uint32_t *lace_size =
NULL;
2794 int trust_default_duration = 1;
2804 if (!track || !track->
stream) {
2806 "Invalid stream %"PRIu64
" or size %u\n", num, size);
2808 }
else if (size <= 3)
2819 if (is_keyframe == -1)
2822 if (cluster_time != (uint64_t) -1 &&
2823 (block_time >= 0 || cluster_time >= -block_time)) {
2824 timecode = cluster_time + block_time - track->
codec_delay;
2826 timecode < track->end_timecode)
2835 if (timecode < matroska->skip_to_timecode)
2846 &lace_size, &laces);
2855 trust_default_duration = 0;
2859 if (!block_duration && trust_default_duration)
2862 if (cluster_time != (uint64_t)-1 && (block_time >= 0 || cluster_time >= -block_time))
2866 for (n = 0; n < laces; n++) {
2867 int64_t lace_duration = block_duration*(n+1) / laces - block_duration*n / laces;
2869 if (lace_size[n] > size) {
2888 timecode, lace_duration,
2894 timecode, lace_duration, pos,
2895 !n ? is_keyframe : 0,
2896 additional, additional_id, additional_size,
2903 timecode = lace_duration ? timecode + lace_duration :
AV_NOPTS_VALUE;
2904 data += lace_size[
n];
2905 size -= lace_size[
n];
2919 matroska_cluster_incremental_parsing,
2934 matroska_clusters_incremental,
2939 matroska_cluster_incremental_parsing,
2947 blocks = blocks_list->
elem;
2951 if (blocks[i].bin.size > 0 && blocks[i].
bin.
data) {
2955 if (!blocks[i].non_simple)
2985 res =
ebml_parse(matroska, matroska_clusters, &cluster);
2986 blocks_list = &cluster.
blocks;
2987 blocks = blocks_list->
elem;
2988 for (i = 0; i < blocks_list->
nb_elem; i++)
2989 if (blocks[i].bin.size > 0 && blocks[i].
bin.
data) {
2994 is_keyframe,
NULL, 0, 0, pos,
3017 int64_t timestamp,
int flags)
3022 int i,
index, index_sub, index_min;
3061 while (index_sub >= 0 &&
3063 tracks[i].stream->index_entries[index_sub].pos < st->
index_entries[index_min].
pos &&
3130 for (i = 1; i < nb_index_entries; i++) {
3131 if (index_entries[i - 1].timestamp * matroska->
time_scale <= ts &&
3139 if (i != nb_index_entries - 1) {
3155 int64_t cluster_pos, before_pos;
3160 if (index < 0)
return 0;
3164 int64_t cluster_id = 0, cluster_length = 0;
3170 if (cluster_id != 0xF43B675) {
3181 cluster_pos += cluster_length + 12;
3192 double min_buffer,
double*
buffer,
3196 double nano_seconds_per_second = 1000000000.0;
3197 double time_sec = time_ns / nano_seconds_per_second;
3199 int64_t time_to_search_ns = (int64_t)(search_sec * nano_seconds_per_second);
3200 int64_t end_time_ns = time_ns + time_to_search_ns;
3201 double sec_downloaded = 0.0;
3205 *sec_to_download = 0.0;
3209 int64_t cue_nano = desc_curr.
end_time_ns - time_ns;
3212 double timeToDownload = (cueBytes * 8.0) /
bps;
3214 sec_downloaded += (cue_nano / nano_seconds_per_second) - timeToDownload;
3215 *sec_to_download += timeToDownload;
3219 double desc_end_time_sec = desc_curr.
end_time_ns / nano_seconds_per_second;
3220 double percent_to_sub = search_sec / (desc_end_time_sec - time_sec);
3221 sec_downloaded = percent_to_sub * sec_downloaded;
3222 *sec_to_download = percent_to_sub * *sec_to_download;
3225 if ((sec_downloaded + *buffer) <= min_buffer) {
3236 double desc_sec = desc_ns / nano_seconds_per_second;
3237 double bits = (desc_bytes * 8.0);
3238 double time_to_download = bits /
bps;
3240 sec_downloaded += desc_sec - time_to_download;
3241 *sec_to_download += time_to_download;
3244 double desc_end_time_sec = desc_curr.
end_time_ns / nano_seconds_per_second;
3245 double percent_to_sub = search_sec / (desc_end_time_sec - time_sec);
3246 sec_downloaded = percent_to_sub * sec_downloaded;
3247 *sec_to_download = percent_to_sub * *sec_to_download;
3249 if ((sec_downloaded + *buffer) <= min_buffer)
3254 if ((sec_downloaded + *buffer) <= min_buffer) {
3261 *buffer = *buffer + sec_downloaded;
3276 double bandwidth = 0.0;
3280 int64_t prebuffer_ns = 1000000000;
3282 double nano_seconds_per_second = 1000000000.0;
3283 int64_t prebuffered_ns = time_ns + prebuffer_ns;
3284 double prebuffer_bytes = 0.0;
3285 int64_t temp_prebuffer_ns = prebuffer_ns;
3286 int64_t pre_bytes, pre_ns;
3287 double pre_sec, prebuffer, bits_per_second;
3305 bits_per_second = 0.0;
3311 pre_sec = pre_ns / nano_seconds_per_second;
3313 pre_bytes * ((temp_prebuffer_ns / nano_seconds_per_second) / pre_sec);
3315 prebuffer = prebuffer_ns / nano_seconds_per_second;
3318 bits_per_second = 0.0;
3322 double desc_sec = desc_ns / nano_seconds_per_second;
3323 double calc_bits_per_second = (desc_bytes * 8) / desc_sec;
3326 double percent = (desc_bytes - prebuffer_bytes) / desc_bytes;
3327 double mod_bits_per_second = calc_bits_per_second * percent;
3329 if (prebuffer < desc_sec) {
3335 int64_t
bps = (int64_t)(mod_bits_per_second) + 1;
3336 const double min_buffer = 0.0;
3337 double buffer = prebuffer;
3338 double sec_to_download = 0.0;
3341 min_buffer, &buffer, &sec_to_download,
3345 }
else if (rv == 0) {
3346 bits_per_second = (double)(bps);
3354 if (bandwidth < bits_per_second) bandwidth = bits_per_second;
3356 return (int64_t)bandwidth;
3365 int64_t cues_start = -1, cues_end = -1, before_pos, bandwidth;
3369 for (i = 0; i < seekhead_list->
nb_elem; i++)
3373 if (i >= seekhead_list->
nb_elem)
return -1;
3377 if (
avio_seek(matroska->
ctx->
pb, cues_start, SEEK_SET) == cues_start) {
3381 uint64_t cues_length = 0, cues_id = 0, bytes_read = 0;
3384 cues_end = cues_start + cues_length + bytes_read - 1;
3387 if (cues_start == -1 || cues_end == -1)
return -1;
3400 if (bandwidth < 0)
return -1;
3409 if (!buf)
return -1;
3412 snprintf(buf, (i + 1) * 20 *
sizeof(
char),
3415 strncat(buf,
",",
sizeof(
char));
3436 if (!buf)
return AVERROR(ENOMEM);
3462 #define OFFSET(x) offsetof(MatroskaDemuxContext, x)
3476 .
name =
"matroska,webm",
3478 .extensions =
"mkv,mk3d,mka,mks",
3485 .mime_type =
"audio/webm,audio/x-matroska,video/webm,video/x-matroska"
3489 .
name =
"webm_dash_manifest",
3495 .priv_class = &webm_dash_class,
#define MATROSKA_ID_SEEKPREROLL
#define MATROSKA_ID_BLOCKADDID
#define MATROSKA_ID_TRACKDEFAULTDURATION
void avio_wl16(AVIOContext *s, unsigned int val)
static int matroska_parse_rm_audio(MatroskaDemuxContext *matroska, MatroskaTrack *track, AVStream *st, uint8_t *data, int size, uint64_t timecode, int64_t pos)
#define MATROSKA_ID_VIDEOFLAGINTERLACED
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static const EbmlSyntax matroska_blockgroup[]
const char *const ff_matroska_video_stereo_plane[MATROSKA_VIDEO_STEREO_PLANE_COUNT]
static const EbmlSyntax matroska_simpletag[]
static void matroska_convert_tags(AVFormatContext *s)
#define MATROSKA_ID_DATEUTC
void av_free_packet(AVPacket *pkt)
Free a packet.
The optional first identifier line of a WebVTT cue.
static const EbmlSyntax matroska_tracks[]
#define MATROSKA_ID_TRACKFLAGLACING
static int webm_dash_manifest_read_packet(AVFormatContext *s, AVPacket *pkt)
#define MATROSKA_ID_TRACKENTRY
static int matroska_deliver_packet(MatroskaDemuxContext *matroska, AVPacket *pkt)
#define MATROSKA_ID_VIDEODISPLAYHEIGHT
AVInputFormat ff_matroska_demuxer
ptrdiff_t const GLvoid * data
static int is_keyframe(NalUnitType naltype)
int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp, int size, int distance, int flags)
Add an index entry into a sorted list.
static const EbmlSyntax matroska_info[]
#define MATROSKA_ID_CUETRACKPOSITION
#define MATROSKA_ID_CODECPRIVATE
const unsigned char ff_sipr_subpk_size[4]
#define MATROSKA_ID_TAGTARGETS_TYPE
#define AV_LOG_WARNING
Something somehow does not look correct.
static int ebml_level_end(MatroskaDemuxContext *matroska)
#define LIBAVUTIL_VERSION_INT
#define INITIALIZATION_RANGE
int64_t pos
byte position in stream, -1 if unknown
static int matroska_ebmlnum_sint(MatroskaDemuxContext *matroska, uint8_t *data, uint32_t size, int64_t *num)
static int webm_clusters_start_with_keyframe(AVFormatContext *s)
static const EbmlSyntax matroska_tagtargets[]
#define MATROSKA_ID_ENCODINGTYPE
#define MATROSKA_ID_AUDIOBITDEPTH
static const EbmlSyntax matroska_track_video[]
static av_always_inline float av_int2float(uint32_t i)
Reinterpret a 32-bit integer as a float.
#define MATROSKA_ID_TRACKFLAGDEFAULT
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
MatroskaCluster current_cluster
static int matroska_parse_frame(MatroskaDemuxContext *matroska, MatroskaTrack *track, AVStream *st, uint8_t *data, int pkt_size, uint64_t timecode, uint64_t lace_duration, int64_t pos, int is_keyframe, uint8_t *additional, uint64_t additional_id, int additional_size, int64_t discard_padding)
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
#define MATROSKA_ID_TAGTARGETS_ATTACHUID
int index
stream index in AVFormatContext
#define MATROSKA_ID_CLUSTERPOSITION
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define MATROSKA_ID_FILEDATA
AVIndexEntry * index_entries
Only used if the format does not support seeking natively.
#define EBML_ID_DOCTYPEREADVERSION
#define MATROSKA_ID_BLOCKREFERENCE
union EbmlSyntax::@157 def
#define MATROSKA_ID_TRACKTYPE
int current_cluster_num_blocks
#define MATROSKA_ID_TAGTARGETS_CHAPTERUID
void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size)
Same behaviour av_fast_malloc but the buffer has additional FF_INPUT_BUFFER_PADDING_SIZE at the end w...
#define MATROSKA_ID_VIDEOASPECTRATIO
static const EbmlSyntax matroska_track_encodings[]
#define MATROSKA_ID_MUXINGAPP
#define MATROSKA_ID_AUDIOCHANNELS
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag)
Put a string representing the codec tag codec_tag in buf.
#define FF_ARRAY_ELEMS(a)
int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size, int big_endian)
MatroskaLevel levels[EBML_MAX_DEPTH]
#define MATROSKA_ID_CUECLUSTERPOSITION
unsigned int avio_rb16(AVIOContext *s)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16
const struct EbmlSyntax * n
#define MATROSKA_ID_EDITIONFLAGDEFAULT
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
#define MATROSKA_ID_CLUSTERTIMECODE
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
#define MATROSKA_ID_ENCODINGENCALGO
#define MATROSKA_ID_CHAPTERTIMEEND
static const EbmlSyntax matroska_track_plane[]
#define MATROSKA_ID_TRACKCONTENTENCODINGS
#define AV_LZO_OUTPUT_FULL
decoded data did not fit into output buffer
#define MATROSKA_ID_FILEDESC
#define MATROSKA_ID_TRACKCONTENTENCODING
static const EbmlSyntax matroska_cluster[]
#define MATROSKA_ID_CODECDOWNLOADURL
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
static int webm_dash_manifest_read_header(AVFormatContext *s)
static int ebml_read_sint(AVIOContext *pb, int size, int64_t *num)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int ffio_limit(AVIOContext *s, int size)
static const EbmlSyntax matroska_chapters[]
static MatroskaLevel1Element * matroska_find_level1_elem(MatroskaDemuxContext *matroska, uint32_t id)
void avio_wl32(AVIOContext *s, unsigned int val)
static av_always_inline double av_int2double(uint64_t i)
Reinterpret a 64-bit integer as a double.
#define MATROSKA_ID_CHAPLANG
MatroskaTrackOperation operation
#define MATROSKA_ID_EDITIONFLAGORDERED
static CueDesc get_cue_desc(AVFormatContext *s, int64_t ts, int64_t cues_start)
#define MATROSKA_ID_TRACKLANGUAGE
MatroskaTrackCompression compression
static int webm_dash_manifest_cues(AVFormatContext *s)
const AVCodecTag ff_codec_movvideo_tags[]
unsigned int avio_rb32(AVIOContext *s)
int ff_mkv_stereo3d_conv(AVStream *st, MatroskaVideoStereoModeType stereo_mode)
static av_cold int end(AVCodecContext *avctx)
#define MATROSKA_ID_VIDEOPIXELCROPT
#define MATROSKA_ID_TIMECODESCALE
static int matroska_aac_sri(int samplerate)
enum AVStreamParseType need_parsing
#define MATROSKA_ID_SIMPLEBLOCK
#define MATROSKA_ID_TAGTARGETS_TYPEVALUE
#define MATROSKA_ID_EDITIONFLAGHIDDEN
#define AV_LZO_OUTPUT_PADDING
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
static const EbmlSyntax matroska_segment[]
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
#define MATROSKA_ID_CODECNAME
#define MATROSKA_ID_BLOCKMORE
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
AVStream ** streams
A list of all streams in the file.
#define MATROSKA_ID_CUERELATIVEPOSITION
#define MATROSKA_ID_AUDIOOUTSAMPLINGFREQ
static const EbmlSyntax matroska_segments[]
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 int matroska_parse_cluster_incremental(MatroskaDemuxContext *matroska)
#define MATROSKA_ID_VIDEODISPLAYWIDTH
#define MATROSKA_ID_EDITIONUID
int ff_vorbis_comment(AVFormatContext *ms, AVDictionary **m, const uint8_t *buf, int size, int parse_picture)
#define MATROSKA_ID_BLOCKADDITIONS
static const EbmlSyntax matroska_index[]
#define AVERROR_EOF
End of file.
#define MATROSKA_ID_CODECDECODEALL
#define MATROSKA_ID_ENCODINGENCRYPTION
static av_cold int read_close(AVFormatContext *ctx)
const uint8_t ff_log2_tab[256]
uint64_t avio_rb64(AVIOContext *s)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
static const uint8_t header[24]
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
#define MATROSKA_ID_TRACKNUMBER
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
#define MATROSKA_ID_SEGMENTUID
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
static int matroska_parse_seekhead_entry(MatroskaDemuxContext *matroska, uint64_t pos)
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
static int matroska_parse_cluster(MatroskaDemuxContext *matroska)
static int ebml_parse_nest(MatroskaDemuxContext *matroska, EbmlSyntax *syntax, void *data)
#define MATROSKA_ID_CUEBLOCKNUMBER
#define MATROSKA_ID_TRACKUID
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
#define MATROSKA_ID_ENCODINGORDER
#define MATROSKA_ID_VIDEOSTEREOMODE
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
AVCodecID
Identify the syntax and semantics of the bitstream.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVDictionary * metadata
Metadata that applies to the whole file.
#define MATROSKA_ID_BLOCKDURATION
#define EBML_ID_EBMLREADVERSION
int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags)
Get the index for a specific timestamp.
static const uint16_t mask[17]
#define AV_EF_EXPLODE
abort decoding on minor error detection
FLAC (Free Lossless Audio Codec) decoder/demuxer common functions.
static int ebml_read_length(MatroskaDemuxContext *matroska, AVIOContext *pb, uint64_t *number)
Read a EBML length value.
int64_t timestamp
Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are...
#define MATROSKA_ID_CLUSTER
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define MATROSKA_ID_FILEMIMETYPE
static const EbmlSyntax matroska_track_encoding[]
static int matroska_ebmlnum_uint(MatroskaDemuxContext *matroska, uint8_t *data, uint32_t size, uint64_t *num)
int64_t convergence_duration
Time difference in AVStream->time_base units from the pts of this packet to the point at which the ou...
#define MATROSKA_ID_WRITINGAPP
static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size, int64_t pos, uint64_t cluster_time, uint64_t block_duration, int is_keyframe, uint8_t *additional, uint64_t additional_id, int additional_size, int64_t cluster_pos, int64_t discard_padding)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
const char *const ff_matroska_video_stereo_mode[MATROSKA_VIDEO_STEREOMODE_TYPE_NB]
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values. ...
#define MATROSKA_ID_TAGDEFAULT_BUG
int cues_parsing_deferred
#define MATROSKA_ID_VIDEOPIXELCROPR
#define MATROSKA_ID_TRACKPLANEUID
#define MATROSKA_ID_ENCODINGCOMPSETTINGS
#define EBML_ID_EBMLMAXIDLENGTH
#define MATROSKA_ID_CHAPTERFLAGHIDDEN
static const EbmlSyntax matroska_index_entry[]
static const EbmlSyntax matroska_chapter_entry[]
static const uint8_t offset[127][2]
char * av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size)
Encode data to base64 and null-terminate.
AVRational avg_frame_rate
Average framerate.
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
static struct tm * gmtime_r(const time_t *clock, struct tm *result)
int flags
A combination of AV_PKT_FLAG values.
uint64_t channel_layout
Audio channel layout.
int avio_r8(AVIOContext *s)
AVCodecContext * codec
Codec context associated with this stream.
static void ebml_free(EbmlSyntax *syntax, void *data)
const CodecMime ff_mkv_mime_tags[]
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
int buf_size
Size of buf except extra allocated bytes.
char * av_asprintf(const char *fmt,...)
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
static const EbmlSyntax matroska_seekhead_entry[]
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
#define MATROSKA_ID_ENCODINGSIGHASHALGO
uint64_t skip_to_timecode
static int matroska_read_header(AVFormatContext *s)
static void matroska_parse_cues(MatroskaDemuxContext *matroska)
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
int bit_rate
the average bitrate
static void matroska_execute_seekhead(MatroskaDemuxContext *matroska)
#define EBML_ID_EBMLVERSION
char filename[1024]
input or output filename
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
#define AV_BASE64_SIZE(x)
Calculate the output size needed to base64-encode x bytes to a null-terminated string.
#define AV_TIME_BASE
Internal time base represented as integer.
static const EbmlSyntax matroska_clusters[]
#define MATROSKA_ID_TAGTARGETS
const AVCodecTag ff_codec_bmp_tags[]
#define MATROSKA_VIDEO_STEREO_PLANE_COUNT
#define MATROSKA_ID_TAGNAME
#define MATROSKA_ID_TRACKTIMECODESCALE
static int ebml_parse_elem(MatroskaDemuxContext *matroska, EbmlSyntax *syntax, void *data)
static int ebml_read_num(MatroskaDemuxContext *matroska, AVIOContext *pb, int max_size, uint64_t *number)
static const EbmlSyntax matroska_track_combine_planes[]
int width
picture width / height.
#define MATROSKA_ID_CHAPTERFLAGENABLED
static MatroskaTrack * matroska_find_track_by_num(MatroskaDemuxContext *matroska, int num)
#define MATROSKA_ID_SIMPLETAG
internal header for RIFF based (de)muxers do NOT include this in end user applications ...
#define MATROSKA_ID_TRACKMAXCACHE
#define MATROSKA_ID_CHAPTERPHYSEQUIV
static int matroska_read_close(AVFormatContext *s)
#define FLAC_STREAMINFO_SIZE
static int ebml_read_ascii(AVIOContext *pb, int size, char **str)
static const EbmlSyntax ebml_syntax[]
static int matroska_decode_buffer(uint8_t **buf, int *buf_size, MatroskaTrack *track)
#define MATROSKA_ID_CHAPTERATOM
int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen)
Decodes LZO 1x compressed data.
static const EbmlSyntax matroska_chapter[]
Opaque data information usually sparse.
#define MATROSKA_ID_VIDEOCOLORSPACE
#define MATROSKA_ID_CHAPTERS
static int matroska_probe(AVProbeData *p)
static void matroska_convert_tag(AVFormatContext *s, EbmlList *list, AVDictionary **metadata, char *prefix)
uint64_t max_block_additional_id
#define MATROSKA_ID_AUDIOSAMPLINGFREQ
#define MATROSKA_ID_TRACKMINCACHE
static void matroska_metadata_creation_time(AVDictionary **metadata, int64_t date_utc)
static int matroska_parse_flac(AVFormatContext *s, MatroskaTrack *track, int *offset)
static int read_header(FFV1Context *f)
static int matroska_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
static int matroska_parse_wavpack(MatroskaTrack *track, uint8_t *src, uint8_t **pdst, int *size)
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define MATROSKA_ID_TRACKPLANETYPE
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
int frame_size
Number of samples per channel in an audio frame.
static const EbmlSyntax matroska_tags[]
static const EbmlSyntax matroska_track_operation[]
static const EbmlSyntax matroska_cluster_incremental[]
int64_t current_cluster_pos
#define MATROSKA_ID_VIDEOPIXELCROPB
#define AV_LOG_INFO
Standard information.
static int matroska_parse_tracks(AVFormatContext *s)
#define MATROSKA_ID_TRACKFLAGFORCED
enum AVMediaType codec_type
const AVCodecTag ff_codec_movaudio_tags[]
static int ebml_read_master(MatroskaDemuxContext *matroska, uint64_t length)
#define MATROSKA_ID_TAGDEFAULT
#define MATROSKA_ID_SEEKID
char * av_strdup(const char *s)
Duplicate the string s.
static const EbmlSyntax matroska_track_encoding_compression[]
int sample_rate
samples per second
AVIOContext * pb
I/O context.
static const EbmlSyntax matroska_track[]
#define MATROSKA_ID_ENCODINGCOMPALGO
#define MATROSKA_ID_BLOCK
#define MATROSKA_ID_TAGTARGETS_TRACKUID
static const EbmlSyntax ebml_header[]
#define MATROSKA_ID_TAGLANG
#define MATROSKA_ID_TRACKCOMBINEPLANES
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
static const AVClass webm_dash_class
#define MATROSKA_ID_TRACKFLAGENABLED
#define MATROSKA_ID_TRACKS
#define MATROSKA_ID_TRACKPLANE
Data found in BlockAdditional element of matroska container.
#define MATROSKA_ID_TRACKNAME
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 MATROSKA_ID_SEEKENTRY
Describe the class of an AVClass context structure.
#define MATROSKA_ID_EDITIONENTRY
static const EbmlSyntax matroska_blockadditions[]
#define MATROSKA_ID_BLOCKGROUP
#define MATROSKA_ID_VIDEOPIXELHEIGHT
rational number numerator/denominator
#define MATROSKA_ID_CUEDURATION
static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf, int *buf_size, int type, uint32_t **lace_buf, int *laces)
#define MATROSKA_ID_CUETIME
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
#define MATROSKA_ID_ENCODINGSIGALGO
static int matroska_read_packet(AVFormatContext *s, AVPacket *pkt)
Recommmends skipping the specified number of samples.
static int ebml_parse(MatroskaDemuxContext *matroska, EbmlSyntax *syntax, void *data)
static av_always_inline void flac_parse_block_header(const uint8_t *block_header, int *last, int *type, int *size)
Parse the metadata block parameters from the header.
#define MATROSKA_ID_ENCODINGSIGKEYID
#define MATROSKA_ID_TITLE
#define MATROSKA_ID_TRACKVIDEO
static const EbmlSyntax matroska_attachments[]
int error
contains the error code or 0 if no error happened
static const EbmlSyntax matroska_clusters_incremental[]
This structure contains the data a format has to probe a file.
static int ebml_parse_id(MatroskaDemuxContext *matroska, EbmlSyntax *syntax, uint32_t id, void *data)
size_t av_strlcat(char *dst, const char *src, size_t size)
Append the string src to the string dst, but to a total length of no more than size - 1 bytes...
static const EbmlSyntax matroska_cluster_incremental_parsing[]
#define MATROSKA_ID_VIDEOFRAMERATE
static av_const int sign_extend(int val, unsigned bits)
#define MATROSKA_ID_ATTACHMENTS
static const EbmlSyntax matroska_chapter_display[]
#define MATROSKA_ID_TRACKOPERATION
static const EbmlSyntax matroska_blockmore[]
#define MATROSKA_ID_CHAPTERDISPLAY
static const EbmlSyntax matroska_track_audio[]
MatroskaLevel1Element level1_elems[64]
#define MATROSKA_ID_FILENAME
#define MATROSKA_ID_BLOCKADDITIONAL
const int avpriv_mpeg4audio_sample_rates[16]
const AVMetadataConv ff_mkv_metadata_conv[]
#define MATROSKA_ID_CODECID
#define MATROSKA_ID_VIDEOALPHAMODE
void ff_rm_reorder_sipr_data(uint8_t *buf, int sub_packet_h, int framesize)
Perform 4-bit block reordering for SIPR data.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_RB64
#define MATROSKA_ID_ENCODINGENCAESSETTINGS
#define MATROSKA_ID_CUETRACK
#define MATROSKA_ID_SEEKPOSITION
static int matroska_resync(MatroskaDemuxContext *matroska, int64_t last_pos)
#define MATROSKA_ID_CODECDELAY
#define MATROSKA_ID_CHAPTERTIMESTART
int ffio_init_context(AVIOContext *s, unsigned char *buffer, int buffer_size, int write_flag, void *opaque, int(*read_packet)(void *opaque, uint8_t *buf, int buf_size), int(*write_packet)(void *opaque, uint8_t *buf, int buf_size), int64_t(*seek)(void *opaque, int64_t offset, int whence))
void * av_realloc(void *ptr, size_t size)
Allocate or reallocate a block of memory.
static const EbmlSyntax matroska_seekhead[]
int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags)
Convenience wrapper for av_dict_set that converts the value to a string and stores it...
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.
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
void av_init_packet(AVPacket *pkt)
Initialize optional fields of a packet with default values.
#define MATROSKA_ID_ENCODINGSIGNATURE
#define MATROSKA_ID_SEGMENT
The optional settings (rendering instructions) that immediately follow the timestamp specifier of a W...
#define MKBETAG(a, b, c, d)
#define MATROSKA_ID_SEEKHEAD
ASS as defined in Matroska.
static int matroska_parse_webvtt(MatroskaDemuxContext *matroska, MatroskaTrack *track, AVStream *st, uint8_t *data, int data_len, uint64_t timecode, uint64_t duration, int64_t pos)
void av_codec_set_seek_preroll(AVCodecContext *avctx, int val)
int skip_to_keyframe
Indicates that everything up to the next keyframe should be discarded.
#define MATROSKA_ID_ENCODINGCOMPRESSION
#define MATROSKA_ID_CLUSTERPREVSIZE
int eof_reached
true if eof reached
#define MATROSKA_ID_POINTENTRY
int channels
number of audio channels
#define MATROSKA_ID_FILEUID
#define MATROSKA_ID_VIDEOPIXELCROPL
static const EbmlSyntax matroska_index_pos[]
void * priv_data
Format private data.
#define MATROSKA_ID_CHAPTERUID
static const EbmlSyntax matroska_attachment[]
static int ebml_read_binary(AVIOContext *pb, int length, EbmlBin *bin)
#define MATROSKA_ID_VIDEODISPLAYUNIT
static int ebml_read_uint(AVIOContext *pb, int size, uint64_t *num)
#define MATROSKA_ID_TRACKMAXBLKADDID
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
#define EBML_ID_EBMLMAXSIZELENGTH
int64_t duration
Duration of the stream, in AV_TIME_BASE fractional seconds.
MatroskaTrackEncryption encryption
#define MATROSKA_ID_CHAPSTRING
#define MATROSKA_ID_TAGSTRING
static const AVOption options[]
const CodecMime ff_mkv_image_mime_tags[]
#define av_malloc_array(a, b)
int avio_feof(AVIOContext *s)
feof() equivalent for AVIOContext.
static int buffer_size_after_time_downloaded(int64_t time_ns, double search_sec, int64_t bps, double min_buffer, double *buffer, double *sec_to_download, AVFormatContext *s, int64_t cues_start)
static int ebml_read_float(AVIOContext *pb, int size, double *num)
#define MATROSKA_ID_DURATION
static int matroska_aac_profile(char *codec_id)
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size)
Allocate new information of a packet.
static const EbmlSyntax matroska_track_encoding_encryption[]
#define EBML_ID_DOCTYPEVERSION
static void matroska_clear_queue(MatroskaDemuxContext *matroska)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
#define MKTAG(a, b, c, d)
enum AVDiscard discard
Selects which packets can be discarded at will and do not need to be demuxed.
AVRational r_frame_rate
Real base framerate of the stream.
#define MATROSKA_ID_ATTACHEDFILE
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
This structure stores compressed data.
#define MATROSKA_ID_CODECSTATE
uint64_t default_duration
static const EbmlSyntax matroska_tag[]
AVInputFormat ff_webm_dash_manifest_demuxer
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define MATROSKA_ID_CODECINFOURL
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
#define MATROSKA_ID_VIDEOPIXELWIDTH
static void matroska_add_index_entries(MatroskaDemuxContext *matroska)
AVPacket attached_pic
For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet will contain the attached pictu...
#define MATROSKA_ID_TRACKAUDIO
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define MATROSKA_ID_ENCODINGSCOPE
const CodecTags ff_mkv_codec_tags[]
#define MATROSKA_ID_ENCODINGENCKEYID
#define MATROSKA_ID_DISCARDPADDING
static int64_t webm_dash_manifest_compute_bandwidth(AVFormatContext *s, int64_t cues_start)
static const char *const matroska_doctypes[]