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

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

Issue 1417533006: Unit test for WebMediaPlayerMS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Style Created 5 years, 1 month 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 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 <string> 8 #include <string>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "base/synchronization/lock.h" 12 #include "base/synchronization/lock.h"
13 #include "base/threading/thread_checker.h" 13 #include "base/threading/thread_checker.h"
14 #include "content/common/content_export.h"
14 #include "media/blink/webmediaplayer_util.h" 15 #include "media/blink/webmediaplayer_util.h"
15 #include "media/renderers/gpu_video_accelerator_factories.h" 16 #include "media/renderers/gpu_video_accelerator_factories.h"
16 #include "media/renderers/skcanvas_video_renderer.h" 17 #include "media/renderers/skcanvas_video_renderer.h"
17 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" 18 #include "third_party/WebKit/public/platform/WebMediaPlayer.h"
18 #include "url/origin.h" 19 #include "url/origin.h"
19 20
20 namespace blink { 21 namespace blink {
21 class WebFrame; 22 class WebFrame;
22 class WebGraphicsContext3D; 23 class WebGraphicsContext3D;
23 class WebMediaPlayerClient; 24 class WebMediaPlayerClient;
(...skipping 27 matching lines...) Expand all
51 // 52 //
52 // VideoFrameProvider 53 // VideoFrameProvider
53 // provides video frames for rendering. 54 // provides video frames for rendering.
54 // 55 //
55 // TODO(wjia): add AudioPlayer. 56 // TODO(wjia): add AudioPlayer.
56 // AudioPlayer 57 // AudioPlayer
57 // plays audio streams. 58 // plays audio streams.
58 // 59 //
59 // blink::WebMediaPlayerClient 60 // blink::WebMediaPlayerClient
60 // WebKit client of this media player object. 61 // WebKit client of this media player object.
61 class WebMediaPlayerMS 62 class CONTENT_EXPORT WebMediaPlayerMS
62 : public blink::WebMediaPlayer, 63 : public NON_EXPORTED_BASE(blink::WebMediaPlayer),
63 public base::SupportsWeakPtr<WebMediaPlayerMS> { 64 public NON_EXPORTED_BASE(base::SupportsWeakPtr<WebMediaPlayerMS>) {
64 public: 65 public:
65 // Construct a WebMediaPlayerMS with reference to the client, and 66 // Construct a WebMediaPlayerMS with reference to the client, and
66 // a MediaStreamClient which provides VideoFrameProvider. 67 // a MediaStreamClient which provides VideoFrameProvider.
67 WebMediaPlayerMS( 68 WebMediaPlayerMS(
68 blink::WebFrame* frame, 69 blink::WebFrame* frame,
69 blink::WebMediaPlayerClient* client, 70 blink::WebMediaPlayerClient* client,
70 base::WeakPtr<media::WebMediaPlayerDelegate> delegate, 71 base::WeakPtr<media::WebMediaPlayerDelegate> delegate,
71 media::MediaLog* media_log, 72 media::MediaLog* media_log,
72 scoped_ptr<MediaStreamRendererFactory> factory, 73 scoped_ptr<MediaStreamRendererFactory> factory,
73 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, 74 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 137
137 bool copyVideoTextureToPlatformTexture( 138 bool copyVideoTextureToPlatformTexture(
138 blink::WebGraphicsContext3D* web_graphics_context, 139 blink::WebGraphicsContext3D* web_graphics_context,
139 unsigned int texture, 140 unsigned int texture,
140 unsigned int internal_format, 141 unsigned int internal_format,
141 unsigned int type, 142 unsigned int type,
142 bool premultiply_alpha, 143 bool premultiply_alpha,
143 bool flip_y) override; 144 bool flip_y) override;
144 145
145 private: 146 private:
147 friend class WebMediaPlayerMSTest;
148
146 // The callback for VideoFrameProvider to signal a new frame is available. 149 // The callback for VideoFrameProvider to signal a new frame is available.
147 void OnFrameAvailable(const scoped_refptr<media::VideoFrame>& frame); 150 void OnFrameAvailable(const scoped_refptr<media::VideoFrame>& frame);
148 // Need repaint due to state change. 151 // Need repaint due to state change.
149 void RepaintInternal(); 152 void RepaintInternal();
150 153
151 // The callback for source to report error. 154 // The callback for source to report error.
152 void OnSourceError(); 155 void OnSourceError();
153 156
154 // Helpers that set the network/ready state and notifies the client if 157 // Helpers that set the network/ready state and notifies the client if
155 // they've changed. 158 // they've changed.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 203
201 const std::string initial_audio_output_device_id_; 204 const std::string initial_audio_output_device_id_;
202 const url::Origin initial_security_origin_; 205 const url::Origin initial_security_origin_;
203 206
204 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerMS); 207 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerMS);
205 }; 208 };
206 209
207 } // namespace content 210 } // namespace content
208 211
209 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_H_ 212 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698