Remove voe::Channel::StopReceive() and associated logic.
- The legacy API is not used in WVoE/MC. - Removed use of the API (along with StartReceive()) from unit tests. BUG=webrtc:4690 Review-Url: https://codereview.webrtc.org/2453243003 Cr-Commit-Position: refs/heads/master@{#14858}
This commit is contained in:
parent
9c41e47b12
commit
e566ac7341
@ -268,14 +268,12 @@ void CallPerfTest::TestAudioVideoSync(FecMode fec,
|
||||
|
||||
fake_audio_device.Start();
|
||||
EXPECT_EQ(0, voe_base->StartPlayout(recv_channel_id));
|
||||
EXPECT_EQ(0, voe_base->StartReceive(recv_channel_id));
|
||||
EXPECT_EQ(0, voe_base->StartSend(send_channel_id));
|
||||
|
||||
EXPECT_TRUE(observer.Wait())
|
||||
<< "Timed out while waiting for audio and video to be synchronized.";
|
||||
|
||||
EXPECT_EQ(0, voe_base->StopSend(send_channel_id));
|
||||
EXPECT_EQ(0, voe_base->StopReceive(recv_channel_id));
|
||||
EXPECT_EQ(0, voe_base->StopPlayout(recv_channel_id));
|
||||
fake_audio_device.Stop();
|
||||
|
||||
|
||||
@ -128,7 +128,6 @@ void CallTest::Start() {
|
||||
if (!audio_receive_streams_.empty()) {
|
||||
fake_recv_audio_device_->Start();
|
||||
EXPECT_EQ(0, voe_recv_.base->StartPlayout(voe_recv_.channel_id));
|
||||
EXPECT_EQ(0, voe_recv_.base->StartReceive(voe_recv_.channel_id));
|
||||
}
|
||||
if (frame_generator_capturer_.get() != NULL)
|
||||
frame_generator_capturer_->Start();
|
||||
@ -139,7 +138,6 @@ void CallTest::Stop() {
|
||||
frame_generator_capturer_->Stop();
|
||||
if (!audio_receive_streams_.empty()) {
|
||||
fake_recv_audio_device_->Stop();
|
||||
EXPECT_EQ(0, voe_recv_.base->StopReceive(voe_recv_.channel_id));
|
||||
EXPECT_EQ(0, voe_recv_.base->StopPlayout(voe_recv_.channel_id));
|
||||
}
|
||||
for (AudioReceiveStream* audio_recv_stream : audio_receive_streams_)
|
||||
|
||||
@ -1366,7 +1366,6 @@ void VideoQualityTest::RunWithRenderers(const Params& params) {
|
||||
// Start receiving audio.
|
||||
audio_receive_stream->Start();
|
||||
EXPECT_EQ(0, voe.base->StartPlayout(voe.receive_channel_id));
|
||||
EXPECT_EQ(0, voe.base->StartReceive(voe.receive_channel_id));
|
||||
|
||||
// Start sending audio.
|
||||
audio_send_stream_->Start();
|
||||
@ -1381,7 +1380,6 @@ void VideoQualityTest::RunWithRenderers(const Params& params) {
|
||||
audio_send_stream_->Stop();
|
||||
|
||||
// Stop receiving audio.
|
||||
EXPECT_EQ(0, voe.base->StopReceive(voe.receive_channel_id));
|
||||
EXPECT_EQ(0, voe.base->StopPlayout(voe.receive_channel_id));
|
||||
audio_receive_stream->Stop();
|
||||
}
|
||||
|
||||
@ -1222,26 +1222,10 @@ int32_t Channel::StopSend() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t Channel::StartReceiving() {
|
||||
void Channel::ResetDiscardedPacketCount() {
|
||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
|
||||
"Channel::StartReceiving()");
|
||||
if (channel_state_.Get().receiving) {
|
||||
return 0;
|
||||
}
|
||||
channel_state_.SetReceiving(true);
|
||||
"Channel::ResetDiscardedPacketCount()");
|
||||
_numberOfDiscardedPackets = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t Channel::StopReceiving() {
|
||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
|
||||
"Channel::StopReceiving()");
|
||||
if (!channel_state_.Get().receiving) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
channel_state_.SetReceiving(false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t Channel::RegisterVoiceEngineObserver(VoiceEngineObserver& observer) {
|
||||
@ -1370,12 +1354,6 @@ int32_t Channel::SetRecPayloadType(const CodecInst& codec) {
|
||||
"SetRecPayloadType() unable to set PT while playing");
|
||||
return -1;
|
||||
}
|
||||
if (channel_state_.Get().receiving) {
|
||||
_engineStatisticsPtr->SetLastError(
|
||||
VE_ALREADY_LISTENING, kTraceError,
|
||||
"SetRecPayloadType() unable to set PT while listening");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (codec.pltype == -1) {
|
||||
// De-register the selected codec (RTP/RTCP module and ACM)
|
||||
|
||||
@ -88,7 +88,6 @@ class ChannelState {
|
||||
bool input_file_playing = false;
|
||||
bool playing = false;
|
||||
bool sending = false;
|
||||
bool receiving = false;
|
||||
};
|
||||
|
||||
ChannelState() {}
|
||||
@ -129,11 +128,6 @@ class ChannelState {
|
||||
state_.sending = enable;
|
||||
}
|
||||
|
||||
void SetReceiving(bool enable) {
|
||||
rtc::CritScope lock(&lock_);
|
||||
state_.receiving = enable;
|
||||
}
|
||||
|
||||
private:
|
||||
rtc::CriticalSection lock_;
|
||||
State state_;
|
||||
@ -189,9 +183,7 @@ class Channel
|
||||
int32_t StopPlayout();
|
||||
int32_t StartSend();
|
||||
int32_t StopSend();
|
||||
int32_t StartReceiving();
|
||||
int32_t StopReceiving();
|
||||
|
||||
void ResetDiscardedPacketCount();
|
||||
int32_t RegisterVoiceEngineObserver(VoiceEngineObserver& observer);
|
||||
int32_t DeRegisterVoiceEngineObserver();
|
||||
|
||||
@ -393,7 +385,6 @@ class Channel
|
||||
int32_t ChannelId() const { return _channelId; }
|
||||
bool Playing() const { return channel_state_.Get().playing; }
|
||||
bool Sending() const { return channel_state_.Get().sending; }
|
||||
bool Receiving() const { return channel_state_.Get().receiving; }
|
||||
bool ExternalTransport() const {
|
||||
rtc::CritScope cs(&_callbackCritSect);
|
||||
return _externalTransport;
|
||||
|
||||
@ -165,7 +165,7 @@ class WEBRTC_DLLEXPORT VoEBase {
|
||||
virtual int StartReceive(int channel) = 0;
|
||||
|
||||
// Stops receiving incoming RTP/RTCP packets on the specified |channel|.
|
||||
virtual int StopReceive(int channel) = 0;
|
||||
virtual int StopReceive(int channel) { return 0; }
|
||||
|
||||
// Starts forwarding the packets to the mixer/soundcard for a
|
||||
// specified |channel|.
|
||||
|
||||
@ -47,11 +47,9 @@ void BeforeStreamingFixture::RestartFakeMicrophone() {
|
||||
void BeforeStreamingFixture::PausePlaying() {
|
||||
EXPECT_EQ(0, voe_base_->StopSend(channel_));
|
||||
EXPECT_EQ(0, voe_base_->StopPlayout(channel_));
|
||||
EXPECT_EQ(0, voe_base_->StopReceive(channel_));
|
||||
}
|
||||
|
||||
void BeforeStreamingFixture::ResumePlaying() {
|
||||
EXPECT_EQ(0, voe_base_->StartReceive(channel_));
|
||||
EXPECT_EQ(0, voe_base_->StartPlayout(channel_));
|
||||
EXPECT_EQ(0, voe_base_->StartSend(channel_));
|
||||
}
|
||||
|
||||
@ -48,9 +48,7 @@ TEST_F(DtmfTest, ManualCanChangeDtmfPayloadType) {
|
||||
codec_instance.pltype = 88; // Use 88 instead of default 106.
|
||||
EXPECT_EQ(0, voe_base_->StopSend(channel_));
|
||||
EXPECT_EQ(0, voe_base_->StopPlayout(channel_));
|
||||
EXPECT_EQ(0, voe_base_->StopReceive(channel_));
|
||||
EXPECT_EQ(0, voe_codec_->SetRecPayloadType(channel_, codec_instance));
|
||||
EXPECT_EQ(0, voe_base_->StartReceive(channel_));
|
||||
EXPECT_EQ(0, voe_base_->StartPlayout(channel_));
|
||||
EXPECT_EQ(0, voe_base_->StartSend(channel_));
|
||||
break;
|
||||
|
||||
@ -185,7 +185,6 @@ class MixingTest : public AfterInitializationFixture {
|
||||
EXPECT_EQ(0, voe_rtp_rtcp_->SetLocalSSRC(
|
||||
stream, static_cast<unsigned int>(stream)));
|
||||
transport_->AddChannel(stream, stream);
|
||||
EXPECT_EQ(0, voe_base_->StartReceive(stream));
|
||||
EXPECT_EQ(0, voe_base_->StartPlayout(stream));
|
||||
EXPECT_EQ(0, voe_codec_->SetSendCodec(stream, codec_inst));
|
||||
EXPECT_EQ(0, voe_base_->StartSend(stream));
|
||||
@ -197,7 +196,6 @@ class MixingTest : public AfterInitializationFixture {
|
||||
for (size_t i = 0; i < streams.size(); ++i) {
|
||||
EXPECT_EQ(0, voe_base_->StopSend(streams[i]));
|
||||
EXPECT_EQ(0, voe_base_->StopPlayout(streams[i]));
|
||||
EXPECT_EQ(0, voe_base_->StopReceive(streams[i]));
|
||||
EXPECT_EQ(0, voe_network_->DeRegisterExternalTransport(streams[i]));
|
||||
EXPECT_EQ(0, voe_base_->DeleteChannel(streams[i]));
|
||||
}
|
||||
|
||||
@ -67,7 +67,6 @@ class RtpRtcpTest : public AfterStreamingFixture {
|
||||
EXPECT_EQ(0, voe_network_->RegisterExternalTransport(second_channel_,
|
||||
*transport_));
|
||||
|
||||
EXPECT_EQ(0, voe_base_->StartReceive(second_channel_));
|
||||
EXPECT_EQ(0, voe_base_->StartPlayout(second_channel_));
|
||||
EXPECT_EQ(0, voe_rtp_rtcp_->SetLocalSSRC(second_channel_, 5678));
|
||||
EXPECT_EQ(0, voe_base_->StartSend(second_channel_));
|
||||
|
||||
@ -74,7 +74,6 @@ int VoECpuTest::DoTest() {
|
||||
CHECK(codec->SetRecPayloadType(channel, isac));
|
||||
CHECK(codec->SetSendCodec(channel, isac));
|
||||
|
||||
CHECK(base->StartReceive(channel));
|
||||
CHECK(base->StartPlayout(channel));
|
||||
CHECK(base->StartSend(channel));
|
||||
CHECK(file->StartPlayingFileAsMicrophone(channel, _mgr.AudioFilename(),
|
||||
@ -92,7 +91,6 @@ int VoECpuTest::DoTest() {
|
||||
|
||||
CHECK(base->StopSend(channel));
|
||||
CHECK(base->StopPlayout(channel));
|
||||
CHECK(base->StopReceive(channel));
|
||||
|
||||
base->DeleteChannel(channel);
|
||||
CHECK(base->Terminate());
|
||||
|
||||
@ -149,7 +149,6 @@ int VoEStressTest::StartStopTest() {
|
||||
for (i = 0; i < numberOfLoops; ++i) {
|
||||
voice_channel_transport->SetSendDestination("127.0.0.1", 4800);
|
||||
voice_channel_transport->SetLocalReceiver(4800);
|
||||
VALIDATE_STRESS(base->StartReceive(0));
|
||||
VALIDATE_STRESS(base->StartPlayout(0));
|
||||
VALIDATE_STRESS(base->StartSend(0));
|
||||
if (!(i % markInterval))
|
||||
@ -157,21 +156,18 @@ int VoEStressTest::StartStopTest() {
|
||||
SleepMs(loopSleep);
|
||||
VALIDATE_STRESS(base->StopSend(0));
|
||||
VALIDATE_STRESS(base->StopPlayout(0));
|
||||
VALIDATE_STRESS(base->StopReceive(0));
|
||||
}
|
||||
ANL();
|
||||
|
||||
VALIDATE_STRESS(voice_channel_transport->SetSendDestination("127.0.0.1",
|
||||
4800));
|
||||
VALIDATE_STRESS(voice_channel_transport->SetLocalReceiver(4800));
|
||||
VALIDATE_STRESS(base->StartReceive(0));
|
||||
VALIDATE_STRESS(base->StartPlayout(0));
|
||||
VALIDATE_STRESS(base->StartSend(0));
|
||||
printf("Verify that audio is good. \n");
|
||||
PAUSE_OR_SLEEP(20000);
|
||||
VALIDATE_STRESS(base->StopSend(0));
|
||||
VALIDATE_STRESS(base->StopPlayout(0));
|
||||
VALIDATE_STRESS(base->StopReceive(0));
|
||||
|
||||
///////////// End test /////////////
|
||||
|
||||
|
||||
@ -378,12 +378,6 @@ void RunTest(std::string out_path) {
|
||||
const bool receive = !(call_selection == 2);
|
||||
|
||||
if (receive) {
|
||||
#ifndef EXTERNAL_TRANSPORT
|
||||
printf("Start Listen \n");
|
||||
res = base1->StartReceive(chan);
|
||||
VALIDATE;
|
||||
#endif
|
||||
|
||||
printf("Start Playout \n");
|
||||
res = base1->StartPlayout(chan);
|
||||
VALIDATE;
|
||||
@ -700,8 +694,6 @@ void RunTest(std::string out_path) {
|
||||
VALIDATE;
|
||||
} else if (option_selection == option_index++) {
|
||||
if (channel_index < kMaxNumChannels) {
|
||||
res = base1->StartReceive(channels[channel_index]);
|
||||
VALIDATE;
|
||||
res = base1->StartPlayout(channels[channel_index]);
|
||||
VALIDATE;
|
||||
res = base1->StartSend(channels[channel_index]);
|
||||
@ -725,8 +717,6 @@ void RunTest(std::string out_path) {
|
||||
VALIDATE;
|
||||
res = base1->StopPlayout(channels[channel_index]);
|
||||
VALIDATE;
|
||||
res = base1->StopReceive(channels[channel_index]);
|
||||
VALIDATE;
|
||||
printf("Using %d additional channels\n", channel_index);
|
||||
} else {
|
||||
printf("All additional channels stopped\n");
|
||||
@ -787,12 +777,6 @@ void RunTest(std::string out_path) {
|
||||
printf("Stop Playout \n");
|
||||
res = base1->StopPlayout(chan);
|
||||
VALIDATE;
|
||||
|
||||
#ifndef EXTERNAL_TRANSPORT
|
||||
printf("Stop Listen \n");
|
||||
res = base1->StopReceive(chan);
|
||||
VALIDATE;
|
||||
#endif
|
||||
}
|
||||
|
||||
while (channel_index > 0) {
|
||||
@ -803,8 +787,6 @@ void RunTest(std::string out_path) {
|
||||
VALIDATE;
|
||||
res = base1->StopPlayout(channels[channel_index]);
|
||||
VALIDATE;
|
||||
res = base1->StopReceive(channels[channel_index]);
|
||||
VALIDATE;
|
||||
}
|
||||
|
||||
printf("\n1. New call \n");
|
||||
|
||||
@ -436,23 +436,8 @@ int VoEBaseImpl::StartReceive(int channel) {
|
||||
"StartReceive() failed to locate channel");
|
||||
return -1;
|
||||
}
|
||||
return channelPtr->StartReceiving();
|
||||
}
|
||||
|
||||
int VoEBaseImpl::StopReceive(int channel) {
|
||||
rtc::CritScope cs(shared_->crit_sec());
|
||||
if (!shared_->statistics().Initialized()) {
|
||||
shared_->SetLastError(VE_NOT_INITED, kTraceError);
|
||||
return -1;
|
||||
}
|
||||
voe::ChannelOwner ch = shared_->channel_manager().GetChannel(channel);
|
||||
voe::Channel* channelPtr = ch.channel();
|
||||
if (channelPtr == nullptr) {
|
||||
shared_->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError,
|
||||
"SetLocalReceiver() failed to locate channel");
|
||||
return -1;
|
||||
}
|
||||
return channelPtr->StopReceiving();
|
||||
channelPtr->ResetDiscardedPacketCount();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int VoEBaseImpl::StartPlayout(int channel) {
|
||||
|
||||
@ -47,7 +47,6 @@ class VoEBaseImpl : public VoEBase,
|
||||
int StartReceive(int channel) override;
|
||||
int StartPlayout(int channel) override;
|
||||
int StartSend(int channel) override;
|
||||
int StopReceive(int channel) override;
|
||||
int StopPlayout(int channel) override;
|
||||
int StopSend(int channel) override;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user