File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
sdk/objc/components/renderer/metal Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -271,18 +271,15 @@ - (void)renderFrame:(nullable RTC_OBJC_TYPE(RTCVideoFrame) *)frame {
271
271
return ;
272
272
}
273
273
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.
278
276
BOOL useI420 = NO ;
279
277
if ([frame.buffer isKindOfClass: [RTC_OBJC_TYPE (RTCCVPixelBuffer) class ]]) {
280
278
RTC_OBJC_TYPE (RTCCVPixelBuffer) *buffer = (RTC_OBJC_TYPE (RTCCVPixelBuffer) *)frame.buffer ;
281
279
const OSType pixelFormat = CVPixelBufferGetPixelFormatType (buffer.pixelBuffer );
282
280
useI420 = pixelFormat == kCVPixelFormatType_32BGRA || pixelFormat == kCVPixelFormatType_32ARGB ;
283
281
}
284
282
self.videoFrame = useI420 ? [frame newI420VideoFrame ] : frame;
285
- #endif
286
283
}
287
284
288
285
#pragma mark - Cross platform
You can’t perform that action at this time.
0 commit comments