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

Side by Side Diff: webkit/renderer/media/android/webmediaplayer_android.h

Issue 16327002: android: Implement single origin and CORS check for video (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased again. Created 7 years, 6 months 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 | Annotate | Revision Log
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 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/message_loop.h" 13 #include "base/message_loop.h"
14 #include "base/time.h" 14 #include "base/time.h"
15 #include "cc/layers/video_frame_provider.h" 15 #include "cc/layers/video_frame_provider.h"
16 #include "media/base/android/media_player_android.h" 16 #include "media/base/android/media_player_android.h"
17 #include "media/base/demuxer_stream.h" 17 #include "media/base/demuxer_stream.h"
18 #include "media/base/media_keys.h" 18 #include "media/base/media_keys.h"
19 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" 19 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
20 #include "third_party/WebKit/public/platform/WebSize.h" 20 #include "third_party/WebKit/public/platform/WebSize.h"
21 #include "third_party/WebKit/public/platform/WebURL.h" 21 #include "third_party/WebKit/public/platform/WebURL.h"
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayer.h" 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayer.h"
23 #include "ui/gfx/rect_f.h" 23 #include "ui/gfx/rect_f.h"
24 #include "webkit/renderer/media/android/media_info_loader_android.h"
24 #include "webkit/renderer/media/android/media_source_delegate.h" 25 #include "webkit/renderer/media/android/media_source_delegate.h"
25 #include "webkit/renderer/media/android/stream_texture_factory_android.h" 26 #include "webkit/renderer/media/android/stream_texture_factory_android.h"
26 #include "webkit/renderer/media/crypto/proxy_decryptor.h" 27 #include "webkit/renderer/media/crypto/proxy_decryptor.h"
27 28
28 namespace media { 29 namespace media {
29 class Demuxer; 30 class Demuxer;
30 class MediaLog; 31 class MediaLog;
31 } 32 }
32 33
33 namespace WebKit { 34 namespace WebKit {
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 void UpdateReadyState(WebKit::WebMediaPlayer::ReadyState state); 237 void UpdateReadyState(WebKit::WebMediaPlayer::ReadyState state);
237 238
238 // Helper method to reestablish the surface texture peer for android 239 // Helper method to reestablish the surface texture peer for android
239 // media player. 240 // media player.
240 void EstablishSurfaceTexturePeer(); 241 void EstablishSurfaceTexturePeer();
241 242
242 // Requesting whether the surface texture peer needs to be reestablished. 243 // Requesting whether the surface texture peer needs to be reestablished.
243 void SetNeedsEstablishPeer(bool needs_establish_peer); 244 void SetNeedsEstablishPeer(bool needs_establish_peer);
244 245
245 void InitializeMediaPlayer( 246 void InitializeMediaPlayer(
246 const WebKit::WebURL& url,
247 media::MediaPlayerAndroid::SourceType source_type); 247 media::MediaPlayerAndroid::SourceType source_type);
248 248
249 #if defined(GOOGLE_TV) 249 #if defined(GOOGLE_TV)
250 // Request external surface for out-of-band composition. 250 // Request external surface for out-of-band composition.
251 void RequestExternalSurface(); 251 void RequestExternalSurface();
252 #endif 252 #endif
253 253
254 private: 254 private:
255 void ReallocateVideoFrame(); 255 void ReallocateVideoFrame();
256 void DidLoadMediaInfo(MediaInfoLoaderAndroid::Status status);
256 257
257 // Actually do the work for generateKeyRequest/addKey so they can easily 258 // Actually do the work for generateKeyRequest/addKey so they can easily
258 // report results to UMA. 259 // report results to UMA.
259 MediaKeyException GenerateKeyRequestInternal( 260 MediaKeyException GenerateKeyRequestInternal(
260 const WebKit::WebString& key_system, 261 const WebKit::WebString& key_system,
261 const unsigned char* init_data, 262 const unsigned char* init_data,
262 unsigned init_data_length); 263 unsigned init_data_length);
263 MediaKeyException AddKeyInternal(const WebKit::WebString& key_system, 264 MediaKeyException AddKeyInternal(const WebKit::WebString& key_system,
264 const unsigned char* key, 265 const unsigned char* key,
265 unsigned key_length, 266 unsigned key_length,
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 WebMediaPlayerProxyAndroid* proxy_; 366 WebMediaPlayerProxyAndroid* proxy_;
366 367
367 // The current playing time. Because the media player is in the browser 368 // The current playing time. Because the media player is in the browser
368 // process, it will regularly update the |current_time_| by calling 369 // process, it will regularly update the |current_time_| by calling
369 // OnTimeUpdate(). 370 // OnTimeUpdate().
370 double current_time_; 371 double current_time_;
371 372
372 media::MediaLog* media_log_; 373 media::MediaLog* media_log_;
373 MediaStreamClient* media_stream_client_; 374 MediaStreamClient* media_stream_client_;
374 375
376 scoped_ptr<MediaInfoLoaderAndroid> info_loader_;
377
375 // The currently selected key system. Empty string means that no key system 378 // The currently selected key system. Empty string means that no key system
376 // has been selected. 379 // has been selected.
377 WebKit::WebString current_key_system_; 380 WebKit::WebString current_key_system_;
378 381
379 // Temporary for EME v0.1. In the future the init data type should be passed 382 // Temporary for EME v0.1. In the future the init data type should be passed
380 // through GenerateKeyRequest() directly from WebKit. 383 // through GenerateKeyRequest() directly from WebKit.
381 std::string init_data_type_; 384 std::string init_data_type_;
382 385
383 // The decryptor that manages decryption keys and decrypts encrypted frames. 386 // The decryptor that manages decryption keys and decrypts encrypted frames.
384 scoped_ptr<ProxyDecryptor> decryptor_; 387 scoped_ptr<ProxyDecryptor> decryptor_;
385 388
386 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); 389 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid);
387 }; 390 };
388 391
389 } // namespace webkit_media 392 } // namespace webkit_media
390 393
391 #endif // WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ 394 #endif // WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698