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/filters/audio_renderer_impl.h" | 5 #include "media/filters/audio_renderer_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/callback_helpers.h" | 13 #include "base/callback_helpers.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
16 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
17 #include "media/base/audio_buffer.h" | 17 #include "media/base/audio_buffer.h" |
18 #include "media/base/audio_splicer.h" | 18 #include "media/base/audio_splicer.h" |
19 #include "media/base/bind_to_current_loop.h" | 19 #include "media/base/bind_to_current_loop.h" |
20 #include "media/base/demuxer_stream.h" | 20 #include "media/base/demuxer_stream.h" |
21 #include "media/filters/decrypting_demuxer_stream.h" | 21 #include "media/filters/decrypting_demuxer_stream.h" |
22 | 22 |
23 namespace media { | 23 namespace media { |
24 | 24 |
25 namespace { | 25 namespace { |
26 | 26 |
27 enum AudioRendererEvent { | 27 enum AudioRendererEvent { |
28 INITIALIZED, | 28 INITIALIZED, |
29 RENDER_ERROR, | 29 RENDER_ERROR, |
30 MAX_EVENTS | 30 EVENT_MAX = RENDER_ERROR, |
31 }; | 31 }; |
32 | 32 |
33 void HistogramRendererEvent(AudioRendererEvent event) { | 33 void HistogramRendererEvent(AudioRendererEvent event) { |
34 UMA_HISTOGRAM_ENUMERATION("Media.AudioRendererEvents", event, MAX_EVENTS); | 34 UMA_HISTOGRAM_ENUMERATION("Media.AudioRendererEvents", event, EVENT_MAX + 1); |
35 } | 35 } |
36 | 36 |
37 } // namespace | 37 } // namespace |
38 | 38 |
39 AudioRendererImpl::AudioRendererImpl( | 39 AudioRendererImpl::AudioRendererImpl( |
40 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 40 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
41 media::AudioRendererSink* sink, | 41 media::AudioRendererSink* sink, |
42 ScopedVector<AudioDecoder> decoders, | 42 ScopedVector<AudioDecoder> decoders, |
43 const SetDecryptorReadyCB& set_decryptor_ready_cb) | 43 const SetDecryptorReadyCB& set_decryptor_ready_cb) |
44 : task_runner_(task_runner), | 44 : task_runner_(task_runner), |
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 } | 728 } |
729 } | 729 } |
730 | 730 |
731 void AudioRendererImpl::ChangeState_Locked(State new_state) { | 731 void AudioRendererImpl::ChangeState_Locked(State new_state) { |
732 DVLOG(1) << __FUNCTION__ << " : " << state_ << " -> " << new_state; | 732 DVLOG(1) << __FUNCTION__ << " : " << state_ << " -> " << new_state; |
733 lock_.AssertAcquired(); | 733 lock_.AssertAcquired(); |
734 state_ = new_state; | 734 state_ = new_state; |
735 } | 735 } |
736 | 736 |
737 } // namespace media | 737 } // namespace media |
OLD | NEW |