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

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: Code update according to reviewer comments 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..c6c6cbf0438a41a214820575ee616ff9e44bd0a0
--- /dev/null
+++ b/webrtc/modules/audio_processing/logging/aec_logging.h
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2015 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_
+
+#include <stdio.h>
+
+#include "webrtc/modules/audio_processing/logging/aec_logging_file_handling.h"
+
+// To enable AEC logging, invoke GYP with -Daec_debug_dump=1.
+#ifdef WEBRTC_AEC_DEBUG_DUMP
+// Dumps a wav data to file.
+#define RTC_AEC_DEBUG_WAV_WRITE(file, data, num_samples) \
+ do { \
+ rtc_WavWriteSamples((file), (data), (num_samples)); \
+ } while (0)
+
+// (Re)opens a wav file for writing using the specified sample rate.
+#define RTC_AEC_DEBUG_WAV_REOPEN(name, instance_index, process_rate, \
+ sample_rate, wav_file) \
+ do { \
+ WebRtcAec_ReopenWav((name), (instance_index), (process_rate), \
+ (sample_rate), (wav_file)); \
+ } while (0)
+
+// Closes a wav file.
+#define RTC_AEC_DEBUG_WAV_CLOSE(wav_file) \
+ do { \
+ rtc_WavClose((wav_file)); \
+ } while (0)
+
+// Dumps a raw data to file.
+#define RTC_AEC_DEBUG_RAW_WRITE(file, data, data_size) \
+ do { \
+ (void) fwrite((data), (data_size), 1, (file)); \
+ } while (0)
+
+// Opens a raw data file for writing using the specified sample rate.
+#define RTC_AEC_DEBUG_RAW_OPEN(name, instance_counter, file) \
+ do { \
+ WebRtcAec_RawFileOpen((name), (instance_counter), (file)); \
+ } while (0)
+
+// Closes a raw data file.
+#define RTC_AEC_DEBUG_RAW_CLOSE(file) \
+ do { \
+ fclose((file)); \
+ } while (0)
+
+#else // RTC_AEC_DEBUG_DUMP
+#define RTC_AEC_DEBUG_WAV_WRITE(file, data, num_samples) \
+ do { \
+ } while (0)
+
+#define RTC_AEC_DEBUG_WAV_REOPEN(wav_file, name, instance_index, process_rate, \
+ sample_rate) \
+ do { \
+ } while (0)
+
+#define RTC_AEC_DEBUG_WAV_CLOSE(wav_file) \
+ do { \
+ } while (0)
+
+#define RTC_AEC_DEBUG_RAW_WRITE(file, data, data_size) \
+ do { \
+ } while (0)
+
+#define RTC_AEC_DEBUG_RAW_OPEN(file, name, instance_counter) \
+ do { \
+ } while (0)
+
+#define RTC_AEC_DEBUG_RAW_CLOSE(file) \
+ do { \
+ } while (0)
+
+#endif // WEBRTC_AEC_DEBUG_DUMP
+
+#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_LOGGING_

Powered by Google App Engine
This is Rietveld 408576698