Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(887)

Unified Diff: content/public/renderer/media_stream_audio_renderer.h

Issue 1809093003: Moving SwitchOutputDevice out of OutputDevice interface, eliminating OutputDevice (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..3061d6427f5061e4d6c3b3e3f855c1321734f20a 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,24 @@ 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 the renderer is not associated with any output device, |device_status|
+ // of OutputDeviceInfo should be set to OUTPUT_DEVICE_STATUS_ERROR_INTERNAL.
+ // Must never be called on the IO thread.
+ 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.
+ // TODO(olka): make sure callback is always called on the client thread,
+ // update clients accordingly and fix the comment.
+ 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.
« no previous file with comments | « content/browser/renderer_host/media/audio_renderer_host.cc ('k') | content/renderer/media/audio_device_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698