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

Side by Side Diff: media/blink/webaudiosourceprovider_impl.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_BLINK_WEBAUDIOSOURCEPROVIDER_IMPL_H_ 5 #ifndef MEDIA_BLINK_WEBAUDIOSOURCEPROVIDER_IMPL_H_
6 #define MEDIA_BLINK_WEBAUDIOSOURCEPROVIDER_IMPL_H_ 6 #define MEDIA_BLINK_WEBAUDIOSOURCEPROVIDER_IMPL_H_
7 7
8 #include <string>
9
8 #include "base/callback.h" 10 #include "base/callback.h"
9 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
10 #include "base/synchronization/lock.h" 12 #include "base/synchronization/lock.h"
11 #include "media/base/audio_renderer_sink.h" 13 #include "media/base/audio_renderer_sink.h"
12 #include "media/base/media_export.h" 14 #include "media/base/media_export.h"
13 #include "third_party/WebKit/public/platform/WebAudioSourceProvider.h" 15 #include "third_party/WebKit/public/platform/WebAudioSourceProvider.h"
14 #include "third_party/WebKit/public/platform/WebVector.h" 16 #include "third_party/WebKit/public/platform/WebVector.h"
15 17
16 namespace blink { 18 namespace blink {
17 class WebAudioSourceProviderClient; 19 class WebAudioSourceProviderClient;
(...skipping 21 matching lines...) Expand all
39 virtual void setClient(blink::WebAudioSourceProviderClient* client); 41 virtual void setClient(blink::WebAudioSourceProviderClient* client);
40 virtual void provideInput(const blink::WebVector<float*>& audio_data, 42 virtual void provideInput(const blink::WebVector<float*>& audio_data,
41 size_t number_of_frames); 43 size_t number_of_frames);
42 44
43 // AudioRendererSink implementation. 45 // AudioRendererSink implementation.
44 void Start() override; 46 void Start() override;
45 void Stop() override; 47 void Stop() override;
46 void Play() override; 48 void Play() override;
47 void Pause() override; 49 void Pause() override;
48 bool SetVolume(double volume) override; 50 bool SetVolume(double volume) override;
51 void SwitchOutputDevice(const std::string& device_id,
52 const GURL& security_origin,
53 const base::Callback<void(int)>& callback) override;
49 void Initialize(const AudioParameters& params, 54 void Initialize(const AudioParameters& params,
50 RenderCallback* renderer) override; 55 RenderCallback* renderer) override;
51 56
52 protected: 57 protected:
53 virtual ~WebAudioSourceProviderImpl(); 58 virtual ~WebAudioSourceProviderImpl();
54 59
55 private: 60 private:
56 // Calls setFormat() on |client_| from the Blink renderer thread. 61 // Calls setFormat() on |client_| from the Blink renderer thread.
57 void OnSetFormat(); 62 void OnSetFormat();
58 63
(...skipping 22 matching lines...) Expand all
81 86
82 // NOTE: Weak pointers must be invalidated before all other member variables. 87 // NOTE: Weak pointers must be invalidated before all other member variables.
83 base::WeakPtrFactory<WebAudioSourceProviderImpl> weak_factory_; 88 base::WeakPtrFactory<WebAudioSourceProviderImpl> weak_factory_;
84 89
85 DISALLOW_IMPLICIT_CONSTRUCTORS(WebAudioSourceProviderImpl); 90 DISALLOW_IMPLICIT_CONSTRUCTORS(WebAudioSourceProviderImpl);
86 }; 91 };
87 92
88 } // namespace media 93 } // namespace media
89 94
90 #endif // MEDIA_BLINK_WEBAUDIOSOURCEPROVIDER_IMPL_H_ 95 #endif // MEDIA_BLINK_WEBAUDIOSOURCEPROVIDER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698