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

Side by Side Diff: content/renderer/media/webmediaplayer_ms.h

Issue 294043015: Move creation of MediaStream renders from MediaStreamImpl to MediaStreamRenderFactory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Win build. Created 6 years, 7 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 | Annotate | Revision Log
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 CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_H_
6 #define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_H_ 6 #define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 13 matching lines...) Expand all
24 namespace media { 24 namespace media {
25 class MediaLog; 25 class MediaLog;
26 } 26 }
27 27
28 namespace webkit { 28 namespace webkit {
29 class WebLayerImpl; 29 class WebLayerImpl;
30 } 30 }
31 31
32 namespace content { 32 namespace content {
33 class MediaStreamAudioRenderer; 33 class MediaStreamAudioRenderer;
34 class MediaStreamClient;
35 class VideoFrameProvider; 34 class VideoFrameProvider;
36 class WebMediaPlayerDelegate; 35 class WebMediaPlayerDelegate;
37 36
38 // WebMediaPlayerMS delegates calls from WebCore::MediaPlayerPrivate to 37 // WebMediaPlayerMS delegates calls from WebCore::MediaPlayerPrivate to
39 // Chrome's media player when "src" is from media stream. 38 // Chrome's media player when "src" is from media stream.
40 // 39 //
41 // WebMediaPlayerMS works with multiple objects, the most important ones are: 40 // WebMediaPlayerMS works with multiple objects, the most important ones are:
42 // 41 //
43 // VideoFrameProvider 42 // VideoFrameProvider
44 // provides video frames for rendering. 43 // provides video frames for rendering.
45 // 44 //
46 // TODO(wjia): add AudioPlayer. 45 // TODO(wjia): add AudioPlayer.
47 // AudioPlayer 46 // AudioPlayer
48 // plays audio streams. 47 // plays audio streams.
49 // 48 //
50 // blink::WebMediaPlayerClient 49 // blink::WebMediaPlayerClient
51 // WebKit client of this media player object. 50 // WebKit client of this media player object.
52 class WebMediaPlayerMS 51 class WebMediaPlayerMS
53 : public blink::WebMediaPlayer, 52 : public blink::WebMediaPlayer,
54 public cc::VideoFrameProvider, 53 public cc::VideoFrameProvider,
55 public base::SupportsWeakPtr<WebMediaPlayerMS> { 54 public base::SupportsWeakPtr<WebMediaPlayerMS> {
56 public: 55 public:
57 // Construct a WebMediaPlayerMS with reference to the client, and 56 // Construct a WebMediaPlayerMS with reference to the client, and
58 // a MediaStreamClient which provides VideoFrameProvider. 57 // a MediaStreamClient which provides VideoFrameProvider.
59 WebMediaPlayerMS(blink::WebFrame* frame, 58 WebMediaPlayerMS(blink::WebFrame* frame,
60 blink::WebMediaPlayerClient* client, 59 blink::WebMediaPlayerClient* client,
61 base::WeakPtr<WebMediaPlayerDelegate> delegate, 60 base::WeakPtr<WebMediaPlayerDelegate> delegate,
62 MediaStreamClient* media_stream_client,
63 media::MediaLog* media_log); 61 media::MediaLog* media_log);
64 virtual ~WebMediaPlayerMS(); 62 virtual ~WebMediaPlayerMS();
65 63
66 virtual void load(LoadType load_type, 64 virtual void load(LoadType load_type,
67 const blink::WebURL& url, 65 const blink::WebURL& url,
68 CORSMode cors_mode); 66 CORSMode cors_mode);
69 67
70 // Playback controls. 68 // Playback controls.
71 virtual void play(); 69 virtual void play();
72 virtual void pause(); 70 virtual void pause();
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 142
145 blink::WebTimeRanges buffered_; 143 blink::WebTimeRanges buffered_;
146 144
147 // Used for DCHECKs to ensure methods calls executed in the correct thread. 145 // Used for DCHECKs to ensure methods calls executed in the correct thread.
148 base::ThreadChecker thread_checker_; 146 base::ThreadChecker thread_checker_;
149 147
150 blink::WebMediaPlayerClient* client_; 148 blink::WebMediaPlayerClient* client_;
151 149
152 base::WeakPtr<WebMediaPlayerDelegate> delegate_; 150 base::WeakPtr<WebMediaPlayerDelegate> delegate_;
153 151
154 MediaStreamClient* media_stream_client_;
155
156 // Specify content:: to disambiguate from cc::. 152 // Specify content:: to disambiguate from cc::.
157 scoped_refptr<content::VideoFrameProvider> video_frame_provider_; 153 scoped_refptr<content::VideoFrameProvider> video_frame_provider_;
158 bool paused_; 154 bool paused_;
159 155
160 // |current_frame_| is updated only on main thread. The object it holds 156 // |current_frame_| is updated only on main thread. The object it holds
161 // can be freed on the compositor thread if it is the last to hold a 157 // can be freed on the compositor thread if it is the last to hold a
162 // reference but media::VideoFrame is a thread-safe ref-pointer. It is 158 // reference but media::VideoFrame is a thread-safe ref-pointer. It is
163 // however read on the compositing thread so locking is required around all 159 // however read on the compositing thread so locking is required around all
164 // modifications on the main thread, and all reads on the compositing thread. 160 // modifications on the main thread, and all reads on the compositing thread.
165 scoped_refptr<media::VideoFrame> current_frame_; 161 scoped_refptr<media::VideoFrame> current_frame_;
(...skipping 22 matching lines...) Expand all
188 scoped_refptr<MediaStreamAudioRenderer> audio_renderer_; 184 scoped_refptr<MediaStreamAudioRenderer> audio_renderer_;
189 185
190 scoped_refptr<media::MediaLog> media_log_; 186 scoped_refptr<media::MediaLog> media_log_;
191 187
192 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerMS); 188 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerMS);
193 }; 189 };
194 190
195 } // namespace content 191 } // namespace content
196 192
197 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_H_ 193 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698