OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Delegate calls from WebCore::MediaPlayerPrivate to Chrome's video player. | 5 // Delegate calls from WebCore::MediaPlayerPrivate to Chrome's video player. |
6 // It contains Pipeline which is the actual media player pipeline, it glues | 6 // It contains Pipeline which is the actual media player pipeline, it glues |
7 // the media player pipeline, data source, audio renderer and renderer. | 7 // the media player pipeline, data source, audio renderer and renderer. |
8 // Pipeline would creates multiple threads and access some public methods | 8 // Pipeline would creates multiple threads and access some public methods |
9 // of this class, so we need to be extra careful about concurrent access of | 9 // of this class, so we need to be extra careful about concurrent access of |
10 // methods and members. | 10 // methods and members. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 namespace webkit_media { | 62 namespace webkit_media { |
63 | 63 |
64 class BufferedDataSource; | 64 class BufferedDataSource; |
65 class MediaStreamClient; | 65 class MediaStreamClient; |
66 class WebAudioSourceProviderImpl; | 66 class WebAudioSourceProviderImpl; |
67 class WebMediaPlayerDelegate; | 67 class WebMediaPlayerDelegate; |
68 class WebMediaPlayerParams; | 68 class WebMediaPlayerParams; |
69 | 69 |
70 class WebMediaPlayerImpl | 70 class WebMediaPlayerImpl |
71 : public WebKit::WebMediaPlayer, | 71 : public WebKit::WebMediaPlayer, |
72 #ifdef REMOVE_WEBVIDEOFRAME | |
73 public cc::VideoFrameProvider, | 72 public cc::VideoFrameProvider, |
74 #endif | |
75 public MessageLoop::DestructionObserver, | 73 public MessageLoop::DestructionObserver, |
76 public base::SupportsWeakPtr<WebMediaPlayerImpl> { | 74 public base::SupportsWeakPtr<WebMediaPlayerImpl> { |
77 public: | 75 public: |
78 // Constructs a WebMediaPlayer implementation using Chromium's media stack. | 76 // Constructs a WebMediaPlayer implementation using Chromium's media stack. |
79 // | 77 // |
80 // |delegate| may be null. | 78 // |delegate| may be null. |
81 WebMediaPlayerImpl( | 79 WebMediaPlayerImpl( |
82 WebKit::WebFrame* frame, | 80 WebKit::WebFrame* frame, |
83 WebKit::WebMediaPlayerClient* client, | 81 WebKit::WebMediaPlayerClient* client, |
84 base::WeakPtr<WebMediaPlayerDelegate> delegate, | 82 base::WeakPtr<WebMediaPlayerDelegate> delegate, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 virtual bool didPassCORSAccessCheck() const; | 140 virtual bool didPassCORSAccessCheck() const; |
143 virtual WebKit::WebMediaPlayer::MovieLoadType movieLoadType() const; | 141 virtual WebKit::WebMediaPlayer::MovieLoadType movieLoadType() const; |
144 | 142 |
145 virtual float mediaTimeForTimeValue(float timeValue) const; | 143 virtual float mediaTimeForTimeValue(float timeValue) const; |
146 | 144 |
147 virtual unsigned decodedFrameCount() const; | 145 virtual unsigned decodedFrameCount() const; |
148 virtual unsigned droppedFrameCount() const; | 146 virtual unsigned droppedFrameCount() const; |
149 virtual unsigned audioDecodedByteCount() const; | 147 virtual unsigned audioDecodedByteCount() const; |
150 virtual unsigned videoDecodedByteCount() const; | 148 virtual unsigned videoDecodedByteCount() const; |
151 | 149 |
152 #ifndef REMOVE_WEBVIDEOFRAME | |
153 virtual WebKit::WebVideoFrame* getCurrentFrame(); | |
154 virtual void putCurrentFrame(WebKit::WebVideoFrame* web_video_frame); | |
155 #else | |
156 // cc::VideoFrameProvider implementation. | 150 // cc::VideoFrameProvider implementation. |
157 virtual void SetVideoFrameProviderClient( | 151 virtual void SetVideoFrameProviderClient( |
158 cc::VideoFrameProvider::Client* client) OVERRIDE; | 152 cc::VideoFrameProvider::Client* client) OVERRIDE; |
159 virtual scoped_refptr<media::VideoFrame> GetCurrentFrame() OVERRIDE; | 153 virtual scoped_refptr<media::VideoFrame> GetCurrentFrame() OVERRIDE; |
160 virtual void PutCurrentFrame(const scoped_refptr<media::VideoFrame>& frame) | 154 virtual void PutCurrentFrame(const scoped_refptr<media::VideoFrame>& frame) |
161 OVERRIDE; | 155 OVERRIDE; |
162 #endif | |
163 | 156 |
164 virtual bool copyVideoTextureToPlatformTexture( | 157 virtual bool copyVideoTextureToPlatformTexture( |
165 WebKit::WebGraphicsContext3D* web_graphics_context, | 158 WebKit::WebGraphicsContext3D* web_graphics_context, |
166 unsigned int texture, | 159 unsigned int texture, |
167 unsigned int level, | 160 unsigned int level, |
168 unsigned int internal_format, | 161 unsigned int internal_format, |
169 bool premultiply_alpha, | 162 bool premultiply_alpha, |
170 bool flip_y); | 163 bool flip_y); |
171 | 164 |
172 virtual WebKit::WebAudioSourceProvider* audioSourceProvider(); | 165 virtual WebKit::WebAudioSourceProvider* audioSourceProvider(); |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 // A pointer back to the compositor to inform it about state changes. This is | 358 // A pointer back to the compositor to inform it about state changes. This is |
366 // not NULL while the compositor is actively using this webmediaplayer. | 359 // not NULL while the compositor is actively using this webmediaplayer. |
367 cc::VideoFrameProvider::Client* video_frame_provider_client_; | 360 cc::VideoFrameProvider::Client* video_frame_provider_client_; |
368 | 361 |
369 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 362 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
370 }; | 363 }; |
371 | 364 |
372 } // namespace webkit_media | 365 } // namespace webkit_media |
373 | 366 |
374 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ | 367 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ |
OLD | NEW |