Adding DTX to WebRTC Opus wrapper

This is a step toward adding Opus DTX support in WebRTC.

Note that opus_encode() returns 1 byte in case of DTX, then the packet does not need to be transmitted. See

https://mf4.xiph.org/jenkins/view/opus/job/opus/ws/doc/html/group__opus__encoder.html

We transmit the first 1-byte packet to let decoder be in-sync

BUG=webrtc:1014
R=henrik.lundin@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/13219004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7846 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
minyue@webrtc.org
2014-12-09 13:27:39 +00:00
parent 5c3ee4bce6
commit 4321f175f1
5 changed files with 390 additions and 108 deletions

View File

@ -39,7 +39,7 @@ int16_t WebRtcOpus_EncoderFree(OpusEncInst* inst);
* Output:
* - encoded : Output compressed data buffer
*
* Return value : >0 - Length (in bytes) of coded data
* Return value : >=0 - Length (in bytes) of coded data
* -1 - Error
*/
int16_t WebRtcOpus_Encode(OpusEncInst* inst,
@ -130,6 +130,32 @@ int16_t WebRtcOpus_EnableFec(OpusEncInst* inst);
*/
int16_t WebRtcOpus_DisableFec(OpusEncInst* inst);
/****************************************************************************
* WebRtcOpus_EnableDtx()
*
* This function enables Opus internal DTX for encoding.
*
* Input:
* - inst : Encoder context
*
* Return value : 0 - Success
* -1 - Error
*/
int16_t WebRtcOpus_EnableDtx(OpusEncInst* inst);
/****************************************************************************
* WebRtcOpus_DisableDtx()
*
* This function disables Opus internal DTX for encoding.
*
* Input:
* - inst : Encoder context
*
* Return value : 0 - Success
* -1 - Error
*/
int16_t WebRtcOpus_DisableDtx(OpusEncInst* inst);
/*
* WebRtcOpus_SetComplexity(...)
*