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

Unified Diff: media/base/android/media_codec_player.h

Issue 1407933010: media: Make MediaKeys ref-counted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/android/browser_cdm_factory_android.cc ('k') | media/base/android/media_codec_player.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/media_codec_player.h
diff --git a/media/base/android/media_codec_player.h b/media/base/android/media_codec_player.h
index 376c2e4f94472a0c8f749227acac84c972b6d7ca..fff4129e210d674c45585284eba8fa5e007cfc32 100644
--- a/media/base/android/media_codec_player.h
+++ b/media/base/android/media_codec_player.h
@@ -157,7 +157,6 @@
namespace media {
-class BrowserCdm;
class MediaCodecAudioDecoder;
class MediaCodecVideoDecoder;
@@ -214,7 +213,7 @@ class MEDIA_EXPORT MediaCodecPlayer : public MediaPlayerAndroid,
bool CanSeekForward() override;
bool CanSeekBackward() override;
bool IsPlayerReady() override;
- void SetCdm(BrowserCdm* cdm) override;
+ void SetCdm(const scoped_refptr<MediaKeys>& cdm) override;
// DemuxerAndroidClient implementation.
void OnDemuxerConfigsAvailable(const DemuxerConfigs& params) override;
@@ -300,11 +299,10 @@ class MEDIA_EXPORT MediaCodecPlayer : public MediaPlayerAndroid,
// Callbacks from video decoder
void OnVideoResolutionChanged(const gfx::Size& size);
- // Callbacks from CDM
+ // Callbacks from MediaDrmBridge.
void OnMediaCryptoReady(MediaDrmBridge::JavaObjectPtr media_crypto,
bool needs_protected_surface);
void OnKeyAdded();
- void OnCdmUnset();
// Operations called from the state machine.
void SetState(PlayerState new_state);
@@ -395,10 +393,11 @@ class MEDIA_EXPORT MediaCodecPlayer : public MediaPlayerAndroid,
// For testing only.
DecodersTimeCallback decoders_time_cb_;
- // DRM
+ // Holds a ref-count to the CDM to keep |media_crypto_| valid.
+ scoped_refptr<MediaKeys> cdm_;
+
MediaDrmBridge::JavaObjectPtr media_crypto_;
- MediaDrmBridge* drm_bridge_;
int cdm_registration_id_;
// The flag is set when the player receives the error from decoder that the
« no previous file with comments | « media/base/android/browser_cdm_factory_android.cc ('k') | media/base/android/media_codec_player.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698