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_BASE_AUDIO_RENDERER_SINK_H_ | 5 #ifndef MEDIA_BASE_AUDIO_RENDERER_SINK_H_ |
6 #define MEDIA_BASE_AUDIO_RENDERER_SINK_H_ | 6 #define MEDIA_BASE_AUDIO_RENDERER_SINK_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // Returns |true| on success. | 63 // Returns |true| on success. |
64 virtual bool SetVolume(double volume) = 0; | 64 virtual bool SetVolume(double volume) = 0; |
65 | 65 |
66 // Returns current output device information. If the information is not | 66 // Returns current output device information. If the information is not |
67 // available yet, this method may block until it becomes available. | 67 // available yet, this method may block until it becomes available. |
68 // If the sink is not associated with any output device, |device_status| of | 68 // If the sink is not associated with any output device, |device_status| of |
69 // OutputDeviceInfo should be set to OUTPUT_DEVICE_STATUS_ERROR_INTERNAL. | 69 // OutputDeviceInfo should be set to OUTPUT_DEVICE_STATUS_ERROR_INTERNAL. |
70 // Must never be called on the IO thread. | 70 // Must never be called on the IO thread. |
71 virtual OutputDeviceInfo GetOutputDeviceInfo() = 0; | 71 virtual OutputDeviceInfo GetOutputDeviceInfo() = 0; |
72 | 72 |
| 73 // Returns true if called on rendering thread, otherwise false. |
| 74 virtual bool BelongsToRenderingThread() = 0; |
| 75 |
73 protected: | 76 protected: |
74 friend class base::RefCountedThreadSafe<AudioRendererSink>; | 77 friend class base::RefCountedThreadSafe<AudioRendererSink>; |
75 virtual ~AudioRendererSink() {} | 78 virtual ~AudioRendererSink() {} |
76 }; | 79 }; |
77 | 80 |
78 // Same as AudioRendererSink except that Initialize() and Start() can be called | 81 // Same as AudioRendererSink except that Initialize() and Start() can be called |
79 // again after Stop(). | 82 // again after Stop(). |
80 // TODO(sandersd): Fold back into AudioRendererSink once all subclasses support | 83 // TODO(sandersd): Fold back into AudioRendererSink once all subclasses support |
81 // this. | 84 // this. |
82 | 85 |
(...skipping 13 matching lines...) Expand all Loading... |
96 const url::Origin& security_origin, | 99 const url::Origin& security_origin, |
97 const OutputDeviceStatusCB& callback) = 0; | 100 const OutputDeviceStatusCB& callback) = 0; |
98 | 101 |
99 protected: | 102 protected: |
100 ~SwitchableAudioRendererSink() override {} | 103 ~SwitchableAudioRendererSink() override {} |
101 }; | 104 }; |
102 | 105 |
103 } // namespace media | 106 } // namespace media |
104 | 107 |
105 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ | 108 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ |
OLD | NEW |