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

Unified Diff: webrtc/modules/audio_processing/audio_processing_impl.h

Issue 1541633002: Reland "Added option to specify a maximum file size when recording an AEC dump." (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix to prevent Chrome from breaking. Created 5 years 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/audio_processing_impl.h
diff --git a/webrtc/modules/audio_processing/audio_processing_impl.h b/webrtc/modules/audio_processing/audio_processing_impl.h
index 3506ac4dc0c5b071f7e7b0e6de0ff8c3d3807ff8..b720bbf1bcd984546abe09bbec84cf1ae7b873ad 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl.h
+++ b/webrtc/modules/audio_processing/audio_processing_impl.h
@@ -57,8 +57,9 @@ class AudioProcessingImpl : public AudioProcessing {
int Initialize(const ProcessingConfig& processing_config) override;
void SetExtraOptions(const Config& config) override;
void UpdateHistogramsOnCallEnd() override;
- int StartDebugRecording(const char filename[kMaxFilenameSize]) override;
- int StartDebugRecording(FILE* handle) override;
+ int StartDebugRecording(const char filename[kMaxFilenameSize],
+ int64_t max_log_size_bytes) override;
+ int StartDebugRecording(FILE* handle, int64_t max_log_size_bytes) override;
int StartDebugRecordingForPlatformFile(rtc::PlatformFile handle) override;
int StopDebugRecording() override;
@@ -143,6 +144,9 @@ class AudioProcessingImpl : public AudioProcessing {
struct ApmDebugDumpState {
ApmDebugDumpState() : debug_file(FileWrapper::Create()) {}
+ // Number of bytes that can still be written to the log before the maximum
+ // size is reached. A value of <= 0 indicates that no limit is used.
+ int64_t num_bytes_left_for_log_ = -1;
rtc::scoped_ptr<FileWrapper> debug_file;
ApmDebugDumpThreadState render;
ApmDebugDumpThreadState capture;
@@ -221,6 +225,7 @@ class AudioProcessingImpl : public AudioProcessing {
// TODO(andrew): make this more graceful. Ideally we would split this stuff
// out into a separate class with an "enabled" and "disabled" implementation.
static int WriteMessageToDebugFile(FileWrapper* debug_file,
+ int64_t* filesize_limit_bytes,
rtc::CriticalSection* crit_debug,
ApmDebugDumpThreadState* debug_state);
int WriteInitMessage() EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);

Powered by Google App Engine
This is Rietveld 408576698