Opus mono/stereo on the same payloadtype, and fix of memory bug

During call setup Opus should always be signaled as a 48000 Hz stereo codec, not depending on what we plan to send, or how we plan to decode received packets.
The previous implementation had different payload types for mono and stereo, which breaks the proposed standard.

While working on this CL I ran in to the problem reported earlier, that we could get a crash related to deleting decoder memory. This should now be solved in Patch Set 3.

BUG=issue1013, issue1112

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3177 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
tina.legrand@webrtc.org
2012-11-28 12:23:29 +00:00
parent 81fb7bfd8b
commit c4590580e8
14 changed files with 161 additions and 60 deletions

View File

@ -117,7 +117,6 @@ int WebRtcNetEQ_DbAdd(CodecDbInst_t *inst, enum WebRtcNetEQDecoder codec,
#endif
#ifdef NETEQ_OPUS_CODEC
case kDecoderOpus :
case kDecoderOpus_2ch :
#endif
#ifdef NETEQ_G722_CODEC
case kDecoderG722 :
@ -466,7 +465,6 @@ int WebRtcNetEQ_DbGetSplitInfo(SplitInfo_t *inst, enum WebRtcNetEQDecoder codecI
#endif
#ifdef NETEQ_OPUS_CODEC
case kDecoderOpus:
case kDecoderOpus_2ch :
#endif
#ifdef NETEQ_ARBITRARY_CODEC
case kDecoderArbitrary:

View File

@ -63,7 +63,6 @@ enum WebRtcNetEQDecoder
kDecoderG722_1C_32,
kDecoderG722_1C_48,
kDecoderOpus,
kDecoderOpus_2ch,
kDecoderSPEEX_8,
kDecoderSPEEX_16,
kDecoderCELT_32,

View File

@ -621,8 +621,7 @@ int WebRtcNetEQ_GetDefaultCodecSettings(const enum WebRtcNetEQDecoder *codecID,
codecBytes = 1560; /* 240ms @ 52kbps (30ms frames) */
codecBuffers = 8;
}
else if ((codecID[i] == kDecoderOpus) ||
(codecID[i] == kDecoderOpus_2ch))
else if (codecID[i] == kDecoderOpus)
{
codecBytes = 15300; /* 240ms @ 510kbps (60ms frames) */
codecBuffers = 30; /* Replicating the value for PCMu/a */

View File

@ -381,7 +381,6 @@ int WebRtcNetEQ_GetTimestampScaling(MCUInst_t *MCU_inst, int rtpPayloadType)
break;
}
case kDecoderOpus:
case kDecoderOpus_2ch:
{
/* We resample Opus internally to 32 kHz, but timestamps
* are counted at 48 kHz. So there are two output samples