Read color info, pixel crop, and codec delay from mkv.
This commit is contained in:
1 parent
3e8353d672
commit
bb81a506c1
4 files changed
+87
-19
No files matched your search
@@ -1149,6 +1149,24 @@ out:
|
||||
ENDFOR(mf);
|
||||
}
|
||||
|
||||
static void parseColourInfo(MatroskaFile *mf,ulonglong toplen,struct TrackInfo *ti) {
|
||||
|
||||
FOREACH(mf,toplen)
|
||||
case 0x55b1: // MatrixCoefficients
|
||||
ti->AV.Video.Colour.MatrixCoefficients = (unsigned)readUInt(mf,len);
|
||||
break;
|
||||
case 0x55b2: // BitsPerChannel
|
||||
ti->AV.Video.Colour.BitsPerChannel = (unsigned)readUInt(mf,len);
|
||||
break;
|
||||
case 0x55ba: // TransferCharacteristics
|
||||
ti->AV.Video.Colour.TransferCharacteristics = (unsigned)readUInt(mf,len);
|
||||
break;
|
||||
case 0x55bb: // Primaries
|
||||
ti->AV.Video.Colour.Primaries = (unsigned)readUInt(mf,len);
|
||||
break;
|
||||
ENDFOR(mf);
|
||||
}
|
||||
|
||||
static void parseVideoInfo(MatroskaFile *mf,ulonglong toplen,struct TrackInfo *ti) {
|
||||
ulonglong v;
|
||||
char dW = 0, dH = 0;
|
||||
@@ -1231,6 +1249,9 @@ static void parseVideoInfo(MatroskaFile *mf,ulonglong toplen,struct TrackInfo *t
|
||||
case 0x2fb523: // GammaValue
|
||||
ti->AV.Video.GammaValue = readFloat(mf,(unsigned)len);
|
||||
break;
|
||||
case 0x55b0: // Colour
|
||||
parseColourInfo(mf,len,&ti);
|
||||
break;
|
||||
ENDFOR(mf);
|
||||
}
|
||||
|
||||
@@ -1390,6 +1411,9 @@ static void parseTrackEntry(MatroskaFile *mf,ulonglong toplen) {
|
||||
errorjmp(mf,"Track number in TrackOverlay is too large: %d",(int)v);
|
||||
t.TrackOverlay = (unsigned char)v;
|
||||
break;
|
||||
case 0x56aa: // CodecDelay
|
||||
t.CodecDelay = readUInt(mf,(unsigned)len);;
|
||||
break;
|
||||
case 0xe0: // VideoInfo
|
||||
parseVideoInfo(mf,len,&t);
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user