Allow NetEQ to use real packet durations.
This is a copy of http://review.webrtc.org/864014/ This adds a FuncDurationEst to each codec instance which estimates the duration of a packet given the packet contents and the duration of the previous packet. By default, this simply returns the duration of the previous packet (which is what is currently assumed to be the duration of all future packets). This patch also provides an initial implementation of this function for G.711 which returns the actual number of samples in the packet. BUG=issue1015 Review URL: https://webrtc-codereview.appspot.com/935016 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3129 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -648,7 +648,8 @@ int WebRtcNetEQ_CodecDbAdd(void *inst, WebRtcNetEQ_CodecDef *codecInst)
|
||||
codecInst->payloadType, codecInst->funcDecode, codecInst->funcDecodeRCU,
|
||||
codecInst->funcDecodePLC, codecInst->funcDecodeInit, codecInst->funcAddLatePkt,
|
||||
codecInst->funcGetMDinfo, codecInst->funcGetPitch, codecInst->funcUpdBWEst,
|
||||
codecInst->funcGetErrorCode, codecInst->codec_state, codecInst->codec_fs);
|
||||
codecInst->funcDurationEst, codecInst->funcGetErrorCode,
|
||||
codecInst->codec_state, codecInst->codec_fs);
|
||||
if (ok != 0)
|
||||
{
|
||||
NetEqMainInst->ErrorCode = -ok;
|
||||
@ -1179,7 +1180,8 @@ int WebRtcNetEQ_GetNetworkStatistics(void *inst, WebRtcNetEQ_NetworkStatistics *
|
||||
WebRtc_Word32 temp32;
|
||||
/* Query packet buffer for number of samples. */
|
||||
temp32 = WebRtcNetEQ_PacketBufferGetSize(
|
||||
&NetEqMainInst->MCUinst.PacketBuffer_inst);
|
||||
&NetEqMainInst->MCUinst.PacketBuffer_inst,
|
||||
&NetEqMainInst->MCUinst.codec_DB_inst);
|
||||
|
||||
/* Divide by sample rate.
|
||||
* Calculate temp32 * 1000 / fs to get result in ms. */
|
||||
|
||||
Reference in New Issue
Block a user