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

Unified Diff: media/audio/mac/audio_low_latency_input_mac.cc

Issue 2458973002: Audio input traces for Mac (browser-side) (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « media/audio/mac/audio_input_mac.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/mac/audio_low_latency_input_mac.cc
diff --git a/media/audio/mac/audio_low_latency_input_mac.cc b/media/audio/mac/audio_low_latency_input_mac.cc
index 9e7aec270433fb6d165f01b8655e4c19cc92d14a..cddf4300d3d61bf449a1cf9ebcc9725dc813233d 100644
--- a/media/audio/mac/audio_low_latency_input_mac.cc
+++ b/media/audio/mac/audio_low_latency_input_mac.cc
@@ -15,6 +15,7 @@
#include "base/strings/stringprintf.h"
#include "base/sys_info.h"
#include "base/time/time.h"
+#include "base/trace_event/trace_event.h"
#include "media/audio/mac/audio_manager_mac.h"
#include "media/base/audio_bus.h"
#include "media/base/data_buffer.h"
@@ -830,6 +831,7 @@ OSStatus AUAudioInputStream::OnDataIsAvailable(
const AudioTimeStamp* time_stamp,
UInt32 bus_number,
UInt32 number_of_frames) {
+ TRACE_EVENT0("audio", "AUAudioInputStream::OnDataIsAvailable");
// Update |last_callback_time_| on the main browser thread. Its value is used
// by CheckIfInputStreamIsAlive() to detect if the stream is dead or alive.
manager_->GetTaskRunner()->PostTask(
@@ -878,12 +880,16 @@ OSStatus AUAudioInputStream::OnDataIsAvailable(
// Since it happens on the input bus, the |&audio_buffer_list_| parameter is
// a reference to the preallocated audio buffer list that the audio unit
// renders into.
+ TRACE_EVENT_BEGIN0("audio", "AudioUnitRender");
OSStatus result = AudioUnitRender(audio_unit_, flags, time_stamp, bus_number,
number_of_frames, &audio_buffer_list_);
+ TRACE_EVENT_END0("audio", "AudioUnitRender");
if (result == noErr) {
audio_unit_render_has_worked_ = true;
}
if (result) {
+ TRACE_EVENT_INSTANT0("audio", "AudioUnitRender error",
+ TRACE_EVENT_SCOPE_THREAD);
// Only upload UMA histograms for the case when AGC is enabled. The reason
// is that we want to compare these stats with others in this class and
// they are only stored for "AGC streams", e.g. WebRTC audio streams.
@@ -942,6 +948,8 @@ OSStatus AUAudioInputStream::OnDataIsAvailable(
OSStatus AUAudioInputStream::Provide(UInt32 number_of_frames,
AudioBufferList* io_data,
const AudioTimeStamp* time_stamp) {
+ TRACE_EVENT1("audio", "AUAudioInputStream::Provide", "number_of_frames",
+ number_of_frames);
UpdateCaptureTimestamp(time_stamp);
last_number_of_frames_ = number_of_frames;
@@ -980,6 +988,8 @@ OSStatus AUAudioInputStream::Provide(UInt32 number_of_frames,
static_cast<int>((number_of_frames - fifo_.GetUnfilledFrames()) /
number_of_frames_) + 1;
DLOG(WARNING) << "Increasing FIFO capacity by " << blocks << " blocks";
+ TRACE_EVENT_INSTANT1("audio", "Increasing FIFO capacity",
+ TRACE_EVENT_SCOPE_THREAD, "increased by", blocks);
fifo_.IncreaseCapacity(blocks);
}
« no previous file with comments | « media/audio/mac/audio_input_mac.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698