| 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 // Audio rendering unit utilizing an AudioRendererSink to output data. | 5 // Audio rendering unit utilizing an AudioRendererSink to output data. |
| 6 // | 6 // |
| 7 // This class lives inside three threads during it's lifetime, namely: | 7 // This class lives inside three threads during it's lifetime, namely: |
| 8 // 1. Render thread | 8 // 1. Render thread |
| 9 // Where the object is created. | 9 // Where the object is created. |
| 10 // 2. Media thread (provided via constructor) | 10 // 2. Media thread (provided via constructor) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include <deque> | 22 #include <deque> |
| 23 | 23 |
| 24 #include "base/gtest_prod_util.h" | 24 #include "base/gtest_prod_util.h" |
| 25 #include "base/memory/scoped_ptr.h" | 25 #include "base/memory/scoped_ptr.h" |
| 26 #include "base/memory/weak_ptr.h" | 26 #include "base/memory/weak_ptr.h" |
| 27 #include "base/synchronization/lock.h" | 27 #include "base/synchronization/lock.h" |
| 28 #include "media/base/audio_decoder.h" | 28 #include "media/base/audio_decoder.h" |
| 29 #include "media/base/audio_renderer.h" | 29 #include "media/base/audio_renderer.h" |
| 30 #include "media/base/audio_renderer_sink.h" | 30 #include "media/base/audio_renderer_sink.h" |
| 31 #include "media/base/decryptor.h" | 31 #include "media/base/decryptor.h" |
| 32 #include "media/base/media_log.h" |
| 32 #include "media/base/time_source.h" | 33 #include "media/base/time_source.h" |
| 33 #include "media/filters/audio_renderer_algorithm.h" | 34 #include "media/filters/audio_renderer_algorithm.h" |
| 34 #include "media/filters/decoder_stream.h" | 35 #include "media/filters/decoder_stream.h" |
| 35 | 36 |
| 36 namespace base { | 37 namespace base { |
| 37 class SingleThreadTaskRunner; | 38 class SingleThreadTaskRunner; |
| 38 } | 39 } |
| 39 | 40 |
| 40 namespace media { | 41 namespace media { |
| 41 | 42 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 57 // | 58 // |
| 58 // |decoders| contains the AudioDecoders to use when initializing. | 59 // |decoders| contains the AudioDecoders to use when initializing. |
| 59 // | 60 // |
| 60 // |set_decryptor_ready_cb| is fired when the audio decryptor is available | 61 // |set_decryptor_ready_cb| is fired when the audio decryptor is available |
| 61 // (only applicable if the stream is encrypted and we have a decryptor). | 62 // (only applicable if the stream is encrypted and we have a decryptor). |
| 62 AudioRendererImpl( | 63 AudioRendererImpl( |
| 63 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 64 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 64 AudioRendererSink* sink, | 65 AudioRendererSink* sink, |
| 65 ScopedVector<AudioDecoder> decoders, | 66 ScopedVector<AudioDecoder> decoders, |
| 66 const SetDecryptorReadyCB& set_decryptor_ready_cb, | 67 const SetDecryptorReadyCB& set_decryptor_ready_cb, |
| 67 const AudioHardwareConfig& hardware_params); | 68 const AudioHardwareConfig& hardware_params, |
| 69 const LogCB& log_cb); |
| 68 virtual ~AudioRendererImpl(); | 70 virtual ~AudioRendererImpl(); |
| 69 | 71 |
| 70 // TimeSource implementation. | 72 // TimeSource implementation. |
| 71 virtual void StartTicking() OVERRIDE; | 73 virtual void StartTicking() OVERRIDE; |
| 72 virtual void StopTicking() OVERRIDE; | 74 virtual void StopTicking() OVERRIDE; |
| 73 virtual void SetPlaybackRate(float rate) OVERRIDE; | 75 virtual void SetPlaybackRate(float rate) OVERRIDE; |
| 74 virtual void SetMediaTime(base::TimeDelta time) OVERRIDE; | 76 virtual void SetMediaTime(base::TimeDelta time) OVERRIDE; |
| 75 virtual base::TimeDelta CurrentMediaTime() OVERRIDE; | 77 virtual base::TimeDelta CurrentMediaTime() OVERRIDE; |
| 76 | 78 |
| 77 // AudioRenderer implementation. | 79 // AudioRenderer implementation. |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 258 |
| 257 // NOTE: Weak pointers must be invalidated before all other member variables. | 259 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 258 base::WeakPtrFactory<AudioRendererImpl> weak_factory_; | 260 base::WeakPtrFactory<AudioRendererImpl> weak_factory_; |
| 259 | 261 |
| 260 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); | 262 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); |
| 261 }; | 263 }; |
| 262 | 264 |
| 263 } // namespace media | 265 } // namespace media |
| 264 | 266 |
| 265 #endif // MEDIA_FILTERS_AUDIO_RENDERER_IMPL_H_ | 267 #endif // MEDIA_FILTERS_AUDIO_RENDERER_IMPL_H_ |
| OLD | NEW |