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
This commit is contained in:
turaj@webrtc.org
2013-09-26 00:27:56 +00:00
parent 6b1e21924a
commit 7b75ac6756
7 changed files with 365 additions and 39 deletions

View File

@ -105,7 +105,8 @@ class NetEq {
kFrameSplitError,
kRedundancySplitError,
kPacketBufferCorruption,
kOversizePacket
kOversizePacket,
kSyncPacketNotAccepted
};
static const int kMaxNumPacketsInBuffer = 240; // TODO(hlundin): Remove.
@ -127,6 +128,18 @@ class NetEq {
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 @@ class NetEq {
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;