Index: webrtc/modules/audio_processing/logging/apm_data_dumper.h |
diff --git a/webrtc/modules/audio_processing/logging/apm_data_dumper.h b/webrtc/modules/audio_processing/logging/apm_data_dumper.h |
index 691c4cec5b6adfe56fe30d9c5ab9c0b66ba98590..b37049222fdccc2bc971b6def511232d9adefa71 100644 |
--- a/webrtc/modules/audio_processing/logging/apm_data_dumper.h |
+++ b/webrtc/modules/audio_processing/logging/apm_data_dumper.h |
@@ -57,6 +57,33 @@ class ApmDataDumper { |
// Methods for performing dumping of data of various types into |
// various formats. |
+ void DumpRaw(const char* name, double v) { |
+#if WEBRTC_APM_DEBUG_DUMP == 1 |
+ FILE* file = GetRawFile(name); |
+ fwrite(&v, sizeof(v), 1, file); |
+#endif |
+ } |
+ |
+ void DumpRaw(const char* name, int v_length, const double* v) { |
hlundin-webrtc
2017/01/18 13:08:51
size_t v_length
peah-webrtc
2017/01/19 15:33:07
Done.
|
+#if WEBRTC_APM_DEBUG_DUMP == 1 |
+ FILE* file = GetRawFile(name); |
+ fwrite(v, sizeof(v[0]), v_length, file); |
+#endif |
+ } |
+ |
+ void DumpRaw(const char* name, rtc::ArrayView<const double> v) { |
+#if WEBRTC_APM_DEBUG_DUMP == 1 |
+ DumpRaw(name, v.size(), v.data()); |
+#endif |
+ } |
+ |
+ void DumpRaw(const char* name, float v) { |
+#if WEBRTC_APM_DEBUG_DUMP == 1 |
+ FILE* file = GetRawFile(name); |
+ fwrite(&v, sizeof(v), 1, file); |
+#endif |
+ } |
+ |
void DumpRaw(const char* name, int v_length, const float* v) { |
#if WEBRTC_APM_DEBUG_DUMP == 1 |
FILE* file = GetRawFile(name); |
@@ -70,6 +97,14 @@ class ApmDataDumper { |
#endif |
} |
+ void DumpRaw(const char* name, bool v) { |
+#if WEBRTC_APM_DEBUG_DUMP == 1 |
+ FILE* file = GetRawFile(name); |
hlundin-webrtc
2017/01/18 13:08:51
You could just call
DumpRaw(name, static_cast<int1
peah-webrtc
2017/01/19 15:33:07
Good find!
Done.
|
+ int16_t value = static_cast<int16_t>(v); |
+ fwrite(&value, sizeof(value), 1, file); |
+#endif |
+ } |
+ |
void DumpRaw(const char* name, int v_length, const bool* v) { |
#if WEBRTC_APM_DEBUG_DUMP == 1 |
FILE* file = GetRawFile(name); |
@@ -86,6 +121,13 @@ class ApmDataDumper { |
#endif |
} |
+ void DumpRaw(const char* name, int16_t v) { |
+#if WEBRTC_APM_DEBUG_DUMP == 1 |
+ FILE* file = GetRawFile(name); |
+ fwrite(&v, sizeof(v), 1, file); |
+#endif |
+ } |
+ |
void DumpRaw(const char* name, int v_length, const int16_t* v) { |
#if WEBRTC_APM_DEBUG_DUMP == 1 |
FILE* file = GetRawFile(name); |
@@ -99,6 +141,13 @@ class ApmDataDumper { |
#endif |
} |
+ void DumpRaw(const char* name, int32_t v) { |
+#if WEBRTC_APM_DEBUG_DUMP == 1 |
+ FILE* file = GetRawFile(name); |
+ fwrite(&v, sizeof(v), 1, file); |
+#endif |
+ } |
+ |
void DumpRaw(const char* name, int v_length, const int32_t* v) { |
#if WEBRTC_APM_DEBUG_DUMP == 1 |
FILE* file = GetRawFile(name); |
@@ -106,6 +155,20 @@ class ApmDataDumper { |
#endif |
} |
+ void DumpRaw(const char* name, size_t v) { |
hlundin-webrtc
2017/01/18 13:08:51
Hmmm. This starts to look a bit like a candidate f
peah-webrtc
2017/01/19 15:33:07
True. Let's do that. But I'd rather keep that chan
hlundin-webrtc
2017/01/20 09:31:44
Good.
peah-webrtc
2017/01/23 14:16:39
Acknowledged.
|
+#if WEBRTC_APM_DEBUG_DUMP == 1 |
+ FILE* file = GetRawFile(name); |
+ fwrite(&v, sizeof(v), 1, file); |
+#endif |
+ } |
+ |
+ void DumpRaw(const char* name, int v_length, const size_t* v) { |
+#if WEBRTC_APM_DEBUG_DUMP == 1 |
+ FILE* file = GetRawFile(name); |
+ fwrite(v, sizeof(v[0]), v_length, file); |
+#endif |
+ } |
+ |
void DumpRaw(const char* name, rtc::ArrayView<const int32_t> v) { |
#if WEBRTC_APM_DEBUG_DUMP == 1 |
DumpRaw(name, v.size(), v.data()); |