Sync-packet insertion into NetEq4. This is related to r3883 & r4052 for NetEq 3.
BUG=
R=henrik.lundin@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/2099004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@4850 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/audio_coding/neteq4/interface/neteq.h b/webrtc/modules/audio_coding/neteq4/interface/neteq.h
index 547360b..ded87f5 100644
--- a/webrtc/modules/audio_coding/neteq4/interface/neteq.h
+++ b/webrtc/modules/audio_coding/neteq4/interface/neteq.h
@@ -105,7 +105,8 @@
kFrameSplitError,
kRedundancySplitError,
kPacketBufferCorruption,
- kOversizePacket
+ kOversizePacket,
+ kSyncPacketNotAccepted
};
static const int kMaxNumPacketsInBuffer = 240; // TODO(hlundin): Remove.
@@ -127,6 +128,18 @@
int length_bytes,
uint32_t receive_timestamp) = 0;
+ // Inserts a sync-packet into packet queue. Sync-packets are decoded to
+ // silence and are intended to keep AV-sync intact in an event of long packet
+ // losses when Video NACK is enabled but Audio NACK is not. Clients of NetEq
+ // might insert sync-packet when they observe that buffer level of NetEq is
+ // decreasing below a certain threshold, defined by the application.
+ // Sync-packets should have the same payload type as the last audio payload
+ // type, i.e. they cannot have DTMF or CNG payload type, nor a codec change
+ // can be implied by inserting a sync-packet.
+ // Returns kOk on success, kFail on failure.
+ virtual int InsertSyncPacket(const WebRtcRTPHeader& rtp_header,
+ uint32_t receive_timestamp) = 0;
+
// Instructs NetEq to deliver 10 ms of audio data. The data is written to
// |output_audio|, which can hold (at least) |max_length| elements.
// The number of channels that were written to the output is provided in
@@ -244,10 +257,6 @@
virtual int DecodedRtpInfo(int* sequence_number,
uint32_t* timestamp) const = 0;
- // Not implemented.
- virtual int InsertSyncPacket(const WebRtcRTPHeader& rtp_header,
- uint32_t receive_timestamp) = 0;
-
// Sets the background noise mode.
virtual void SetBackgroundNoiseMode(NetEqBackgroundNoiseMode mode) = 0;