Improve color range passthru.

This commit is contained in:
Damiano Galassi committed 2021-05-22 10:22:48 +02:00
1 parent 0cf26cf3df
commit 3e2a9f4cc7
3 files changed
+14 -1

No files matched your search

+5
View File
@@ -253,6 +253,11 @@ MP42_OBJC_DIRECT_MEMBERS
videoTrack.matrixCoefficients = 9;
}
}
CFBooleanRef colorRange = CMFormatDescriptionGetExtension(formatDescription, kCMFormatDescriptionExtension_FullRangeVideo);
if (colorRange) {
videoTrack.colorRange = CFBooleanGetValue(colorRange);
}
}
newTrack = videoTrack;
+1 -1
View File
@@ -150,7 +150,7 @@ MP42_OBJC_DIRECT_MEMBERS
}
if (mkvTrack->AV.Video.Colour.Range) {
videoTrack.colorRange = mkvTrack->AV.Video.Colour.Range;
videoTrack.colorRange = mkvTrack->AV.Video.Colour.Range == 2 ? 1 : 0;
}
newTrack = videoTrack;
+8
View File
@@ -187,6 +187,7 @@ static uint32_t convertToFixedPoint(CGFloat value) {
}
else {
MP4AddColr(fileHandle, self.trackId, _colorPrimaries, _transferCharacteristics, _matrixCoefficients);
MP4SetTrackIntegerProperty(fileHandle, self.trackId, "mdia.minf.stbl.stsd.*.colr.full_range_flag", _colorRange);
}
}
else {
@@ -269,6 +270,13 @@ static uint32_t convertToFixedPoint(CGFloat value) {
self.edited = YES;
}
- (void)setColorRange:(uint16_t)colorRange
{
self.updatedProperty[@"colr"] = @YES;
_colorRange = colorRange;
self.edited = YES;
}
- (void)setHSpacing:(uint64_t)newHSpacing
{
_hSpacing = newHSpacing;