diff --git a/sdk/objc/components/video_codec/RTCVideoDecoderH264.mm b/sdk/objc/components/video_codec/RTCVideoDecoderH264.mm index 06cfb741d8..7f47ace65a 100644 --- a/sdk/objc/components/video_codec/RTCVideoDecoderH264.mm +++ b/sdk/objc/components/video_codec/RTCVideoDecoderH264.mm @@ -209,7 +209,7 @@ void decompressionOutputCallback(void *decoderRef, #endif CFTypeRef keys[attributesSize] = { -#if defined(WEBRTC_IOS) && TARGET_OS_MACCATALYST +#if defined(WEBRTC_IOS) && (TARGET_OS_MACCATALYST || TARGET_OS_SIMULATOR) kCVPixelBufferMetalCompatibilityKey, #elif defined(WEBRTC_IOS) kCVPixelBufferOpenGLESCompatibilityKey, diff --git a/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm b/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm index 93ed03a7c3..912137d5a0 100644 --- a/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm +++ b/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm @@ -607,7 +607,7 @@ NSUInteger GetMaxSampleRate(const webrtc::H264ProfileLevelId &profile_level_id) // buffers retrieved from the encoder's pixel buffer pool. const size_t attributesSize = 3; CFTypeRef keys[attributesSize] = { -#if defined(WEBRTC_IOS) && TARGET_OS_MACCATALYST +#if defined(WEBRTC_IOS) && (TARGET_OS_MACCATALYST || TARGET_OS_SIMULATOR) kCVPixelBufferMetalCompatibilityKey, #elif defined(WEBRTC_IOS) kCVPixelBufferOpenGLESCompatibilityKey,