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 #ifndef MEDIA_AUDIO_AUDIO_OUTPUT_RESAMPLER_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_OUTPUT_RESAMPLER_H_ |
6 #define MEDIA_AUDIO_AUDIO_OUTPUT_RESAMPLER_H_ | 6 #define MEDIA_AUDIO_AUDIO_OUTPUT_RESAMPLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 // remove fallback support once it's stable. http://crbug.com/148418 | 37 // remove fallback support once it's stable. http://crbug.com/148418 |
38 class MEDIA_EXPORT AudioOutputResampler : public AudioOutputDispatcher { | 38 class MEDIA_EXPORT AudioOutputResampler : public AudioOutputDispatcher { |
39 public: | 39 public: |
40 AudioOutputResampler(AudioManager* audio_manager, | 40 AudioOutputResampler(AudioManager* audio_manager, |
41 const AudioParameters& input_params, | 41 const AudioParameters& input_params, |
42 const AudioParameters& output_params, | 42 const AudioParameters& output_params, |
43 const std::string& output_device_id, | 43 const std::string& output_device_id, |
44 const base::TimeDelta& close_delay); | 44 const base::TimeDelta& close_delay); |
45 | 45 |
46 // AudioOutputDispatcher interface. | 46 // AudioOutputDispatcher interface. |
47 virtual bool OpenStream() override; | 47 bool OpenStream() override; |
48 virtual bool StartStream(AudioOutputStream::AudioSourceCallback* callback, | 48 bool StartStream(AudioOutputStream::AudioSourceCallback* callback, |
49 AudioOutputProxy* stream_proxy) override; | 49 AudioOutputProxy* stream_proxy) override; |
50 virtual void StopStream(AudioOutputProxy* stream_proxy) override; | 50 void StopStream(AudioOutputProxy* stream_proxy) override; |
51 virtual void StreamVolumeSet(AudioOutputProxy* stream_proxy, | 51 void StreamVolumeSet(AudioOutputProxy* stream_proxy, double volume) override; |
52 double volume) override; | 52 void CloseStream(AudioOutputProxy* stream_proxy) override; |
53 virtual void CloseStream(AudioOutputProxy* stream_proxy) override; | 53 void Shutdown() override; |
54 virtual void Shutdown() override; | |
55 | 54 |
56 private: | 55 private: |
57 friend class base::RefCountedThreadSafe<AudioOutputResampler>; | 56 friend class base::RefCountedThreadSafe<AudioOutputResampler>; |
58 virtual ~AudioOutputResampler(); | 57 ~AudioOutputResampler() override; |
59 | 58 |
60 // Converts low latency based output parameters into high latency | 59 // Converts low latency based output parameters into high latency |
61 // appropriate output parameters in error situations. | 60 // appropriate output parameters in error situations. |
62 void SetupFallbackParams(); | 61 void SetupFallbackParams(); |
63 | 62 |
64 // Used to initialize and reinitialize |dispatcher_|. | 63 // Used to initialize and reinitialize |dispatcher_|. |
65 void Initialize(); | 64 void Initialize(); |
66 | 65 |
67 // Dispatcher to proxy all AudioOutputDispatcher calls too. | 66 // Dispatcher to proxy all AudioOutputDispatcher calls too. |
68 scoped_refptr<AudioOutputDispatcher> dispatcher_; | 67 scoped_refptr<AudioOutputDispatcher> dispatcher_; |
(...skipping 12 matching lines...) Expand all Loading... |
81 // Whether any streams have been opened through |dispatcher_|, if so we can't | 80 // Whether any streams have been opened through |dispatcher_|, if so we can't |
82 // fallback on future OpenStream() failures. | 81 // fallback on future OpenStream() failures. |
83 bool streams_opened_; | 82 bool streams_opened_; |
84 | 83 |
85 DISALLOW_COPY_AND_ASSIGN(AudioOutputResampler); | 84 DISALLOW_COPY_AND_ASSIGN(AudioOutputResampler); |
86 }; | 85 }; |
87 | 86 |
88 } // namespace media | 87 } // namespace media |
89 | 88 |
90 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_RESAMPLER_H_ | 89 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_RESAMPLER_H_ |
OLD | NEW |