From df894ad299703bc7cdd43df28591b2fe1f6c92f1 Mon Sep 17 00:00:00 2001 From: Byoungchan Lee Date: Wed, 6 Apr 2022 10:57:39 +0900 Subject: [PATCH] Fix H.264 codec on Arm64(M1) MacOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Arm64 (M1) MacOS doesn't seem to like the kCVPixelBufferOpenGLCompatibilityKey attribute. Remove this and the crash goes away. Bug: webrtc:13934 Change-Id: Ic78db1ed852af6846f04b86462947ed7df17bb3c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257921 Reviewed-by: Kári Helgason Commit-Queue: Kári Helgason Cr-Commit-Position: refs/heads/main@{#36457} --- sdk/objc/components/video_codec/RTCVideoDecoderH264.mm | 2 +- sdk/objc/components/video_codec/RTCVideoEncoderH264.mm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/objc/components/video_codec/RTCVideoDecoderH264.mm b/sdk/objc/components/video_codec/RTCVideoDecoderH264.mm index 3c31aa7b38..09e642bc37 100644 --- a/sdk/objc/components/video_codec/RTCVideoDecoderH264.mm +++ b/sdk/objc/components/video_codec/RTCVideoDecoderH264.mm @@ -207,7 +207,7 @@ void decompressionOutputCallback(void *decoderRef, (NSString *)kCVPixelBufferMetalCompatibilityKey : @(YES), #elif defined(WEBRTC_IOS) (NSString *)kCVPixelBufferOpenGLESCompatibilityKey : @(YES), -#elif defined(WEBRTC_MAC) +#elif defined(WEBRTC_MAC) && !defined(WEBRTC_ARCH_ARM64) (NSString *)kCVPixelBufferOpenGLCompatibilityKey : @(YES), #endif #if !(TARGET_OS_SIMULATOR) diff --git a/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm b/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm index 4d1d2193a0..50dfd21935 100644 --- a/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm +++ b/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm @@ -610,7 +610,7 @@ NSUInteger GetMaxSampleRate(const webrtc::H264ProfileLevelId &profile_level_id) (NSString *)kCVPixelBufferMetalCompatibilityKey : @(YES), #elif defined(WEBRTC_IOS) (NSString *)kCVPixelBufferOpenGLESCompatibilityKey : @(YES), -#elif defined(WEBRTC_MAC) +#elif defined(WEBRTC_MAC) && !defined(WEBRTC_ARCH_ARM64) (NSString *)kCVPixelBufferOpenGLCompatibilityKey : @(YES), #endif (NSString *)kCVPixelBufferIOSurfacePropertiesKey : @{},