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

Unified Diff: media/audio/mac/audio_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/audio_input_controller.cc ('k') | media/audio/mac/audio_low_latency_input_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/mac/audio_input_mac.cc
diff --git a/media/audio/mac/audio_input_mac.cc b/media/audio/mac/audio_input_mac.cc
index 88c6a019c6894a67e69c28429af0f4b4c619533a..8fc18d3d7807b6da332ae49d149eb3f9e05b524a 100644
--- a/media/audio/mac/audio_input_mac.cc
+++ b/media/audio/mac/audio_input_mac.cc
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "base/mac/mac_logging.h"
+#include "base/trace_event/trace_event.h"
#include "media/audio/mac/audio_manager_mac.h"
#include "media/base/audio_bus.h"
@@ -202,6 +203,7 @@ void PCMQueueInAudioInputStream::HandleInputBuffer(
const AudioStreamPacketDescription* packet_desc) {
DCHECK_EQ(audio_queue_, audio_queue);
DCHECK(audio_buffer->mAudioData);
+ TRACE_EVENT0("audio", "PCMQueueInAudioInputStream::HandleInputBuffer");
if (!callback_) {
// This can happen if Stop() was called without start.
DCHECK_EQ(0U, audio_buffer->mAudioDataByteSize);
@@ -220,8 +222,11 @@ void PCMQueueInAudioInputStream::HandleInputBuffer(
// http://crbug.com/161383.
base::TimeDelta elapsed = base::TimeTicks::Now() - last_fill_;
const base::TimeDelta kMinDelay = base::TimeDelta::FromMilliseconds(5);
- if (elapsed < kMinDelay)
+ if (elapsed < kMinDelay) {
+ TRACE_EVENT0("audio",
+ "PCMQueueInAudioInputStream::HandleInputBuffer sleep");
base::PlatformThread::Sleep(kMinDelay - elapsed);
+ }
uint8_t* audio_data = reinterpret_cast<uint8_t*>(audio_buffer->mAudioData);
audio_bus_->FromInterleaved(
« no previous file with comments | « media/audio/audio_input_controller.cc ('k') | media/audio/mac/audio_low_latency_input_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698