Skip to content

Commit f99a884

Browse files
authored
Workaround: Render PixelBuffer in RTCMTLVideoView (#58)
* workaround for iOS also * comment
1 parent a70eb2d commit f99a884

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

sdk/objc/components/renderer/metal/RTCMTLVideoView.m

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,18 +271,15 @@ - (void)renderFrame:(nullable RTC_OBJC_TYPE(RTCVideoFrame) *)frame {
271271
return;
272272
}
273273

274-
#if TARGET_OS_IPHONE
275-
self.videoFrame = frame;
276-
#elif TARGET_OS_OSX
277-
// Rendering native CVPixelBuffer is not supported on OS X.
274+
// Workaround to support RTCCVPixelBuffer rendering.
275+
// RTCMTLRGBRenderer seems to be broken at the moment.
278276
BOOL useI420 = NO;
279277
if ([frame.buffer isKindOfClass:[RTC_OBJC_TYPE(RTCCVPixelBuffer) class]]) {
280278
RTC_OBJC_TYPE(RTCCVPixelBuffer) *buffer = (RTC_OBJC_TYPE(RTCCVPixelBuffer) *)frame.buffer;
281279
const OSType pixelFormat = CVPixelBufferGetPixelFormatType(buffer.pixelBuffer);
282280
useI420 = pixelFormat == kCVPixelFormatType_32BGRA || pixelFormat == kCVPixelFormatType_32ARGB;
283281
}
284282
self.videoFrame = useI420 ? [frame newI420VideoFrame] : frame;
285-
#endif
286283
}
287284

288285
#pragma mark - Cross platform

0 commit comments

Comments
 (0)