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 22 matching lines...) Expand all Loading... |
33 #include "third_party/skia/include/gpu/GrContext.h" | 33 #include "third_party/skia/include/gpu/GrContext.h" |
34 #include "third_party/skia/include/gpu/SkGrPixelRef.h" | 34 #include "third_party/skia/include/gpu/SkGrPixelRef.h" |
35 #include "ui/gfx/rect_f.h" | 35 #include "ui/gfx/rect_f.h" |
36 | 36 |
37 namespace base { | 37 namespace base { |
38 class MessageLoopProxy; | 38 class MessageLoopProxy; |
39 } | 39 } |
40 | 40 |
41 namespace blink { | 41 namespace blink { |
42 class WebContentDecryptionModule; | 42 class WebContentDecryptionModule; |
| 43 class WebContentDecryptionModuleResult; |
43 class WebFrame; | 44 class WebFrame; |
44 class WebURL; | 45 class WebURL; |
45 } | 46 } |
46 | 47 |
47 namespace gpu { | 48 namespace gpu { |
48 struct MailboxHolder; | 49 struct MailboxHolder; |
49 } | 50 } |
50 | 51 |
51 namespace media { | 52 namespace media { |
52 class MediaLog; | 53 class MediaLog; |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 virtual MediaKeyException addKey( | 213 virtual MediaKeyException addKey( |
213 const blink::WebString& key_system, | 214 const blink::WebString& key_system, |
214 const unsigned char* key, | 215 const unsigned char* key, |
215 unsigned key_length, | 216 unsigned key_length, |
216 const unsigned char* init_data, | 217 const unsigned char* init_data, |
217 unsigned init_data_length, | 218 unsigned init_data_length, |
218 const blink::WebString& session_id); | 219 const blink::WebString& session_id); |
219 virtual MediaKeyException cancelKeyRequest( | 220 virtual MediaKeyException cancelKeyRequest( |
220 const blink::WebString& key_system, | 221 const blink::WebString& key_system, |
221 const blink::WebString& session_id); | 222 const blink::WebString& session_id); |
| 223 // TODO(jrummell): Remove this method once Blink updated to use the other |
| 224 // two methods. |
222 virtual void setContentDecryptionModule( | 225 virtual void setContentDecryptionModule( |
223 blink::WebContentDecryptionModule* cdm); | 226 blink::WebContentDecryptionModule* cdm); |
| 227 virtual void setContentDecryptionModule( |
| 228 blink::WebContentDecryptionModule* cdm, |
| 229 blink::WebContentDecryptionModuleResult result); |
| 230 virtual void setContentDecryptionModuleSync( |
| 231 blink::WebContentDecryptionModule* cdm); |
224 | 232 |
225 void OnKeyAdded(const std::string& session_id); | 233 void OnKeyAdded(const std::string& session_id); |
226 void OnKeyError(const std::string& session_id, | 234 void OnKeyError(const std::string& session_id, |
227 media::MediaKeys::KeyError error_code, | 235 media::MediaKeys::KeyError error_code, |
228 uint32 system_code); | 236 uint32 system_code); |
229 void OnKeyMessage(const std::string& session_id, | 237 void OnKeyMessage(const std::string& session_id, |
230 const std::vector<uint8>& message, | 238 const std::vector<uint8>& message, |
231 const GURL& destination_url); | 239 const GURL& destination_url); |
232 | 240 |
233 void OnMediaSourceOpened(blink::WebMediaSource* web_media_source); | 241 void OnMediaSourceOpened(blink::WebMediaSource* web_media_source); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 const std::string& session_id); | 285 const std::string& session_id); |
278 MediaKeyException CancelKeyRequestInternal(const std::string& key_system, | 286 MediaKeyException CancelKeyRequestInternal(const std::string& key_system, |
279 const std::string& session_id); | 287 const std::string& session_id); |
280 | 288 |
281 // Requests that this object notifies when a decryptor is ready through the | 289 // Requests that this object notifies when a decryptor is ready through the |
282 // |decryptor_ready_cb| provided. | 290 // |decryptor_ready_cb| provided. |
283 // If |decryptor_ready_cb| is null, the existing callback will be fired with | 291 // If |decryptor_ready_cb| is null, the existing callback will be fired with |
284 // NULL immediately and reset. | 292 // NULL immediately and reset. |
285 void SetDecryptorReadyCB(const media::DecryptorReadyCB& decryptor_ready_cb); | 293 void SetDecryptorReadyCB(const media::DecryptorReadyCB& decryptor_ready_cb); |
286 | 294 |
| 295 // Called when the ContentDecryptionModule has been attached to the |
| 296 // pipeline/decoders. |
| 297 void ContentDecryptionModuleAttached( |
| 298 blink::WebContentDecryptionModuleResult result, |
| 299 bool success); |
| 300 |
287 bool EnsureTextureBackedSkBitmap(GrContext* gr, SkBitmap& bitmap, | 301 bool EnsureTextureBackedSkBitmap(GrContext* gr, SkBitmap& bitmap, |
288 const blink::WebSize& size, | 302 const blink::WebSize& size, |
289 GrSurfaceOrigin origin, | 303 GrSurfaceOrigin origin, |
290 GrPixelConfig config); | 304 GrPixelConfig config); |
291 | 305 |
292 blink::WebFrame* const frame_; | 306 blink::WebFrame* const frame_; |
293 | 307 |
294 blink::WebMediaPlayerClient* const client_; | 308 blink::WebMediaPlayerClient* const client_; |
295 | 309 |
296 // |delegate_| is used to notify the browser process of the player status, so | 310 // |delegate_| is used to notify the browser process of the player status, so |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 | 466 |
453 // NOTE: Weak pointers must be invalidated before all other member variables. | 467 // NOTE: Weak pointers must be invalidated before all other member variables. |
454 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; | 468 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; |
455 | 469 |
456 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); | 470 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); |
457 }; | 471 }; |
458 | 472 |
459 } // namespace content | 473 } // namespace content |
460 | 474 |
461 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 475 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
OLD | NEW |