From a828846eb98e404bf3b00c1abf3787f93171a39c Mon Sep 17 00:00:00 2001 From: davidliu Date: Mon, 18 Jul 2022 12:16:10 +0900 Subject: [PATCH] Fix build for m104 --- .../peerconnection/RTCPeerConnectionFactory.mm | 2 +- video/frame_buffer_proxy.cc | 16 ++++++++++++++++ video/frame_buffer_proxy.h | 1 + video/video_receive_stream2.cc | 2 +- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/sdk/objc/api/peerconnection/RTCPeerConnectionFactory.mm b/sdk/objc/api/peerconnection/RTCPeerConnectionFactory.mm index d1f7719b7d..aac5c24954 100644 --- a/sdk/objc/api/peerconnection/RTCPeerConnectionFactory.mm +++ b/sdk/objc/api/peerconnection/RTCPeerConnectionFactory.mm @@ -136,7 +136,7 @@ - (instancetype)init { nativeAudioDecoderFactory:webrtc::CreateBuiltinAudioDecoderFactory() nativeVideoEncoderFactory:std::move(native_encoder_factory) nativeVideoDecoderFactory:std::move(native_decoder_factory) - audioDeviceModule:[self audioDeviceModule:bypassVoiceProcessing] + audioDeviceModule:[self audioDeviceModule:bypassVoiceProcessing].get() audioProcessingModule:nullptr]; #endif } diff --git a/video/frame_buffer_proxy.cc b/video/frame_buffer_proxy.cc index 85ad274f92..c3b8bf9ff5 100644 --- a/video/frame_buffer_proxy.cc +++ b/video/frame_buffer_proxy.cc @@ -65,6 +65,14 @@ class FrameBuffer2Proxy : public FrameBufferProxy { }); } + void StartOnWorker() override { + RTC_DCHECK_RUN_ON(&worker_sequence_checker_); + decode_queue_->PostTask([this] { + frame_buffer_.Start(); + decode_safety_->SetAlive(); + }); + } + void SetProtectionMode(VCMVideoProtection protection_mode) override { RTC_DCHECK_RUN_ON(&worker_sequence_checker_); frame_buffer_.SetProtectionMode(kProtectionNackFEC); @@ -234,6 +242,14 @@ class FrameBuffer3Proxy : public FrameBufferProxy { }); } + void StartOnWorker() override { + RTC_DCHECK_RUN_ON(&worker_sequence_checker_); + decode_queue_->PostTask([this] { + RTC_DCHECK_RUN_ON(decode_queue_); + decode_safety_->SetAlive(); + }); + } + void SetProtectionMode(VCMVideoProtection protection_mode) override { RTC_DCHECK_RUN_ON(&worker_sequence_checker_); protection_mode_ = kProtectionNackFEC; diff --git a/video/frame_buffer_proxy.h b/video/frame_buffer_proxy.h index 16f8fc5112..394d1c067a 100644 --- a/video/frame_buffer_proxy.h +++ b/video/frame_buffer_proxy.h @@ -54,6 +54,7 @@ class FrameBufferProxy { // Run on the worker thread. virtual void StopOnWorker() = 0; + virtual void StartOnWorker() = 0; virtual void SetProtectionMode(VCMVideoProtection protection_mode) = 0; virtual void Clear() = 0; virtual absl::optional InsertFrame( diff --git a/video/video_receive_stream2.cc b/video/video_receive_stream2.cc index 144491bf54..d1fa0306de 100644 --- a/video/video_receive_stream2.cc +++ b/video/video_receive_stream2.cc @@ -361,7 +361,7 @@ void VideoReceiveStream2::Start() { return; } - frame_buffer_->Start(); + frame_buffer_->StartOnWorker(); const bool protected_by_fec = config_.rtp.protected_by_flexfec || rtp_video_stream_receiver_.IsUlpfecEnabled();