| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // Returns |true| on success. | 66 // Returns |true| on success. |
| 67 virtual bool SetVolume(double volume) = 0; | 67 virtual bool SetVolume(double volume) = 0; |
| 68 | 68 |
| 69 // Returns current output device information. If the information is not | 69 // Returns current output device information. If the information is not |
| 70 // available yet, this method may block until it becomes available. | 70 // available yet, this method may block until it becomes available. |
| 71 // If the sink is not associated with any output device, |device_status| of | 71 // If the sink is not associated with any output device, |device_status| of |
| 72 // OutputDeviceInfo should be set to OUTPUT_DEVICE_STATUS_ERROR_INTERNAL. | 72 // OutputDeviceInfo should be set to OUTPUT_DEVICE_STATUS_ERROR_INTERNAL. |
| 73 // Must never be called on the IO thread. | 73 // Must never be called on the IO thread. |
| 74 virtual OutputDeviceInfo GetOutputDeviceInfo() = 0; | 74 virtual OutputDeviceInfo GetOutputDeviceInfo() = 0; |
| 75 | 75 |
| 76 // Returns |true| if a source with hardware parameters is preferable. |
| 77 virtual bool IsOptimizedForHardwareParameters() = 0; |
| 78 |
| 76 // If DCHECKs are enabled, this function returns true if called on rendering | 79 // If DCHECKs are enabled, this function returns true if called on rendering |
| 77 // thread, otherwise false. With DCHECKs disabled, it returns true. Thus, it | 80 // thread, otherwise false. With DCHECKs disabled, it returns true. Thus, it |
| 78 // is intended to be used for DCHECKing. | 81 // is intended to be used for DCHECKing. |
| 79 virtual bool CurrentThreadIsRenderingThread() = 0; | 82 virtual bool CurrentThreadIsRenderingThread() = 0; |
| 80 | 83 |
| 81 protected: | 84 protected: |
| 82 friend class base::RefCountedThreadSafe<AudioRendererSink>; | 85 friend class base::RefCountedThreadSafe<AudioRendererSink>; |
| 83 virtual ~AudioRendererSink() {} | 86 virtual ~AudioRendererSink() {} |
| 84 }; | 87 }; |
| 85 | 88 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 104 const url::Origin& security_origin, | 107 const url::Origin& security_origin, |
| 105 const OutputDeviceStatusCB& callback) = 0; | 108 const OutputDeviceStatusCB& callback) = 0; |
| 106 | 109 |
| 107 protected: | 110 protected: |
| 108 ~SwitchableAudioRendererSink() override {} | 111 ~SwitchableAudioRendererSink() override {} |
| 109 }; | 112 }; |
| 110 | 113 |
| 111 } // namespace media | 114 } // namespace media |
| 112 | 115 |
| 113 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ | 116 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ |
| OLD | NEW |