Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions sdk/objc/components/renderer/metal/RTCMTLVideoView.m
Original file line number Diff line number Diff line change
Expand Up @@ -271,18 +271,15 @@ - (void)renderFrame:(nullable RTC_OBJC_TYPE(RTCVideoFrame) *)frame {
return;
}

#if TARGET_OS_IPHONE
self.videoFrame = frame;
#elif TARGET_OS_OSX
// Rendering native CVPixelBuffer is not supported on OS X.
// Workaround to support RTCCVPixelBuffer rendering.
// RTCMTLRGBRenderer seems to be broken at the moment.
BOOL useI420 = NO;
if ([frame.buffer isKindOfClass:[RTC_OBJC_TYPE(RTCCVPixelBuffer) class]]) {
RTC_OBJC_TYPE(RTCCVPixelBuffer) *buffer = (RTC_OBJC_TYPE(RTCCVPixelBuffer) *)frame.buffer;
const OSType pixelFormat = CVPixelBufferGetPixelFormatType(buffer.pixelBuffer);
useI420 = pixelFormat == kCVPixelFormatType_32BGRA || pixelFormat == kCVPixelFormatType_32ARGB;
}
self.videoFrame = useI420 ? [frame newI420VideoFrame] : frame;
#endif
}

#pragma mark - Cross platform
Expand Down