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

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

Issue 1533913004: Revert of 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: 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.cc
diff --git a/webrtc/modules/audio_processing/audio_processing_impl.cc b/webrtc/modules/audio_processing/audio_processing_impl.cc
index bf614dcc5ba729bc29be499a009a577884f99e43..805e05eeee8d71643ca5d72b10df251b39a11e66 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl.cc
+++ b/webrtc/modules/audio_processing/audio_processing_impl.cc
@@ -627,7 +627,6 @@
for (int i = 0; i < formats_.api_format.output_stream().num_channels(); ++i)
msg->add_output_channel(dest[i], channel_size);
RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(),
- &debug_dump_.num_bytes_left_for_log_,
&crit_debug_, &debug_dump_.capture));
}
#endif
@@ -714,7 +713,6 @@
sizeof(int16_t) * frame->samples_per_channel_ * frame->num_channels_;
msg->set_output_data(frame->data_, data_size);
RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(),
- &debug_dump_.num_bytes_left_for_log_,
&crit_debug_, &debug_dump_.capture));
}
#endif
@@ -880,7 +878,6 @@
i < formats_.api_format.reverse_input_stream().num_channels(); ++i)
msg->add_channel(src[i], channel_size);
RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(),
- &debug_dump_.num_bytes_left_for_log_,
&crit_debug_, &debug_dump_.render));
}
#endif
@@ -947,7 +944,6 @@
sizeof(int16_t) * frame->samples_per_channel_ * frame->num_channels_;
msg->set_data(frame->data_, data_size);
RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(),
- &debug_dump_.num_bytes_left_for_log_,
&crit_debug_, &debug_dump_.render));
}
#endif
@@ -1033,8 +1029,7 @@
}
int AudioProcessingImpl::StartDebugRecording(
- const char filename[AudioProcessing::kMaxFilenameSize],
- int64_t max_log_size_bytes) {
+ const char filename[AudioProcessing::kMaxFilenameSize]) {
// Run in a single-threaded manner.
rtc::CritScope cs_render(&crit_render_);
rtc::CritScope cs_capture(&crit_capture_);
@@ -1045,7 +1040,6 @@
}
#ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
- debug_dump_.num_bytes_left_for_log_ = max_log_size_bytes;
// Stop any ongoing recording.
if (debug_dump_.debug_file->Open()) {
if (debug_dump_.debug_file->CloseFile() == -1) {
@@ -1066,8 +1060,7 @@
#endif // WEBRTC_AUDIOPROC_DEBUG_DUMP
}
-int AudioProcessingImpl::StartDebugRecording(FILE* handle,
- int64_t max_log_size_bytes) {
+int AudioProcessingImpl::StartDebugRecording(FILE* handle) {
// Run in a single-threaded manner.
rtc::CritScope cs_render(&crit_render_);
rtc::CritScope cs_capture(&crit_capture_);
@@ -1077,8 +1070,6 @@
}
#ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
- debug_dump_.num_bytes_left_for_log_ = max_log_size_bytes;
-
// Stop any ongoing recording.
if (debug_dump_.debug_file->Open()) {
if (debug_dump_.debug_file->CloseFile() == -1) {
@@ -1104,7 +1095,7 @@
rtc::CritScope cs_render(&crit_render_);
rtc::CritScope cs_capture(&crit_capture_);
FILE* stream = rtc::FdopenPlatformFileForWriting(handle);
- return StartDebugRecording(stream, -1);
+ return StartDebugRecording(stream);
}
int AudioProcessingImpl::StopDebugRecording() {
@@ -1385,7 +1376,6 @@
#ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
int AudioProcessingImpl::WriteMessageToDebugFile(
FileWrapper* debug_file,
- int64_t* filesize_limit_bytes,
rtc::CriticalSection* crit_debug,
ApmDebugDumpThreadState* debug_state) {
int32_t size = debug_state->event_msg->ByteSize();
@@ -1403,19 +1393,7 @@
{
// Ensure atomic writes of the message.
- rtc::CritScope cs_debug(crit_debug);
-
- RTC_DCHECK(debug_file->Open());
- // Update the byte counter.
- if (*filesize_limit_bytes >= 0) {
- *filesize_limit_bytes -=
- (sizeof(int32_t) + debug_state->event_str.length());
- if (*filesize_limit_bytes < 0) {
- // Not enough bytes are left to write this message, so stop logging.
- debug_file->CloseFile();
- return kNoError;
- }
- }
+ rtc::CritScope cs_capture(crit_debug);
// Write message preceded by its size.
if (!debug_file->Write(&size, sizeof(int32_t))) {
return kFileError;
@@ -1450,7 +1428,6 @@
// debug_dump_.capture.event_msg.
RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(),
- &debug_dump_.num_bytes_left_for_log_,
&crit_debug_, &debug_dump_.capture));
return kNoError;
}
@@ -1503,7 +1480,6 @@
debug_dump_.capture.event_msg->mutable_config()->CopyFrom(config);
RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(),
- &debug_dump_.num_bytes_left_for_log_,
&crit_debug_, &debug_dump_.capture));
return kNoError;
}
« no previous file with comments | « webrtc/modules/audio_processing/audio_processing_impl.h ('k') | webrtc/modules/audio_processing/include/audio_processing.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698