Removed versions in module/audio_processing and common_audio/vad.
Affected vad_unittest only. In addition changed to correct header guards. Review URL: https://webrtc-codereview.appspot.com/367019 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1567 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
		| @@ -13,8 +13,8 @@ | |||||||
|  * This header file includes the VAD API calls. Specific function calls are given below. |  * This header file includes the VAD API calls. Specific function calls are given below. | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #ifndef WEBRTC_VAD_WEBRTC_VAD_H_ | #ifndef WEBRTC_COMMON_AUDIO_VAD_INCLUDE_WEBRTC_VAD_H_ | ||||||
| #define WEBRTC_VAD_WEBRTC_VAD_H_ | #define WEBRTC_COMMON_AUDIO_VAD_INCLUDE_WEBRTC_VAD_H_ | ||||||
|  |  | ||||||
| #include "typedefs.h" | #include "typedefs.h" | ||||||
|  |  | ||||||
| @@ -25,20 +25,6 @@ extern "C" | |||||||
| { | { | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| /**************************************************************************** |  | ||||||
|  * WebRtcVad_get_version(...) |  | ||||||
|  * |  | ||||||
|  * This function returns the version number of the code. |  | ||||||
|  * |  | ||||||
|  * Output: |  | ||||||
|  *      - version       : Pointer to a buffer where the version info will |  | ||||||
|  *                        be stored. |  | ||||||
|  * Input: |  | ||||||
|  *      - size_bytes    : Size of the buffer. |  | ||||||
|  * |  | ||||||
|  */ |  | ||||||
| WebRtc_Word16 WebRtcVad_get_version(char *version, size_t size_bytes); |  | ||||||
|  |  | ||||||
| /**************************************************************************** | /**************************************************************************** | ||||||
|  * WebRtcVad_AssignSize(...)  |  * WebRtcVad_AssignSize(...)  | ||||||
|  * |  * | ||||||
| @@ -156,4 +142,4 @@ WebRtc_Word16 WebRtcVad_Process(VadInst *vad_inst, | |||||||
| } | } | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #endif // WEBRTC_VAD_WEBRTC_VAD_H_ | #endif  // WEBRTC_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 |  *  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 |  *  that can be found in the LICENSE file in the root of the source | ||||||
| @@ -61,12 +61,6 @@ TEST_F(VadTest, ApiTest) { | |||||||
|     speech[i] = (i * i); |     speech[i] = (i * i); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   // WebRtcVad_get_version() tests |  | ||||||
|   char version[32]; |  | ||||||
|   EXPECT_EQ(-1, WebRtcVad_get_version(NULL, sizeof(version))); |  | ||||||
|   EXPECT_EQ(-1, WebRtcVad_get_version(version, 1)); |  | ||||||
|   EXPECT_EQ(0, WebRtcVad_get_version(version, sizeof(version))); |  | ||||||
|  |  | ||||||
|   // Null instance tests |   // Null instance tests | ||||||
|   EXPECT_EQ(-1, WebRtcVad_Create(NULL)); |   EXPECT_EQ(-1, WebRtcVad_Create(NULL)); | ||||||
|   EXPECT_EQ(-1, WebRtcVad_Init(NULL)); |   EXPECT_EQ(-1, WebRtcVad_Init(NULL)); | ||||||
|   | |||||||
| @@ -22,24 +22,6 @@ | |||||||
|  |  | ||||||
| static const int kInitCheck = 42; | static const int kInitCheck = 42; | ||||||
|  |  | ||||||
| WebRtc_Word16 WebRtcVad_get_version(char *version, size_t size_bytes) |  | ||||||
| { |  | ||||||
|     const char my_version[] = "VAD 1.2.0"; |  | ||||||
|  |  | ||||||
|     if (version == NULL) |  | ||||||
|     { |  | ||||||
|         return -1; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     if (size_bytes < sizeof(my_version)) |  | ||||||
|     { |  | ||||||
|         return -1; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     memcpy(version, my_version, sizeof(my_version)); |  | ||||||
|     return 0; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| WebRtc_Word16 WebRtcVad_AssignSize(int *size_in_bytes) | WebRtc_Word16 WebRtcVad_AssignSize(int *size_in_bytes) | ||||||
| { | { | ||||||
|     *size_in_bytes = sizeof(VadInstT) * 2 / sizeof(WebRtc_Word16); |     *size_in_bytes = sizeof(VadInstT) * 2 / sizeof(WebRtc_Word16); | ||||||
|   | |||||||
| @@ -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 |  *  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 |  *  that can be found in the LICENSE file in the root of the source | ||||||
| @@ -867,23 +867,6 @@ int WebRtcAec_GetDelayMetrics(void* handle, int* median, int* std) { | |||||||
|   return 0; |   return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
| WebRtc_Word32 WebRtcAec_get_version(WebRtc_Word8 *versionStr, WebRtc_Word16 len) |  | ||||||
| { |  | ||||||
|     const char version[] = "AEC 2.5.0"; |  | ||||||
|     const short versionLen = (short)strlen(version) + 1; // +1 for null-termination |  | ||||||
|  |  | ||||||
|     if (versionStr == NULL) { |  | ||||||
|         return -1; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     if (versionLen > len) { |  | ||||||
|         return -1; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     strncpy(versionStr, version, versionLen); |  | ||||||
|     return 0; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| WebRtc_Word32 WebRtcAec_get_error_code(void *aecInst) | WebRtc_Word32 WebRtcAec_get_error_code(void *aecInst) | ||||||
| { | { | ||||||
|     aecpc_t *aecpc = aecInst; |     aecpc_t *aecpc = aecInst; | ||||||
|   | |||||||
| @@ -8,8 +8,8 @@ | |||||||
|  *  be found in the AUTHORS file in the root of the source tree. |  *  be found in the AUTHORS file in the root of the source tree. | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC_MAIN_INTERFACE_ECHO_CANCELLATION_H_ | #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC_INCLUDE_ECHO_CANCELLATION_H_ | ||||||
| #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC_MAIN_INTERFACE_ECHO_CANCELLATION_H_ | #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC_INCLUDE_ECHO_CANCELLATION_H_ | ||||||
|  |  | ||||||
| #include "typedefs.h" | #include "typedefs.h" | ||||||
|  |  | ||||||
| @@ -256,23 +256,7 @@ int WebRtcAec_GetDelayMetrics(void* handle, int* median, int* std); | |||||||
|  */ |  */ | ||||||
| WebRtc_Word32 WebRtcAec_get_error_code(void *aecInst); | WebRtc_Word32 WebRtcAec_get_error_code(void *aecInst); | ||||||
|  |  | ||||||
| /* |  | ||||||
|  * Gets a version string. |  | ||||||
|  * |  | ||||||
|  * Inputs                       Description |  | ||||||
|  * ------------------------------------------------------------------- |  | ||||||
|  * char           *versionStr   Pointer to a string array |  | ||||||
|  * WebRtc_Word16  len           The maximum length of the string |  | ||||||
|  * |  | ||||||
|  * Outputs                      Description |  | ||||||
|  * ------------------------------------------------------------------- |  | ||||||
|  * WebRtc_Word8   *versionStr   Pointer to a string array |  | ||||||
|  * WebRtc_Word32  return         0: OK |  | ||||||
|  *                              -1: error |  | ||||||
|  */ |  | ||||||
| WebRtc_Word32 WebRtcAec_get_version(WebRtc_Word8 *versionStr, WebRtc_Word16 len); |  | ||||||
|  |  | ||||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
| #endif  /* WEBRTC_MODULES_AUDIO_PROCESSING_AEC_MAIN_INTERFACE_ECHO_CANCELLATION_H_ */ | #endif  // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_INCLUDE_ECHO_CANCELLATION_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 |  *  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 |  *  that can be found in the LICENSE file in the root of the source | ||||||
| @@ -702,25 +702,6 @@ size_t WebRtcAecm_echo_path_size_bytes() | |||||||
|     return (PART_LEN1 * sizeof(WebRtc_Word16)); |     return (PART_LEN1 * sizeof(WebRtc_Word16)); | ||||||
| } | } | ||||||
|  |  | ||||||
| WebRtc_Word32 WebRtcAecm_get_version(WebRtc_Word8 *versionStr, WebRtc_Word16 len) |  | ||||||
| { |  | ||||||
|     const char version[] = "AECM 1.2.0"; |  | ||||||
|     const short versionLen = (short)strlen(version) + 1; // +1 for null-termination |  | ||||||
|  |  | ||||||
|     if (versionStr == NULL) |  | ||||||
|     { |  | ||||||
|         return -1; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     if (versionLen > len) |  | ||||||
|     { |  | ||||||
|         return -1; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     strncpy(versionStr, version, versionLen); |  | ||||||
|     return 0; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| WebRtc_Word32 WebRtcAecm_get_error_code(void *aecmInst) | WebRtc_Word32 WebRtcAecm_get_error_code(void *aecmInst) | ||||||
| { | { | ||||||
|     aecmob_t *aecm = aecmInst; |     aecmob_t *aecm = aecmInst; | ||||||
|   | |||||||
| @@ -8,8 +8,8 @@ | |||||||
|  *  be found in the AUTHORS file in the root of the source tree. |  *  be found in the AUTHORS file in the root of the source tree. | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AECM_MAIN_INTERFACE_ECHO_CONTROL_MOBILE_H_ | #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AECM_INCLUDE_ECHO_CONTROL_MOBILE_H_ | ||||||
| #define WEBRTC_MODULES_AUDIO_PROCESSING_AECM_MAIN_INTERFACE_ECHO_CONTROL_MOBILE_H_ | #define WEBRTC_MODULES_AUDIO_PROCESSING_AECM_INCLUDE_ECHO_CONTROL_MOBILE_H_ | ||||||
|  |  | ||||||
| #include "typedefs.h" | #include "typedefs.h" | ||||||
|  |  | ||||||
| @@ -227,24 +227,7 @@ size_t WebRtcAecm_echo_path_size_bytes(); | |||||||
|  */ |  */ | ||||||
| WebRtc_Word32 WebRtcAecm_get_error_code(void *aecmInst); | WebRtc_Word32 WebRtcAecm_get_error_code(void *aecmInst); | ||||||
|  |  | ||||||
| /* |  | ||||||
|  * Gets a version string |  | ||||||
|  * |  | ||||||
|  * Inputs                       Description |  | ||||||
|  * ------------------------------------------------------------------- |  | ||||||
|  * char           *versionStr   Pointer to a string array |  | ||||||
|  * WebRtc_Word16  len           The maximum length of the string |  | ||||||
|  * |  | ||||||
|  * Outputs                      Description |  | ||||||
|  * ------------------------------------------------------------------- |  | ||||||
|  * WebRtc_Word8   *versionStr   Pointer to a string array |  | ||||||
|  * WebRtc_Word32  return        0: OK |  | ||||||
|  *                             -1: error |  | ||||||
|  */ |  | ||||||
| WebRtc_Word32 WebRtcAecm_get_version(WebRtc_Word8 *versionStr, |  | ||||||
|                                      WebRtc_Word16 len); |  | ||||||
|  |  | ||||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
| #endif /* WEBRTC_MODULES_AUDIO_PROCESSING_AECM_MAIN_INTERFACE_ECHO_CONTROL_MOBILE_H_ */ | #endif  // WEBRTC_MODULES_AUDIO_PROCESSING_AECM_INCLUDE_ECHO_CONTROL_MOBILE_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 |  *  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 |  *  that can be found in the LICENSE file in the root of the source | ||||||
| @@ -1692,22 +1692,3 @@ int WebRtcAgc_Init(void *agcInst, WebRtc_Word32 minLevel, WebRtc_Word32 maxLevel | |||||||
|         return 0; |         return 0; | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| int WebRtcAgc_Version(WebRtc_Word8 *versionStr, WebRtc_Word16 length) |  | ||||||
| { |  | ||||||
|     const WebRtc_Word8 version[] = "AGC 1.7.0"; |  | ||||||
|     const WebRtc_Word16 versionLen = (WebRtc_Word16)strlen(version) + 1; |  | ||||||
|  |  | ||||||
|     if (versionStr == NULL) |  | ||||||
|     { |  | ||||||
|         return -1; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     if (versionLen > length) |  | ||||||
|     { |  | ||||||
|         return -1; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     strncpy(versionStr, version, versionLen); |  | ||||||
|     return 0; |  | ||||||
| } |  | ||||||
|   | |||||||
| @@ -8,8 +8,8 @@ | |||||||
|  *  be found in the AUTHORS file in the root of the source tree. |  *  be found in the AUTHORS file in the root of the source tree. | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AGC_MAIN_INTERFACE_GAIN_CONTROL_H_ | #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AGC_INCLUDE_GAIN_CONTROL_H_ | ||||||
| #define WEBRTC_MODULES_AUDIO_PROCESSING_AGC_MAIN_INTERFACE_GAIN_CONTROL_H_ | #define WEBRTC_MODULES_AUDIO_PROCESSING_AGC_INCLUDE_GAIN_CONTROL_H_ | ||||||
|  |  | ||||||
| #include "typedefs.h" | #include "typedefs.h" | ||||||
|  |  | ||||||
| @@ -252,22 +252,8 @@ int WebRtcAgc_Init(void *agcInst, | |||||||
|                    WebRtc_Word16 agcMode, |                    WebRtc_Word16 agcMode, | ||||||
|                    WebRtc_UWord32 fs); |                    WebRtc_UWord32 fs); | ||||||
|  |  | ||||||
| /* |  | ||||||
|  * This function returns a text string containing the version. |  | ||||||
|  * |  | ||||||
|  * Input: |  | ||||||
|  *      - length            : Length of the char array pointed to by version |  | ||||||
|  * Output: |  | ||||||
|  *      - version           : Pointer to a char array of to which the version |  | ||||||
|  *                          : string will be copied. |  | ||||||
|  * |  | ||||||
|  * Return value             :  0 - OK |  | ||||||
|  *                            -1 - Error |  | ||||||
|  */ |  | ||||||
| int WebRtcAgc_Version(WebRtc_Word8 *versionStr, WebRtc_Word16 length); |  | ||||||
|  |  | ||||||
| #if defined(__cplusplus) | #if defined(__cplusplus) | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AGC_MAIN_INTERFACE_GAIN_CONTROL_H_ | #endif  // WEBRTC_MODULES_AUDIO_PROCESSING_AGC_INCLUDE_GAIN_CONTROL_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 |  *  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 |  *  that can be found in the LICENSE file in the root of the source | ||||||
| @@ -328,15 +328,6 @@ int EchoCancellationImpl::Initialize() { | |||||||
|   return apm_->kNoError; |   return apm_->kNoError; | ||||||
| } | } | ||||||
|  |  | ||||||
| int EchoCancellationImpl::get_version(char* version, |  | ||||||
|                                       int version_len_bytes) const { |  | ||||||
|   if (WebRtcAec_get_version(version, version_len_bytes) != 0) { |  | ||||||
|       return apm_->kBadParameterError; |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   return apm_->kNoError; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| void* EchoCancellationImpl::CreateHandle() const { | void* EchoCancellationImpl::CreateHandle() const { | ||||||
|   Handle* handle = NULL; |   Handle* handle = NULL; | ||||||
|   if (WebRtcAec_Create(&handle) != apm_->kNoError) { |   if (WebRtcAec_Create(&handle) != apm_->kNoError) { | ||||||
|   | |||||||
| @@ -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 |  *  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 |  *  that can be found in the LICENSE file in the root of the source | ||||||
| @@ -8,8 +8,8 @@ | |||||||
|  *  be found in the AUTHORS file in the root of the source tree. |  *  be found in the AUTHORS file in the root of the source tree. | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_ECHO_CANCELLATION_IMPL_H_ | #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_IMPL_H_ | ||||||
| #define WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_ECHO_CANCELLATION_IMPL_H_ | #define WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_IMPL_H_ | ||||||
|  |  | ||||||
| #include "audio_processing.h" | #include "audio_processing.h" | ||||||
| #include "processing_component.h" | #include "processing_component.h" | ||||||
| @@ -34,7 +34,6 @@ class EchoCancellationImpl : public EchoCancellation, | |||||||
|  |  | ||||||
|   // ProcessingComponent implementation. |   // ProcessingComponent implementation. | ||||||
|   virtual int Initialize(); |   virtual int Initialize(); | ||||||
|   virtual int get_version(char* version, int version_len_bytes) const; |  | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   // EchoCancellation implementation. |   // EchoCancellation implementation. | ||||||
| @@ -73,4 +72,4 @@ class EchoCancellationImpl : public EchoCancellation, | |||||||
| }; | }; | ||||||
| }  // namespace webrtc | }  // namespace webrtc | ||||||
|  |  | ||||||
| #endif  // WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_ECHO_CANCELLATION_IMPL_H_ | #endif  // WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_IMPL_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 |  *  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 |  *  that can be found in the LICENSE file in the root of the source | ||||||
| @@ -248,15 +248,6 @@ int EchoControlMobileImpl::Initialize() { | |||||||
|   return ProcessingComponent::Initialize(); |   return ProcessingComponent::Initialize(); | ||||||
| } | } | ||||||
|  |  | ||||||
| int EchoControlMobileImpl::get_version(char* version, |  | ||||||
|                                        int version_len_bytes) const { |  | ||||||
|   if (WebRtcAecm_get_version(version, version_len_bytes) != 0) { |  | ||||||
|     return apm_->kBadParameterError; |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   return apm_->kNoError; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| void* EchoControlMobileImpl::CreateHandle() const { | void* EchoControlMobileImpl::CreateHandle() const { | ||||||
|   Handle* handle = NULL; |   Handle* handle = NULL; | ||||||
|   if (WebRtcAecm_Create(&handle) != apm_->kNoError) { |   if (WebRtcAecm_Create(&handle) != apm_->kNoError) { | ||||||
|   | |||||||
| @@ -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 |  *  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 |  *  that can be found in the LICENSE file in the root of the source | ||||||
| @@ -8,8 +8,8 @@ | |||||||
|  *  be found in the AUTHORS file in the root of the source tree. |  *  be found in the AUTHORS file in the root of the source tree. | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_ECHO_CONTROL_MOBILE_IMPL_H_ | #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CONTROL_MOBILE_IMPL_H_ | ||||||
| #define WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_ECHO_CONTROL_MOBILE_IMPL_H_ | #define WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CONTROL_MOBILE_IMPL_H_ | ||||||
|  |  | ||||||
| #include "audio_processing.h" | #include "audio_processing.h" | ||||||
| #include "processing_component.h" | #include "processing_component.h" | ||||||
| @@ -32,7 +32,6 @@ class EchoControlMobileImpl : public EchoControlMobile, | |||||||
|  |  | ||||||
|   // ProcessingComponent implementation. |   // ProcessingComponent implementation. | ||||||
|   virtual int Initialize(); |   virtual int Initialize(); | ||||||
|   virtual int get_version(char* version, int version_len_bytes) const; |  | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   // EchoControlMobile implementation. |   // EchoControlMobile implementation. | ||||||
| @@ -59,4 +58,4 @@ class EchoControlMobileImpl : public EchoControlMobile, | |||||||
| }; | }; | ||||||
| }  // namespace webrtc | }  // namespace webrtc | ||||||
|  |  | ||||||
| #endif  // WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_ECHO_CONTROL_MOBILE_IMPL_H_ | #endif  // WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CONTROL_MOBILE_IMPL_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 |  *  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 |  *  that can be found in the LICENSE file in the root of the source | ||||||
| @@ -333,14 +333,6 @@ int GainControlImpl::Initialize() { | |||||||
|   return apm_->kNoError; |   return apm_->kNoError; | ||||||
| } | } | ||||||
|  |  | ||||||
| int GainControlImpl::get_version(char* version, int version_len_bytes) const { |  | ||||||
|   if (WebRtcAgc_Version(version, version_len_bytes) != 0) { |  | ||||||
|       return apm_->kBadParameterError; |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   return apm_->kNoError; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| void* GainControlImpl::CreateHandle() const { | void* GainControlImpl::CreateHandle() const { | ||||||
|   Handle* handle = NULL; |   Handle* handle = NULL; | ||||||
|   if (WebRtcAgc_Create(&handle) != apm_->kNoError) { |   if (WebRtcAgc_Create(&handle) != apm_->kNoError) { | ||||||
|   | |||||||
| @@ -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 |  *  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 |  *  that can be found in the LICENSE file in the root of the source | ||||||
| @@ -8,8 +8,8 @@ | |||||||
|  *  be found in the AUTHORS file in the root of the source tree. |  *  be found in the AUTHORS file in the root of the source tree. | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_GAIN_CONTROL_IMPL_H_ | #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_GAIN_CONTROL_IMPL_H_ | ||||||
| #define WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_GAIN_CONTROL_IMPL_H_ | #define WEBRTC_MODULES_AUDIO_PROCESSING_GAIN_CONTROL_IMPL_H_ | ||||||
|  |  | ||||||
| #include <vector> | #include <vector> | ||||||
|  |  | ||||||
| @@ -32,7 +32,6 @@ class GainControlImpl : public GainControl, | |||||||
|  |  | ||||||
|   // ProcessingComponent implementation. |   // ProcessingComponent implementation. | ||||||
|   virtual int Initialize(); |   virtual int Initialize(); | ||||||
|   virtual int get_version(char* version, int version_len_bytes) const; |  | ||||||
|  |  | ||||||
|   // GainControl implementation. |   // GainControl implementation. | ||||||
|   virtual bool is_enabled() const; |   virtual bool is_enabled() const; | ||||||
| @@ -77,4 +76,4 @@ class GainControlImpl : public GainControl, | |||||||
| }; | }; | ||||||
| }  // namespace webrtc | }  // namespace webrtc | ||||||
|  |  | ||||||
| #endif  // WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_GAIN_CONTROL_IMPL_H_ | #endif  // WEBRTC_MODULES_AUDIO_PROCESSING_GAIN_CONTROL_IMPL_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 |  *  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 |  *  that can be found in the LICENSE file in the root of the source | ||||||
| @@ -143,13 +143,6 @@ bool HighPassFilterImpl::is_enabled() const { | |||||||
|   return is_component_enabled(); |   return is_component_enabled(); | ||||||
| } | } | ||||||
|  |  | ||||||
| int HighPassFilterImpl::get_version(char* version, |  | ||||||
|                                     int version_len_bytes) const { |  | ||||||
|   // An empty string is used to indicate no version information. |  | ||||||
|   memset(version, 0, version_len_bytes); |  | ||||||
|   return apm_->kNoError; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| void* HighPassFilterImpl::CreateHandle() const { | void* HighPassFilterImpl::CreateHandle() const { | ||||||
|   return new FilterState; |   return new FilterState; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -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 |  *  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 |  *  that can be found in the LICENSE file in the root of the source | ||||||
| @@ -8,8 +8,8 @@ | |||||||
|  *  be found in the AUTHORS file in the root of the source tree. |  *  be found in the AUTHORS file in the root of the source tree. | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_HIGH_PASS_FILTER_IMPL_H_ | #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_HIGH_PASS_FILTER_IMPL_H_ | ||||||
| #define WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_HIGH_PASS_FILTER_IMPL_H_ | #define WEBRTC_MODULES_AUDIO_PROCESSING_HIGH_PASS_FILTER_IMPL_H_ | ||||||
|  |  | ||||||
| #include "audio_processing.h" | #include "audio_processing.h" | ||||||
| #include "processing_component.h" | #include "processing_component.h" | ||||||
| @@ -29,9 +29,6 @@ class HighPassFilterImpl : public HighPassFilter, | |||||||
|   // HighPassFilter implementation. |   // HighPassFilter implementation. | ||||||
|   virtual bool is_enabled() const; |   virtual bool is_enabled() const; | ||||||
|  |  | ||||||
|   // ProcessingComponent implementation. |  | ||||||
|   virtual int get_version(char* version, int version_len_bytes) const; |  | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   // HighPassFilter implementation. |   // HighPassFilter implementation. | ||||||
|   virtual int Enable(bool enable); |   virtual int Enable(bool enable); | ||||||
| @@ -48,4 +45,4 @@ class HighPassFilterImpl : public HighPassFilter, | |||||||
| }; | }; | ||||||
| }  // namespace webrtc | }  // namespace webrtc | ||||||
|  |  | ||||||
| #endif  // WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_HIGH_PASS_FILTER_IMPL_H_ | #endif  // WEBRTC_MODULES_AUDIO_PROCESSING_HIGH_PASS_FILTER_IMPL_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 |  *  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 |  *  that can be found in the LICENSE file in the root of the source | ||||||
| @@ -130,13 +130,6 @@ int LevelEstimatorImpl::RMS() { | |||||||
|   return level->RMS(); |   return level->RMS(); | ||||||
| } | } | ||||||
|  |  | ||||||
| int LevelEstimatorImpl::get_version(char* version, |  | ||||||
|                                     int version_len_bytes) const { |  | ||||||
|   // An empty string is used to indicate no version information. |  | ||||||
|   memset(version, 0, version_len_bytes); |  | ||||||
|   return apm_->kNoError; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| void* LevelEstimatorImpl::CreateHandle() const { | void* LevelEstimatorImpl::CreateHandle() const { | ||||||
|   return new Level; |   return new Level; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -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 |  *  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 |  *  that can be found in the LICENSE file in the root of the source | ||||||
| @@ -8,8 +8,8 @@ | |||||||
|  *  be found in the AUTHORS file in the root of the source tree. |  *  be found in the AUTHORS file in the root of the source tree. | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_LEVEL_ESTIMATOR_IMPL_H_ | #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_LEVEL_ESTIMATOR_IMPL_H_ | ||||||
| #define WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_LEVEL_ESTIMATOR_IMPL_H_ | #define WEBRTC_MODULES_AUDIO_PROCESSING_LEVEL_ESTIMATOR_IMPL_H_ | ||||||
|  |  | ||||||
| #include "audio_processing.h" | #include "audio_processing.h" | ||||||
| #include "processing_component.h" | #include "processing_component.h" | ||||||
| @@ -29,9 +29,6 @@ class LevelEstimatorImpl : public LevelEstimator, | |||||||
|   // LevelEstimator implementation. |   // LevelEstimator implementation. | ||||||
|   virtual bool is_enabled() const; |   virtual bool is_enabled() const; | ||||||
|  |  | ||||||
|   // ProcessingComponent implementation. |  | ||||||
|   virtual int get_version(char* version, int version_len_bytes) const; |  | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   // LevelEstimator implementation. |   // LevelEstimator implementation. | ||||||
|   virtual int Enable(bool enable); |   virtual int Enable(bool enable); | ||||||
| @@ -49,4 +46,4 @@ class LevelEstimatorImpl : public LevelEstimator, | |||||||
| }; | }; | ||||||
| }  // namespace webrtc | }  // namespace webrtc | ||||||
|  |  | ||||||
| #endif  // WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_LEVEL_ESTIMATOR_IMPL_H_ | #endif  // WEBRTC_MODULES_AUDIO_PROCESSING_LEVEL_ESTIMATOR_IMPL_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 |  *  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 |  *  that can be found in the LICENSE file in the root of the source | ||||||
| @@ -110,20 +110,6 @@ NoiseSuppression::Level NoiseSuppressionImpl::level() const { | |||||||
|   return level_; |   return level_; | ||||||
| } | } | ||||||
|  |  | ||||||
| int NoiseSuppressionImpl::get_version(char* version, |  | ||||||
|                                       int version_len_bytes) const { |  | ||||||
| #if defined(WEBRTC_NS_FLOAT) |  | ||||||
|   if (WebRtcNs_get_version(version, version_len_bytes) != 0) |  | ||||||
| #elif defined(WEBRTC_NS_FIXED) |  | ||||||
|   if (WebRtcNsx_get_version(version, version_len_bytes) != 0) |  | ||||||
| #endif |  | ||||||
|   { |  | ||||||
|       return apm_->kBadParameterError; |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   return apm_->kNoError; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| void* NoiseSuppressionImpl::CreateHandle() const { | void* NoiseSuppressionImpl::CreateHandle() const { | ||||||
|   Handle* handle = NULL; |   Handle* handle = NULL; | ||||||
| #if defined(WEBRTC_NS_FLOAT) | #if defined(WEBRTC_NS_FLOAT) | ||||||
|   | |||||||
| @@ -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 |  *  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 |  *  that can be found in the LICENSE file in the root of the source | ||||||
| @@ -8,8 +8,8 @@ | |||||||
|  *  be found in the AUTHORS file in the root of the source tree. |  *  be found in the AUTHORS file in the root of the source tree. | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_NOISE_SUPPRESSION_IMPL_H_ | #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_NOISE_SUPPRESSION_IMPL_H_ | ||||||
| #define WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_NOISE_SUPPRESSION_IMPL_H_ | #define WEBRTC_MODULES_AUDIO_PROCESSING_NOISE_SUPPRESSION_IMPL_H_ | ||||||
|  |  | ||||||
| #include "audio_processing.h" | #include "audio_processing.h" | ||||||
| #include "processing_component.h" | #include "processing_component.h" | ||||||
| @@ -29,9 +29,6 @@ class NoiseSuppressionImpl : public NoiseSuppression, | |||||||
|   // NoiseSuppression implementation. |   // NoiseSuppression implementation. | ||||||
|   virtual bool is_enabled() const; |   virtual bool is_enabled() const; | ||||||
|  |  | ||||||
|   // ProcessingComponent implementation. |  | ||||||
|   virtual int get_version(char* version, int version_len_bytes) const; |  | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   // NoiseSuppression implementation. |   // NoiseSuppression implementation. | ||||||
|   virtual int Enable(bool enable); |   virtual int Enable(bool enable); | ||||||
| @@ -51,4 +48,4 @@ class NoiseSuppressionImpl : public NoiseSuppression, | |||||||
| }; | }; | ||||||
| }  // namespace webrtc | }  // namespace webrtc | ||||||
|  |  | ||||||
| #endif  // WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_NOISE_SUPPRESSION_IMPL_H_ | #endif  // WEBRTC_MODULES_AUDIO_PROCESSING_NOISE_SUPPRESSION_IMPL_H_ | ||||||
|   | |||||||
| @@ -8,8 +8,8 @@ | |||||||
|  *  be found in the AUTHORS file in the root of the source tree. |  *  be found in the AUTHORS file in the root of the source tree. | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_NS_MAIN_INTERFACE_NOISE_SUPPRESSION_H_ | #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_NS_INCLUDE_NOISE_SUPPRESSION_H_ | ||||||
| #define WEBRTC_MODULES_AUDIO_PROCESSING_NS_MAIN_INTERFACE_NOISE_SUPPRESSION_H_ | #define WEBRTC_MODULES_AUDIO_PROCESSING_NS_INCLUDE_NOISE_SUPPRESSION_H_ | ||||||
|  |  | ||||||
| #include "typedefs.h" | #include "typedefs.h" | ||||||
|  |  | ||||||
| @@ -19,20 +19,6 @@ typedef struct NsHandleT NsHandle; | |||||||
| extern "C" { | extern "C" { | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| /* |  | ||||||
|  * This function returns the version number of the code. |  | ||||||
|  * |  | ||||||
|  * Input: |  | ||||||
|  *      - version       : Pointer to a character array where the version |  | ||||||
|  *                        info is stored. |  | ||||||
|  *      - length        : Length of version. |  | ||||||
|  * |  | ||||||
|  * Return value         :  0 - Ok |  | ||||||
|  *                        -1 - Error (probably length is not sufficient) |  | ||||||
|  */ |  | ||||||
| int WebRtcNs_get_version(char* version, short length); |  | ||||||
|  |  | ||||||
|  |  | ||||||
| /* | /* | ||||||
|  * This function creates an instance to the noise reduction structure |  * This function creates an instance to the noise reduction structure | ||||||
|  * |  * | ||||||
| @@ -121,4 +107,4 @@ int WebRtcNs_Process(NsHandle* NS_inst, | |||||||
| } | } | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #endif // WEBRTC_MODULES_AUDIO_PROCESSING_NS_MAIN_INTERFACE_NOISE_SUPPRESSION_H_ | #endif  // WEBRTC_MODULES_AUDIO_PROCESSING_NS_INCLUDE_NOISE_SUPPRESSION_H_ | ||||||
|   | |||||||
| @@ -8,8 +8,8 @@ | |||||||
|  *  be found in the AUTHORS file in the root of the source tree. |  *  be found in the AUTHORS file in the root of the source tree. | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_NS_MAIN_INTERFACE_NOISE_SUPPRESSION_X_H_ | #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_NS_INCLUDE_NOISE_SUPPRESSION_X_H_ | ||||||
| #define WEBRTC_MODULES_AUDIO_PROCESSING_NS_MAIN_INTERFACE_NOISE_SUPPRESSION_X_H_ | #define WEBRTC_MODULES_AUDIO_PROCESSING_NS_INCLUDE_NOISE_SUPPRESSION_X_H_ | ||||||
|  |  | ||||||
| #include "typedefs.h" | #include "typedefs.h" | ||||||
|  |  | ||||||
| @@ -19,20 +19,6 @@ typedef struct NsxHandleT NsxHandle; | |||||||
| extern "C" { | extern "C" { | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| /* |  | ||||||
|  * This function returns the version number of the code. |  | ||||||
|  * |  | ||||||
|  * Input: |  | ||||||
|  *      - version       : Pointer to a character array where the version |  | ||||||
|  *                        info is stored. |  | ||||||
|  *      - length        : Length of version. |  | ||||||
|  * |  | ||||||
|  * Return value         :  0 - Ok |  | ||||||
|  *                        -1 - Error (probably length is not sufficient) |  | ||||||
|  */ |  | ||||||
| int WebRtcNsx_get_version(char* version, short length); |  | ||||||
|  |  | ||||||
|  |  | ||||||
| /* | /* | ||||||
|  * This function creates an instance to the noise reduction structure |  * This function creates an instance to the noise reduction structure | ||||||
|  * |  * | ||||||
| @@ -120,4 +106,4 @@ int WebRtcNsx_Process(NsxHandle* nsxInst, | |||||||
| } | } | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #endif // WEBRTC_MODULES_AUDIO_PROCESSING_NS_MAIN_INTERFACE_NOISE_SUPPRESSION_X_H_ | #endif  // WEBRTC_MODULES_AUDIO_PROCESSING_NS_INCLUDE_NOISE_SUPPRESSION_X_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 |  *  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 |  *  that can be found in the LICENSE file in the root of the source | ||||||
| @@ -15,23 +15,6 @@ | |||||||
| #include "ns_core.h" | #include "ns_core.h" | ||||||
| #include "defines.h" | #include "defines.h" | ||||||
|  |  | ||||||
| int WebRtcNs_get_version(char* versionStr, short length) { |  | ||||||
|   const char version[] = "NS 2.2.0"; |  | ||||||
|   const short versionLen = (short)strlen(version) + 1; // +1: null-termination |  | ||||||
|  |  | ||||||
|   if (versionStr == NULL) { |  | ||||||
|     return -1; |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   if (versionLen > length) { |  | ||||||
|     return -1; |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   strncpy(versionStr, version, versionLen); |  | ||||||
|  |  | ||||||
|   return 0; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| int WebRtcNs_Create(NsHandle** NS_inst) { | int WebRtcNs_Create(NsHandle** NS_inst) { | ||||||
|   *NS_inst = (NsHandle*) malloc(sizeof(NSinst_t)); |   *NS_inst = (NsHandle*) malloc(sizeof(NSinst_t)); | ||||||
|   if (*NS_inst != NULL) { |   if (*NS_inst != NULL) { | ||||||
|   | |||||||
| @@ -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 |  *  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 |  *  that can be found in the LICENSE file in the root of the source | ||||||
| @@ -15,23 +15,6 @@ | |||||||
| #include "nsx_core.h" | #include "nsx_core.h" | ||||||
| #include "nsx_defines.h" | #include "nsx_defines.h" | ||||||
|  |  | ||||||
| int WebRtcNsx_get_version(char* versionStr, short length) { |  | ||||||
|   const char version[] = "NS\t3.1.0"; |  | ||||||
|   const short versionLen = (short)strlen(version) + 1; // +1: null-termination |  | ||||||
|  |  | ||||||
|   if (versionStr == NULL) { |  | ||||||
|     return -1; |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   if (versionLen > length) { |  | ||||||
|     return -1; |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   strncpy(versionStr, version, versionLen); |  | ||||||
|  |  | ||||||
|   return 0; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| int WebRtcNsx_Create(NsxHandle** nsxInst) { | int WebRtcNsx_Create(NsxHandle** nsxInst) { | ||||||
|   *nsxInst = (NsxHandle*)malloc(sizeof(NsxInst_t)); |   *nsxInst = (NsxHandle*)malloc(sizeof(NsxInst_t)); | ||||||
|   if (*nsxInst != NULL) { |   if (*nsxInst != NULL) { | ||||||
|   | |||||||
| @@ -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 |  *  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 |  *  that can be found in the LICENSE file in the root of the source | ||||||
| @@ -8,8 +8,8 @@ | |||||||
|  *  be found in the AUTHORS file in the root of the source tree. |  *  be found in the AUTHORS file in the root of the source tree. | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_PROCESSING_COMPONENT_H_ | #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_PROCESSING_COMPONENT_H_ | ||||||
| #define WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_PROCESSING_COMPONENT_H_ | #define WEBRTC_MODULES_AUDIO_PROCESSING_PROCESSING_COMPONENT_H_ | ||||||
|  |  | ||||||
| #include <vector> | #include <vector> | ||||||
|  |  | ||||||
| @@ -25,7 +25,6 @@ class ProcessingComponent { | |||||||
|  |  | ||||||
|   virtual int Initialize(); |   virtual int Initialize(); | ||||||
|   virtual int Destroy(); |   virtual int Destroy(); | ||||||
|   virtual int get_version(char* version, int version_len_bytes) const = 0; |  | ||||||
|  |  | ||||||
|   bool is_component_enabled() const; |   bool is_component_enabled() const; | ||||||
|  |  | ||||||
| @@ -51,4 +50,4 @@ class ProcessingComponent { | |||||||
| }; | }; | ||||||
| }  // namespace webrtc | }  // namespace webrtc | ||||||
|  |  | ||||||
| #endif  // WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_PROCESSING_COMPONENT_H__ | #endif  // WEBRTC_MODULES_AUDIO_PROCESSING_PROCESSING_COMPONENT_H__ | ||||||
|   | |||||||
| @@ -157,15 +157,6 @@ int VoiceDetectionImpl::Initialize() { | |||||||
|   return apm_->kNoError; |   return apm_->kNoError; | ||||||
| } | } | ||||||
|  |  | ||||||
| int VoiceDetectionImpl::get_version(char* version, |  | ||||||
|                                     int version_len_bytes) const { |  | ||||||
|   if (WebRtcVad_get_version(version, version_len_bytes) != 0) { |  | ||||||
|     return apm_->kBadParameterError; |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   return apm_->kNoError; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| void* VoiceDetectionImpl::CreateHandle() const { | void* VoiceDetectionImpl::CreateHandle() const { | ||||||
|   Handle* handle = NULL; |   Handle* handle = NULL; | ||||||
|   if (WebRtcVad_Create(&handle) != apm_->kNoError) { |   if (WebRtcVad_Create(&handle) != apm_->kNoError) { | ||||||
|   | |||||||
| @@ -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 |  *  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 |  *  that can be found in the LICENSE file in the root of the source | ||||||
| @@ -8,8 +8,8 @@ | |||||||
|  *  be found in the AUTHORS file in the root of the source tree. |  *  be found in the AUTHORS file in the root of the source tree. | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_VOICE_DETECTION_IMPL_H_ | #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_VOICE_DETECTION_IMPL_H_ | ||||||
| #define WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_VOICE_DETECTION_IMPL_H_ | #define WEBRTC_MODULES_AUDIO_PROCESSING_VOICE_DETECTION_IMPL_H_ | ||||||
|  |  | ||||||
| #include "audio_processing.h" | #include "audio_processing.h" | ||||||
| #include "processing_component.h" | #include "processing_component.h" | ||||||
| @@ -31,7 +31,6 @@ class VoiceDetectionImpl : public VoiceDetection, | |||||||
|  |  | ||||||
|   // ProcessingComponent implementation. |   // ProcessingComponent implementation. | ||||||
|   virtual int Initialize(); |   virtual int Initialize(); | ||||||
|   virtual int get_version(char* version, int version_len_bytes) const; |  | ||||||
|  |  | ||||||
|  private: |  private: | ||||||
|   // VoiceDetection implementation. |   // VoiceDetection implementation. | ||||||
| @@ -60,4 +59,4 @@ class VoiceDetectionImpl : public VoiceDetection, | |||||||
| }; | }; | ||||||
| }  // namespace webrtc | }  // namespace webrtc | ||||||
|  |  | ||||||
| #endif  // WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_SOURCE_VOICE_DETECTION_IMPL_H_ | #endif  // WEBRTC_MODULES_AUDIO_PROCESSING_VOICE_DETECTION_IMPL_H_ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 bjornv@webrtc.org
					bjornv@webrtc.org