OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 25 matching lines...) Expand all Loading... | |
36 do { \ | 36 do { \ |
37 rtc_WavClose(wav_file); \ | 37 rtc_WavClose(wav_file); \ |
38 } while (0) | 38 } while (0) |
39 | 39 |
40 // Dumps a raw data to file. | 40 // Dumps a raw data to file. |
41 #define RTC_AEC_DEBUG_RAW_WRITE(file, data, data_size) \ | 41 #define RTC_AEC_DEBUG_RAW_WRITE(file, data, data_size) \ |
42 do { \ | 42 do { \ |
43 (void) fwrite(data, data_size, 1, file); \ | 43 (void) fwrite(data, data_size, 1, file); \ |
44 } while (0) | 44 } while (0) |
45 | 45 |
46 // Dumps a raw scalar int32 to file. | |
47 #define RTC_AEC_DEBUG_RAW_WRITE_SCALAR_INT32(file, data) \ | |
48 do { \ | |
49 int32_t value_to_store = data; \ | |
ivoc
2015/12/01 09:47:52
Would it be possible/desirable to merge this with
peah-webrtc
2015/12/01 12:21:43
I think you are right in that it could. My only co
| |
50 (void) fwrite(&value_to_store, sizeof(value_to_store), 1, file); \ | |
51 } while (0) | |
52 | |
53 // Dumps a raw scalar double to file. | |
54 #define RTC_AEC_DEBUG_RAW_WRITE_SCALAR_DOUBLE(file, data) \ | |
55 do { \ | |
56 double value_to_store = data; \ | |
57 (void) fwrite(&value_to_store, sizeof(value_to_store), 1, file); \ | |
58 } while (0) | |
59 | |
kwiberg-webrtc
2015/11/30 14:55:43
Drive-by: Please consider using inline functions i
| |
46 // Opens a raw data file for writing using the specified sample rate. | 60 // Opens a raw data file for writing using the specified sample rate. |
47 #define RTC_AEC_DEBUG_RAW_OPEN(name, instance_counter, file) \ | 61 #define RTC_AEC_DEBUG_RAW_OPEN(name, instance_counter, file) \ |
48 do { \ | 62 do { \ |
49 WebRtcAec_RawFileOpen(name, instance_counter, file); \ | 63 WebRtcAec_RawFileOpen(name, instance_counter, file); \ |
50 } while (0) | 64 } while (0) |
51 | 65 |
52 // Closes a raw data file. | 66 // Closes a raw data file. |
53 #define RTC_AEC_DEBUG_RAW_CLOSE(file) \ | 67 #define RTC_AEC_DEBUG_RAW_CLOSE(file) \ |
54 do { \ | 68 do { \ |
55 fclose(file); \ | 69 fclose(file); \ |
(...skipping 10 matching lines...) Expand all Loading... | |
66 } while (0) | 80 } while (0) |
67 | 81 |
68 #define RTC_AEC_DEBUG_WAV_CLOSE(wav_file) \ | 82 #define RTC_AEC_DEBUG_WAV_CLOSE(wav_file) \ |
69 do { \ | 83 do { \ |
70 } while (0) | 84 } while (0) |
71 | 85 |
72 #define RTC_AEC_DEBUG_RAW_WRITE(file, data, data_size) \ | 86 #define RTC_AEC_DEBUG_RAW_WRITE(file, data, data_size) \ |
73 do { \ | 87 do { \ |
74 } while (0) | 88 } while (0) |
75 | 89 |
90 #define RTC_AEC_DEBUG_RAW_WRITE_SCALAR_INT32(file, data) \ | |
91 do { \ | |
92 } while (0) | |
93 | |
94 #define RTC_AEC_DEBUG_RAW_WRITE_SCALAR_DOUBLE(file, data) \ | |
95 do { \ | |
96 } while (0) | |
97 | |
76 #define RTC_AEC_DEBUG_RAW_OPEN(file, name, instance_counter) \ | 98 #define RTC_AEC_DEBUG_RAW_OPEN(file, name, instance_counter) \ |
77 do { \ | 99 do { \ |
78 } while (0) | 100 } while (0) |
79 | 101 |
80 #define RTC_AEC_DEBUG_RAW_CLOSE(file) \ | 102 #define RTC_AEC_DEBUG_RAW_CLOSE(file) \ |
81 do { \ | 103 do { \ |
82 } while (0) | 104 } while (0) |
83 | 105 |
84 #endif // WEBRTC_AEC_DEBUG_DUMP | 106 #endif // WEBRTC_AEC_DEBUG_DUMP |
85 | 107 |
86 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_LOGGING_ | 108 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_LOGGING_ |
OLD | NEW |