Chromium Code Reviews| Index: content/public/renderer/media_stream_audio_renderer.h |
| diff --git a/content/public/renderer/media_stream_audio_renderer.h b/content/public/renderer/media_stream_audio_renderer.h |
| index 5a5d68d3d6234171c33df2e2462e8d430e9c0402..c13b612ad8e57346671da5a23602c7bf5873e277 100644 |
| --- a/content/public/renderer/media_stream_audio_renderer.h |
| +++ b/content/public/renderer/media_stream_audio_renderer.h |
| @@ -10,8 +10,8 @@ |
| #include "base/callback.h" |
| #include "base/memory/ref_counted.h" |
| #include "base/time/time.h" |
| -#include "media/base/output_device.h" |
| -#include "url/gurl.h" |
| +#include "media/base/output_device_info.h" |
| +#include "url/origin.h" |
| namespace content { |
| @@ -34,12 +34,28 @@ class MediaStreamAudioRenderer |
| // Sets the output volume. |
| virtual void SetVolume(float volume) = 0; |
| - // Returns a pointer to the internal output device. |
| - // The pointer is not to be owned by the caller and is valid only during |
| - // the lifetime of the MediaStreamAudioRenderer. |
| - // It can be null, which means that access to the output device is not |
| - // supported. |
| - virtual media::OutputDevice* GetOutputDevice() = 0; |
| + // Returns current output device information. If the information is not |
| + // available yet, this method may block until it becomes available. |
| + // If output device is not supported, |device_status| of |
| + // OutputDeviceInfo should be set to OUTPUT_DEVICE_STATUS_ERROR_INTERNAL. |
| + // Must never be called on the IO thread. |
|
miu
2016/03/24 21:32:02
nit: You can probably omit the "never be called on
o1ka
2016/03/29 13:39:53
I would probably leave it as it is now: Since the
|
| + virtual media::OutputDeviceInfo GetOutputDeviceInfo() = 0; |
| + |
| + // 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 |
|
miu
2016/03/24 21:32:02
Because this is a public interface, it's usually b
o1ka
2016/03/29 13:39:53
I just copied the old SwitchOutputDevice() comment
miu
2016/03/29 19:46:27
I suppose it's fine to leave it alone for this cha
o1ka
2016/03/30 14:02:42
Agree. We need to come back to it after a couple o
|
| + // ensure that |callback| runs on the correct thread. |
| + // Note also that copy constructors and destructors for arguments bound to |
|
miu
2016/03/24 21:32:02
You can remove lines 51-54. This is generally und
o1ka
2016/03/29 13:39:54
Done.
|
| + // |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 media::OutputDeviceStatusCB& callback) = 0; |
| // Time stamp that reflects the current render time. Should not be updated |
| // when paused. |