VAD refactor: int return value for Init.

For consistency and as part of style, the return value of WebRtcVad_Init() has been changed to int.

Impact:
 1) audio_processing, audio_coding, a test in CNG, functionTest in audio_conference_mixer, a test in net_eq all used int values. Hence, unaffected.
 2) Function pointers in net_eq changed.
 3) The VADInit in neteq/dsp.c boiled down to typecast into int anyhow, which now is removed.

TEST=vad_unittests, neteq_unittests
Review URL: https://webrtc-codereview.appspot.com/355003

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1453 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
bjornv@webrtc.org 2012-01-18 14:51:02 +00:00
parent 5badc7e969
commit ab2bb82ac9
5 changed files with 5 additions and 5 deletions

View File

@ -110,7 +110,7 @@ WebRtc_Word16 WebRtcVad_Free(VadInst *vad_inst);
* Return value : 0 - Ok
* -1 - Error
*/
WebRtc_Word16 WebRtcVad_Init(VadInst *vad_inst);
int WebRtcVad_Init(VadInst *vad_inst);
/****************************************************************************
* WebRtcVad_set_mode(...)

View File

@ -101,7 +101,7 @@ WebRtc_Word16 WebRtcVad_Free(VadInst *vad_inst)
return 0;
}
WebRtc_Word16 WebRtcVad_Init(VadInst *vad_inst)
int WebRtcVad_Init(VadInst *vad_inst)
{
short mode = 0; // Default high quality

View File

@ -429,7 +429,7 @@ int WebRtcNetEQ_InitVAD(PostDecodeVAD_t *VADInst, WebRtc_UWord16 fs)
&& VADInst->setmodeFunction != NULL /* ... pointers ... */
&& VADInst->VADFunction != NULL) /* ... are defined */
{
res = (int) VADInst->initFunction( VADInst->VADState ); /* call VAD init function */
res = VADInst->initFunction( VADInst->VADState ); /* call VAD init function */
res |= WebRtcNetEQ_SetVADModeInternal( VADInst, VADInst->VADMode );
if (res!=0)

View File

@ -188,7 +188,7 @@ typedef struct ExpandInst_t_
* These function pointers match the definitions of WebRtc VAD functions WebRtcVad_Init,
* WebRtcVad_set_mode and WebRtcVad_Process, respectively, all found in webrtc_vad.h.
*/
typedef WebRtc_Word16 (*VADInitFunction)(void *VAD_inst);
typedef int (*VADInitFunction)(void *VAD_inst);
typedef WebRtc_Word16 (*VADSetmodeFunction)(void *VAD_inst, WebRtc_Word16 mode);
typedef WebRtc_Word16 (*VADFunction)(void *VAD_inst, WebRtc_Word16 fs, WebRtc_Word16 *frame,
WebRtc_Word16 frameLen);

View File

@ -138,7 +138,7 @@ int WebRtcNetEQ_GetRawFrameWaitingTimes(void *inst,
* These function pointers match the definitions of webrtc VAD functions WebRtcVad_Init,
* WebRtcVad_set_mode and WebRtcVad_Process, respectively, all found in webrtc_vad.h.
*/
typedef WebRtc_Word16 (*WebRtcNetEQ_VADInitFunction)(void *VAD_inst);
typedef int (*WebRtcNetEQ_VADInitFunction)(void *VAD_inst);
typedef WebRtc_Word16 (*WebRtcNetEQ_VADSetmodeFunction)(void *VAD_inst, WebRtc_Word16 mode);
typedef WebRtc_Word16 (*WebRtcNetEQ_VADFunction)(void *VAD_inst, WebRtc_Word16 fs,
WebRtc_Word16 *frame, WebRtc_Word16 frameLen);