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

Side by Side Diff: media/audio/null_audio_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, 8 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
« no previous file with comments | « media/audio/clockless_audio_sink.cc ('k') | media/audio/null_audio_sink.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_AUDIO_NULL_AUDIO_SINK_H_ 5 #ifndef MEDIA_AUDIO_NULL_AUDIO_SINK_H_
6 #define MEDIA_AUDIO_NULL_AUDIO_SINK_H_ 6 #define MEDIA_AUDIO_NULL_AUDIO_SINK_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "media/base/audio_renderer_sink.h" 12 #include "media/base/audio_renderer_sink.h"
13 13
14 namespace base { 14 namespace base {
15 class SingleThreadTaskRunner; 15 class SingleThreadTaskRunner;
16 } 16 }
17 17
18 namespace media { 18 namespace media {
19 class AudioBus; 19 class AudioBus;
20 class AudioHash; 20 class AudioHash;
21 class FakeAudioWorker; 21 class FakeAudioWorker;
22 class OutputDevice;
23 22
24 class MEDIA_EXPORT NullAudioSink 23 class MEDIA_EXPORT NullAudioSink
25 : NON_EXPORTED_BASE(public RestartableAudioRendererSink) { 24 : NON_EXPORTED_BASE(public SwitchableAudioRendererSink) {
26 public: 25 public:
27 NullAudioSink(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); 26 NullAudioSink(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
28 27
29 // AudioRendererSink implementation. 28 // AudioRendererSink implementation.
30 void Initialize(const AudioParameters& params, 29 void Initialize(const AudioParameters& params,
31 RenderCallback* callback) override; 30 RenderCallback* callback) override;
32 void Start() override; 31 void Start() override;
33 void Stop() override; 32 void Stop() override;
34 void Pause() override; 33 void Pause() override;
35 void Play() override; 34 void Play() override;
36 bool SetVolume(double volume) override; 35 bool SetVolume(double volume) override;
37 OutputDevice* GetOutputDevice() override; 36 OutputDeviceInfo GetOutputDeviceInfo() override;
37 void SwitchOutputDevice(const std::string& device_id,
38 const url::Origin& security_origin,
39 const OutputDeviceStatusCB& callback) override;
38 40
39 // Enables audio frame hashing. Must be called prior to Initialize(). 41 // Enables audio frame hashing. Must be called prior to Initialize().
40 void StartAudioHashForTesting(); 42 void StartAudioHashForTesting();
41 43
42 // Returns the hash of all audio frames seen since construction. 44 // Returns the hash of all audio frames seen since construction.
43 std::string GetAudioHashForTesting(); 45 std::string GetAudioHashForTesting();
44 46
45 protected: 47 protected:
46 ~NullAudioSink() override; 48 ~NullAudioSink() override;
47 49
(...skipping 12 matching lines...) Expand all
60 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 62 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
61 scoped_ptr<FakeAudioWorker> fake_worker_; 63 scoped_ptr<FakeAudioWorker> fake_worker_;
62 scoped_ptr<AudioBus> audio_bus_; 64 scoped_ptr<AudioBus> audio_bus_;
63 65
64 DISALLOW_COPY_AND_ASSIGN(NullAudioSink); 66 DISALLOW_COPY_AND_ASSIGN(NullAudioSink);
65 }; 67 };
66 68
67 } // namespace media 69 } // namespace media
68 70
69 #endif // MEDIA_AUDIO_NULL_AUDIO_SINK_H_ 71 #endif // MEDIA_AUDIO_NULL_AUDIO_SINK_H_
OLDNEW
« no previous file with comments | « media/audio/clockless_audio_sink.cc ('k') | media/audio/null_audio_sink.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698