Remove ignored return code from modules.
ModuleProcessImpl doesn't act on return codes and having them around is confusing (it's unclear what an error return code here would do even). BUG= R=tommi@webrtc.org Review URL: https://codereview.webrtc.org/1703833002 . Cr-Commit-Position: refs/heads/master@{#11747}
This commit is contained in:
@ -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(
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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(
|
||||
|
@ -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(
|
||||
|
@ -64,7 +64,7 @@ public:
|
||||
|
||||
// Module functions
|
||||
int64_t TimeUntilNextProcess() override;
|
||||
int32_t Process() override;
|
||||
void Process() override;
|
||||
|
||||
// AudioConferenceMixer functions
|
||||
int32_t RegisterMixedStreamCallback(
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
@ -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(
|
||||
|
@ -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; }
|
||||
|
@ -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(
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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_;
|
||||
|
@ -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|
|
||||
|
@ -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,
|
||||
|
@ -26,7 +26,7 @@ public:
|
||||
MediaFileImpl(const int32_t id);
|
||||
~MediaFileImpl();
|
||||
|
||||
int32_t Process() override;
|
||||
void Process() override;
|
||||
int64_t TimeUntilNextProcess() override;
|
||||
|
||||
// MediaFile functions
|
||||
|
@ -373,7 +373,7 @@ int64_t PacedSender::TimeUntilNextProcess() {
|
||||
return std::max<int64_t>(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<size_t>(padding_needed));
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool PacedSender::SendPacket(const paced_sender::Packet& packet) {
|
||||
|
@ -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.
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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));
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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() {
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -67,7 +67,7 @@ class NullBweSender : public BweSender {
|
||||
int64_t TimeUntilNextProcess() override {
|
||||
return std::numeric_limits<int64_t>::max();
|
||||
}
|
||||
int Process() override { return 0; }
|
||||
void Process() override {}
|
||||
|
||||
private:
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(NullBweSender);
|
||||
|
@ -238,8 +238,7 @@ int64_t NadaBweSender::TimeUntilNextProcess() {
|
||||
return 100;
|
||||
}
|
||||
|
||||
int NadaBweSender::Process() {
|
||||
return 0;
|
||||
void NadaBweSender::Process() {
|
||||
}
|
||||
|
||||
void NadaBweSender::AcceleratedRampUp(const NadaFeedback& fb) {
|
||||
|
@ -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,
|
||||
|
@ -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 {
|
||||
|
@ -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<BitrateController> bitrate_controller_;
|
||||
|
@ -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)
|
||||
|
@ -31,7 +31,7 @@ class FullBweSender : public BweSender, public RemoteBitrateObserver {
|
||||
void OnReceiveBitrateChanged(const std::vector<uint32_t>& ssrcs,
|
||||
uint32_t bitrate) override;
|
||||
int64_t TimeUntilNextProcess() override;
|
||||
int Process() override;
|
||||
void Process() override;
|
||||
|
||||
protected:
|
||||
rtc::scoped_ptr<BitrateController> bitrate_controller_;
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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) {}
|
||||
|
@ -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(
|
||||
|
@ -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) {
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
@ -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() {
|
||||
|
@ -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));
|
||||
}
|
||||
|
@ -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() {
|
||||
|
@ -53,7 +53,7 @@ public:
|
||||
static void DestroyVideoRender(VideoRender* module);
|
||||
|
||||
int64_t TimeUntilNextProcess() override = 0;
|
||||
int32_t Process() override = 0;
|
||||
void Process() override = 0;
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
|
@ -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()
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
virtual ~ModuleVideoRenderImpl();
|
||||
|
||||
virtual int64_t TimeUntilNextProcess();
|
||||
virtual int32_t Process();
|
||||
virtual void Process();
|
||||
|
||||
/*
|
||||
* Returns the render window
|
||||
|
@ -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()
|
||||
|
@ -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 {
|
||||
|
@ -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.
|
||||
|
@ -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) {
|
||||
|
@ -90,7 +90,7 @@ class OveruseFrameDetector : public Module {
|
||||
|
||||
// Implements Module.
|
||||
int64_t TimeUntilNextProcess() override;
|
||||
int32_t Process() override;
|
||||
void Process() override;
|
||||
|
||||
private:
|
||||
class SendProcessingUsage;
|
||||
|
@ -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
|
||||
|
@ -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_;
|
||||
|
@ -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
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
public: // module
|
||||
int64_t TimeUntilNextProcess() override;
|
||||
|
||||
int32_t Process() override;
|
||||
void Process() override;
|
||||
|
||||
private:
|
||||
rtc::CriticalSection _callbackCritSect;
|
||||
|
@ -224,7 +224,8 @@ OutputMixer::SetAnonymousMixabilityStatus(MixerParticipant& participant,
|
||||
int32_t
|
||||
OutputMixer::MixActiveChannels()
|
||||
{
|
||||
return _mixerModule.Process();
|
||||
_mixerModule.Process();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
|
Reference in New Issue
Block a user