Signal to NetEq Controller if arrived packets are DTX packets.

This CL also puts the arguments in a struct to allow for easier future additions.

Bug: webrtc:11005
Change-Id: I47bf664e7106b724eb1fc42299c42bbf022393ef
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/188385
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32409}
This commit is contained in:
Ivo Creusen
2020-10-14 17:54:22 +02:00
committed by Commit Bot
parent c4de62d51f
commit a2b31c35ff
6 changed files with 99 additions and 47 deletions

View File

@ -97,6 +97,14 @@ class NetEqController {
size_t sync_buffer_samples;
};
struct PacketArrivedInfo {
size_t packet_length_samples;
uint32_t main_timestamp;
uint16_t main_sequence_number;
bool is_cng_or_dtmf;
bool is_dtx;
};
virtual ~NetEqController() = default;
// Resets object to a clean state.
@ -154,15 +162,33 @@ class NetEqController {
// Returns the target buffer level in ms.
virtual int TargetLevelMs() const = 0;
// Notify the NetEqController that a packet has arrived. Returns the relative
// arrival delay, if it can be computed.
// Deprecated.
// TODO(ivoc): Remove when downstream is updated.
virtual absl::optional<int> PacketArrived(bool last_cng_or_dtmf,
size_t packet_length_samples,
bool should_update_stats,
uint16_t main_sequence_number,
uint32_t main_timestamp,
int fs_hz) = 0;
int fs_hz) {
PacketArrivedInfo info;
info.is_dtx = false;
info.is_cng_or_dtmf = last_cng_or_dtmf;
info.packet_length_samples = packet_length_samples;
info.main_sequence_number = main_sequence_number;
info.main_timestamp = main_timestamp;
return PacketArrived(fs_hz, should_update_stats, info);
}
// Notify the NetEqController that a packet has arrived. Returns the relative
// arrival delay, if it can be computed.
// TODO(ivoc): Make pure virtual when downstream is updated.
virtual absl::optional<int> PacketArrived(int fs_hz,
bool should_update_stats,
const PacketArrivedInfo& info) {
return PacketArrived(info.is_cng_or_dtmf, info.packet_length_samples,
should_update_stats, info.main_sequence_number,
info.main_timestamp, fs_hz);
}
// Notify the NetEqController that we are currently in muted state.
// TODO(ivoc): Make pure virtual when downstream is updated.
virtual void NotifyMutedState() {}