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

Side by Side Diff: webrtc/modules/audio_processing/logging/aec_logging.h

Issue 1272403003: Replaced the wav file dumping functionality in aec_core.c with the newly added corresponding macros (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Updates according to comments. Also added BUILD.gn that were previously missing from the changeset Created 5 years, 4 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
(Empty)
1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_LOGGING_
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_LOGGING_
13
14 #include <stdio.h>
15
16 #include "webrtc/modules/audio_processing/logging/aec_logging_file_handling.h"
17
18 // To enable AEC logging, invoke GYP with -Daec_debug_dump=1.
19 #ifdef WEBRTC_AEC_DEBUG_DUMP
20 // Dumps a wav data to file.
21 #define RTC_AEC_DEBUG_WAV_WRITE(file, data, num_samples) \
22 do { \
23 rtc_WavWriteSamples(file, data, num_samples); \
24 } while (0)
25
26 // (Re)opens a wav file for writing using the specified sample rate.
27 #define RTC_AEC_DEBUG_WAV_REOPEN(name, instance_index, process_rate, \
28 sample_rate, wav_file) \
29 do { \
30 WebRtcAec_ReopenWav(name, instance_index, process_rate, sample_rate, \
31 wav_file); \
32 } while (0)
33
34 // Closes a wav file.
35 #define RTC_AEC_DEBUG_WAV_CLOSE(wav_file) \
36 do { \
37 rtc_WavClose(wav_file); \
38 } while (0)
39
40 // Dumps a raw data to file.
41 #define RTC_AEC_DEBUG_RAW_WRITE(file, data, data_size) \
42 do { \
43 (void) fwrite(data, data_size, 1, file); \
44 } while (0)
45
46 // Opens a raw data file for writing using the specified sample rate.
47 #define RTC_AEC_DEBUG_RAW_OPEN(name, instance_counter, file) \
48 do { \
49 WebRtcAec_RawFileOpen(name, instance_counter, file); \
50 } while (0)
51
52 // Closes a raw data file.
53 #define RTC_AEC_DEBUG_RAW_CLOSE(file) \
54 do { \
55 fclose(file); \
56 } while (0)
57
58 #else // RTC_AEC_DEBUG_DUMP
59 #define RTC_AEC_DEBUG_WAV_WRITE(file, data, num_samples) \
60 do { \
61 } while (0)
62
63 #define RTC_AEC_DEBUG_WAV_REOPEN(wav_file, name, instance_index, process_rate, \
64 sample_rate) \
65 do { \
66 } while (0)
67
68 #define RTC_AEC_DEBUG_WAV_CLOSE(wav_file) \
69 do { \
70 } while (0)
71
72 #define RTC_AEC_DEBUG_RAW_WRITE(file, data, data_size) \
73 do { \
74 } while (0)
75
76 #define RTC_AEC_DEBUG_RAW_OPEN(file, name, instance_counter) \
77 do { \
78 } while (0)
79
80 #define RTC_AEC_DEBUG_RAW_CLOSE(file) \
81 do { \
82 } while (0)
83
84 #endif // WEBRTC_AEC_DEBUG_DUMP
85
86 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_LOGGING_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698