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

Side by Side Diff: webrtc/modules/audio_processing/agc/legacy/analog_agc.c

Issue 1175903002: audio_processing: Create now returns a pointer to the object (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed review comments Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1306 return -1; 1306 return -1;
1307 } 1307 }
1308 1308
1309 config->limiterEnable = stt->usedConfig.limiterEnable; 1309 config->limiterEnable = stt->usedConfig.limiterEnable;
1310 config->targetLevelDbfs = stt->usedConfig.targetLevelDbfs; 1310 config->targetLevelDbfs = stt->usedConfig.targetLevelDbfs;
1311 config->compressionGaindB = stt->usedConfig.compressionGaindB; 1311 config->compressionGaindB = stt->usedConfig.compressionGaindB;
1312 1312
1313 return 0; 1313 return 0;
1314 } 1314 }
1315 1315
1316 int WebRtcAgc_Create(void **agcInst) 1316 void* WebRtcAgc_Create() {
1317 { 1317 LegacyAgc* stt = malloc(sizeof(LegacyAgc));
1318 LegacyAgc* stt;
1319 if (agcInst == NULL)
1320 {
1321 return -1;
1322 }
1323 stt = (LegacyAgc*)malloc(sizeof(LegacyAgc));
1324
1325 *agcInst = stt;
1326 if (stt == NULL)
1327 {
1328 return -1;
1329 }
1330 1318
1331 #ifdef WEBRTC_AGC_DEBUG_DUMP 1319 #ifdef WEBRTC_AGC_DEBUG_DUMP
1332 stt->fpt = fopen("./agc_test_log.txt", "wt"); 1320 stt->fpt = fopen("./agc_test_log.txt", "wt");
1333 stt->agcLog = fopen("./agc_debug_log.txt", "wt"); 1321 stt->agcLog = fopen("./agc_debug_log.txt", "wt");
1334 stt->digitalAgc.logFile = fopen("./agc_log.txt", "wt"); 1322 stt->digitalAgc.logFile = fopen("./agc_log.txt", "wt");
1335 #endif 1323 #endif
1336 1324
1337 stt->initFlag = 0; 1325 stt->initFlag = 0;
1338 stt->lastError = 0; 1326 stt->lastError = 0;
1339 1327
1340 return 0; 1328 return stt;
1341 } 1329 }
1342 1330
1343 void WebRtcAgc_Free(void *state) { 1331 void WebRtcAgc_Free(void *state) {
1344 LegacyAgc* stt; 1332 LegacyAgc* stt;
1345 1333
1346 stt = (LegacyAgc*)state; 1334 stt = (LegacyAgc*)state;
1347 #ifdef WEBRTC_AGC_DEBUG_DUMP 1335 #ifdef WEBRTC_AGC_DEBUG_DUMP
1348 fclose(stt->fpt); 1336 fclose(stt->fpt);
1349 fclose(stt->agcLog); 1337 fclose(stt->agcLog);
1350 fclose(stt->digitalAgc.logFile); 1338 fclose(stt->digitalAgc.logFile);
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 #endif 1509 #endif
1522 return -1; 1510 return -1;
1523 } else 1511 } else
1524 { 1512 {
1525 #ifdef WEBRTC_AGC_DEBUG_DUMP 1513 #ifdef WEBRTC_AGC_DEBUG_DUMP
1526 fprintf(stt->fpt, "\n"); 1514 fprintf(stt->fpt, "\n");
1527 #endif 1515 #endif
1528 return 0; 1516 return 0;
1529 } 1517 }
1530 } 1518 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698