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

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

Issue 1423163004: media: Replace DecryptorReadyCB with CdmReadyCB. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix android Created 5 years, 1 month 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
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 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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 const unsigned char* init_data, 314 const unsigned char* init_data,
315 unsigned init_data_length, 315 unsigned init_data_length,
316 const std::string& session_id); 316 const std::string& session_id);
317 MediaKeyException CancelKeyRequestInternal(const std::string& key_system, 317 MediaKeyException CancelKeyRequestInternal(const std::string& key_system,
318 const std::string& session_id); 318 const std::string& session_id);
319 319
320 // Called when |cdm_context| is ready. 320 // Called when |cdm_context| is ready.
321 void OnCdmContextReady(media::CdmContext* cdm_context); 321 void OnCdmContextReady(media::CdmContext* cdm_context);
322 322
323 // Sets the CDM. Should only be called when |is_player_initialized_| is true 323 // Sets the CDM. Should only be called when |is_player_initialized_| is true
324 // and a new non-null |cdm_context_| is available. Fires |cdm_attached_cb_| 324 // and a new non-null |cdm_context_| is available. Fires |cdm_attached_cb_| on
325 // with the result after the CDM is attached. 325 // the main thread with the result after the CDM is attached.
326 void SetCdmInternal(const media::CdmAttachedCB& cdm_attached_cb); 326 void SetCdmInternal(const media::CdmAttachedCB& cdm_attached_cb);
327 327
328 // Requests that this object notifies when a decryptor is ready through the 328 // Called when the CDM is attached.
329 // |decryptor_ready_cb| provided. 329 void OnCdmAttached(const media::CdmAttachedCB& cdm_attached_cb, bool success);
330 // If |decryptor_ready_cb| is null, the existing callback will be fired with 330
331 // Requests that this object notifies when a CDM is ready through the
332 // |cdm_ready_cb| provided.
333 // If |cdm_ready_cb| is null, the existing callback will be fired with
331 // NULL immediately and reset. 334 // NULL immediately and reset.
332 void SetDecryptorReadyCB(const media::DecryptorReadyCB& decryptor_ready_cb); 335 void SetCdmReadyCB(const media::CdmReadyCB& cdm_ready_cb);
333 336
334 // Called when the ContentDecryptionModule has been attached to the 337 // Called when the ContentDecryptionModule has been attached to the
335 // pipeline/decoders. 338 // pipeline/decoders.
336 void ContentDecryptionModuleAttached( 339 void ContentDecryptionModuleAttached(
337 blink::WebContentDecryptionModuleResult result, 340 blink::WebContentDecryptionModuleResult result,
338 bool success); 341 bool success);
339 342
340 bool IsHLSStream() const; 343 bool IsHLSStream() const;
341 // Report whether the loaded url, after following redirects, points to a HLS 344 // Report whether the loaded url, after following redirects, points to a HLS
342 // playlist, and record the origin of the player. 345 // playlist, and record the origin of the player.
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 scoped_ptr<media::ProxyDecryptor> proxy_decryptor_; 506 scoped_ptr<media::ProxyDecryptor> proxy_decryptor_;
504 507
505 // Non-owned pointer to the CdmContext. Updated in the constructor, 508 // Non-owned pointer to the CdmContext. Updated in the constructor,
506 // generateKeyRequest() or setContentDecryptionModule(). 509 // generateKeyRequest() or setContentDecryptionModule().
507 media::CdmContext* cdm_context_; 510 media::CdmContext* cdm_context_;
508 511
509 // This is only Used by Clear Key key system implementation, where a renderer 512 // This is only Used by Clear Key key system implementation, where a renderer
510 // side CDM will be used. This is similar to WebMediaPlayerImpl. For other key 513 // side CDM will be used. This is similar to WebMediaPlayerImpl. For other key
511 // systems, a browser side CDM will be used and we set CDM by calling 514 // systems, a browser side CDM will be used and we set CDM by calling
512 // player_manager_->SetCdm() directly. 515 // player_manager_->SetCdm() directly.
513 media::DecryptorReadyCB decryptor_ready_cb_; 516 media::CdmReadyCB cdm_ready_cb_;
514 517
515 SkBitmap bitmap_; 518 SkBitmap bitmap_;
516 519
517 // Whether stored credentials are allowed to be passed to the server. 520 // Whether stored credentials are allowed to be passed to the server.
518 bool allow_stored_credentials_; 521 bool allow_stored_credentials_;
519 522
520 // Whether the resource is local. 523 // Whether the resource is local.
521 bool is_local_resource_; 524 bool is_local_resource_;
522 525
523 // base::TickClock used by |interpolator_|. 526 // base::TickClock used by |interpolator_|.
524 base::DefaultTickClock default_tick_clock_; 527 base::DefaultTickClock default_tick_clock_;
525 528
526 // Tracks the most recent media time update and provides interpolated values 529 // Tracks the most recent media time update and provides interpolated values
527 // as playback progresses. 530 // as playback progresses.
528 media::TimeDeltaInterpolator interpolator_; 531 media::TimeDeltaInterpolator interpolator_;
529 532
530 scoped_ptr<MediaSourceDelegate> media_source_delegate_; 533 scoped_ptr<MediaSourceDelegate> media_source_delegate_;
531 534
532 // NOTE: Weak pointers must be invalidated before all other member variables. 535 // NOTE: Weak pointers must be invalidated before all other member variables.
533 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; 536 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_;
534 537
535 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); 538 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid);
536 }; 539 };
537 540
538 } // namespace content 541 } // namespace content
539 542
540 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ 543 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698