/* * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef MODULES_AUDIO_CODING_NETEQ_NACK_TRACKER_H_ #define MODULES_AUDIO_CODING_NETEQ_NACK_TRACKER_H_ #include <stddef.h> #include <stdint.h> #include <map> #include <vector> #include "absl/types/optional.h" #include "api/field_trials_view.h" #include "modules/include/module_common_types_public.h" #include "rtc_base/gtest_prod_util.h" // // The NackTracker class keeps track of the lost packets, an estimate of // time-to-play for each packet is also given. // // Every time a packet is pushed into NetEq, LastReceivedPacket() has to be // called to update the NACK list. // // Every time 10ms audio is pulled from NetEq LastDecodedPacket() should be // called, and time-to-play is updated at that moment. // // If packet N is received, any packet prior to N which has not arrived is // considered lost, and should be labeled as "missing" (the size of // the list might be limited and older packet eliminated from the list). // // The NackTracker class has to know about the sample rate of the packets to // compute time-to-play. So sample rate should be set as soon as the first // packet is received. If there is a change in the receive codec (sender changes // codec) then NackTracker should be reset. This is because NetEQ would flush // its buffer and re-transmission is meaning less for old packet. Therefore, in // that case, after reset the sampling rate has to be updated. // // Thread Safety // ============= // Please note that this class in not thread safe. The class must be protected // if different APIs are called from different threads. // namespace webrtc { class NackTracker { … }; } // namespace webrtc #endif // MODULES_AUDIO_CODING_NETEQ_NACK_TRACKER_H_