refactor: request limited range for connection
This commit is contained in:
1 parent
46b5d9522d
commit
85611bcab5
2 files changed
+5
-19
No files matched your search
@@ -591,7 +591,6 @@ void ClSetControllerLED(uint16_t controllerNumber, uint8_t r, uint8_t g, uint8_t
|
|||||||
_callbacks = callbacks;
|
_callbacks = callbacks;
|
||||||
|
|
||||||
LiInitializeStreamConfiguration(&_streamConfig);
|
LiInitializeStreamConfiguration(&_streamConfig);
|
||||||
_streamConfig.colorRange = 1; // Full range
|
|
||||||
_streamConfig.width = config.width;
|
_streamConfig.width = config.width;
|
||||||
_streamConfig.height = config.height;
|
_streamConfig.height = config.height;
|
||||||
_streamConfig.fps = config.frameRate;
|
_streamConfig.fps = config.frameRate;
|
||||||
|
|||||||
@@ -221,19 +221,10 @@ extern int ff_isom_write_av1c(AVIOContext *pb, const uint8_t *buf, int size,
|
|||||||
} mutableCopy];
|
} mutableCopy];
|
||||||
#else
|
#else
|
||||||
NSNumber *pixelFormat = nil;
|
NSNumber *pixelFormat = nil;
|
||||||
|
if (self->_videoFormat & VIDEO_FORMAT_MASK_YUV444) {
|
||||||
// Uses limited range for AV1 as full range doesn't work well on all devices
|
pixelFormat = @(kCVPixelFormatType_444YpCbCr10BiPlanarVideoRange);
|
||||||
if (self->_videoFormat & VIDEO_FORMAT_MASK_AV1) {
|
|
||||||
if (self->_videoFormat & VIDEO_FORMAT_MASK_YUV444) {
|
|
||||||
pixelFormat = @(kCVPixelFormatType_444YpCbCr10BiPlanarVideoRange);
|
|
||||||
} else {
|
|
||||||
pixelFormat = @(kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange);
|
|
||||||
}
|
|
||||||
Log(LOG_I, @"Using VideoRange pixel format for AV1 (workaround for M3 decoder bug)");
|
|
||||||
} else if (self->_videoFormat & VIDEO_FORMAT_MASK_YUV444) {
|
|
||||||
pixelFormat = @(kCVPixelFormatType_444YpCbCr10BiPlanarFullRange);
|
|
||||||
} else {
|
} else {
|
||||||
pixelFormat = @(kCVPixelFormatType_420YpCbCr10BiPlanarFullRange);
|
pixelFormat = @(kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange);
|
||||||
}
|
}
|
||||||
NSMutableDictionary *destinationPixelBufferAttributes = [@{
|
NSMutableDictionary *destinationPixelBufferAttributes = [@{
|
||||||
(id)kCVPixelBufferPixelFormatTypeKey : pixelFormat
|
(id)kCVPixelBufferPixelFormatTypeKey : pixelFormat
|
||||||
@@ -636,12 +627,8 @@ int DrSubmitDecodeUnit(PDECODE_UNIT decodeUnit);
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log(LOG_I, @"AV1 video range reported by stream: %@", seqHeader->color_config.color_range == 1 ? @"full" : @"limited");
|
Log(LOG_I, @"AV1 video range: %@", seqHeader->color_config.color_range == 1 ? @"full" : @"limited");
|
||||||
|
SET_EXTENSION(kCMFormatDescriptionExtension_FullRangeVideo, @(seqHeader->color_config.color_range == 1));
|
||||||
// Forces limited range for AV1 as full range doesn't work well on all devices
|
|
||||||
SET_EXTENSION(kCMFormatDescriptionExtension_FullRangeVideo, @NO);
|
|
||||||
|
|
||||||
Log(LOG_I, @"AV1 using limited range end-to-end");
|
|
||||||
|
|
||||||
// Progressive content
|
// Progressive content
|
||||||
SET_EXTENSION(kCMFormatDescriptionExtension_FieldCount, @(1));
|
SET_EXTENSION(kCMFormatDescriptionExtension_FieldCount, @(1));
|
||||||
|
|||||||
Reference in new issue
Block a user