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 18 matching lines...) Expand all Loading... | |
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 "ui/gfx/rect_f.h" | 32 #include "ui/gfx/rect_f.h" |
33 | 33 |
34 namespace base { | 34 namespace base { |
35 class MessageLoopProxy; | 35 class MessageLoopProxy; |
36 } | 36 } |
37 | 37 |
38 namespace blink { | 38 namespace blink { |
39 class WebContentDecryptionModule; | |
39 class WebFrame; | 40 class WebFrame; |
40 class WebURL; | 41 class WebURL; |
41 } | 42 } |
42 | 43 |
43 namespace gpu { | 44 namespace gpu { |
44 struct MailboxHolder; | 45 struct MailboxHolder; |
45 } | 46 } |
46 | 47 |
47 namespace media { | 48 namespace media { |
48 class MediaLog; | 49 class MediaLog; |
49 } | 50 } |
50 | 51 |
51 namespace webkit { | 52 namespace webkit { |
52 class WebLayerImpl; | 53 class WebLayerImpl; |
53 } | 54 } |
54 | 55 |
55 namespace content { | 56 namespace content { |
57 class RendererMediaPlayerManager; | |
58 class WebContentDecryptionModuleImpl; | |
56 class WebMediaPlayerDelegate; | 59 class WebMediaPlayerDelegate; |
57 class RendererMediaPlayerManager; | |
58 | 60 |
59 // This class implements blink::WebMediaPlayer by keeping the android | 61 // This class implements blink::WebMediaPlayer by keeping the android |
60 // media player in the browser process. It listens to all the status changes | 62 // media player in the browser process. It listens to all the status changes |
61 // sent from the browser process and sends playback controls to the media | 63 // sent from the browser process and sends playback controls to the media |
62 // player. | 64 // player. |
63 class WebMediaPlayerAndroid | 65 class WebMediaPlayerAndroid |
64 : public blink::WebMediaPlayer, | 66 : public blink::WebMediaPlayer, |
65 public cc::VideoFrameProvider, | 67 public cc::VideoFrameProvider, |
66 public RenderFrameObserver, | 68 public RenderFrameObserver, |
67 public base::SupportsWeakPtr<WebMediaPlayerAndroid> { | 69 public base::SupportsWeakPtr<WebMediaPlayerAndroid> { |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
209 virtual MediaKeyException addKey( | 211 virtual MediaKeyException addKey( |
210 const blink::WebString& key_system, | 212 const blink::WebString& key_system, |
211 const unsigned char* key, | 213 const unsigned char* key, |
212 unsigned key_length, | 214 unsigned key_length, |
213 const unsigned char* init_data, | 215 const unsigned char* init_data, |
214 unsigned init_data_length, | 216 unsigned init_data_length, |
215 const blink::WebString& session_id); | 217 const blink::WebString& session_id); |
216 virtual MediaKeyException cancelKeyRequest( | 218 virtual MediaKeyException cancelKeyRequest( |
217 const blink::WebString& key_system, | 219 const blink::WebString& key_system, |
218 const blink::WebString& session_id); | 220 const blink::WebString& session_id); |
221 virtual void setContentDecryptionModule( | |
222 blink::WebContentDecryptionModule* cdm); | |
219 | 223 |
220 void OnKeyAdded(const std::string& session_id); | 224 void OnKeyAdded(const std::string& session_id); |
221 void OnKeyError(const std::string& session_id, | 225 void OnKeyError(const std::string& session_id, |
222 media::MediaKeys::KeyError error_code, | 226 media::MediaKeys::KeyError error_code, |
223 uint32 system_code); | 227 uint32 system_code); |
224 void OnKeyMessage(const std::string& session_id, | 228 void OnKeyMessage(const std::string& session_id, |
225 const std::vector<uint8>& message, | 229 const std::vector<uint8>& message, |
226 const std::string& destination_url); | 230 const std::string& destination_url); |
227 | 231 |
228 void OnMediaSourceOpened(blink::WebMediaSource* web_media_source); | 232 void OnMediaSourceOpened(blink::WebMediaSource* web_media_source); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
431 scoped_ptr<MediaInfoLoader> info_loader_; | 435 scoped_ptr<MediaInfoLoader> info_loader_; |
432 | 436 |
433 // The currently selected key system. Empty string means that no key system | 437 // The currently selected key system. Empty string means that no key system |
434 // has been selected. | 438 // has been selected. |
435 std::string current_key_system_; | 439 std::string current_key_system_; |
436 | 440 |
437 // Temporary for EME v0.1. In the future the init data type should be passed | 441 // Temporary for EME v0.1. In the future the init data type should be passed |
438 // through GenerateKeyRequest() directly from WebKit. | 442 // through GenerateKeyRequest() directly from WebKit. |
439 std::string init_data_type_; | 443 std::string init_data_type_; |
440 | 444 |
441 media::DecryptorReadyCB decryptor_ready_cb_; | |
442 | |
443 // Manages decryption keys and decrypts encrypted frames. | 445 // Manages decryption keys and decrypts encrypted frames. |
444 scoped_ptr<ProxyDecryptor> proxy_decryptor_; | 446 scoped_ptr<ProxyDecryptor> proxy_decryptor_; |
445 | 447 |
448 // Non-owned pointer to the CDM. Updated via calls to | |
449 // setContentDecryptionModule(). | |
450 WebContentDecryptionModuleImpl* web_cdm_; | |
451 | |
452 // Used by clear key implementation. | |
ddorwin
2014/03/11 04:06:33
Can we get rid of this somehow?
ddorwin
2014/03/11 18:05:14
It sounds like no. It would be nice to have consis
xhwang
2014/03/12 01:07:52
Agreed. Sounds like a good future cleanup task :\
| |
453 media::DecryptorReadyCB decryptor_ready_cb_; | |
454 | |
446 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; | 455 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; |
447 | 456 |
448 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); | 457 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); |
449 }; | 458 }; |
450 | 459 |
451 } // namespace content | 460 } // namespace content |
452 | 461 |
453 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 462 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
OLD | NEW |