OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2013 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 |
| 15 // To enable AEC logging, run this command from trunk/ : |
| 16 // python webrtc/build/gyp_webrtc.py -Daec_debug_dump=1 |
| 17 #ifdef WEBRTC_AEC_DEBUG_DUMP |
| 18 #include <stdio.h> |
| 19 #include "webrtc/modules/audio_processing/logging/aec_logging_file_handling.h" |
| 20 #endif |
| 21 |
| 22 |
| 23 #ifndef WEBRTC_AEC_DEBUG_DUMP |
| 24 |
| 25 // Dump wav data to file |
| 26 #define WEBRTC_AEC_DEBUG_WAV_WRITE(file, data, numSamples) |
| 27 |
| 28 // (Re)open wav file for writing using the specified sample rate |
| 29 #define WEBRTC_AEC_DEBUG_WAV_REOPEN(wavFile, name, seq1, seq2, sampleRate) |
| 30 |
| 31 // Close wav file |
| 32 #define WEBRTC_AEC_DEBUG_WAV_CLOSE(wavFile) |
| 33 |
| 34 // Dump raw data to file |
| 35 #define WEBRTC_AEC_DEBUG_RAW_WRITE(file, data, dataSize) |
| 36 |
| 37 // Open raw data file for writing using the specified sample rate |
| 38 #define WEBRTC_AEC_DEBUG_RAW_OPEN(file, name, instanceCtr) |
| 39 |
| 40 // Close raw data file |
| 41 #define WEBRTC_AEC_DEBUG_RAW_CLOSE(file) |
| 42 |
| 43 #else // WEBRTC_AEC_DEBUG_DUMP |
| 44 |
| 45 // Dump wav data to file |
| 46 #define WEBRTC_AEC_DEBUG_WAV_WRITE(file, data, numSamples) \ |
| 47 do { \ |
| 48 rtc_WavWriteSamples(file, data, numSamples); \ |
| 49 } while (0); |
| 50 |
| 51 // (Re)open wav file for writing using the specified sample rate |
| 52 #define WEBRTC_AEC_DEBUG_WAV_REOPEN(wavFile, name, seq1, seq2, sampleRate) \ |
| 53 do { \ |
| 54 WebRtcAec_ReopenWav((wavFile), (name), (seq1), (seq2), (sampleRate)); \ |
| 55 } while (0); |
| 56 |
| 57 // Close wav file |
| 58 #define WEBRTC_AEC_DEBUG_WAV_CLOSE(wavFile) \ |
| 59 do { \ |
| 60 rtc_WavClose((wavFile)); \ |
| 61 } while (0); |
| 62 |
| 63 // Dump raw data to file |
| 64 #define WEBRTC_AEC_DEBUG_RAW_WRITE(file, data, dataSize) \ |
| 65 do { \ |
| 66 (void)fwrite((data), (dataSize) , 1, (file)); \ |
| 67 } while (0); |
| 68 |
| 69 // Open raw data file for writing using the specified sample rate |
| 70 #define WEBRTC_AEC_DEBUG_RAW_OPEN(file, name, instanceCtr) \ |
| 71 do { \ |
| 72 WebRtcAec_RawFileOpen((file), (name), (instanceCtr)); \ |
| 73 } while (0); |
| 74 |
| 75 |
| 76 // Close raw data file |
| 77 #define WEBRTC_AEC_DEBUG_RAW_CLOSE(file) \ |
| 78 do { \ |
| 79 fclose((file)); \ |
| 80 } while (0); |
| 81 |
| 82 |
| 83 |
| 84 #endif // WEBRTC_AEC_DEBUG_DUMP |
| 85 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_LOGGING_ |
OLD | NEW |