diff --git a/sdk/objc/api/video_codec/RTCWrappedNativeVideoEncoder.mm b/sdk/objc/api/video_codec/RTCWrappedNativeVideoEncoder.mm index ea2a459360..6b04d83e2b 100644 --- a/sdk/objc/api/video_codec/RTCWrappedNativeVideoEncoder.mm +++ b/sdk/objc/api/video_codec/RTCWrappedNativeVideoEncoder.mm @@ -79,4 +79,8 @@ return NO; } +- (BOOL)supportsNativeHandle { + RTC_NOTREACHED(); + return NO; +} @end diff --git a/sdk/objc/base/RTCVideoEncoder.h b/sdk/objc/base/RTCVideoEncoder.h index 26cf4ec03f..2b5c952afa 100644 --- a/sdk/objc/base/RTCVideoEncoder.h +++ b/sdk/objc/base/RTCVideoEncoder.h @@ -50,6 +50,10 @@ RTC_OBJC_EXPORT scaled, all resolutions comply with 'resolutionAlignment'. */ @property(nonatomic, readonly) BOOL applyAlignmentToAllSimulcastLayers; +/** If YES, the reciever is expected to resample/scale the source texture to the expected output + size. */ +@property(nonatomic, readonly) BOOL supportsNativeHandle; + @end NS_ASSUME_NONNULL_END diff --git a/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm b/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm index 8794849545..966eb3ee5c 100644 --- a/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm +++ b/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm @@ -537,6 +537,10 @@ NSUInteger GetMaxSampleRate(const webrtc::H264ProfileLevelId &profile_level_id) return NO; } +- (BOOL)supportsNativeHandle { + return YES; +} + #pragma mark - Private - (NSInteger)releaseEncoder { diff --git a/sdk/objc/native/src/objc_video_encoder_factory.mm b/sdk/objc/native/src/objc_video_encoder_factory.mm index b66554b1a4..06515e586e 100644 --- a/sdk/objc/native/src/objc_video_encoder_factory.mm +++ b/sdk/objc/native/src/objc_video_encoder_factory.mm @@ -91,7 +91,6 @@ class ObjCVideoEncoder : public VideoEncoder { VideoEncoder::EncoderInfo GetEncoderInfo() const override { EncoderInfo info; - info.supports_native_handle = true; info.implementation_name = implementation_name_; RTC_OBJC_TYPE(RTCVideoEncoderQpThresholds) *qp_thresholds = [encoder_ scalingSettings]; @@ -100,6 +99,7 @@ class ObjCVideoEncoder : public VideoEncoder { info.requested_resolution_alignment = encoder_.resolutionAlignment > 0 ?: 1; info.apply_alignment_to_all_simulcast_layers = encoder_.applyAlignmentToAllSimulcastLayers; + info.supports_native_handle = encoder_.supportsNativeHandle; info.is_hardware_accelerated = true; info.has_internal_source = false; return info;