Fix H.264 codec on Arm64(M1) MacOS
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 <kthelgason@webrtc.org>
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36457}
diff --git a/sdk/objc/components/video_codec/RTCVideoDecoderH264.mm b/sdk/objc/components/video_codec/RTCVideoDecoderH264.mm
index 3c31aa7b..09e642b 100644
--- a/sdk/objc/components/video_codec/RTCVideoDecoderH264.mm
+++ b/sdk/objc/components/video_codec/RTCVideoDecoderH264.mm
@@ -207,7 +207,7 @@
(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 4d1d219..50dfd21 100644
--- a/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm
+++ b/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm
@@ -610,7 +610,7 @@
(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 : @{},