Make NetEqController::TargetLevelMs method const

This method is used by GetStats, and hence must not modify any state.

This cl is step one of the api change, the non-const version of the
method can be deleted once downstream implementations of this
interface are updated.

Bug: webrtc:11622
Change-Id: Icfaccee6bc918ac5c8a39dd2567a1081e342e9e8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183881
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32072}
This commit is contained in:
Niels Möller 2020-09-10 16:44:48 +02:00 committed by Commit Bot
parent fc83cdc819
commit 0240bcc1f3

View File

@ -152,7 +152,15 @@ class NetEqController {
virtual void AddSampleMemory(int32_t value) = 0;
// Returns the target buffer level in ms.
virtual int TargetLevelMs() = 0;
// 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();
}
// Notify the NetEqController that a packet has arrived. Returns the relative
// arrival delay, if it can be computed.