Get rid of unnecessary cast of FlexfecReceiveStreamImpl to FlexfecReceiveStream
BUG=None Review-Url: https://codereview.webrtc.org/2967913002 Cr-Commit-Position: refs/heads/master@{#19131}
This commit is contained in:
parent
59cac99c9a
commit
42f44f9cf6
@ -885,15 +885,10 @@ void Call::DestroyFlexfecReceiveStream(FlexfecReceiveStream* receive_stream) {
|
||||
RTC_DCHECK_RUN_ON(&configuration_thread_checker_);
|
||||
|
||||
RTC_DCHECK(receive_stream != nullptr);
|
||||
// There exist no other derived classes of FlexfecReceiveStream,
|
||||
// so this downcast is safe.
|
||||
FlexfecReceiveStreamImpl* receive_stream_impl =
|
||||
static_cast<FlexfecReceiveStreamImpl*>(receive_stream);
|
||||
{
|
||||
WriteLockScoped write_lock(*receive_crit_);
|
||||
|
||||
const FlexfecReceiveStream::Config& config =
|
||||
receive_stream_impl->GetConfig();
|
||||
const FlexfecReceiveStream::Config& config = receive_stream->GetConfig();
|
||||
uint32_t ssrc = config.remote_ssrc;
|
||||
receive_rtp_config_.erase(ssrc);
|
||||
|
||||
@ -903,7 +898,7 @@ void Call::DestroyFlexfecReceiveStream(FlexfecReceiveStream* receive_stream) {
|
||||
->RemoveStream(ssrc);
|
||||
}
|
||||
|
||||
delete receive_stream_impl;
|
||||
delete receive_stream;
|
||||
}
|
||||
|
||||
Call::Stats Call::GetStats() const {
|
||||
|
||||
@ -23,6 +23,8 @@ namespace webrtc {
|
||||
|
||||
class FlexfecReceiveStream {
|
||||
public:
|
||||
virtual ~FlexfecReceiveStream() = default;
|
||||
|
||||
struct Stats {
|
||||
std::string ToString(int64_t time_ms) const;
|
||||
|
||||
@ -82,8 +84,7 @@ class FlexfecReceiveStream {
|
||||
|
||||
virtual Stats GetStats() const = 0;
|
||||
|
||||
protected:
|
||||
virtual ~FlexfecReceiveStream() = default;
|
||||
virtual const Config& GetConfig() const = 0;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -206,4 +206,9 @@ FlexfecReceiveStreamImpl::Stats FlexfecReceiveStreamImpl::GetStats() const {
|
||||
return FlexfecReceiveStream::Stats();
|
||||
}
|
||||
|
||||
const FlexfecReceiveStream::Config& FlexfecReceiveStreamImpl::GetConfig()
|
||||
const {
|
||||
return config_;
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -40,8 +40,6 @@ class FlexfecReceiveStreamImpl : public FlexfecReceiveStream,
|
||||
ProcessThread* process_thread);
|
||||
~FlexfecReceiveStreamImpl() override;
|
||||
|
||||
const Config& GetConfig() const { return config_; }
|
||||
|
||||
// RtpPacketSinkInterface.
|
||||
void OnRtpPacket(const RtpPacketReceived& packet) override;
|
||||
|
||||
@ -49,6 +47,7 @@ class FlexfecReceiveStreamImpl : public FlexfecReceiveStream,
|
||||
void Start() override;
|
||||
void Stop() override;
|
||||
Stats GetStats() const override;
|
||||
const Config& GetConfig() const override;
|
||||
|
||||
private:
|
||||
// Config.
|
||||
|
||||
@ -217,7 +217,7 @@ class FakeFlexfecReceiveStream final : public webrtc::FlexfecReceiveStream {
|
||||
explicit FakeFlexfecReceiveStream(
|
||||
const webrtc::FlexfecReceiveStream::Config& config);
|
||||
|
||||
const webrtc::FlexfecReceiveStream::Config& GetConfig() const;
|
||||
const webrtc::FlexfecReceiveStream::Config& GetConfig() const override;
|
||||
|
||||
private:
|
||||
// webrtc::FlexfecReceiveStream implementation.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user