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 : public blink::WebMediaPlayer, | 65 class WebMediaPlayerAndroid : public blink::WebMediaPlayer, |
64 public cc::VideoFrameProvider, | 66 public cc::VideoFrameProvider, |
65 public RenderFrameObserver { | 67 public RenderFrameObserver { |
66 public: | 68 public: |
67 // Construct a WebMediaPlayerAndroid object. This class communicates with the | 69 // Construct a WebMediaPlayerAndroid object. This class communicates with the |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
207 virtual MediaKeyException addKey( | 209 virtual MediaKeyException addKey( |
208 const blink::WebString& key_system, | 210 const blink::WebString& key_system, |
209 const unsigned char* key, | 211 const unsigned char* key, |
210 unsigned key_length, | 212 unsigned key_length, |
211 const unsigned char* init_data, | 213 const unsigned char* init_data, |
212 unsigned init_data_length, | 214 unsigned init_data_length, |
213 const blink::WebString& session_id); | 215 const blink::WebString& session_id); |
214 virtual MediaKeyException cancelKeyRequest( | 216 virtual MediaKeyException cancelKeyRequest( |
215 const blink::WebString& key_system, | 217 const blink::WebString& key_system, |
216 const blink::WebString& session_id); | 218 const blink::WebString& session_id); |
219 virtual void setContentDecryptionModule( | |
220 blink::WebContentDecryptionModule* cdm); | |
217 | 221 |
218 void OnKeyAdded(const std::string& session_id); | 222 void OnKeyAdded(const std::string& session_id); |
219 void OnKeyError(const std::string& session_id, | 223 void OnKeyError(const std::string& session_id, |
220 media::MediaKeys::KeyError error_code, | 224 media::MediaKeys::KeyError error_code, |
221 uint32 system_code); | 225 uint32 system_code); |
222 void OnKeyMessage(const std::string& session_id, | 226 void OnKeyMessage(const std::string& session_id, |
223 const std::vector<uint8>& message, | 227 const std::vector<uint8>& message, |
224 const std::string& destination_url); | 228 const std::string& destination_url); |
225 | 229 |
226 void OnMediaSourceOpened(blink::WebMediaSource* web_media_source); | 230 void OnMediaSourceOpened(blink::WebMediaSource* web_media_source); |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
420 scoped_ptr<MediaInfoLoader> info_loader_; | 424 scoped_ptr<MediaInfoLoader> info_loader_; |
421 | 425 |
422 // The currently selected key system. Empty string means that no key system | 426 // The currently selected key system. Empty string means that no key system |
423 // has been selected. | 427 // has been selected. |
424 std::string current_key_system_; | 428 std::string current_key_system_; |
425 | 429 |
426 // Temporary for EME v0.1. In the future the init data type should be passed | 430 // Temporary for EME v0.1. In the future the init data type should be passed |
427 // through GenerateKeyRequest() directly from WebKit. | 431 // through GenerateKeyRequest() directly from WebKit. |
428 std::string init_data_type_; | 432 std::string init_data_type_; |
429 | 433 |
430 media::DecryptorReadyCB decryptor_ready_cb_; | |
431 | |
432 // Manages decryption keys and decrypts encrypted frames. | 434 // Manages decryption keys and decrypts encrypted frames. |
433 scoped_ptr<ProxyDecryptor> proxy_decryptor_; | 435 scoped_ptr<ProxyDecryptor> proxy_decryptor_; |
434 | 436 |
437 // Non-owned pointer to the CDM. Updated via calls to | |
438 // setContentDecryptionModule(). | |
439 WebContentDecryptionModuleImpl* web_cdm_; | |
440 | |
441 // This is only Used by Clear Key key system implementation, where a render | |
ddorwin
2014/03/26 19:25:59
nit: renderer-side?
^^^
xhwang
2014/03/27 19:07:42
Done.
| |
442 // side CDM will be used. This is similar to WebMediaPlayerImpl. For other key | |
443 // systems, a browser side CDM will be used and we set CDM my calling | |
ddorwin
2014/03/26 19:25:59
s/my/by/
xhwang
2014/03/27 19:07:42
Done.
| |
444 // manager_->SetCdm() directly. | |
445 media::DecryptorReadyCB decryptor_ready_cb_; | |
446 | |
435 // NOTE: Weak pointers must be invalidated before all other member variables. | 447 // NOTE: Weak pointers must be invalidated before all other member variables. |
436 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; | 448 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; |
437 | 449 |
438 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); | 450 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); |
439 }; | 451 }; |
440 | 452 |
441 } // namespace content | 453 } // namespace content |
442 | 454 |
443 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 455 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
OLD | NEW |