| 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 WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 5 #ifndef WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
| 6 #define WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 6 #define WEBKIT_RENDERER_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/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
| 15 #include "base/time.h" | 15 #include "base/time.h" |
| 16 #include "cc/layers/video_frame_provider.h" | 16 #include "cc/layers/video_frame_provider.h" |
| 17 #include "media/base/android/media_player_android.h" | 17 #include "media/base/android/media_player_android.h" |
| 18 #include "media/base/demuxer_stream.h" | 18 #include "media/base/demuxer_stream.h" |
| 19 #include "media/base/media_keys.h" | 19 #include "media/base/media_keys.h" |
| 20 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 20 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
| 21 #include "third_party/WebKit/public/platform/WebSize.h" | 21 #include "third_party/WebKit/public/platform/WebSize.h" |
| 22 #include "third_party/WebKit/public/platform/WebURL.h" | 22 #include "third_party/WebKit/public/platform/WebURL.h" |
| 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayer.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayer.h" |
| 24 #include "ui/gfx/rect_f.h" | 24 #include "ui/gfx/rect_f.h" |
| 25 #include "webkit/renderer/media/android/media_source_delegate.h" | 25 #include "webkit/renderer/media/android/media_source_delegate.h" |
| 26 #include "webkit/renderer/media/android/stream_texture_factory_android.h" | 26 #include "webkit/renderer/media/android/stream_texture_factory_android.h" |
| 27 #include "webkit/renderer/media/crypto/proxy_decryptor.h" | 27 #include "webkit/renderer/media/crypto/proxy_decryptor.h" |
| 28 #include "webkit/renderer/media/media_info_loader.h" |
| 28 | 29 |
| 29 namespace media { | 30 namespace media { |
| 30 class Demuxer; | 31 class Demuxer; |
| 31 class MediaLog; | 32 class MediaLog; |
| 32 } | 33 } |
| 33 | 34 |
| 34 namespace WebKit { | 35 namespace WebKit { |
| 35 class WebFrame; | 36 class WebFrame; |
| 36 } | 37 } |
| 37 | 38 |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 248 |
| 248 void InitializeMediaPlayer(const WebKit::WebURL& url); | 249 void InitializeMediaPlayer(const WebKit::WebURL& url); |
| 249 | 250 |
| 250 #if defined(GOOGLE_TV) | 251 #if defined(GOOGLE_TV) |
| 251 // Request external surface for out-of-band composition. | 252 // Request external surface for out-of-band composition. |
| 252 void RequestExternalSurface(); | 253 void RequestExternalSurface(); |
| 253 #endif | 254 #endif |
| 254 | 255 |
| 255 private: | 256 private: |
| 256 void ReallocateVideoFrame(); | 257 void ReallocateVideoFrame(); |
| 258 void DidLoadMediaInfo(MediaInfoLoader::Status status); |
| 257 | 259 |
| 258 // Actually do the work for generateKeyRequest/addKey so they can easily | 260 // Actually do the work for generateKeyRequest/addKey so they can easily |
| 259 // report results to UMA. | 261 // report results to UMA. |
| 260 MediaKeyException GenerateKeyRequestInternal( | 262 MediaKeyException GenerateKeyRequestInternal( |
| 261 const WebKit::WebString& key_system, | 263 const WebKit::WebString& key_system, |
| 262 const unsigned char* init_data, | 264 const unsigned char* init_data, |
| 263 unsigned init_data_length); | 265 unsigned init_data_length); |
| 264 MediaKeyException AddKeyInternal(const WebKit::WebString& key_system, | 266 MediaKeyException AddKeyInternal(const WebKit::WebString& key_system, |
| 265 const unsigned char* key, | 267 const unsigned char* key, |
| 266 unsigned key_length, | 268 unsigned key_length, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 | 330 |
| 329 // Whether media player needs to re-establish the surface texture peer. | 331 // Whether media player needs to re-establish the surface texture peer. |
| 330 bool needs_establish_peer_; | 332 bool needs_establish_peer_; |
| 331 | 333 |
| 332 // Whether |stream_texture_proxy_| is initialized. | 334 // Whether |stream_texture_proxy_| is initialized. |
| 333 bool stream_texture_proxy_initialized_; | 335 bool stream_texture_proxy_initialized_; |
| 334 | 336 |
| 335 // Whether the video size info is available. | 337 // Whether the video size info is available. |
| 336 bool has_size_info_; | 338 bool has_size_info_; |
| 337 | 339 |
| 340 // Whether the video metadata and info are available. |
| 341 bool has_media_metadata_; |
| 342 bool has_media_info_; |
| 343 |
| 338 // Object for allocating stream textures. | 344 // Object for allocating stream textures. |
| 339 scoped_ptr<StreamTextureFactory> stream_texture_factory_; | 345 scoped_ptr<StreamTextureFactory> stream_texture_factory_; |
| 340 | 346 |
| 341 // Object for calling back the compositor thread to repaint the video when a | 347 // Object for calling back the compositor thread to repaint the video when a |
| 342 // frame available. It should be initialized on the compositor thread. | 348 // frame available. It should be initialized on the compositor thread. |
| 343 ScopedStreamTextureProxy stream_texture_proxy_; | 349 ScopedStreamTextureProxy stream_texture_proxy_; |
| 344 | 350 |
| 345 // Whether media player needs external surface. | 351 // Whether media player needs external surface. |
| 346 bool needs_external_surface_; | 352 bool needs_external_surface_; |
| 347 | 353 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 373 WebMediaPlayerProxyAndroid* proxy_; | 379 WebMediaPlayerProxyAndroid* proxy_; |
| 374 | 380 |
| 375 // The current playing time. Because the media player is in the browser | 381 // The current playing time. Because the media player is in the browser |
| 376 // process, it will regularly update the |current_time_| by calling | 382 // process, it will regularly update the |current_time_| by calling |
| 377 // OnTimeUpdate(). | 383 // OnTimeUpdate(). |
| 378 double current_time_; | 384 double current_time_; |
| 379 | 385 |
| 380 media::MediaLog* media_log_; | 386 media::MediaLog* media_log_; |
| 381 MediaStreamClient* media_stream_client_; | 387 MediaStreamClient* media_stream_client_; |
| 382 | 388 |
| 389 scoped_ptr<MediaInfoLoader> info_loader_; |
| 390 |
| 383 // The currently selected key system. Empty string means that no key system | 391 // The currently selected key system. Empty string means that no key system |
| 384 // has been selected. | 392 // has been selected. |
| 385 WebKit::WebString current_key_system_; | 393 WebKit::WebString current_key_system_; |
| 386 | 394 |
| 387 // Temporary for EME v0.1. In the future the init data type should be passed | 395 // Temporary for EME v0.1. In the future the init data type should be passed |
| 388 // through GenerateKeyRequest() directly from WebKit. | 396 // through GenerateKeyRequest() directly from WebKit. |
| 389 std::string init_data_type_; | 397 std::string init_data_type_; |
| 390 | 398 |
| 391 // The decryptor that manages decryption keys and decrypts encrypted frames. | 399 // The decryptor that manages decryption keys and decrypts encrypted frames. |
| 392 scoped_ptr<ProxyDecryptor> decryptor_; | 400 scoped_ptr<ProxyDecryptor> decryptor_; |
| 393 | 401 |
| 394 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); | 402 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); |
| 395 }; | 403 }; |
| 396 | 404 |
| 397 } // namespace webkit_media | 405 } // namespace webkit_media |
| 398 | 406 |
| 399 #endif // WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 407 #endif // WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
| OLD | NEW |