OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/audio/audio_output_controller.h" | 5 #include "media/audio/audio_output_controller.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/message_loop/message_loop.h" | |
10 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
11 #include "base/task_runner_util.h" | 10 #include "base/task_runner_util.h" |
12 #include "base/threading/platform_thread.h" | 11 #include "base/threading/platform_thread.h" |
13 #include "base/time/time.h" | 12 #include "base/time/time.h" |
14 #include "build/build_config.h" | 13 #include "build/build_config.h" |
15 #include "media/base/scoped_histogram_timer.h" | 14 #include "media/base/scoped_histogram_timer.h" |
16 | 15 |
17 using base::Time; | 16 using base::Time; |
18 using base::TimeDelta; | 17 using base::TimeDelta; |
19 | 18 |
(...skipping 24 matching lines...) Expand all Loading... |
44 params_(params), | 43 params_(params), |
45 handler_(handler), | 44 handler_(handler), |
46 output_device_id_(output_device_id), | 45 output_device_id_(output_device_id), |
47 input_device_id_(input_device_id), | 46 input_device_id_(input_device_id), |
48 stream_(NULL), | 47 stream_(NULL), |
49 diverting_to_stream_(NULL), | 48 diverting_to_stream_(NULL), |
50 volume_(1.0), | 49 volume_(1.0), |
51 state_(kEmpty), | 50 state_(kEmpty), |
52 num_allowed_io_(0), | 51 num_allowed_io_(0), |
53 sync_reader_(sync_reader), | 52 sync_reader_(sync_reader), |
54 message_loop_(audio_manager->GetMessageLoop()), | 53 message_loop_(audio_manager->GetTaskRunner()), |
55 #if defined(AUDIO_POWER_MONITORING) | 54 #if defined(AUDIO_POWER_MONITORING) |
56 power_monitor_( | 55 power_monitor_( |
57 params.sample_rate(), | 56 params.sample_rate(), |
58 TimeDelta::FromMilliseconds(kPowerMeasurementTimeConstantMillis)), | 57 TimeDelta::FromMilliseconds(kPowerMeasurementTimeConstantMillis)), |
59 #endif | 58 #endif |
60 on_more_io_data_called_(0) { | 59 on_more_io_data_called_(0) { |
61 DCHECK(audio_manager); | 60 DCHECK(audio_manager); |
62 DCHECK(handler_); | 61 DCHECK(handler_); |
63 DCHECK(sync_reader_); | 62 DCHECK(sync_reader_); |
64 DCHECK(message_loop_.get()); | 63 DCHECK(message_loop_.get()); |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 UMA_HISTOGRAM_BOOLEAN( | 483 UMA_HISTOGRAM_BOOLEAN( |
485 "Media.AudioOutputControllerPlaybackStartupSuccess", playback_success); | 484 "Media.AudioOutputControllerPlaybackStartupSuccess", playback_success); |
486 | 485 |
487 // Let the AudioManager try and fix it. | 486 // Let the AudioManager try and fix it. |
488 if (!playback_success) | 487 if (!playback_success) |
489 audio_manager_->FixWedgedAudio(); | 488 audio_manager_->FixWedgedAudio(); |
490 } | 489 } |
491 } | 490 } |
492 | 491 |
493 } // namespace media | 492 } // namespace media |
OLD | NEW |