| Index: media/base/audio_renderer_sink.h
|
| diff --git a/media/base/audio_renderer_sink.h b/media/base/audio_renderer_sink.h
|
| index ac845f3ff4b64bc77a8b2e4045b6da6144d99249..eafd0c237ef6de92f3bf96f9eca428b1b6595ce5 100644
|
| --- a/media/base/audio_renderer_sink.h
|
| +++ b/media/base/audio_renderer_sink.h
|
| @@ -93,6 +93,27 @@ class RestartableAudioRendererSink : public AudioRendererSink {
|
| ~RestartableAudioRendererSink() override {}
|
| };
|
|
|
| +class SwitchableAudioRendererSink : public RestartableAudioRendererSink {
|
| + public:
|
| + // Attempts to switch the audio output device.
|
| + // Once the attempt is finished, |callback| is invoked with the
|
| + // result of the operation passed as a parameter. The result is a value from
|
| + // the media::OutputDeviceStatus enum.
|
| + // There is no guarantee about the thread where |callback| will
|
| + // be invoked, so users are advised to use media::BindToCurrentLoop() to
|
| + // ensure that |callback| runs on the correct thread.
|
| + // Note also that copy constructors and destructors for arguments bound to
|
| + // |callback| may run on arbitrary threads as |callback| is moved across
|
| + // threads. It is advisable to bind arguments such that they are released by
|
| + // |callback| when it runs in order to avoid surprises.
|
| + virtual void SwitchOutputDevice(const std::string& device_id,
|
| + const url::Origin& security_origin,
|
| + const OutputDeviceStatusCB& callback) = 0;
|
| +
|
| + protected:
|
| + ~SwitchableAudioRendererSink() override {}
|
| +};
|
| +
|
| } // namespace media
|
|
|
| #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_
|
|
|