From abbc430ea073b304f171821ad42c2b83eaf32c0b Mon Sep 17 00:00:00 2001 From: eladalon Date: Wed, 26 Jul 2017 02:09:44 -0700 Subject: [PATCH] Make ~webrtc::AudioSendStream public, and s/config()/GetConfig(), as well as make public. BUG=None Review-Url: https://codereview.webrtc.org/2987763003 Cr-Commit-Position: refs/heads/master@{#19149} --- webrtc/audio/audio_receive_stream.cc | 2 +- webrtc/audio/audio_send_stream.cc | 10 +++++----- webrtc/audio/audio_send_stream.h | 3 +-- webrtc/call/audio_send_stream.h | 7 ++++--- webrtc/call/call.cc | 4 ++-- webrtc/media/engine/fakewebrtccall.h | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/webrtc/audio/audio_receive_stream.cc b/webrtc/audio/audio_receive_stream.cc index d9829c75f0..be5c18a57c 100644 --- a/webrtc/audio/audio_receive_stream.cc +++ b/webrtc/audio/audio_receive_stream.cc @@ -294,7 +294,7 @@ void AudioReceiveStream::AssociateSendStream(AudioSendStream* send_stream) { if (send_stream) { VoiceEngineImpl* voe_impl = static_cast(voice_engine()); std::unique_ptr send_channel_proxy = - voe_impl->GetChannelProxy(send_stream->config().voe_channel_id); + voe_impl->GetChannelProxy(send_stream->GetConfig().voe_channel_id); channel_proxy_->AssociateSendChannel(*send_channel_proxy.get()); } else { channel_proxy_->DisassociateSendChannel(); diff --git a/webrtc/audio/audio_send_stream.cc b/webrtc/audio/audio_send_stream.cc index 103d6306fd..376af816f6 100644 --- a/webrtc/audio/audio_send_stream.cc +++ b/webrtc/audio/audio_send_stream.cc @@ -126,6 +126,11 @@ AudioSendStream::~AudioSendStream() { channel_proxy_->SetRtcpRttStats(nullptr); } +const webrtc::AudioSendStream::Config& AudioSendStream::GetConfig() const { + RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); + return config_; +} + void AudioSendStream::Reconfigure( const webrtc::AudioSendStream::Config& new_config) { ConfigureStream(this, new_config, false); @@ -405,11 +410,6 @@ void AudioSendStream::OnPacketFeedbackVector( } } -const webrtc::AudioSendStream::Config& AudioSendStream::config() const { - RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); - return config_; -} - void AudioSendStream::SetTransportOverhead(int transport_overhead_per_packet) { RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); transport_->send_side_cc()->SetTransportOverhead( diff --git a/webrtc/audio/audio_send_stream.h b/webrtc/audio/audio_send_stream.h index 42a04aee09..f46608d59a 100644 --- a/webrtc/audio/audio_send_stream.h +++ b/webrtc/audio/audio_send_stream.h @@ -50,8 +50,8 @@ class AudioSendStream final : public webrtc::AudioSendStream, ~AudioSendStream() override; // webrtc::AudioSendStream implementation. + const webrtc::AudioSendStream::Config& GetConfig() const override; void Reconfigure(const webrtc::AudioSendStream::Config& config) override; - void Start() override; void Stop() override; bool SendTelephoneEvent(int payload_type, int payload_frequency, int event, @@ -73,7 +73,6 @@ class AudioSendStream final : public webrtc::AudioSendStream, void OnPacketFeedbackVector( const std::vector& packet_feedback_vector) override; - const webrtc::AudioSendStream::Config& config() const; void SetTransportOverhead(int transport_overhead_per_packet); RtpState GetRtpState() const; diff --git a/webrtc/call/audio_send_stream.h b/webrtc/call/audio_send_stream.h index 26729e426c..fa5b5eecc8 100644 --- a/webrtc/call/audio_send_stream.h +++ b/webrtc/call/audio_send_stream.h @@ -129,6 +129,10 @@ class AudioSendStream { rtc::scoped_refptr encoder_factory; }; + virtual ~AudioSendStream() = default; + + virtual const webrtc::AudioSendStream::Config& GetConfig() const = 0; + // Reconfigure the stream according to the Configuration. virtual void Reconfigure(const Config& config) = 0; @@ -146,9 +150,6 @@ class AudioSendStream { virtual void SetMuted(bool muted) = 0; virtual Stats GetStats() const = 0; - - protected: - virtual ~AudioSendStream() {} }; } // namespace webrtc diff --git a/webrtc/call/call.cc b/webrtc/call/call.cc index 6475e00abf..26d97aad52 100644 --- a/webrtc/call/call.cc +++ b/webrtc/call/call.cc @@ -637,9 +637,9 @@ void Call::DestroyAudioSendStream(webrtc::AudioSendStream* send_stream) { send_stream->Stop(); + const uint32_t ssrc = send_stream->GetConfig().rtp.ssrc; webrtc::internal::AudioSendStream* audio_send_stream = static_cast(send_stream); - const uint32_t ssrc = audio_send_stream->config().rtp.ssrc; suspended_audio_send_ssrcs_[ssrc] = audio_send_stream->GetRtpState(); { WriteLockScoped write_lock(*send_crit_); @@ -656,7 +656,7 @@ void Call::DestroyAudioSendStream(webrtc::AudioSendStream* send_stream) { } UpdateAggregateNetworkState(); sent_rtp_audio_timer_ms_.Extend(audio_send_stream->GetActiveLifetime()); - delete audio_send_stream; + delete send_stream; } webrtc::AudioReceiveStream* Call::CreateAudioReceiveStream( diff --git a/webrtc/media/engine/fakewebrtccall.h b/webrtc/media/engine/fakewebrtccall.h index 15f2108cca..e4bc6563c5 100644 --- a/webrtc/media/engine/fakewebrtccall.h +++ b/webrtc/media/engine/fakewebrtccall.h @@ -47,7 +47,7 @@ class FakeAudioSendStream final : public webrtc::AudioSendStream { int id, const webrtc::AudioSendStream::Config& config); int id() const { return id_; } - const webrtc::AudioSendStream::Config& GetConfig() const; + const webrtc::AudioSendStream::Config& GetConfig() const override; void SetStats(const webrtc::AudioSendStream::Stats& stats); TelephoneEvent GetLatestTelephoneEvent() const; bool IsSending() const { return sending_; }