demux_mkv: support V_PRORES

Why not...

Code for demangling Matroska-style prores video packets inspired by
libavformat's Matroska demuxer.
This commit is contained in:
wm4
2013-09-08 23:05:18 +02:00
parent 3992e5dfca
commit f5195cc4e7
3 changed files with 11 additions and 0 deletions

View File

@@ -312,6 +312,7 @@ static const struct mp_codec_tag mp_video_codec_tags[] = {
{MKTAG('V', 'Q', 'A', 'V'), "ws_vqa"},
{MKTAG('C', '9', '3', 'V'), "c93"},
{MKTAG('V', 'P', '9', '0'), "vp9"},
{MKTAG('p', 'r', '0', '0'), "prores"},
{0},
};

View File

@@ -1167,6 +1167,7 @@ static const videocodec_info_t vinfo[] = {
{MKV_V_VP8, mmioFOURCC('V', 'P', '8', '0'), 0},
{MKV_V_VP9, mmioFOURCC('V', 'P', '9', '0'), 0},
{MKV_V_DIRAC, mmioFOURCC('d', 'r', 'a', 'c'), 0},
{MKV_V_PRORES, mmioFOURCC('p', 'r', '0', '0'), 0},
{NULL, 0, 0}
};
@@ -2173,6 +2174,14 @@ static void mkv_parse_packet(mkv_track_t *track, bstr *buffer)
buffer->len = size;
}
#endif
} else if (track->codec_id && strcmp(track->codec_id, MKV_V_PRORES) == 0) {
size_t newlen = buffer->len + 8;
char *data = talloc_size(NULL, newlen);
AV_WB32(data + 0, newlen);
AV_WB32(data + 4, MKBETAG('i', 'c', 'p', 'f'));
memcpy(data + 8, buffer->start, buffer->len);
buffer->start = data;
buffer->len = newlen;
}
}

View File

@@ -79,6 +79,7 @@
#define MKV_V_MJPEG "V_MJPEG"
#define MKV_V_UNCOMPRESSED "V_UNCOMPRESSED"
#define MKV_V_DIRAC "V_DIRAC"
#define MKV_V_PRORES "V_PRORES"
#define MKV_S_TEXTASCII "S_TEXT/ASCII"
#define MKV_S_TEXTUTF8 "S_TEXT/UTF8"