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

Unified 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: Added logging using the raw variant of the new aec logging macros 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/logging/aec_logging.h
diff --git a/webrtc/modules/audio_processing/logging/aec_logging.h b/webrtc/modules/audio_processing/logging/aec_logging.h
new file mode 100644
index 0000000000000000000000000000000000000000..14a7d2c894373c48d166c2291c5eff1a3336b674
--- /dev/null
+++ b/webrtc/modules/audio_processing/logging/aec_logging.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_LOGGING_
+#define WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_LOGGING_
+
+
+// To enable AEC logging, run this command from trunk/ :
+// python webrtc/build/gyp_webrtc.py -Daec_debug_dump=1
+#ifdef WEBRTC_AEC_DEBUG_DUMP
+#include <stdio.h>
+#include "webrtc/modules/audio_processing/logging/aec_logging_file_handling.h"
+#endif
+
+
+#ifndef WEBRTC_AEC_DEBUG_DUMP
+
+// Dump wav data to file
+#define WEBRTC_AEC_DEBUG_WAV_WRITE(file, data, numSamples)
+
+// (Re)open wav file for writing using the specified sample rate
+#define WEBRTC_AEC_DEBUG_WAV_REOPEN(wavFile, name, seq1, seq2, sampleRate)
+
+// Close wav file
+#define WEBRTC_AEC_DEBUG_WAV_CLOSE(wavFile)
+
+// Dump raw data to file
+#define WEBRTC_AEC_DEBUG_RAW_WRITE(file, data, dataSize)
+
+// Open raw data file for writing using the specified sample rate
+#define WEBRTC_AEC_DEBUG_RAW_OPEN(file, name, instanceCtr)
+
+// Close raw data file
+#define WEBRTC_AEC_DEBUG_RAW_CLOSE(file)
+
+#else // WEBRTC_AEC_DEBUG_DUMP
+
+// Dump wav data to file
+#define WEBRTC_AEC_DEBUG_WAV_WRITE(file, data, numSamples) \
+ do { \
+ rtc_WavWriteSamples(file, data, numSamples); \
+ } while (0);
+
+// (Re)open wav file for writing using the specified sample rate
+#define WEBRTC_AEC_DEBUG_WAV_REOPEN(wavFile, name, seq1, seq2, sampleRate) \
+ do { \
+ WebRtcAec_ReopenWav((wavFile), (name), (seq1), (seq2), (sampleRate)); \
+ } while (0);
+
+// Close wav file
+#define WEBRTC_AEC_DEBUG_WAV_CLOSE(wavFile) \
+ do { \
+ rtc_WavClose((wavFile)); \
+ } while (0);
+
+// Dump raw data to file
+#define WEBRTC_AEC_DEBUG_RAW_WRITE(file, data, dataSize) \
+ do { \
+ (void)fwrite((data), (dataSize) , 1, (file)); \
+ } while (0);
+
+// Open raw data file for writing using the specified sample rate
+#define WEBRTC_AEC_DEBUG_RAW_OPEN(file, name, instanceCtr) \
+ do { \
+ WebRtcAec_RawFileOpen((file), (name), (instanceCtr)); \
+ } while (0);
+
+
+// Close raw data file
+#define WEBRTC_AEC_DEBUG_RAW_CLOSE(file) \
+ do { \
+ fclose((file)); \
+ } while (0);
+
+
+
+#endif // WEBRTC_AEC_DEBUG_DUMP
+#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_LOGGING_

Powered by Google App Engine
This is Rietveld 408576698