Delete unneeded Start and Stop methods on FlexfecReceiveStream.
Bug: None Change-Id: I3013cfc54ed357901f175dd408127eda75e5ba99 Reviewed-on: https://chromium-review.googlesource.com/542735 Reviewed-by: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#19363}
This commit is contained in:
parent
22c76c4e65
commit
2bf9e73e6b
@ -76,13 +76,6 @@ class FlexfecReceiveStream : public RtpPacketSinkInterface {
|
||||
std::vector<RtpExtension> rtp_header_extensions;
|
||||
};
|
||||
|
||||
// Starts stream activity.
|
||||
// When a stream is active, it can receive and process packets.
|
||||
virtual void Start() = 0;
|
||||
// Stops stream activity.
|
||||
// When a stream is stopped, it can't receive nor process packets.
|
||||
virtual void Stop() = 0;
|
||||
|
||||
virtual Stats GetStats() const = 0;
|
||||
|
||||
virtual const Config& GetConfig() const = 0;
|
||||
|
||||
@ -129,7 +129,6 @@ FlexfecReceiveStreamImpl::FlexfecReceiveStreamImpl(
|
||||
RtcpRttStats* rtt_stats,
|
||||
ProcessThread* process_thread)
|
||||
: config_(config),
|
||||
started_(false),
|
||||
receiver_(MaybeCreateFlexfecReceiver(config_, recovered_packet_receiver)),
|
||||
rtp_receive_statistics_(
|
||||
ReceiveStatistics::Create(Clock::GetRealTimeClock())),
|
||||
@ -161,14 +160,10 @@ FlexfecReceiveStreamImpl::FlexfecReceiveStreamImpl(
|
||||
|
||||
FlexfecReceiveStreamImpl::~FlexfecReceiveStreamImpl() {
|
||||
LOG(LS_INFO) << "~FlexfecReceiveStreamImpl: " << config_.ToString();
|
||||
Stop();
|
||||
process_thread_->DeRegisterModule(rtp_rtcp_.get());
|
||||
}
|
||||
|
||||
void FlexfecReceiveStreamImpl::OnRtpPacket(const RtpPacketReceived& packet) {
|
||||
if (!started_.load())
|
||||
return;
|
||||
|
||||
if (!receiver_)
|
||||
return;
|
||||
|
||||
@ -185,14 +180,6 @@ void FlexfecReceiveStreamImpl::OnRtpPacket(const RtpPacketReceived& packet) {
|
||||
}
|
||||
}
|
||||
|
||||
void FlexfecReceiveStreamImpl::Start() {
|
||||
started_.store(true);
|
||||
}
|
||||
|
||||
void FlexfecReceiveStreamImpl::Stop() {
|
||||
started_.store(false);
|
||||
}
|
||||
|
||||
// TODO(brandtr): Implement this member function when we have designed the
|
||||
// stats for FlexFEC.
|
||||
FlexfecReceiveStreamImpl::Stats FlexfecReceiveStreamImpl::GetStats() const {
|
||||
|
||||
@ -11,12 +11,10 @@
|
||||
#ifndef WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_IMPL_H_
|
||||
#define WEBRTC_CALL_FLEXFEC_RECEIVE_STREAM_IMPL_H_
|
||||
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/call/flexfec_receive_stream.h"
|
||||
#include "webrtc/call/rtp_packet_sink_interface.h"
|
||||
#include "webrtc/rtc_base/criticalsection.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -43,16 +41,12 @@ class FlexfecReceiveStreamImpl : public FlexfecReceiveStream {
|
||||
// RtpPacketSinkInterface.
|
||||
void OnRtpPacket(const RtpPacketReceived& packet) override;
|
||||
|
||||
// Implements FlexfecReceiveStream.
|
||||
void Start() override;
|
||||
void Stop() override;
|
||||
Stats GetStats() const override;
|
||||
const Config& GetConfig() const override;
|
||||
|
||||
private:
|
||||
// Config.
|
||||
const Config config_;
|
||||
std::atomic<bool> started_;
|
||||
|
||||
// Erasure code interfacing.
|
||||
const std::unique_ptr<FlexfecReceiver> receiver_;
|
||||
|
||||
@ -104,15 +104,10 @@ class FlexfecReceiveStreamTest : public ::testing::Test {
|
||||
|
||||
TEST_F(FlexfecReceiveStreamTest, ConstructDestruct) {}
|
||||
|
||||
TEST_F(FlexfecReceiveStreamTest, StartStop) {
|
||||
receive_stream_->Start();
|
||||
receive_stream_->Stop();
|
||||
}
|
||||
|
||||
// Create a FlexFEC packet that protects a single media packet and ensure
|
||||
// that the callback is called. Correctness of recovery is checked in the
|
||||
// FlexfecReceiver unit tests.
|
||||
TEST_F(FlexfecReceiveStreamTest, RecoversPacketWhenStarted) {
|
||||
TEST_F(FlexfecReceiveStreamTest, RecoversPacket) {
|
||||
constexpr uint8_t kFlexfecSeqNum[] = {0x00, 0x01};
|
||||
constexpr uint8_t kFlexfecTs[] = {0x00, 0x11, 0x22, 0x33};
|
||||
constexpr uint8_t kMediaPlType = 107;
|
||||
@ -150,13 +145,9 @@ TEST_F(FlexfecReceiveStreamTest, RecoversPacketWhenStarted) {
|
||||
config_, &recovered_packet_receiver,
|
||||
&rtt_stats_, &process_thread_);
|
||||
|
||||
// Do not call back before being started.
|
||||
receive_stream.OnRtpPacket(ParsePacket(kFlexfecPacket));
|
||||
|
||||
// Call back after being started.
|
||||
receive_stream.Start();
|
||||
EXPECT_CALL(recovered_packet_receiver,
|
||||
OnRecoveredPacket(_, kRtpHeaderSize + kPayloadLength[1]));
|
||||
|
||||
receive_stream.OnRtpPacket(ParsePacket(kFlexfecPacket));
|
||||
|
||||
// Tear-down
|
||||
|
||||
@ -340,21 +340,13 @@ void FakeVideoReceiveStream::RemoveSecondarySink(
|
||||
|
||||
FakeFlexfecReceiveStream::FakeFlexfecReceiveStream(
|
||||
const webrtc::FlexfecReceiveStream::Config& config)
|
||||
: config_(config), receiving_(false) {}
|
||||
: config_(config) {}
|
||||
|
||||
const webrtc::FlexfecReceiveStream::Config&
|
||||
FakeFlexfecReceiveStream::GetConfig() const {
|
||||
return config_;
|
||||
}
|
||||
|
||||
void FakeFlexfecReceiveStream::Start() {
|
||||
receiving_ = true;
|
||||
}
|
||||
|
||||
void FakeFlexfecReceiveStream::Stop() {
|
||||
receiving_ = false;
|
||||
}
|
||||
|
||||
// TODO(brandtr): Implement when the stats have been designed.
|
||||
webrtc::FlexfecReceiveStream::Stats FakeFlexfecReceiveStream::GetStats() const {
|
||||
return webrtc::FlexfecReceiveStream::Stats();
|
||||
|
||||
@ -224,16 +224,11 @@ class FakeFlexfecReceiveStream final : public webrtc::FlexfecReceiveStream {
|
||||
const webrtc::FlexfecReceiveStream::Config& GetConfig() const override;
|
||||
|
||||
private:
|
||||
// webrtc::FlexfecReceiveStream implementation.
|
||||
void Start() override;
|
||||
void Stop() override;
|
||||
|
||||
webrtc::FlexfecReceiveStream::Stats GetStats() const override;
|
||||
|
||||
void OnRtpPacket(const webrtc::RtpPacketReceived& packet) override;
|
||||
|
||||
webrtc::FlexfecReceiveStream::Config config_;
|
||||
bool receiving_;
|
||||
};
|
||||
|
||||
class FakeCall final : public webrtc::Call, public webrtc::PacketReceiver {
|
||||
|
||||
@ -2346,7 +2346,6 @@ void WebRtcVideoChannel::WebRtcVideoReceiveStream::
|
||||
}
|
||||
if (flexfec_config_.IsCompleteAndEnabled()) {
|
||||
flexfec_stream_ = call_->CreateFlexfecReceiveStream(flexfec_config_);
|
||||
flexfec_stream_->Start();
|
||||
MaybeAssociateFlexfecWithVideo();
|
||||
}
|
||||
}
|
||||
|
||||
@ -363,8 +363,6 @@ void CallTest::Start() {
|
||||
}
|
||||
for (AudioReceiveStream* audio_recv_stream : audio_receive_streams_)
|
||||
audio_recv_stream->Start();
|
||||
for (FlexfecReceiveStream* flexfec_recv_stream : flexfec_receive_streams_)
|
||||
flexfec_recv_stream->Start();
|
||||
if (frame_generator_capturer_.get() != NULL)
|
||||
frame_generator_capturer_->Start();
|
||||
}
|
||||
@ -372,8 +370,6 @@ void CallTest::Start() {
|
||||
void CallTest::Stop() {
|
||||
if (frame_generator_capturer_.get() != NULL)
|
||||
frame_generator_capturer_->Stop();
|
||||
for (FlexfecReceiveStream* flexfec_recv_stream : flexfec_receive_streams_)
|
||||
flexfec_recv_stream->Stop();
|
||||
for (AudioReceiveStream* audio_recv_stream : audio_receive_streams_)
|
||||
audio_recv_stream->Stop();
|
||||
if (audio_send_stream_) {
|
||||
|
||||
@ -1860,8 +1860,6 @@ void VideoQualityTest::RunWithAnalyzer(const Params& params) {
|
||||
thumbnail_send_stream->Start();
|
||||
for (VideoReceiveStream* receive_stream : video_receive_streams_)
|
||||
receive_stream->Start();
|
||||
for (FlexfecReceiveStream* receive_stream : flexfec_receive_streams_)
|
||||
receive_stream->Start();
|
||||
for (VideoReceiveStream* thumbnail_receive_stream :
|
||||
thumbnail_receive_streams_)
|
||||
thumbnail_receive_stream->Start();
|
||||
@ -1886,8 +1884,6 @@ void VideoQualityTest::RunWithAnalyzer(const Params& params) {
|
||||
for (VideoReceiveStream* thumbnail_receive_stream :
|
||||
thumbnail_receive_streams_)
|
||||
thumbnail_receive_stream->Stop();
|
||||
for (FlexfecReceiveStream* receive_stream : flexfec_receive_streams_)
|
||||
receive_stream->Stop();
|
||||
for (VideoReceiveStream* receive_stream : video_receive_streams_)
|
||||
receive_stream->Stop();
|
||||
for (VideoSendStream* thumbnail_send_stream : thumbnail_send_streams_)
|
||||
@ -2048,12 +2044,9 @@ void VideoQualityTest::RunWithRenderers(const Params& params) {
|
||||
|
||||
// Start sending and receiving video.
|
||||
if (params_.video.enabled) {
|
||||
for (FlexfecReceiveStream* flexfec_receive_stream :
|
||||
flexfec_receive_streams_) {
|
||||
flexfec_receive_stream->Start();
|
||||
}
|
||||
for (VideoReceiveStream* receive_stream : video_receive_streams_)
|
||||
receive_stream->Start();
|
||||
for (VideoReceiveStream* video_receive_stream : video_receive_streams_)
|
||||
video_receive_stream->Start();
|
||||
|
||||
video_send_stream_->Start();
|
||||
video_capturer_->Start();
|
||||
}
|
||||
@ -2091,7 +2084,6 @@ void VideoQualityTest::RunWithRenderers(const Params& params) {
|
||||
for (VideoReceiveStream* video_receive_stream : video_receive_streams_) {
|
||||
video_receive_stream->RemoveSecondarySink(flexfec_receive_stream);
|
||||
}
|
||||
flexfec_receive_stream->Stop();
|
||||
receiver_call_->DestroyFlexfecReceiveStream(flexfec_receive_stream);
|
||||
}
|
||||
for (VideoReceiveStream* receive_stream : video_receive_streams_) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user