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

Side by Side Diff: media/base/audio_renderer_sink.h

Issue 1122393004: Add support for switching the audio output device for HTMLMediaElements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes to MediaPlayers so that they invoke callbacks in the correct threads. First complete implem… Created 5 years, 6 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 unified diff | Download patch
OLDNEW
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 <string>
8 #include <vector> 9 #include <vector>
10
9 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/callback.h"
10 #include "base/logging.h" 13 #include "base/logging.h"
11 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
12 #include "media/audio/audio_parameters.h" 15 #include "media/audio/audio_parameters.h"
13 #include "media/base/audio_bus.h" 16 #include "media/base/audio_bus.h"
14 #include "media/base/media_export.h" 17 #include "media/base/media_export.h"
18 #include "url/gurl.h"
15 19
16 namespace media { 20 namespace media {
17 21
18 // AudioRendererSink is an interface representing the end-point for 22 // AudioRendererSink is an interface representing the end-point for
19 // rendered audio. An implementation is expected to 23 // rendered audio. An implementation is expected to
20 // periodically call Render() on a callback object. 24 // periodically call Render() on a callback object.
21 25
22 class AudioRendererSink 26 class AudioRendererSink
23 : public base::RefCountedThreadSafe<media::AudioRendererSink> { 27 : public base::RefCountedThreadSafe<media::AudioRendererSink> {
24 public: 28 public:
(...skipping 24 matching lines...) Expand all
49 // Pauses playback. 53 // Pauses playback.
50 virtual void Pause() = 0; 54 virtual void Pause() = 0;
51 55
52 // Resumes playback after calling Pause(). 56 // Resumes playback after calling Pause().
53 virtual void Play() = 0; 57 virtual void Play() = 0;
54 58
55 // Sets the playback volume, with range [0.0, 1.0] inclusive. 59 // Sets the playback volume, with range [0.0, 1.0] inclusive.
56 // Returns |true| on success. 60 // Returns |true| on success.
57 virtual bool SetVolume(double volume) = 0; 61 virtual bool SetVolume(double volume) = 0;
58 62
63 // Switches the audio output device.
miu 2015/06/03 21:01:01 The documentation here is insufficient: Please cla
64 virtual void SwitchOutputDevice(
65 const std::string& device_id,
66 const GURL& security_origin,
67 const base::Callback<void(int)>& callback) = 0;
68
59 protected: 69 protected:
60 friend class base::RefCountedThreadSafe<AudioRendererSink>; 70 friend class base::RefCountedThreadSafe<AudioRendererSink>;
61 virtual ~AudioRendererSink() {} 71 virtual ~AudioRendererSink() {}
62 }; 72 };
63 73
64 } // namespace media 74 } // namespace media
65 75
66 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ 76 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698