diff --git a/webrtc/api/test/fakeaudiocapturemodule.cc b/webrtc/api/test/fakeaudiocapturemodule.cc index b85f30b836..0b6478ed2f 100644 --- a/webrtc/api/test/fakeaudiocapturemodule.cc +++ b/webrtc/api/test/fakeaudiocapturemodule.cc @@ -85,9 +85,8 @@ int64_t FakeAudioCaptureModule::TimeUntilNextProcess() { return kAdmMaxIdleTimeProcess - elapsed_time; } -int32_t FakeAudioCaptureModule::Process() { +void FakeAudioCaptureModule::Process() { last_process_time_ms_ = rtc::Time(); - return 0; } int32_t FakeAudioCaptureModule::ActiveAudioLayer( diff --git a/webrtc/api/test/fakeaudiocapturemodule.h b/webrtc/api/test/fakeaudiocapturemodule.h index c27d02df64..9200bdf6f3 100644 --- a/webrtc/api/test/fakeaudiocapturemodule.h +++ b/webrtc/api/test/fakeaudiocapturemodule.h @@ -56,7 +56,7 @@ class FakeAudioCaptureModule // nothing and return success. If a function is not expected to be called by // PeerConnection an assertion is triggered if it is in fact called. int64_t TimeUntilNextProcess() override; - int32_t Process() override; + void Process() override; int32_t ActiveAudioLayer(AudioLayer* audio_layer) const override; diff --git a/webrtc/api/test/fakeaudiocapturemodule_unittest.cc b/webrtc/api/test/fakeaudiocapturemodule_unittest.cc index 1611b81ddd..2c5730a813 100644 --- a/webrtc/api/test/fakeaudiocapturemodule_unittest.cc +++ b/webrtc/api/test/fakeaudiocapturemodule_unittest.cc @@ -123,8 +123,8 @@ TEST_F(FakeAdmTest, TestProccess) { // Next process call must be some time in the future (or now). EXPECT_LE(0, fake_audio_capture_module_->TimeUntilNextProcess()); // Process call updates TimeUntilNextProcess() but there are no guarantees on - // timing so just check that Process can ba called successfully. - EXPECT_LE(0, fake_audio_capture_module_->Process()); + // timing so just check that Process can be called successfully. + fake_audio_capture_module_->Process(); } TEST_F(FakeAdmTest, PlayoutTest) { diff --git a/webrtc/media/engine/fakewebrtcvideocapturemodule.h b/webrtc/media/engine/fakewebrtcvideocapturemodule.h index 8c63d2b6e1..43f72b9538 100644 --- a/webrtc/media/engine/fakewebrtcvideocapturemodule.h +++ b/webrtc/media/engine/fakewebrtcvideocapturemodule.h @@ -30,7 +30,7 @@ class FakeWebRtcVideoCaptureModule : public webrtc::VideoCaptureModule { delay_(0) { } int64_t TimeUntilNextProcess() override { return 0; } - int32_t Process() override { return 0; } + void Process() override {} void RegisterCaptureDataCallback( webrtc::VideoCaptureDataCallback& callback) override { callback_ = &callback; diff --git a/webrtc/modules/audio_conference_mixer/include/audio_conference_mixer.h b/webrtc/modules/audio_conference_mixer/include/audio_conference_mixer.h index 7370442704..7b14f2f79d 100644 --- a/webrtc/modules/audio_conference_mixer/include/audio_conference_mixer.h +++ b/webrtc/modules/audio_conference_mixer/include/audio_conference_mixer.h @@ -40,7 +40,7 @@ public: // Module functions int64_t TimeUntilNextProcess() override = 0; - int32_t Process() override = 0; + void Process() override = 0; // Register/unregister a callback class for receiving the mixed audio. virtual int32_t RegisterMixedStreamCallback( diff --git a/webrtc/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc b/webrtc/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc index 9411a9a47e..1d7602533e 100644 --- a/webrtc/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc +++ b/webrtc/modules/audio_conference_mixer/source/audio_conference_mixer_impl.cc @@ -189,7 +189,7 @@ int64_t AudioConferenceMixerImpl::TimeUntilNextProcess() { return timeUntilNextProcess; } -int32_t AudioConferenceMixerImpl::Process() { +void AudioConferenceMixerImpl::Process() { size_t remainingParticipantsAllowedToMix = kMaximumAmountOfMixedParticipants; { @@ -222,7 +222,7 @@ int32_t AudioConferenceMixerImpl::Process() { if(lowFreq <= 0) { CriticalSectionScoped cs(_crit.get()); _processCalls--; - return 0; + return; } else { switch(lowFreq) { case 8000: @@ -250,7 +250,7 @@ int32_t AudioConferenceMixerImpl::Process() { CriticalSectionScoped cs(_crit.get()); _processCalls--; - return -1; + return; } } @@ -267,10 +267,9 @@ int32_t AudioConferenceMixerImpl::Process() { WEBRTC_TRACE(kTraceMemory, kTraceAudioMixerServer, _id, "failed PopMemory() call"); assert(false); - return -1; + return; } - int retval = 0; { CriticalSectionScoped cs(_crit.get()); @@ -304,8 +303,7 @@ int32_t AudioConferenceMixerImpl::Process() { mixedAudio->Mute(); } else { // Only call the limiter if we have something to mix. - if(!LimitMixedAudio(mixedAudio)) - retval = -1; + LimitMixedAudio(mixedAudio); } } @@ -330,7 +328,7 @@ int32_t AudioConferenceMixerImpl::Process() { CriticalSectionScoped cs(_crit.get()); _processCalls--; } - return retval; + return; } int32_t AudioConferenceMixerImpl::RegisterMixedStreamCallback( diff --git a/webrtc/modules/audio_conference_mixer/source/audio_conference_mixer_impl.h b/webrtc/modules/audio_conference_mixer/source/audio_conference_mixer_impl.h index 0fab84ba81..13d30c3a71 100644 --- a/webrtc/modules/audio_conference_mixer/source/audio_conference_mixer_impl.h +++ b/webrtc/modules/audio_conference_mixer/source/audio_conference_mixer_impl.h @@ -64,7 +64,7 @@ public: // Module functions int64_t TimeUntilNextProcess() override; - int32_t Process() override; + void Process() override; // AudioConferenceMixer functions int32_t RegisterMixedStreamCallback( diff --git a/webrtc/modules/audio_conference_mixer/test/audio_conference_mixer_unittest.cc b/webrtc/modules/audio_conference_mixer/test/audio_conference_mixer_unittest.cc index 293bfa0db9..f393e0f029 100644 --- a/webrtc/modules/audio_conference_mixer/test/audio_conference_mixer_unittest.cc +++ b/webrtc/modules/audio_conference_mixer/test/audio_conference_mixer_unittest.cc @@ -145,7 +145,7 @@ TEST(AudioConferenceMixer, LargestEnergyVadActiveMixed) { EXPECT_CALL(output_receiver, NewMixedAudio(_, _, _, _)) .Times(AtLeast(1)); - EXPECT_EQ(0, mixer->Process()); + mixer->Process(); for (int i = 0; i < kParticipants; ++i) { bool is_mixed = participants[i].IsMixed(); diff --git a/webrtc/modules/audio_device/audio_device_impl.cc b/webrtc/modules/audio_device/audio_device_impl.cc index a11c496289..6496f5efc4 100644 --- a/webrtc/modules/audio_device/audio_device_impl.cc +++ b/webrtc/modules/audio_device/audio_device_impl.cc @@ -427,7 +427,7 @@ int64_t AudioDeviceModuleImpl::TimeUntilNextProcess() // new reports exists. // ---------------------------------------------------------------------------- -int32_t AudioDeviceModuleImpl::Process() +void AudioDeviceModuleImpl::Process() { _lastProcessTime = TickTime::MillisecondTimestamp(); @@ -479,8 +479,6 @@ int32_t AudioDeviceModuleImpl::Process() } _ptrAudioDevice->ClearRecordingError(); } - - return 0; } // ============================================================================ diff --git a/webrtc/modules/audio_device/audio_device_impl.h b/webrtc/modules/audio_device/audio_device_impl.h index c7312bf4b0..d7c48abf17 100644 --- a/webrtc/modules/audio_device/audio_device_impl.h +++ b/webrtc/modules/audio_device/audio_device_impl.h @@ -45,7 +45,7 @@ class AudioDeviceModuleImpl : public AudioDeviceModule { virtual ~AudioDeviceModuleImpl(); int64_t TimeUntilNextProcess() override; - int32_t Process() override; + void Process() override; // Factory methods (resource allocation/deallocation) static AudioDeviceModule* Create( diff --git a/webrtc/modules/audio_device/include/fake_audio_device.h b/webrtc/modules/audio_device/include/fake_audio_device.h index 8b154794c7..45bf45c181 100644 --- a/webrtc/modules/audio_device/include/fake_audio_device.h +++ b/webrtc/modules/audio_device/include/fake_audio_device.h @@ -37,7 +37,7 @@ class FakeAudioDeviceModule : public AudioDeviceModule { virtual int32_t SetAGC(bool enable) { return 0; } virtual int32_t StopRecording() { return 0; } virtual int64_t TimeUntilNextProcess() { return 0; } - virtual int32_t Process() { return 0; } + virtual void Process() {} virtual int32_t Terminate() { return 0; } virtual int32_t ActiveAudioLayer(AudioLayer* audioLayer) const { return 0; } diff --git a/webrtc/modules/bitrate_controller/bitrate_controller_impl.cc b/webrtc/modules/bitrate_controller/bitrate_controller_impl.cc index 72a5ff510d..bf608789d5 100644 --- a/webrtc/modules/bitrate_controller/bitrate_controller_impl.cc +++ b/webrtc/modules/bitrate_controller/bitrate_controller_impl.cc @@ -162,16 +162,15 @@ int64_t BitrateControllerImpl::TimeUntilNextProcess() { kBitrateControllerUpdateIntervalMs - time_since_update_ms, 0); } -int32_t BitrateControllerImpl::Process() { +void BitrateControllerImpl::Process() { if (TimeUntilNextProcess() > 0) - return 0; + return; { rtc::CritScope cs(&critsect_); bandwidth_estimation_.UpdateEstimate(clock_->TimeInMilliseconds()); } MaybeTriggerOnNetworkChanged(); last_bitrate_update_ms_ = clock_->TimeInMilliseconds(); - return 0; } void BitrateControllerImpl::OnReceivedRtcpReceiverReport( diff --git a/webrtc/modules/bitrate_controller/bitrate_controller_impl.h b/webrtc/modules/bitrate_controller/bitrate_controller_impl.h index 74f3c14334..da42b4c749 100644 --- a/webrtc/modules/bitrate_controller/bitrate_controller_impl.h +++ b/webrtc/modules/bitrate_controller/bitrate_controller_impl.h @@ -45,7 +45,7 @@ class BitrateControllerImpl : public BitrateController { void SetEventLog(RtcEventLog* event_log) override; int64_t TimeUntilNextProcess() override; - int32_t Process() override; + void Process() override; private: class RtcpBandwidthObserverImpl; diff --git a/webrtc/modules/bitrate_controller/include/mock/mock_bitrate_controller.h b/webrtc/modules/bitrate_controller/include/mock/mock_bitrate_controller.h index 8748696d45..45b596a868 100644 --- a/webrtc/modules/bitrate_controller/include/mock/mock_bitrate_controller.h +++ b/webrtc/modules/bitrate_controller/include/mock/mock_bitrate_controller.h @@ -36,7 +36,7 @@ class MockBitrateController : public BitrateController { MOCK_CONST_METHOD1(AvailableBandwidth, bool(uint32_t* bandwidth)); MOCK_METHOD1(SetReservedBitrate, void(uint32_t reserved_bitrate_bps)); - MOCK_METHOD0(Process, int()); + MOCK_METHOD0(Process, void()); MOCK_METHOD0(TimeUntilNextProcess, int64_t()); }; } // namespace test diff --git a/webrtc/modules/congestion_controller/congestion_controller.cc b/webrtc/modules/congestion_controller/congestion_controller.cc index 50074d50e4..f9e7e018e5 100644 --- a/webrtc/modules/congestion_controller/congestion_controller.cc +++ b/webrtc/modules/congestion_controller/congestion_controller.cc @@ -53,9 +53,9 @@ class WrappingBitrateEstimator : public RemoteBitrateEstimator { rbe_->IncomingPacket(arrival_time_ms, payload_size, header, was_paced); } - int32_t Process() override { + void Process() override { CriticalSectionScoped cs(crit_sect_.get()); - return rbe_->Process(); + rbe_->Process(); } int64_t TimeUntilNextProcess() override { @@ -241,10 +241,9 @@ int64_t CongestionController::TimeUntilNextProcess() { remote_bitrate_estimator_->TimeUntilNextProcess()); } -int32_t CongestionController::Process() { +void CongestionController::Process() { bitrate_controller_->Process(); remote_bitrate_estimator_->Process(); - return 0; } } // namespace webrtc diff --git a/webrtc/modules/congestion_controller/include/congestion_controller.h b/webrtc/modules/congestion_controller/include/congestion_controller.h index f4381e2a4d..2c0b2e3d79 100644 --- a/webrtc/modules/congestion_controller/include/congestion_controller.h +++ b/webrtc/modules/congestion_controller/include/congestion_controller.h @@ -65,7 +65,7 @@ class CongestionController : public CallStatsObserver, public Module { // Implements Module. int64_t TimeUntilNextProcess() override; - int32_t Process() override; + void Process() override; private: Clock* const clock_; diff --git a/webrtc/modules/include/module.h b/webrtc/modules/include/module.h index d02aa95dc8..432ed409ee 100644 --- a/webrtc/modules/include/module.h +++ b/webrtc/modules/include/module.h @@ -32,7 +32,7 @@ class Module { // Process any pending tasks such as timeouts. // Called on a worker thread. - virtual int32_t Process() = 0; + virtual void Process() = 0; // This method is called when the module is attached to a *running* process // thread or detached from one. In the case of detaching, |process_thread| diff --git a/webrtc/modules/media_file/media_file_impl.cc b/webrtc/modules/media_file/media_file_impl.cc index abc7b9d9e0..76bcca74d2 100644 --- a/webrtc/modules/media_file/media_file_impl.cc +++ b/webrtc/modules/media_file/media_file_impl.cc @@ -95,11 +95,10 @@ int64_t MediaFileImpl::TimeUntilNextProcess() return -1; } -int32_t MediaFileImpl::Process() +void MediaFileImpl::Process() { WEBRTC_TRACE(kTraceWarning, kTraceFile, _id, "Process: This method is not used by MediaFile class."); - return -1; } int32_t MediaFileImpl::PlayoutAudioData(int8_t* buffer, diff --git a/webrtc/modules/media_file/media_file_impl.h b/webrtc/modules/media_file/media_file_impl.h index c23f514c75..677098e8fc 100644 --- a/webrtc/modules/media_file/media_file_impl.h +++ b/webrtc/modules/media_file/media_file_impl.h @@ -26,7 +26,7 @@ public: MediaFileImpl(const int32_t id); ~MediaFileImpl(); - int32_t Process() override; + void Process() override; int64_t TimeUntilNextProcess() override; // MediaFile functions diff --git a/webrtc/modules/pacing/paced_sender.cc b/webrtc/modules/pacing/paced_sender.cc index c32d365668..6998650979 100644 --- a/webrtc/modules/pacing/paced_sender.cc +++ b/webrtc/modules/pacing/paced_sender.cc @@ -373,7 +373,7 @@ int64_t PacedSender::TimeUntilNextProcess() { return std::max(kMinPacketLimitMs - elapsed_time_ms, 0); } -int32_t PacedSender::Process() { +void PacedSender::Process() { int64_t now_us = clock_->TimeInMicroseconds(); CriticalSectionScoped cs(critsect_.get()); int64_t elapsed_time_ms = (now_us - time_last_update_us_ + 500) / 1000; @@ -402,7 +402,7 @@ int32_t PacedSender::Process() { } while (!packets_->Empty()) { if (media_budget_->bytes_remaining() == 0 && !prober_->IsProbing()) - return 0; + return; // Since we need to release the lock in order to send, we first pop the // element from the priority queue but keep it in storage, so that we can @@ -413,17 +413,17 @@ int32_t PacedSender::Process() { // Send succeeded, remove it from the queue. packets_->FinalizePop(packet); if (prober_->IsProbing()) - return 0; + return; } else { // Send failed, put it back into the queue. packets_->CancelPop(packet); - return 0; + return; } } // TODO(holmer): Remove the paused_ check when issue 5307 has been fixed. if (paused_ || !packets_->Empty()) - return 0; + return; size_t padding_needed; if (prober_->IsProbing()) { @@ -434,7 +434,6 @@ int32_t PacedSender::Process() { if (padding_needed > 0) SendPadding(static_cast(padding_needed)); - return 0; } bool PacedSender::SendPacket(const paced_sender::Packet& packet) { diff --git a/webrtc/modules/pacing/paced_sender.h b/webrtc/modules/pacing/paced_sender.h index 62e794fdbc..e2c757dc8f 100644 --- a/webrtc/modules/pacing/paced_sender.h +++ b/webrtc/modules/pacing/paced_sender.h @@ -122,7 +122,7 @@ class PacedSender : public Module, public RtpPacketSender { int64_t TimeUntilNextProcess() override; // Process any pending packets in the queue(s). - int32_t Process() override; + void Process() override; private: // Updates the number of bytes that can be sent for the next time interval. diff --git a/webrtc/modules/pacing/paced_sender_unittest.cc b/webrtc/modules/pacing/paced_sender_unittest.cc index 70ffc75c92..2c1383346d 100644 --- a/webrtc/modules/pacing/paced_sender_unittest.cc +++ b/webrtc/modules/pacing/paced_sender_unittest.cc @@ -222,12 +222,12 @@ TEST_F(PacedSenderTest, PaceQueuedPackets) { .Times(3) .WillRepeatedly(Return(true)); EXPECT_EQ(0, send_bucket_->TimeUntilNextProcess()); - EXPECT_EQ(0, send_bucket_->Process()); + send_bucket_->Process(); } EXPECT_EQ(5, send_bucket_->TimeUntilNextProcess()); clock_.AdvanceTimeMilliseconds(5); EXPECT_EQ(0, send_bucket_->TimeUntilNextProcess()); - EXPECT_EQ(0, send_bucket_->Process()); + send_bucket_->Process(); SendAndExpectPacket(PacedSender::kNormalPriority, ssrc, sequence_number++, @@ -290,12 +290,12 @@ TEST_F(PacedSenderTest, PaceQueuedPacketsWithDuplicates) { .WillRepeatedly(Return(true)); } EXPECT_EQ(0, send_bucket_->TimeUntilNextProcess()); - EXPECT_EQ(0, send_bucket_->Process()); + send_bucket_->Process(); } EXPECT_EQ(5, send_bucket_->TimeUntilNextProcess()); clock_.AdvanceTimeMilliseconds(5); EXPECT_EQ(0, send_bucket_->TimeUntilNextProcess()); - EXPECT_EQ(0, send_bucket_->Process()); + send_bucket_->Process(); SendAndExpectPacket(PacedSender::kNormalPriority, ssrc, sequence_number++, @@ -373,7 +373,7 @@ TEST_F(PacedSenderTest, Padding) { EXPECT_EQ(5, send_bucket_->TimeUntilNextProcess()); clock_.AdvanceTimeMilliseconds(5); EXPECT_EQ(0, send_bucket_->TimeUntilNextProcess()); - EXPECT_EQ(0, send_bucket_->Process()); + send_bucket_->Process(); // 5 milliseconds later we have enough budget to send some padding. EXPECT_CALL(callback_, TimeToSendPadding(250)).Times(1). @@ -381,7 +381,7 @@ TEST_F(PacedSenderTest, Padding) { EXPECT_EQ(5, send_bucket_->TimeUntilNextProcess()); clock_.AdvanceTimeMilliseconds(5); EXPECT_EQ(0, send_bucket_->TimeUntilNextProcess()); - EXPECT_EQ(0, send_bucket_->Process()); + send_bucket_->Process(); } TEST_F(PacedSenderTest, VerifyPaddingUpToBitrate) { @@ -486,7 +486,7 @@ TEST_F(PacedSenderTest, Priority) { EXPECT_EQ(5, send_bucket_->TimeUntilNextProcess()); clock_.AdvanceTimeMilliseconds(5); EXPECT_EQ(0, send_bucket_->TimeUntilNextProcess()); - EXPECT_EQ(0, send_bucket_->Process()); + send_bucket_->Process(); EXPECT_CALL(callback_, TimeToSendPacket( @@ -497,7 +497,7 @@ TEST_F(PacedSenderTest, Priority) { EXPECT_EQ(5, send_bucket_->TimeUntilNextProcess()); clock_.AdvanceTimeMilliseconds(5); EXPECT_EQ(0, send_bucket_->TimeUntilNextProcess()); - EXPECT_EQ(0, send_bucket_->Process()); + send_bucket_->Process(); } TEST_F(PacedSenderTest, HighPrioDoesntAffectBudget) { @@ -587,7 +587,7 @@ TEST_F(PacedSenderTest, Pause) { for (int i = 0; i < 10; ++i) { clock_.AdvanceTimeMilliseconds(5); EXPECT_EQ(0, send_bucket_->TimeUntilNextProcess()); - EXPECT_EQ(0, send_bucket_->Process()); + send_bucket_->Process(); } // Expect high prio packets to come out first followed by all packets in the // way they were added. @@ -602,7 +602,7 @@ TEST_F(PacedSenderTest, Pause) { EXPECT_EQ(5, send_bucket_->TimeUntilNextProcess()); clock_.AdvanceTimeMilliseconds(5); EXPECT_EQ(0, send_bucket_->TimeUntilNextProcess()); - EXPECT_EQ(0, send_bucket_->Process()); + send_bucket_->Process(); EXPECT_EQ(0, send_bucket_->QueueInMs()); } diff --git a/webrtc/modules/remote_bitrate_estimator/include/mock/mock_remote_bitrate_estimator.h b/webrtc/modules/remote_bitrate_estimator/include/mock/mock_remote_bitrate_estimator.h index 588e1e714a..2c35df872b 100644 --- a/webrtc/modules/remote_bitrate_estimator/include/mock/mock_remote_bitrate_estimator.h +++ b/webrtc/modules/remote_bitrate_estimator/include/mock/mock_remote_bitrate_estimator.h @@ -37,7 +37,7 @@ class MockRemoteBitrateEstimator : public RemoteBitrateEstimator { // From Module. MOCK_METHOD0(TimeUntilNextProcess, int64_t()); - MOCK_METHOD0(Process, int32_t()); + MOCK_METHOD0(Process, void()); MOCK_METHOD1(SetMinBitrate, void(int)); }; diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc index db54cab43c..bf3fdc23df 100644 --- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc +++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc @@ -333,9 +333,7 @@ void RemoteBitrateEstimatorAbsSendTime::IncomingPacketInfo( } } -int32_t RemoteBitrateEstimatorAbsSendTime::Process() { - return 0; -} +void RemoteBitrateEstimatorAbsSendTime::Process() {} int64_t RemoteBitrateEstimatorAbsSendTime::TimeUntilNextProcess() { const int64_t kDisabledModuleTime = 1000; diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h index 69b777395d..39d3e032a7 100644 --- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h +++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h @@ -82,7 +82,7 @@ class RemoteBitrateEstimatorAbsSendTime : public RemoteBitrateEstimator { // every other second) for streams to be timed out properly. Therefore it // shouldn't be detached from the ProcessThread except if it's about to be // deleted. - int32_t Process() override; + void Process() override; int64_t TimeUntilNextProcess() override; void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override; void RemoveStream(uint32_t ssrc) override; diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time_unittest.cc b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time_unittest.cc index c1a498806b..7d39b03666 100644 --- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time_unittest.cc +++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time_unittest.cc @@ -93,10 +93,10 @@ TEST_F(RemoteBitrateEstimatorAbsSendTimeTest, TestProcessAfterTimeout) { IncomingPacket(0, 1000, clock_.TimeInMilliseconds(), 0, 0, true); clock_.AdvanceTimeMilliseconds(kStreamTimeOutMs + 1); // Trigger timeout. - EXPECT_EQ(0, bitrate_estimator_->Process()); + bitrate_estimator_->Process(); clock_.AdvanceTimeMilliseconds(kProcessIntervalMs); // This shouldn't crash. - EXPECT_EQ(0, bitrate_estimator_->Process()); + bitrate_estimator_->Process(); } TEST_F(RemoteBitrateEstimatorAbsSendTimeTest, TestProbeDetection) { @@ -118,7 +118,7 @@ TEST_F(RemoteBitrateEstimatorAbsSendTimeTest, TestProbeDetection) { true); } - EXPECT_EQ(0, bitrate_estimator_->Process()); + bitrate_estimator_->Process(); EXPECT_TRUE(bitrate_observer_->updated()); EXPECT_GT(bitrate_observer_->latest_bitrate(), 1500000u); } @@ -140,7 +140,7 @@ TEST_F(RemoteBitrateEstimatorAbsSendTimeTest, false); } - EXPECT_EQ(0, bitrate_estimator_->Process()); + bitrate_estimator_->Process(); EXPECT_TRUE(bitrate_observer_->updated()); EXPECT_GT(bitrate_observer_->latest_bitrate(), 800000u); } @@ -171,7 +171,7 @@ TEST_F(RemoteBitrateEstimatorAbsSendTimeTest, AbsSendTime(send_time_ms, 1000), true); } - EXPECT_EQ(0, bitrate_estimator_->Process()); + bitrate_estimator_->Process(); EXPECT_TRUE(bitrate_observer_->updated()); EXPECT_NEAR(bitrate_observer_->latest_bitrate(), 800000u, 10000); } @@ -191,7 +191,7 @@ TEST_F(RemoteBitrateEstimatorAbsSendTimeTest, AbsSendTime(send_time_ms, 1000), true); } - EXPECT_EQ(0, bitrate_estimator_->Process()); + bitrate_estimator_->Process(); EXPECT_TRUE(bitrate_observer_->updated()); EXPECT_GT(bitrate_observer_->latest_bitrate(), 800000u); } @@ -210,7 +210,7 @@ TEST_F(RemoteBitrateEstimatorAbsSendTimeTest, TestProbeDetectionFasterArrival) { AbsSendTime(send_time_ms, 1000), true); } - EXPECT_EQ(0, bitrate_estimator_->Process()); + bitrate_estimator_->Process(); EXPECT_FALSE(bitrate_observer_->updated()); } @@ -228,7 +228,7 @@ TEST_F(RemoteBitrateEstimatorAbsSendTimeTest, TestProbeDetectionSlowerArrival) { AbsSendTime(send_time_ms, 1000), true); } - EXPECT_EQ(0, bitrate_estimator_->Process()); + bitrate_estimator_->Process(); EXPECT_TRUE(bitrate_observer_->updated()); EXPECT_NEAR(bitrate_observer_->latest_bitrate(), 1140000, 10000); } @@ -248,7 +248,7 @@ TEST_F(RemoteBitrateEstimatorAbsSendTimeTest, AbsSendTime(send_time_ms, 1000), true); } - EXPECT_EQ(0, bitrate_estimator_->Process()); + bitrate_estimator_->Process(); EXPECT_TRUE(bitrate_observer_->updated()); EXPECT_NEAR(bitrate_observer_->latest_bitrate(), 4000000u, 10000); } @@ -265,7 +265,7 @@ TEST_F(RemoteBitrateEstimatorAbsSendTimeTest, ProbingIgnoresSmallPackets) { true); } - EXPECT_EQ(0, bitrate_estimator_->Process()); + bitrate_estimator_->Process(); EXPECT_FALSE(bitrate_observer_->updated()); // Followed by a probe with 1000 bytes packets, should be detected as a @@ -280,7 +280,7 @@ TEST_F(RemoteBitrateEstimatorAbsSendTimeTest, ProbingIgnoresSmallPackets) { // Wait long enough so that we can call Process again. clock_.AdvanceTimeMilliseconds(1000); - EXPECT_EQ(0, bitrate_estimator_->Process()); + bitrate_estimator_->Process(); EXPECT_TRUE(bitrate_observer_->updated()); EXPECT_NEAR(bitrate_observer_->latest_bitrate(), 800000u, 10000); } diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc index 2b740434c1..9a1bbc16b5 100644 --- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc +++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc @@ -118,16 +118,15 @@ void RemoteBitrateEstimatorSingleStream::IncomingPacket(int64_t arrival_time_ms, } } -int32_t RemoteBitrateEstimatorSingleStream::Process() { +void RemoteBitrateEstimatorSingleStream::Process() { if (TimeUntilNextProcess() > 0) { - return 0; + return; } { CriticalSectionScoped cs(crit_sect_.get()); UpdateEstimate(clock_->TimeInMilliseconds()); } last_process_time_ = clock_->TimeInMilliseconds(); - return 0; } int64_t RemoteBitrateEstimatorSingleStream::TimeUntilNextProcess() { diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h index 001311b45d..f3a208a0b7 100644 --- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h +++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h @@ -31,7 +31,7 @@ class RemoteBitrateEstimatorSingleStream : public RemoteBitrateEstimator { size_t payload_size, const RTPHeader& header, bool was_paced) override; - int32_t Process() override; + void Process() override; int64_t TimeUntilNextProcess() override; void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override; void RemoveStream(uint32_t ssrc) override; diff --git a/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.cc b/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.cc index ee17ad78db..51f93f96ce 100644 --- a/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.cc +++ b/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.cc @@ -71,9 +71,9 @@ int64_t RemoteEstimatorProxy::TimeUntilNextProcess() { return time_until_next; } -int32_t RemoteEstimatorProxy::Process() { +void RemoteEstimatorProxy::Process() { if (TimeUntilNextProcess() > 0) - return 0; + return; last_process_time_ms_ = clock_->TimeInMilliseconds(); bool more_to_build = true; @@ -86,8 +86,6 @@ int32_t RemoteEstimatorProxy::Process() { more_to_build = false; } } - - return 0; } void RemoteEstimatorProxy::OnPacketArrival(uint16_t sequence_number, diff --git a/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.h b/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.h index 7145543960..93d5244b67 100644 --- a/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.h +++ b/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.h @@ -47,7 +47,7 @@ class RemoteEstimatorProxy : public RemoteBitrateEstimator { void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override {} void SetMinBitrate(int min_bitrate_bps) override {} int64_t TimeUntilNextProcess() override; - int32_t Process() override; + void Process() override; static const int kDefaultProcessIntervalMs; static const int kBackWindowMs; diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe.cc b/webrtc/modules/remote_bitrate_estimator/test/bwe.cc index c667b6864e..5e282c6f08 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/bwe.cc +++ b/webrtc/modules/remote_bitrate_estimator/test/bwe.cc @@ -67,7 +67,7 @@ class NullBweSender : public BweSender { int64_t TimeUntilNextProcess() override { return std::numeric_limits::max(); } - int Process() override { return 0; } + void Process() override {} private: RTC_DISALLOW_COPY_AND_ASSIGN(NullBweSender); diff --git a/webrtc/modules/remote_bitrate_estimator/test/estimators/nada.cc b/webrtc/modules/remote_bitrate_estimator/test/estimators/nada.cc index 066b4b5e35..b91ee6df0b 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/estimators/nada.cc +++ b/webrtc/modules/remote_bitrate_estimator/test/estimators/nada.cc @@ -238,8 +238,7 @@ int64_t NadaBweSender::TimeUntilNextProcess() { return 100; } -int NadaBweSender::Process() { - return 0; +void NadaBweSender::Process() { } void NadaBweSender::AcceleratedRampUp(const NadaFeedback& fb) { diff --git a/webrtc/modules/remote_bitrate_estimator/test/estimators/nada.h b/webrtc/modules/remote_bitrate_estimator/test/estimators/nada.h index bf23d09884..ab4541672d 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/estimators/nada.h +++ b/webrtc/modules/remote_bitrate_estimator/test/estimators/nada.h @@ -71,7 +71,7 @@ class NadaBweSender : public BweSender { void GiveFeedback(const FeedbackPacket& feedback) override; void OnPacketsSent(const Packets& packets) override {} int64_t TimeUntilNextProcess() override; - int Process() override; + void Process() override; void AcceleratedRampUp(const NadaFeedback& fb); void AcceleratedRampDown(const NadaFeedback& fb); void GradualRateUpdate(const NadaFeedback& fb, diff --git a/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.cc b/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.cc index 3f049df918..d469e675e4 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.cc +++ b/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.cc @@ -53,8 +53,8 @@ int64_t RembBweSender::TimeUntilNextProcess() { return bitrate_controller_->TimeUntilNextProcess(); } -int RembBweSender::Process() { - return bitrate_controller_->Process(); +void RembBweSender::Process() { + bitrate_controller_->Process(); } int RembBweSender::GetFeedbackIntervalMs() const { diff --git a/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.h b/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.h index c6fddf7d38..058873eeda 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.h +++ b/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.h @@ -35,7 +35,7 @@ class RembBweSender : public BweSender { void GiveFeedback(const FeedbackPacket& feedback) override; void OnPacketsSent(const Packets& packets) override {} int64_t TimeUntilNextProcess() override; - int Process() override; + void Process() override; protected: rtc::scoped_ptr bitrate_controller_; diff --git a/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.cc b/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.cc index c55bb1ab11..36dff1fb2a 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.cc +++ b/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.cc @@ -110,9 +110,9 @@ int64_t FullBweSender::TimeUntilNextProcess() { return bitrate_controller_->TimeUntilNextProcess(); } -int FullBweSender::Process() { +void FullBweSender::Process() { rbe_->Process(); - return bitrate_controller_->Process(); + bitrate_controller_->Process(); } SendSideBweReceiver::SendSideBweReceiver(int flow_id) diff --git a/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.h b/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.h index 57d0432f89..9832eb2d28 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.h +++ b/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.h @@ -31,7 +31,7 @@ class FullBweSender : public BweSender, public RemoteBitrateObserver { void OnReceiveBitrateChanged(const std::vector& ssrcs, uint32_t bitrate) override; int64_t TimeUntilNextProcess() override; - int Process() override; + void Process() override; protected: rtc::scoped_ptr bitrate_controller_; diff --git a/webrtc/modules/rtp_rtcp/include/receive_statistics.h b/webrtc/modules/rtp_rtcp/include/receive_statistics.h index b4a7cd0de2..cc21e22df5 100644 --- a/webrtc/modules/rtp_rtcp/include/receive_statistics.h +++ b/webrtc/modules/rtp_rtcp/include/receive_statistics.h @@ -90,7 +90,7 @@ class NullReceiveStatistics : public ReceiveStatistics { StatisticianMap GetActiveStatisticians() const override; StreamStatistician* GetStatistician(uint32_t ssrc) const override; int64_t TimeUntilNextProcess() override; - int32_t Process() override; + void Process() override; void SetMaxReorderingThreshold(int max_reordering_threshold) override; void RegisterRtcpStatisticsCallback( RtcpStatisticsCallback* callback) override; diff --git a/webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h b/webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h index 796be1304c..d4d6e1491c 100644 --- a/webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h +++ b/webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h @@ -249,7 +249,7 @@ class MockRtpRtcp : public RtpRtcp { MOCK_METHOD0(TimeUntilNextProcess, int64_t()); MOCK_METHOD0(Process, - int32_t()); + void()); MOCK_METHOD1(RegisterSendFrameCountObserver, void(FrameCountObserver*)); MOCK_CONST_METHOD0(GetSendFrameCountObserver, diff --git a/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.cc b/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.cc index 24f1e2c96e..022fc9610f 100644 --- a/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.cc +++ b/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.cc @@ -454,14 +454,13 @@ void ReceiveStatisticsImpl::SetMaxReorderingThreshold( } } -int32_t ReceiveStatisticsImpl::Process() { +void ReceiveStatisticsImpl::Process() { CriticalSectionScoped cs(receive_statistics_lock_.get()); for (StatisticianImplMap::iterator it = statisticians_.begin(); it != statisticians_.end(); ++it) { it->second->ProcessBitrate(); } last_rate_update_ms_ = clock_->TimeInMilliseconds(); - return 0; } int64_t ReceiveStatisticsImpl::TimeUntilNextProcess() { @@ -530,7 +529,7 @@ void NullReceiveStatistics::SetMaxReorderingThreshold( int64_t NullReceiveStatistics::TimeUntilNextProcess() { return 0; } -int32_t NullReceiveStatistics::Process() { return 0; } +void NullReceiveStatistics::Process() {} void NullReceiveStatistics::RegisterRtcpStatisticsCallback( RtcpStatisticsCallback* callback) {} diff --git a/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h b/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h index 025dcd42c7..6da8334da6 100644 --- a/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h +++ b/webrtc/modules/rtp_rtcp/source/receive_statistics_impl.h @@ -112,7 +112,7 @@ class ReceiveStatisticsImpl : public ReceiveStatistics, void SetMaxReorderingThreshold(int max_reordering_threshold) override; // Implement Module. - int32_t Process() override; + void Process() override; int64_t TimeUntilNextProcess() override; void RegisterRtcpStatisticsCallback( diff --git a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc index 07889f9eca..7f33bc2ee5 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc @@ -118,7 +118,7 @@ int64_t ModuleRtpRtcpImpl::TimeUntilNextProcess() { } // Process any pending tasks such as timeouts (non time critical events). -int32_t ModuleRtpRtcpImpl::Process() { +void ModuleRtpRtcpImpl::Process() { const int64_t now = clock_->TimeInMilliseconds(); last_process_time_ = now; @@ -202,7 +202,6 @@ int32_t ModuleRtpRtcpImpl::Process() { // A receiver has timed out rtcp_receiver_.UpdateTMMBR(); } - return 0; } void ModuleRtpRtcpImpl::SetRtxSendStatus(int mode) { diff --git a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h index 3621f9bdfd..8c211e4d9c 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h +++ b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h @@ -35,7 +35,7 @@ class ModuleRtpRtcpImpl : public RtpRtcp { int64_t TimeUntilNextProcess() override; // Process any pending tasks such as timeouts. - int32_t Process() override; + void Process() override; // Receiver part. diff --git a/webrtc/modules/utility/source/process_thread_impl_unittest.cc b/webrtc/modules/utility/source/process_thread_impl_unittest.cc index 0b35fad7d2..4f70e8acde 100644 --- a/webrtc/modules/utility/source/process_thread_impl_unittest.cc +++ b/webrtc/modules/utility/source/process_thread_impl_unittest.cc @@ -28,7 +28,7 @@ using ::testing::SetArgPointee; class MockModule : public Module { public: MOCK_METHOD0(TimeUntilNextProcess, int64_t()); - MOCK_METHOD0(Process, int32_t()); + MOCK_METHOD0(Process, void()); MOCK_METHOD1(ProcessThreadAttached, void(ProcessThread*)); }; @@ -77,8 +77,8 @@ TEST(ProcessThreadImpl, ProcessCall) { MockModule module; EXPECT_CALL(module, TimeUntilNextProcess()).WillRepeatedly(Return(0)); EXPECT_CALL(module, Process()) - .WillOnce(DoAll(SetEvent(event.get()), Return(0))) - .WillRepeatedly(Return(0)); + .WillOnce(DoAll(SetEvent(event.get()), Return())) + .WillRepeatedly(Return()); EXPECT_CALL(module, ProcessThreadAttached(&thread)).Times(1); thread.RegisterModule(&module); @@ -97,8 +97,8 @@ TEST(ProcessThreadImpl, ProcessCall2) { MockModule module; EXPECT_CALL(module, TimeUntilNextProcess()).WillRepeatedly(Return(0)); EXPECT_CALL(module, Process()) - .WillOnce(DoAll(SetEvent(event.get()), Return(0))) - .WillRepeatedly(Return(0)); + .WillOnce(DoAll(SetEvent(event.get()), Return())) + .WillRepeatedly(Return()); thread.RegisterModule(&module); @@ -122,8 +122,8 @@ TEST(ProcessThreadImpl, Deregister) { EXPECT_CALL(module, Process()) .WillOnce(DoAll(SetEvent(event.get()), Increment(&process_count), - Return(0))) - .WillRepeatedly(DoAll(Increment(&process_count), Return(0))); + Return())) + .WillRepeatedly(DoAll(Increment(&process_count), Return())); thread.RegisterModule(&module); @@ -163,8 +163,8 @@ void ProcessCallAfterAFewMs(int64_t milliseconds) { EXPECT_CALL(module, Process()) .WillOnce(DoAll(SetTimestamp(&called_time), SetEvent(event.get()), - Return(0))) - .WillRepeatedly(Return(0)); + Return())) + .WillRepeatedly(Return()); EXPECT_CALL(module, ProcessThreadAttached(&thread)).Times(1); thread.RegisterModule(&module); @@ -225,7 +225,7 @@ TEST(ProcessThreadImpl, DISABLED_Process50Times) { .WillRepeatedly(Return(20)); EXPECT_CALL(module, Process()) .WillRepeatedly(DoAll(Increment(&callback_count), - Return(0))); + Return())); EXPECT_CALL(module, ProcessThreadAttached(&thread)).Times(1); thread.RegisterModule(&module); @@ -269,10 +269,9 @@ TEST(ProcessThreadImpl, WakeUp) { Return(1000))) .WillOnce(Return(1000)); EXPECT_CALL(module, Process()) - .WillOnce(DoAll(SetTimestamp(&called_time), - SetEvent(called.get()), - Return(0))) - .WillRepeatedly(Return(0)); + .WillOnce( + DoAll(SetTimestamp(&called_time), SetEvent(called.get()), Return())) + .WillRepeatedly(Return()); EXPECT_CALL(module, ProcessThreadAttached(&thread)).Times(1); thread.RegisterModule(&module); diff --git a/webrtc/modules/video_capture/video_capture_impl.cc b/webrtc/modules/video_capture/video_capture_impl.cc index 90730cd984..3013a7def0 100644 --- a/webrtc/modules/video_capture/video_capture_impl.cc +++ b/webrtc/modules/video_capture/video_capture_impl.cc @@ -93,7 +93,7 @@ int64_t VideoCaptureImpl::TimeUntilNextProcess() } // Process any pending tasks such as timeouts -int32_t VideoCaptureImpl::Process() +void VideoCaptureImpl::Process() { CriticalSectionScoped cs(&_callBackCs); @@ -136,8 +136,6 @@ int32_t VideoCaptureImpl::Process() } _lastProcessFrameCount = _incomingFrameTimes[0]; - - return 0; } VideoCaptureImpl::VideoCaptureImpl(const int32_t id) diff --git a/webrtc/modules/video_capture/video_capture_impl.h b/webrtc/modules/video_capture/video_capture_impl.h index 164421776c..4aa39394c7 100644 --- a/webrtc/modules/video_capture/video_capture_impl.h +++ b/webrtc/modules/video_capture/video_capture_impl.h @@ -79,7 +79,7 @@ public: // Module handling virtual int64_t TimeUntilNextProcess(); - virtual int32_t Process(); + virtual void Process(); // Implement VideoCaptureExternal // |capture_time| must be specified in NTP time format in milliseconds. diff --git a/webrtc/modules/video_coding/test/vcm_payload_sink_factory.cc b/webrtc/modules/video_coding/test/vcm_payload_sink_factory.cc index c9ec372f41..88242fd0ab 100644 --- a/webrtc/modules/video_coding/test/vcm_payload_sink_factory.cc +++ b/webrtc/modules/video_coding/test/vcm_payload_sink_factory.cc @@ -74,9 +74,7 @@ class VcmPayloadSinkFactory::VcmPayloadSink : public PayloadSinkInterface, bool Process() { if (vcm_->TimeUntilNextProcess() <= 0) { - if (vcm_->Process() < 0) { - return false; - } + vcm_->Process(); } return true; } diff --git a/webrtc/modules/video_coding/video_coding_impl.cc b/webrtc/modules/video_coding/video_coding_impl.cc index 7f74b4162f..7d6d17798d 100644 --- a/webrtc/modules/video_coding/video_coding_impl.cc +++ b/webrtc/modules/video_coding/video_coding_impl.cc @@ -94,12 +94,9 @@ class VideoCodingModuleImpl : public VideoCodingModule { return VCM_MIN(sender_time, receiver_time); } - int32_t Process() override { - int32_t sender_return = sender_.Process(); - int32_t receiver_return = receiver_.Process(); - if (sender_return != VCM_OK) - return sender_return; - return receiver_return; + void Process() override { + sender_.Process(); + receiver_.Process(); } int32_t RegisterSendCodec(const VideoCodec* sendCodec, diff --git a/webrtc/modules/video_coding/video_coding_impl.h b/webrtc/modules/video_coding/video_coding_impl.h index 581ab0eda5..dc766b1ed2 100644 --- a/webrtc/modules/video_coding/video_coding_impl.h +++ b/webrtc/modules/video_coding/video_coding_impl.h @@ -93,7 +93,7 @@ class VideoSender { bool VideoSuspended() const; int64_t TimeUntilNextProcess(); - int32_t Process(); + void Process(); private: void SetEncoderParameters(EncoderParameters params) @@ -172,7 +172,7 @@ class VideoReceiver { int32_t SetVideoProtection(VCMVideoProtection videoProtection, bool enable); int64_t TimeUntilNextProcess(); - int32_t Process(); + void Process(); void RegisterPreDecodeImageCallback(EncodedImageCallback* observer); void TriggerDecoderShutdown(); diff --git a/webrtc/modules/video_coding/video_coding_robustness_unittest.cc b/webrtc/modules/video_coding/video_coding_robustness_unittest.cc index 51cffcdb2d..eb5d485d59 100644 --- a/webrtc/modules/video_coding/video_coding_robustness_unittest.cc +++ b/webrtc/modules/video_coding/video_coding_robustness_unittest.cc @@ -113,20 +113,20 @@ TEST_F(VCMRobustnessTest, TestHardNack) { clock_->AdvanceTimeMilliseconds(10); - ASSERT_EQ(VCM_OK, vcm_->Process()); + vcm_->Process(); ASSERT_EQ(VCM_FRAME_NOT_READY, vcm_->Decode(0)); InsertPacket(6000, 8, false, true, kVideoFrameDelta); clock_->AdvanceTimeMilliseconds(10); - ASSERT_EQ(VCM_OK, vcm_->Process()); + vcm_->Process(); ASSERT_EQ(VCM_FRAME_NOT_READY, vcm_->Decode(0)); InsertPacket(6000, 6, true, false, kVideoFrameDelta); InsertPacket(6000, 7, false, false, kVideoFrameDelta); clock_->AdvanceTimeMilliseconds(10); - ASSERT_EQ(VCM_OK, vcm_->Process()); + vcm_->Process(); ASSERT_EQ(VCM_OK, vcm_->Decode(0)); } @@ -143,12 +143,12 @@ TEST_F(VCMRobustnessTest, TestHardNackNoneDecoded) { InsertPacket(3000, 5, false, true, kVideoFrameDelta); EXPECT_EQ(VCM_FRAME_NOT_READY, vcm_->Decode(0)); - ASSERT_EQ(VCM_OK, vcm_->Process()); + vcm_->Process(); clock_->AdvanceTimeMilliseconds(10); EXPECT_EQ(VCM_FRAME_NOT_READY, vcm_->Decode(0)); - ASSERT_EQ(VCM_OK, vcm_->Process()); + vcm_->Process(); } TEST_F(VCMRobustnessTest, TestModeNoneWithErrors) { @@ -195,25 +195,25 @@ TEST_F(VCMRobustnessTest, TestModeNoneWithErrors) { InsertPacket(0, 1, false, false, kVideoFrameKey); InsertPacket(0, 2, false, true, kVideoFrameKey); EXPECT_EQ(VCM_OK, vcm_->Decode(33)); // Decode timestamp 0. - EXPECT_EQ(VCM_OK, vcm_->Process()); // Expect no NACK list. + vcm_->Process(); clock_->AdvanceTimeMilliseconds(33); InsertPacket(3000, 3, true, false, kVideoFrameDelta); // Packet 4 missing InsertPacket(3000, 5, false, true, kVideoFrameDelta); EXPECT_EQ(VCM_FRAME_NOT_READY, vcm_->Decode(0)); - EXPECT_EQ(VCM_OK, vcm_->Process()); // Expect no NACK list. + vcm_->Process(); clock_->AdvanceTimeMilliseconds(33); InsertPacket(6000, 6, true, false, kVideoFrameDelta); InsertPacket(6000, 7, false, false, kVideoFrameDelta); InsertPacket(6000, 8, false, true, kVideoFrameDelta); EXPECT_EQ(VCM_OK, vcm_->Decode(0)); // Decode timestamp 3000 incomplete. - EXPECT_EQ(VCM_OK, vcm_->Process()); // Expect no NACK list. + vcm_->Process(); clock_->AdvanceTimeMilliseconds(10); EXPECT_EQ(VCM_OK, vcm_->Decode(23)); // Decode timestamp 6000 complete. - EXPECT_EQ(VCM_OK, vcm_->Process()); // Expect no NACK list. + vcm_->Process(); clock_->AdvanceTimeMilliseconds(23); InsertPacket(3000, 4, false, false, kVideoFrameDelta); diff --git a/webrtc/modules/video_coding/video_receiver.cc b/webrtc/modules/video_coding/video_receiver.cc index 02d51a7b90..e7844d0add 100644 --- a/webrtc/modules/video_coding/video_receiver.cc +++ b/webrtc/modules/video_coding/video_receiver.cc @@ -63,9 +63,7 @@ VideoReceiver::~VideoReceiver() { #endif } -int32_t VideoReceiver::Process() { - int32_t returnValue = VCM_OK; - +void VideoReceiver::Process() { // Receive-side statistics if (_receiveStatsTimer.TimeUntilProcess() == 0) { _receiveStatsTimer.Processed(); @@ -108,12 +106,8 @@ int32_t VideoReceiver::Process() { CriticalSectionScoped cs(process_crit_sect_.get()); request_key_frame = _scheduleKeyRequest && _frameTypeCallback != NULL; } - if (request_key_frame) { - const int32_t ret = RequestKeyFrame(); - if (ret != VCM_OK && returnValue == VCM_OK) { - returnValue = ret; - } - } + if (request_key_frame) + RequestKeyFrame(); } // Packet retransmission requests @@ -135,9 +129,6 @@ int32_t VideoReceiver::Process() { int32_t ret = VCM_OK; if (request_key_frame) { ret = RequestKeyFrame(); - if (ret != VCM_OK && returnValue == VCM_OK) { - returnValue = ret; - } } if (ret == VCM_OK && !nackList.empty()) { CriticalSectionScoped cs(process_crit_sect_.get()); @@ -147,8 +138,6 @@ int32_t VideoReceiver::Process() { } } } - - return returnValue; } int64_t VideoReceiver::TimeUntilNextProcess() { diff --git a/webrtc/modules/video_coding/video_receiver_unittest.cc b/webrtc/modules/video_coding/video_receiver_unittest.cc index 820ce9ae2d..693fdc60ee 100644 --- a/webrtc/modules/video_coding/video_receiver_unittest.cc +++ b/webrtc/modules/video_coding/video_receiver_unittest.cc @@ -52,7 +52,7 @@ class TestVideoReceiver : public ::testing::Test { EXPECT_EQ(0, receiver_->IncomingPacket(payload, 0, *header)); ++header->header.sequenceNumber; } - EXPECT_EQ(0, receiver_->Process()); + receiver_->Process(); EXPECT_CALL(decoder_, Decode(_, _, _, _, _)).Times(0); EXPECT_EQ(VCM_FRAME_NOT_READY, receiver_->Decode(100)); } @@ -64,7 +64,7 @@ class TestVideoReceiver : public ::testing::Test { EXPECT_EQ(0, receiver_->IncomingPacket(payload, length, *header)); ++header->header.sequenceNumber; EXPECT_CALL(packet_request_callback_, ResendPackets(_, _)).Times(0); - EXPECT_EQ(0, receiver_->Process()); + receiver_->Process();; EXPECT_CALL(decoder_, Decode(_, _, _, _, _)).Times(1); EXPECT_EQ(0, receiver_->Decode(100)); } diff --git a/webrtc/modules/video_coding/video_sender.cc b/webrtc/modules/video_coding/video_sender.cc index f14f852114..d92ad4593d 100644 --- a/webrtc/modules/video_coding/video_sender.cc +++ b/webrtc/modules/video_coding/video_sender.cc @@ -53,9 +53,7 @@ VideoSender::VideoSender(Clock* clock, VideoSender::~VideoSender() {} -int32_t VideoSender::Process() { - int32_t returnValue = VCM_OK; - +void VideoSender::Process() { if (_sendStatsTimer.TimeUntilProcess() == 0) { _sendStatsTimer.Processed(); CriticalSectionScoped cs(process_crit_sect_.get()); @@ -72,8 +70,6 @@ int32_t VideoSender::Process() { // updated even if bandwidth hasn't changed. encoder_params_.input_frame_rate = _mediaOpt.InputFrameRate(); } - - return returnValue; } int64_t VideoSender::TimeUntilNextProcess() { diff --git a/webrtc/modules/video_render/video_render.h b/webrtc/modules/video_render/video_render.h index a193a187e7..84c9536e35 100644 --- a/webrtc/modules/video_render/video_render.h +++ b/webrtc/modules/video_render/video_render.h @@ -53,7 +53,7 @@ public: static void DestroyVideoRender(VideoRender* module); int64_t TimeUntilNextProcess() override = 0; - int32_t Process() override = 0; + void Process() override = 0; /************************************************************************** * diff --git a/webrtc/modules/video_render/video_render_impl.cc b/webrtc/modules/video_render/video_render_impl.cc index d2a074b4c4..2f145a7ec9 100644 --- a/webrtc/modules/video_render/video_render_impl.cc +++ b/webrtc/modules/video_render/video_render_impl.cc @@ -119,11 +119,7 @@ int64_t ModuleVideoRenderImpl::TimeUntilNextProcess() // Not used return 50; } -int32_t ModuleVideoRenderImpl::Process() -{ - // Not used - return 0; -} +void ModuleVideoRenderImpl::Process() {} void* ModuleVideoRenderImpl::Window() diff --git a/webrtc/modules/video_render/video_render_impl.h b/webrtc/modules/video_render/video_render_impl.h index ce93cea6b5..12244a60b8 100644 --- a/webrtc/modules/video_render/video_render_impl.h +++ b/webrtc/modules/video_render/video_render_impl.h @@ -35,7 +35,7 @@ public: virtual ~ModuleVideoRenderImpl(); virtual int64_t TimeUntilNextProcess(); - virtual int32_t Process(); + virtual void Process(); /* * Returns the render window diff --git a/webrtc/modules/video_render/video_render_internal_impl.cc b/webrtc/modules/video_render/video_render_internal_impl.cc index 1fed26e9c4..a9ae0b0948 100644 --- a/webrtc/modules/video_render/video_render_internal_impl.cc +++ b/webrtc/modules/video_render/video_render_internal_impl.cc @@ -299,11 +299,7 @@ int64_t ModuleVideoRenderImpl::TimeUntilNextProcess() // Not used return 50; } -int32_t ModuleVideoRenderImpl::Process() -{ - // Not used - return 0; -} +void ModuleVideoRenderImpl::Process() {} void* ModuleVideoRenderImpl::Window() diff --git a/webrtc/video/call_stats.cc b/webrtc/video/call_stats.cc index 1ee4625552..8874c2b631 100644 --- a/webrtc/video/call_stats.cc +++ b/webrtc/video/call_stats.cc @@ -109,11 +109,11 @@ int64_t CallStats::TimeUntilNextProcess() { return last_process_time_ + kUpdateIntervalMs - clock_->TimeInMilliseconds(); } -int32_t CallStats::Process() { +void CallStats::Process() { rtc::CritScope cs(&crit_); int64_t now = clock_->TimeInMilliseconds(); if (now < last_process_time_ + kUpdateIntervalMs) - return 0; + return; last_process_time_ = now; @@ -132,7 +132,6 @@ int32_t CallStats::Process() { sum_avg_rtt_ms_ += avg_rtt_ms_; ++num_avg_rtt_; } - return 0; } int64_t CallStats::avg_rtt_ms() const { diff --git a/webrtc/video/call_stats.h b/webrtc/video/call_stats.h index 385f6ffbe0..bb3670c39d 100644 --- a/webrtc/video/call_stats.h +++ b/webrtc/video/call_stats.h @@ -34,7 +34,7 @@ class CallStats : public Module { // Implements Module, to use the process thread. int64_t TimeUntilNextProcess() override; - int32_t Process() override; + void Process() override; // Returns a RtcpRttStats to register at a statistics provider. The object // has the same lifetime as the CallStats instance. diff --git a/webrtc/video/overuse_frame_detector.cc b/webrtc/video/overuse_frame_detector.cc index 9f12137940..18c6b9e7ed 100644 --- a/webrtc/video/overuse_frame_detector.cc +++ b/webrtc/video/overuse_frame_detector.cc @@ -297,14 +297,14 @@ void OveruseFrameDetector::FrameSent(uint32_t timestamp) { } } -int32_t OveruseFrameDetector::Process() { +void OveruseFrameDetector::Process() { RTC_DCHECK(processing_thread_.CalledOnValidThread()); int64_t now = clock_->TimeInMilliseconds(); // Used to protect against Process() being called too often. if (now < next_process_time_ms_) - return 0; + return; next_process_time_ms_ = now + kProcessIntervalMs; @@ -313,7 +313,7 @@ int32_t OveruseFrameDetector::Process() { rtc::CritScope cs(&crit_); ++num_process_times_; if (num_process_times_ <= options_.min_process_count || !metrics_) - return 0; + return; current_metrics = *metrics_; } @@ -358,8 +358,6 @@ int32_t OveruseFrameDetector::Process() { << " encode usage " << current_metrics.encode_usage_percent << " overuse detections " << num_overuse_detections_ << " rampup delay " << rampup_delay; - - return 0; } bool OveruseFrameDetector::IsOverusing(const CpuOveruseMetrics& metrics) { diff --git a/webrtc/video/overuse_frame_detector.h b/webrtc/video/overuse_frame_detector.h index 80c9b55fb0..43c9e28459 100644 --- a/webrtc/video/overuse_frame_detector.h +++ b/webrtc/video/overuse_frame_detector.h @@ -90,7 +90,7 @@ class OveruseFrameDetector : public Module { // Implements Module. int64_t TimeUntilNextProcess() override; - int32_t Process() override; + void Process() override; private: class SendProcessingUsage; diff --git a/webrtc/video/vie_sync_module.cc b/webrtc/video/vie_sync_module.cc index dc924fb62f..f8376e53d1 100644 --- a/webrtc/video/vie_sync_module.cc +++ b/webrtc/video/vie_sync_module.cc @@ -88,14 +88,14 @@ int64_t ViESyncModule::TimeUntilNextProcess() { return kSyncIntervalMs - (TickTime::Now() - last_sync_time_).Milliseconds(); } -int32_t ViESyncModule::Process() { +void ViESyncModule::Process() { rtc::CritScope lock(&data_cs_); last_sync_time_ = TickTime::Now(); const int current_video_delay_ms = vcm_->Delay(); if (voe_channel_id_ == -1) { - return 0; + return; } assert(video_rtp_rtcp_ && voe_sync_interface_); assert(sync_.get()); @@ -105,7 +105,7 @@ int32_t ViESyncModule::Process() { if (voe_sync_interface_->GetDelayEstimate(voe_channel_id_, &audio_jitter_buffer_delay_ms, &playout_buffer_delay_ms) != 0) { - return 0; + return; } const int current_audio_delay_ms = audio_jitter_buffer_delay_ms + playout_buffer_delay_ms; @@ -114,26 +114,26 @@ int32_t ViESyncModule::Process() { RtpReceiver* voice_receiver = NULL; if (0 != voe_sync_interface_->GetRtpRtcp(voe_channel_id_, &voice_rtp_rtcp, &voice_receiver)) { - return 0; + return; } assert(voice_rtp_rtcp); assert(voice_receiver); if (UpdateMeasurements(&video_measurement_, *video_rtp_rtcp_, *video_receiver_) != 0) { - return 0; + return; } if (UpdateMeasurements(&audio_measurement_, *voice_rtp_rtcp, *voice_receiver) != 0) { - return 0; + return; } int relative_delay_ms; // Calculate how much later or earlier the audio stream is compared to video. if (!sync_->ComputeRelativeDelay(audio_measurement_, video_measurement_, &relative_delay_ms)) { - return 0; + return; } TRACE_COUNTER1("webrtc", "SyncCurrentVideoDelay", current_video_delay_ms); @@ -147,7 +147,7 @@ int32_t ViESyncModule::Process() { current_audio_delay_ms, &target_audio_delay_ms, &target_video_delay_ms)) { - return 0; + return; } if (voe_sync_interface_->SetMinimumPlayoutDelay( @@ -155,7 +155,6 @@ int32_t ViESyncModule::Process() { LOG(LS_ERROR) << "Error setting voice delay."; } vcm_->SetMinimumPlayoutDelay(target_video_delay_ms); - return 0; } } // namespace webrtc diff --git a/webrtc/video/vie_sync_module.h b/webrtc/video/vie_sync_module.h index 779eb00a45..5724ce799a 100644 --- a/webrtc/video/vie_sync_module.h +++ b/webrtc/video/vie_sync_module.h @@ -40,7 +40,7 @@ class ViESyncModule : public Module { // Implements Module. int64_t TimeUntilNextProcess() override; - int32_t Process() override; + void Process() override; private: rtc::CriticalSection data_cs_; diff --git a/webrtc/voice_engine/monitor_module.cc b/webrtc/voice_engine/monitor_module.cc index 2d8f4d4656..fb3c2b4920 100644 --- a/webrtc/voice_engine/monitor_module.cc +++ b/webrtc/voice_engine/monitor_module.cc @@ -57,7 +57,7 @@ MonitorModule::TimeUntilNextProcess() return kAverageProcessUpdateTimeMs - (now - _lastProcessTime); } -int32_t +void MonitorModule::Process() { _lastProcessTime = TickTime::MillisecondTimestamp(); @@ -66,7 +66,6 @@ MonitorModule::Process() { _observerPtr->OnPeriodicProcess(); } - return 0; } } // namespace voe diff --git a/webrtc/voice_engine/monitor_module.h b/webrtc/voice_engine/monitor_module.h index 5539915238..f026f725d5 100644 --- a/webrtc/voice_engine/monitor_module.h +++ b/webrtc/voice_engine/monitor_module.h @@ -42,7 +42,7 @@ public: public: // module int64_t TimeUntilNextProcess() override; - int32_t Process() override; + void Process() override; private: rtc::CriticalSection _callbackCritSect; diff --git a/webrtc/voice_engine/output_mixer.cc b/webrtc/voice_engine/output_mixer.cc index aa50e0bf2b..1c9525a1ab 100644 --- a/webrtc/voice_engine/output_mixer.cc +++ b/webrtc/voice_engine/output_mixer.cc @@ -224,7 +224,8 @@ OutputMixer::SetAnonymousMixabilityStatus(MixerParticipant& participant, int32_t OutputMixer::MixActiveChannels() { - return _mixerModule.Process(); + _mixerModule.Process(); + return 0; } int