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

Side by Side Diff: media/renderers/renderer_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_RENDERERS_RENDERER_IMPL_H_ 5 #ifndef MEDIA_RENDERERS_RENDERER_IMPL_H_
6 #define MEDIA_RENDERERS_RENDERER_IMPL_H_ 6 #define MEDIA_RENDERERS_RENDERER_IMPL_H_
7 7
8 #include <string>
8 #include <vector> 9 #include <vector>
9 10
10 #include "base/cancelable_callback.h" 11 #include "base/cancelable_callback.h"
11 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
14 #include "base/synchronization/lock.h" 15 #include "base/synchronization/lock.h"
15 #include "base/time/clock.h" 16 #include "base/time/clock.h"
16 #include "base/time/default_tick_clock.h" 17 #include "base/time/default_tick_clock.h"
17 #include "base/time/time.h" 18 #include "base/time/time.h"
18 #include "media/base/buffering_state.h" 19 #include "media/base/buffering_state.h"
19 #include "media/base/decryptor.h" 20 #include "media/base/decryptor.h"
20 #include "media/base/media_export.h" 21 #include "media/base/media_export.h"
21 #include "media/base/pipeline_status.h" 22 #include "media/base/pipeline_status.h"
22 #include "media/base/renderer.h" 23 #include "media/base/renderer.h"
24 #include "url/gurl.h"
23 25
24 namespace base { 26 namespace base {
25 class SingleThreadTaskRunner; 27 class SingleThreadTaskRunner;
26 } 28 }
27 29
28 namespace media { 30 namespace media {
29 31
30 class AudioRenderer; 32 class AudioRenderer;
31 class DemuxerStreamProvider; 33 class DemuxerStreamProvider;
32 class TimeSource; 34 class TimeSource;
(...skipping 19 matching lines...) Expand all
52 const BufferingStateCB& buffering_state_cb, 54 const BufferingStateCB& buffering_state_cb,
53 const base::Closure& ended_cb, 55 const base::Closure& ended_cb,
54 const PipelineStatusCB& error_cb, 56 const PipelineStatusCB& error_cb,
55 const base::Closure& waiting_for_decryption_key_cb) final; 57 const base::Closure& waiting_for_decryption_key_cb) final;
56 void SetCdm(CdmContext* cdm_context, 58 void SetCdm(CdmContext* cdm_context,
57 const CdmAttachedCB& cdm_attached_cb) final; 59 const CdmAttachedCB& cdm_attached_cb) final;
58 void Flush(const base::Closure& flush_cb) final; 60 void Flush(const base::Closure& flush_cb) final;
59 void StartPlayingFrom(base::TimeDelta time) final; 61 void StartPlayingFrom(base::TimeDelta time) final;
60 void SetPlaybackRate(double playback_rate) final; 62 void SetPlaybackRate(double playback_rate) final;
61 void SetVolume(float volume) final; 63 void SetVolume(float volume) final;
64 void SwitchAudioOutputDevice(const std::string& device_id,
65 const GURL& security_origin,
66 const base::Callback<void(int)>& callback) final;
62 base::TimeDelta GetMediaTime() final; 67 base::TimeDelta GetMediaTime() final;
63 bool HasAudio() final; 68 bool HasAudio() final;
64 bool HasVideo() final; 69 bool HasVideo() final;
65 70
66 // Helper functions for testing purposes. Must be called before Initialize(). 71 // Helper functions for testing purposes. Must be called before Initialize().
67 void DisableUnderflowForTesting(); 72 void DisableUnderflowForTesting();
68 void EnableClocklessVideoPlaybackForTesting(); 73 void EnableClocklessVideoPlaybackForTesting();
69 void set_time_source_for_testing(TimeSource* time_source) { 74 void set_time_source_for_testing(TimeSource* time_source) {
70 time_source_ = time_source; 75 time_source_ = time_source;
71 } 76 }
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 194
190 base::WeakPtr<RendererImpl> weak_this_; 195 base::WeakPtr<RendererImpl> weak_this_;
191 base::WeakPtrFactory<RendererImpl> weak_factory_; 196 base::WeakPtrFactory<RendererImpl> weak_factory_;
192 197
193 DISALLOW_COPY_AND_ASSIGN(RendererImpl); 198 DISALLOW_COPY_AND_ASSIGN(RendererImpl);
194 }; 199 };
195 200
196 } // namespace media 201 } // namespace media
197 202
198 #endif // MEDIA_RENDERERS_RENDERER_IMPL_H_ 203 #endif // MEDIA_RENDERERS_RENDERER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698