Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: webrtc/modules/audio_processing/aecm/echo_control_mobile.cc

Issue 1857153002: Changed AECM to be built using C++ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added external declaration to the delay estimator wrapper inclusion Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/aecm/echo_control_mobile.cc
diff --git a/webrtc/modules/audio_processing/aecm/echo_control_mobile.c b/webrtc/modules/audio_processing/aecm/echo_control_mobile.cc
similarity index 96%
rename from webrtc/modules/audio_processing/aecm/echo_control_mobile.c
rename to webrtc/modules/audio_processing/aecm/echo_control_mobile.cc
index 91e6f0e80ce1afa0579aa111f961734b10b65e11..a81466e678e681901221a8a181b6f47bb7e3b935 100644
--- a/webrtc/modules/audio_processing/aecm/echo_control_mobile.c
+++ b/webrtc/modules/audio_processing/aecm/echo_control_mobile.cc
@@ -15,8 +15,10 @@
#endif
#include <stdlib.h>
+extern "C" {
#include "webrtc/common_audio/ring_buffer.h"
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
+}
#include "webrtc/modules/audio_processing/aecm/aecm_core.h"
#define BUF_SIZE_FRAMES 50 // buffer size (frames)
@@ -79,7 +81,7 @@ static int WebRtcAecm_EstBufDelay(AecMobile* aecmInst, short msInSndCardBuf);
static int WebRtcAecm_DelayComp(AecMobile* aecmInst);
void* WebRtcAecm_Create() {
- AecMobile* aecm = malloc(sizeof(AecMobile));
+ AecMobile* aecm = static_cast<AecMobile*>(malloc(sizeof(AecMobile)));
WebRtcSpl_Init();
@@ -114,7 +116,7 @@ void* WebRtcAecm_Create() {
}
void WebRtcAecm_Free(void* aecmInst) {
- AecMobile* aecm = aecmInst;
+ AecMobile* aecm = static_cast<AecMobile*>(aecmInst);
if (aecm == NULL) {
return;
@@ -138,7 +140,7 @@ void WebRtcAecm_Free(void* aecmInst) {
int32_t WebRtcAecm_Init(void *aecmInst, int32_t sampFreq)
{
- AecMobile* aecm = aecmInst;
+ AecMobile* aecm = static_cast<AecMobile*>(aecmInst);
AecmConfig aecConfig;
if (aecm == NULL)
@@ -196,7 +198,7 @@ int32_t WebRtcAecm_Init(void *aecmInst, int32_t sampFreq)
// farend signal.
int32_t WebRtcAecm_GetBufferFarendError(void *aecmInst, const int16_t *farend,
size_t nrOfSamples) {
- AecMobile* aecm = aecmInst;
+ AecMobile* aecm = static_cast<AecMobile*>(aecmInst);
if (aecm == NULL)
return -1;
@@ -216,7 +218,7 @@ int32_t WebRtcAecm_GetBufferFarendError(void *aecmInst, const int16_t *farend,
int32_t WebRtcAecm_BufferFarend(void *aecmInst, const int16_t *farend,
size_t nrOfSamples) {
- AecMobile* aecm = aecmInst;
+ AecMobile* aecm = static_cast<AecMobile*>(aecmInst);
const int32_t err =
WebRtcAecm_GetBufferFarendError(aecmInst, farend, nrOfSamples);
@@ -239,7 +241,7 @@ int32_t WebRtcAecm_Process(void *aecmInst, const int16_t *nearendNoisy,
const int16_t *nearendClean, int16_t *out,
size_t nrOfSamples, int16_t msInSndCardBuf)
{
- AecMobile* aecm = aecmInst;
+ AecMobile* aecm = static_cast<AecMobile*>(aecmInst);
int32_t retVal = 0;
size_t i;
short nmbrOfFilledBuffers;
@@ -435,7 +437,7 @@ int32_t WebRtcAecm_Process(void *aecmInst, const int16_t *nearendNoisy,
int32_t WebRtcAecm_set_config(void *aecmInst, AecmConfig config)
{
- AecMobile* aecm = aecmInst;
+ AecMobile* aecm = static_cast<AecMobile*>(aecmInst);
if (aecm == NULL)
{
@@ -516,8 +518,8 @@ int32_t WebRtcAecm_InitEchoPath(void* aecmInst,
const void* echo_path,
size_t size_bytes)
{
- AecMobile* aecm = aecmInst;
- const int16_t* echo_path_ptr = echo_path;
+ AecMobile* aecm = static_cast<AecMobile*>(aecmInst);
+ const int16_t* echo_path_ptr = static_cast<const int16_t*>(echo_path);
if (aecmInst == NULL) {
return -1;
@@ -544,8 +546,8 @@ int32_t WebRtcAecm_GetEchoPath(void* aecmInst,
void* echo_path,
size_t size_bytes)
{
- AecMobile* aecm = aecmInst;
- int16_t* echo_path_ptr = echo_path;
+ AecMobile* aecm = static_cast<AecMobile*>(aecmInst);
+ int16_t* echo_path_ptr = static_cast<int16_t*>(echo_path);
if (aecmInst == NULL) {
return -1;
« no previous file with comments | « webrtc/modules/audio_processing/aecm/echo_control_mobile.c ('k') | webrtc/modules/audio_processing/audio_processing.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698