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

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. Same origin = true for media streams. 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 void UpdateReadyState(WebKit::WebMediaPlayer::ReadyState state); 246 void UpdateReadyState(WebKit::WebMediaPlayer::ReadyState state);
246 247
247 // Helper method to reestablish the surface texture peer for android 248 // Helper method to reestablish the surface texture peer for android
248 // media player. 249 // media player.
249 void EstablishSurfaceTexturePeer(); 250 void EstablishSurfaceTexturePeer();
250 251
251 // Requesting whether the surface texture peer needs to be reestablished. 252 // Requesting whether the surface texture peer needs to be reestablished.
252 void SetNeedsEstablishPeer(bool needs_establish_peer); 253 void SetNeedsEstablishPeer(bool needs_establish_peer);
253 254
254 void InitializeMediaPlayer( 255 void InitializeMediaPlayer(
255 const WebKit::WebURL& url,
256 media::MediaPlayerAndroid::SourceType source_type); 256 media::MediaPlayerAndroid::SourceType source_type);
257 257
258 #if defined(GOOGLE_TV) 258 #if defined(GOOGLE_TV)
259 // Request external surface for out-of-band composition. 259 // Request external surface for out-of-band composition.
260 void RequestExternalSurface(); 260 void RequestExternalSurface();
261 #endif 261 #endif
262 262
263 private: 263 private:
264 void ReallocateVideoFrame(); 264 void ReallocateVideoFrame();
265 void DidLoadMediaInfo(MediaInfoLoaderAndroid::Status status);
265 266
266 // Actually do the work for generateKeyRequest/addKey so they can easily 267 // Actually do the work for generateKeyRequest/addKey so they can easily
267 // report results to UMA. 268 // report results to UMA.
268 MediaKeyException GenerateKeyRequestInternal( 269 MediaKeyException GenerateKeyRequestInternal(
269 const WebKit::WebString& key_system, 270 const WebKit::WebString& key_system,
270 const unsigned char* init_data, 271 const unsigned char* init_data,
271 unsigned init_data_length); 272 unsigned init_data_length);
272 MediaKeyException AddKeyInternal(const WebKit::WebString& key_system, 273 MediaKeyException AddKeyInternal(const WebKit::WebString& key_system,
273 const unsigned char* key, 274 const unsigned char* key,
274 unsigned key_length, 275 unsigned key_length,
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 WebMediaPlayerProxyAndroid* proxy_; 375 WebMediaPlayerProxyAndroid* proxy_;
375 376
376 // The current playing time. Because the media player is in the browser 377 // The current playing time. Because the media player is in the browser
377 // process, it will regularly update the |current_time_| by calling 378 // process, it will regularly update the |current_time_| by calling
378 // OnTimeUpdate(). 379 // OnTimeUpdate().
379 double current_time_; 380 double current_time_;
380 381
381 media::MediaLog* media_log_; 382 media::MediaLog* media_log_;
382 MediaStreamClient* media_stream_client_; 383 MediaStreamClient* media_stream_client_;
383 384
385 scoped_ptr<MediaInfoLoaderAndroid> info_loader_;
386
384 // The currently selected key system. Empty string means that no key system 387 // The currently selected key system. Empty string means that no key system
385 // has been selected. 388 // has been selected.
386 WebKit::WebString current_key_system_; 389 WebKit::WebString current_key_system_;
387 390
388 // Temporary for EME v0.1. In the future the init data type should be passed 391 // Temporary for EME v0.1. In the future the init data type should be passed
389 // through GenerateKeyRequest() directly from WebKit. 392 // through GenerateKeyRequest() directly from WebKit.
390 std::string init_data_type_; 393 std::string init_data_type_;
391 394
392 // The decryptor that manages decryption keys and decrypts encrypted frames. 395 // The decryptor that manages decryption keys and decrypts encrypted frames.
393 scoped_ptr<ProxyDecryptor> decryptor_; 396 scoped_ptr<ProxyDecryptor> decryptor_;
394 397
395 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); 398 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid);
396 }; 399 };
397 400
398 } // namespace webkit_media 401 } // namespace webkit_media
399 402
400 #endif // WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ 403 #endif // WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698