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 #ifndef WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 5 #ifndef WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
6 #define WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 6 #define WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
14 #include "base/time.h" | 14 #include "base/time.h" |
15 #include "media/base/demuxer_stream.h" | 15 #include "media/base/demuxer_stream.h" |
16 #include "cc/layers/video_frame_provider.h" | 16 #include "cc/layers/video_frame_provider.h" |
17 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" | 17 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" |
18 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" | 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" |
19 #include "third_party/WebKit/Source/Platform/chromium/public/WebURL.h" | 19 #include "third_party/WebKit/Source/Platform/chromium/public/WebURL.h" |
20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayer.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayer.h" |
21 #include "ui/gfx/rect_f.h" | 21 #include "ui/gfx/rect_f.h" |
| 22 #include "webkit/media/android/media_source_delegate.h" |
22 #include "webkit/media/android/stream_texture_factory_android.h" | 23 #include "webkit/media/android/stream_texture_factory_android.h" |
23 | 24 |
24 namespace media { | 25 namespace media { |
25 class MediaLog; | 26 class MediaLog; |
26 } | 27 } |
27 | 28 |
28 namespace WebKit { | 29 namespace WebKit { |
29 class WebFrame; | 30 class WebFrame; |
30 } | 31 } |
31 | 32 |
32 namespace webkit { | 33 namespace webkit { |
33 class WebLayerImpl; | 34 class WebLayerImpl; |
34 } | 35 } |
35 | 36 |
36 namespace webkit_media { | 37 namespace webkit_media { |
37 | |
38 class MediaSourceDelegate; | |
39 class WebMediaPlayerManagerAndroid; | 38 class WebMediaPlayerManagerAndroid; |
40 class WebMediaPlayerProxyAndroid; | 39 class WebMediaPlayerProxyAndroid; |
41 | 40 |
42 // This class implements WebKit::WebMediaPlayer by keeping the android | 41 // This class implements WebKit::WebMediaPlayer by keeping the android |
43 // media player in the browser process. It listens to all the status changes | 42 // media player in the browser process. It listens to all the status changes |
44 // sent from the browser process and sends playback controls to the media | 43 // sent from the browser process and sends playback controls to the media |
45 // player. | 44 // player. |
46 class WebMediaPlayerAndroid | 45 class WebMediaPlayerAndroid |
47 : public WebKit::WebMediaPlayer, | 46 : public WebKit::WebMediaPlayer, |
48 public cc::VideoFrameProvider, | 47 public cc::VideoFrameProvider, |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 cc::VideoFrameProvider::Client* video_frame_provider_client_; | 296 cc::VideoFrameProvider::Client* video_frame_provider_client_; |
298 | 297 |
299 scoped_ptr<webkit::WebLayerImpl> video_weblayer_; | 298 scoped_ptr<webkit::WebLayerImpl> video_weblayer_; |
300 | 299 |
301 #if defined(GOOGLE_TV) | 300 #if defined(GOOGLE_TV) |
302 // A rectangle represents the geometry of video frame, when computed last | 301 // A rectangle represents the geometry of video frame, when computed last |
303 // time. | 302 // time. |
304 gfx::RectF last_computed_rect_; | 303 gfx::RectF last_computed_rect_; |
305 #endif | 304 #endif |
306 | 305 |
307 scoped_ptr<MediaSourceDelegate> media_source_delegate_; | 306 scoped_ptr<MediaSourceDelegate, |
| 307 MediaSourceDelegate::Destroyer> media_source_delegate_; |
308 | 308 |
309 // Proxy object that delegates method calls on Render Thread. | 309 // Proxy object that delegates method calls on Render Thread. |
310 // This object is created on the Render Thread and is only called in the | 310 // This object is created on the Render Thread and is only called in the |
311 // destructor. | 311 // destructor. |
312 WebMediaPlayerProxyAndroid* proxy_; | 312 WebMediaPlayerProxyAndroid* proxy_; |
313 | 313 |
314 // The current playing time. Because the media player is in the browser | 314 // The current playing time. Because the media player is in the browser |
315 // process, it will regularly update the |current_time_| by calling | 315 // process, it will regularly update the |current_time_| by calling |
316 // OnTimeUpdate(). | 316 // OnTimeUpdate(). |
317 double current_time_; | 317 double current_time_; |
318 | 318 |
319 media::MediaLog* media_log_; | 319 media::MediaLog* media_log_; |
320 | 320 |
321 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); | 321 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); |
322 }; | 322 }; |
323 | 323 |
324 } // namespace webkit_media | 324 } // namespace webkit_media |
325 | 325 |
326 #endif // WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 326 #endif // WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
OLD | NEW |