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

Unified Diff: media/base/audio_renderer_sink.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
« no previous file with comments | « media/base/audio_renderer_mixer_unittest.cc ('k') | media/base/fake_audio_renderer_sink.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..01be1017aeb70331d76915a32bf6a9d4fae80c3a 100644
--- a/media/base/audio_renderer_sink.h
+++ b/media/base/audio_renderer_sink.h
@@ -8,21 +8,13 @@
#include <stdint.h>
#include <string>
-#include <vector>
#include "base/callback.h"
-#include "base/logging.h"
#include "base/memory/ref_counted.h"
-#include "media/audio/audio_output_ipc.h"
#include "media/audio/audio_parameters.h"
#include "media/base/audio_bus.h"
-#include "media/base/media_export.h"
-#include "media/base/output_device.h"
-#include "url/gurl.h"
-
-namespace base {
-class SingleThreadTaskRunner;
-}
+#include "media/base/output_device_info.h"
+#include "url/origin.h"
namespace media {
@@ -71,12 +63,12 @@ class AudioRendererSink
// Returns |true| on success.
virtual bool SetVolume(double volume) = 0;
- // Returns a pointer to the internal output device.
- // This pointer is not to be owned by the caller and is valid only during
- // the lifetime of the AudioRendererSink.
- // It can be null, which means that access to the output device is not
- // supported.
- virtual 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 sink 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 OutputDeviceInfo GetOutputDeviceInfo() = 0;
protected:
friend class base::RefCountedThreadSafe<AudioRendererSink>;
@@ -93,6 +85,21 @@ class RestartableAudioRendererSink : public AudioRendererSink {
~RestartableAudioRendererSink() override {}
};
+class SwitchableAudioRendererSink : public RestartableAudioRendererSink {
+ public:
+ // Attempts to switch the audio output device associated with a sink.
+ // 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.
+ 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_
« no previous file with comments | « media/base/audio_renderer_mixer_unittest.cc ('k') | media/base/fake_audio_renderer_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698