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

Side by Side Diff: media/base/renderer.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_BASE_RENDERER_H_ 5 #ifndef MEDIA_BASE_RENDERER_H_
6 #define MEDIA_BASE_RENDERER_H_ 6 #define MEDIA_BASE_RENDERER_H_
7 7
8 #include <string>
9
8 #include "base/callback.h" 10 #include "base/callback.h"
9 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
10 #include "base/time/time.h" 12 #include "base/time/time.h"
11 #include "media/base/buffering_state.h" 13 #include "media/base/buffering_state.h"
12 #include "media/base/cdm_context.h" 14 #include "media/base/cdm_context.h"
13 #include "media/base/media_export.h" 15 #include "media/base/media_export.h"
14 #include "media/base/pipeline_status.h" 16 #include "media/base/pipeline_status.h"
17 #include "url/gurl.h"
15 18
16 namespace media { 19 namespace media {
17 20
18 class DemuxerStreamProvider; 21 class DemuxerStreamProvider;
19 class VideoFrame; 22 class VideoFrame;
20 23
21 class MEDIA_EXPORT Renderer { 24 class MEDIA_EXPORT Renderer {
22 public: 25 public:
23 typedef base::Callback<void(const scoped_refptr<VideoFrame>&)> PaintCB; 26 typedef base::Callback<void(const scoped_refptr<VideoFrame>&)> PaintCB;
24 typedef base::Callback<base::TimeDelta()> TimeDeltaCB; 27 typedef base::Callback<base::TimeDelta()> TimeDeltaCB;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 66
64 // Starts rendering from |time|. 67 // Starts rendering from |time|.
65 virtual void StartPlayingFrom(base::TimeDelta time) = 0; 68 virtual void StartPlayingFrom(base::TimeDelta time) = 0;
66 69
67 // Updates the current playback rate. The default playback rate should be 1. 70 // Updates the current playback rate. The default playback rate should be 1.
68 virtual void SetPlaybackRate(double playback_rate) = 0; 71 virtual void SetPlaybackRate(double playback_rate) = 0;
69 72
70 // Sets the output volume. The default volume should be 1. 73 // Sets the output volume. The default volume should be 1.
71 virtual void SetVolume(float volume) = 0; 74 virtual void SetVolume(float volume) = 0;
72 75
76 // Switches the audio output device
77 virtual void SwitchAudioOutputDevice(
78 const std::string& device_id,
79 const GURL& security_origin,
80 const base::Callback<void(int)>& callback) = 0;
81
73 // Returns the current media time. 82 // Returns the current media time.
74 virtual base::TimeDelta GetMediaTime() = 0; 83 virtual base::TimeDelta GetMediaTime() = 0;
75 84
76 // Returns whether |this| renders audio. 85 // Returns whether |this| renders audio.
77 virtual bool HasAudio() = 0; 86 virtual bool HasAudio() = 0;
78 87
79 // Returns whether |this| renders video. 88 // Returns whether |this| renders video.
80 virtual bool HasVideo() = 0; 89 virtual bool HasVideo() = 0;
81 90
82 private: 91 private:
83 DISALLOW_COPY_AND_ASSIGN(Renderer); 92 DISALLOW_COPY_AND_ASSIGN(Renderer);
84 }; 93 };
85 94
86 } // namespace media 95 } // namespace media
87 96
88 #endif // MEDIA_BASE_RENDERER_H_ 97 #endif // MEDIA_BASE_RENDERER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698