Make NetEqController::TargetLevelMs const, part 2
Followup to https://webrtc-review.googlesource.com/c/src/+/183881. Bug: webrtc:11622 Change-Id: I8d76bf082e81ba1217d20e57c6ae6555eca2fc7b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183883 Reviewed-by: Ivo Creusen <ivoc@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#32078}
This commit is contained in:
parent
f5c373b5fb
commit
673027b4a5
@ -152,15 +152,7 @@ class NetEqController {
|
||||
virtual void AddSampleMemory(int32_t value) = 0;
|
||||
|
||||
// Returns the target buffer level in ms.
|
||||
// TODO(bugs.webrtc.org/11622): Delete the non-const version and default
|
||||
// implementation, once downstream code is updated.
|
||||
virtual int TargetLevelMs() {
|
||||
return const_cast<const NetEqController*>(this)->TargetLevelMs();
|
||||
}
|
||||
|
||||
virtual int TargetLevelMs() const {
|
||||
return const_cast<NetEqController*>(this)->TargetLevelMs();
|
||||
}
|
||||
virtual int TargetLevelMs() const = 0;
|
||||
|
||||
// Notify the NetEqController that a packet has arrived. Returns the relative
|
||||
// arrival delay, if it can be computed.
|
||||
|
||||
@ -70,7 +70,7 @@ class DecisionLogic : public NetEqController {
|
||||
// Adds |value| to |sample_memory_|.
|
||||
void AddSampleMemory(int32_t value) override { sample_memory_ += value; }
|
||||
|
||||
int TargetLevelMs() override {
|
||||
int TargetLevelMs() const override {
|
||||
return ((delay_manager_->TargetLevel() * packet_length_samples_) >> 8) /
|
||||
rtc::CheckedDivExact(sample_rate_, 1000);
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ class MockNetEqController : public NetEqController {
|
||||
MOCK_METHOD(void, SetCngOff, (), (override));
|
||||
MOCK_METHOD(void, ExpandDecision, (NetEq::Operation operation), (override));
|
||||
MOCK_METHOD(void, AddSampleMemory, (int32_t value), (override));
|
||||
MOCK_METHOD(int, TargetLevelMs, (), (override));
|
||||
MOCK_METHOD(int, TargetLevelMs, (), (const, override));
|
||||
MOCK_METHOD(absl::optional<int>,
|
||||
PacketArrived,
|
||||
(bool last_cng_or_dtmf,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user