From 152c34cf11927193c0b29ddf2545e392e603aa82 Mon Sep 17 00:00:00 2001 From: "bjornv@webrtc.org" Date: Mon, 23 Jan 2012 12:36:46 +0000 Subject: [PATCH] VAD-refactor. Changed to int as return value for WebRtcVad_set_mode(). Impact on NetEq function pointers. Other components already treat the output as int. These are: * audio_processing * funtion test in audio_conference_mixer * audio_coding TEST=vad_unittests, neteq_unittests Review URL: https://webrtc-codereview.appspot.com/367003 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1503 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/common_audio/vad/include/webrtc_vad.h | 4 ++-- src/common_audio/vad/webrtc_vad.c | 4 ++-- src/modules/audio_coding/neteq/dsp.c | 4 ++-- src/modules/audio_coding/neteq/dsp.h | 4 ++-- .../audio_coding/neteq/interface/webrtc_neteq_internal.h | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/common_audio/vad/include/webrtc_vad.h b/src/common_audio/vad/include/webrtc_vad.h index 733cdca7f..4324381ca 100644 --- a/src/common_audio/vad/include/webrtc_vad.h +++ b/src/common_audio/vad/include/webrtc_vad.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -127,7 +127,7 @@ int WebRtcVad_Init(VadInst *vad_inst); * Return value : 0 - Ok * -1 - Error */ -WebRtc_Word16 WebRtcVad_set_mode(VadInst *vad_inst, WebRtc_Word16 mode); +int WebRtcVad_set_mode(VadInst *vad_inst, WebRtc_Word16 mode); /**************************************************************************** * WebRtcVad_Process(...) diff --git a/src/common_audio/vad/webrtc_vad.c b/src/common_audio/vad/webrtc_vad.c index cd1d95e80..493a764ff 100644 --- a/src/common_audio/vad/webrtc_vad.c +++ b/src/common_audio/vad/webrtc_vad.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -113,7 +113,7 @@ int WebRtcVad_Init(VadInst *vad_inst) return WebRtcVad_InitCore((VadInstT*)vad_inst, mode); } -WebRtc_Word16 WebRtcVad_set_mode(VadInst *vad_inst, WebRtc_Word16 mode) +int WebRtcVad_set_mode(VadInst *vad_inst, WebRtc_Word16 mode) { VadInstT* vad_ptr; diff --git a/src/modules/audio_coding/neteq/dsp.c b/src/modules/audio_coding/neteq/dsp.c index 53f7006ca..441d981e7 100644 --- a/src/modules/audio_coding/neteq/dsp.c +++ b/src/modules/audio_coding/neteq/dsp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -482,7 +482,7 @@ int WebRtcNetEQ_SetVADModeInternal(PostDecodeVAD_t *VADInst, if (VADInst->VADState != NULL) { /* call setmode function */ - res = (int) VADInst->setmodeFunction(VADInst->VADState, mode); + res = VADInst->setmodeFunction(VADInst->VADState, mode); } return(res); diff --git a/src/modules/audio_coding/neteq/dsp.h b/src/modules/audio_coding/neteq/dsp.h index ac947b24d..4cafb8faa 100644 --- a/src/modules/audio_coding/neteq/dsp.h +++ b/src/modules/audio_coding/neteq/dsp.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -189,7 +189,7 @@ typedef struct ExpandInst_t_ * WebRtcVad_set_mode and WebRtcVad_Process, respectively, all found in webrtc_vad.h. */ typedef int (*VADInitFunction)(void *VAD_inst); -typedef WebRtc_Word16 (*VADSetmodeFunction)(void *VAD_inst, WebRtc_Word16 mode); +typedef int (*VADSetmodeFunction)(void *VAD_inst, WebRtc_Word16 mode); typedef WebRtc_Word16 (*VADFunction)(void *VAD_inst, WebRtc_Word16 fs, WebRtc_Word16 *frame, WebRtc_Word16 frameLen); diff --git a/src/modules/audio_coding/neteq/interface/webrtc_neteq_internal.h b/src/modules/audio_coding/neteq/interface/webrtc_neteq_internal.h index b67abdd5d..1044727ca 100644 --- a/src/modules/audio_coding/neteq/interface/webrtc_neteq_internal.h +++ b/src/modules/audio_coding/neteq/interface/webrtc_neteq_internal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -139,7 +139,7 @@ int WebRtcNetEQ_GetRawFrameWaitingTimes(void *inst, * WebRtcVad_set_mode and WebRtcVad_Process, respectively, all found in webrtc_vad.h. */ typedef int (*WebRtcNetEQ_VADInitFunction)(void *VAD_inst); -typedef WebRtc_Word16 (*WebRtcNetEQ_VADSetmodeFunction)(void *VAD_inst, WebRtc_Word16 mode); +typedef int (*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);