fix: metal renderer no image on ios15.2 simulator

This commit is contained in:
Acaki
2025-08-18 17:01:09 +08:00
parent 25ca131da1
commit ea1a2f3cd0
+8 -3
View File
@@ -200,6 +200,12 @@ extern int ff_isom_write_av1c(AVIOContext *pb, const uint8_t *buf, int size,
- (void)setupDecompressionSession {
#if TARGET_OS_SIMULATOR
NSNumber *pixelFormat = @(kCVPixelFormatType_32BGRA);
NSMutableDictionary *destinationPixelBufferAttributes = [@{
(id)kCVPixelBufferPixelFormatTypeKey : pixelFormat,
(id)kCVPixelBufferIOSurfacePropertiesKey : @{
(id)kIOSurfaceIsGlobal : @YES
},
} mutableCopy];
#else
NSNumber *pixelFormat = nil;
if (self->_videoFormat & VIDEO_FORMAT_MASK_YUV444) {
@@ -208,12 +214,11 @@ extern int ff_isom_write_av1c(AVIOContext *pb, const uint8_t *buf, int size,
else {
pixelFormat = @(kCVPixelFormatType_420YpCbCr10BiPlanarFullRange);
}
#endif
NSMutableDictionary *destinationPixelBufferAttributes = [@{
(id)kCVPixelBufferPixelFormatTypeKey : pixelFormat
} mutableCopy];
#endif
if (@available(iOS 17.0, tvOS 17.0, *)) {
destinationPixelBufferAttributes[(id)kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder] = @YES;
destinationPixelBufferAttributes[(id)kVTDecompressionPropertyKey_GeneratePerFrameHDRDisplayMetadata] = @YES;