OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef MEDIA_FILTERS_AUDIO_RENDERER_IMPL_H_ | 5 #ifndef MEDIA_FILTERS_AUDIO_RENDERER_IMPL_H_ |
6 #define MEDIA_FILTERS_AUDIO_RENDERER_IMPL_H_ | 6 #define MEDIA_FILTERS_AUDIO_RENDERER_IMPL_H_ |
7 | 7 |
8 // This is the default implementation of AudioRenderer, which uses the audio | 8 // This is the default implementation of AudioRenderer, which uses the audio |
9 // interfaces to open an audio device. Although it cannot be used in the | 9 // interfaces to open an audio device. Although it cannot be used in the |
10 // sandbox, it serves as a reference implementation and can be used in other | 10 // sandbox, it serves as a reference implementation and can be used in other |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // Only allow a factory to create this class. | 51 // Only allow a factory to create this class. |
52 friend class FilterFactoryImpl0<AudioRendererImpl>; | 52 friend class FilterFactoryImpl0<AudioRendererImpl>; |
53 AudioRendererImpl(); | 53 AudioRendererImpl(); |
54 virtual ~AudioRendererImpl(); | 54 virtual ~AudioRendererImpl(); |
55 | 55 |
56 // AudioRendererBase implementation. | 56 // AudioRendererBase implementation. |
57 virtual bool OnInitialize(const MediaFormat& media_format); | 57 virtual bool OnInitialize(const MediaFormat& media_format); |
58 virtual void OnStop(); | 58 virtual void OnStop(); |
59 | 59 |
60 private: | 60 private: |
61 // Playback rate | |
62 // 0.0f is paused, 0.5f is half speed, 1.0f is normal, 2.0f is double speed. | |
63 // Rate should normally be any value between 0.5 and 3.0. | |
64 float playback_rate_; | |
65 | |
66 // Audio output stream device. | 61 // Audio output stream device. |
67 AudioOutputStream* stream_; | 62 AudioOutputStream* stream_; |
68 | 63 |
69 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); | 64 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); |
70 }; | 65 }; |
71 | 66 |
72 } // namespace media | 67 } // namespace media |
73 | 68 |
74 #endif // MEDIA_FILTERS_AUDIO_RENDERER_IMPL_H_ | 69 #endif // MEDIA_FILTERS_AUDIO_RENDERER_IMPL_H_ |
OLD | NEW |