OLD | NEW |
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_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
6 #define CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 6 #define CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "content/renderer/media/android/stream_texture_factory.h" | 22 #include "content/renderer/media/android/stream_texture_factory.h" |
23 #include "content/renderer/media/crypto/proxy_decryptor.h" | 23 #include "content/renderer/media/crypto/proxy_decryptor.h" |
24 #include "gpu/command_buffer/common/mailbox.h" | 24 #include "gpu/command_buffer/common/mailbox.h" |
25 #include "media/base/android/media_player_android.h" | 25 #include "media/base/android/media_player_android.h" |
26 #include "media/base/demuxer_stream.h" | 26 #include "media/base/demuxer_stream.h" |
27 #include "media/base/media_keys.h" | 27 #include "media/base/media_keys.h" |
28 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 28 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
29 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" | 29 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" |
30 #include "third_party/WebKit/public/platform/WebSize.h" | 30 #include "third_party/WebKit/public/platform/WebSize.h" |
31 #include "third_party/WebKit/public/platform/WebURL.h" | 31 #include "third_party/WebKit/public/platform/WebURL.h" |
| 32 #include "third_party/skia/include/core/SkBitmap.h" |
| 33 #include "third_party/skia/include/gpu/GrContext.h" |
| 34 #include "third_party/skia/include/gpu/SkGrPixelRef.h" |
32 #include "ui/gfx/rect_f.h" | 35 #include "ui/gfx/rect_f.h" |
33 | 36 |
34 namespace base { | 37 namespace base { |
35 class MessageLoopProxy; | 38 class MessageLoopProxy; |
36 } | 39 } |
37 | 40 |
38 namespace blink { | 41 namespace blink { |
39 class WebContentDecryptionModule; | 42 class WebContentDecryptionModule; |
40 class WebFrame; | 43 class WebFrame; |
41 class WebURL; | 44 class WebURL; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 virtual bool supportsSave() const; | 99 virtual bool supportsSave() const; |
97 virtual void setRate(double rate); | 100 virtual void setRate(double rate); |
98 virtual void setVolume(double volume); | 101 virtual void setVolume(double volume); |
99 virtual blink::WebTimeRanges buffered() const; | 102 virtual blink::WebTimeRanges buffered() const; |
100 virtual double maxTimeSeekable() const; | 103 virtual double maxTimeSeekable() const; |
101 | 104 |
102 // Poster image, as defined in the <video> element. | 105 // Poster image, as defined in the <video> element. |
103 virtual void setPoster(const blink::WebURL& poster) OVERRIDE; | 106 virtual void setPoster(const blink::WebURL& poster) OVERRIDE; |
104 | 107 |
105 // Methods for painting. | 108 // Methods for painting. |
| 109 // FIXME: This path "only works" on Android. It is a workaround for the |
| 110 // issue that Skia could not handle Android's GL_TEXTURE_EXTERNAL_OES texture |
| 111 // internally. It should be removed and replaced by the normal paint path. |
| 112 // https://code.google.com/p/skia/issues/detail?id=1189 |
106 virtual void paint(blink::WebCanvas* canvas, | 113 virtual void paint(blink::WebCanvas* canvas, |
107 const blink::WebRect& rect, | 114 const blink::WebRect& rect, |
108 unsigned char alpha); | 115 unsigned char alpha); |
109 | 116 |
110 virtual bool copyVideoTextureToPlatformTexture( | 117 virtual bool copyVideoTextureToPlatformTexture( |
111 blink::WebGraphicsContext3D* web_graphics_context, | 118 blink::WebGraphicsContext3D* web_graphics_context, |
112 unsigned int texture, | 119 unsigned int texture, |
113 unsigned int level, | 120 unsigned int level, |
114 unsigned int internal_format, | 121 unsigned int internal_format, |
115 unsigned int type, | 122 unsigned int type, |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 const std::string& session_id); | 277 const std::string& session_id); |
271 MediaKeyException CancelKeyRequestInternal(const std::string& key_system, | 278 MediaKeyException CancelKeyRequestInternal(const std::string& key_system, |
272 const std::string& session_id); | 279 const std::string& session_id); |
273 | 280 |
274 // Requests that this object notifies when a decryptor is ready through the | 281 // Requests that this object notifies when a decryptor is ready through the |
275 // |decryptor_ready_cb| provided. | 282 // |decryptor_ready_cb| provided. |
276 // If |decryptor_ready_cb| is null, the existing callback will be fired with | 283 // If |decryptor_ready_cb| is null, the existing callback will be fired with |
277 // NULL immediately and reset. | 284 // NULL immediately and reset. |
278 void SetDecryptorReadyCB(const media::DecryptorReadyCB& decryptor_ready_cb); | 285 void SetDecryptorReadyCB(const media::DecryptorReadyCB& decryptor_ready_cb); |
279 | 286 |
| 287 bool EnsureTextureBackedSkBitmap(GrContext* gr, SkBitmap& bitmap, |
| 288 const blink::WebSize& size, |
| 289 GrSurfaceOrigin origin, |
| 290 GrPixelConfig config); |
| 291 |
280 blink::WebFrame* const frame_; | 292 blink::WebFrame* const frame_; |
281 | 293 |
282 blink::WebMediaPlayerClient* const client_; | 294 blink::WebMediaPlayerClient* const client_; |
283 | 295 |
284 // |delegate_| is used to notify the browser process of the player status, so | 296 // |delegate_| is used to notify the browser process of the player status, so |
285 // that the browser process can control screen locks. | 297 // that the browser process can control screen locks. |
286 // TODO(qinmin): Currently android mediaplayer takes care of the screen | 298 // TODO(qinmin): Currently android mediaplayer takes care of the screen |
287 // lock. So this is only used for media source. Will apply this to regular | 299 // lock. So this is only used for media source. Will apply this to regular |
288 // media tag once http://crbug.com/247892 is fixed. | 300 // media tag once http://crbug.com/247892 is fixed. |
289 base::WeakPtr<WebMediaPlayerDelegate> delegate_; | 301 base::WeakPtr<WebMediaPlayerDelegate> delegate_; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 // Non-owned pointer to the CDM. Updated via calls to | 441 // Non-owned pointer to the CDM. Updated via calls to |
430 // setContentDecryptionModule(). | 442 // setContentDecryptionModule(). |
431 WebContentDecryptionModuleImpl* web_cdm_; | 443 WebContentDecryptionModuleImpl* web_cdm_; |
432 | 444 |
433 // This is only Used by Clear Key key system implementation, where a renderer | 445 // This is only Used by Clear Key key system implementation, where a renderer |
434 // side CDM will be used. This is similar to WebMediaPlayerImpl. For other key | 446 // side CDM will be used. This is similar to WebMediaPlayerImpl. For other key |
435 // systems, a browser side CDM will be used and we set CDM by calling | 447 // systems, a browser side CDM will be used and we set CDM by calling |
436 // player_manager_->SetCdm() directly. | 448 // player_manager_->SetCdm() directly. |
437 media::DecryptorReadyCB decryptor_ready_cb_; | 449 media::DecryptorReadyCB decryptor_ready_cb_; |
438 | 450 |
| 451 SkBitmap bitmap_; |
| 452 |
439 // NOTE: Weak pointers must be invalidated before all other member variables. | 453 // NOTE: Weak pointers must be invalidated before all other member variables. |
440 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; | 454 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; |
441 | 455 |
442 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); | 456 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); |
443 }; | 457 }; |
444 | 458 |
445 } // namespace content | 459 } // namespace content |
446 | 460 |
447 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 461 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
OLD | NEW |