Index: content/common/gpu/media/android_video_decode_accelerator.h |
diff --git a/content/common/gpu/media/android_video_decode_accelerator.h b/content/common/gpu/media/android_video_decode_accelerator.h |
index 2e8058af4600187c6df9e2cc83f2738af18cd54f..544a455834796446d0f2bef2457b72fdf7f195ae 100644 |
--- a/content/common/gpu/media/android_video_decode_accelerator.h |
+++ b/content/common/gpu/media/android_video_decode_accelerator.h |
@@ -18,6 +18,8 @@ |
#include "content/common/gpu/media/avda_state_provider.h" |
#include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
#include "media/base/android/media_codec_bridge.h" |
+#include "media/base/android/media_drm_bridge.h" |
+#include "media/base/media_keys.h" |
#include "media/video/video_decode_accelerator.h" |
namespace gfx { |
@@ -147,6 +149,13 @@ class CONTENT_EXPORT AndroidVideoDecodeAccelerator |
// Requests picture buffers from the client. |
void RequestPictureBuffers(); |
+ // This callback is called after CDM obtained a MediaCrypto object. |
+ void OnMediaCryptoReady(media::MediaDrmBridge::JavaObjectPtr media_crypto, |
+ bool needs_protected_surface); |
+ |
+ // This callback is called when a new key is added to CDM. |
+ void OnKeyAdded(); |
+ |
// Notifies the client of the CDM setting result. |
void NotifyCdmAttached(bool success); |
@@ -181,6 +190,9 @@ class CONTENT_EXPORT AndroidVideoDecodeAccelerator |
// Whether the stream is encrypted. |
bool is_encrypted_; |
+ // Whether encryption scheme requires to use protected surface. |
+ bool needs_protected_surface_; |
+ |
// The current state of this class. For now, this is used only for setting |
// error state. |
State state_; |
@@ -236,6 +248,19 @@ class CONTENT_EXPORT AndroidVideoDecodeAccelerator |
// Backing strategy that we'll use to connect PictureBuffers to frames. |
scoped_ptr<BackingStrategy> strategy_; |
+ // CDM related stuff. |
+ |
+ // Holds a ref-count to the CDM. |
+ scoped_refptr<media::MediaKeys> cdm_; |
+ |
+ // MediaDrmBridge requires registration/unregistration of the player, this |
+ // registration id is used for this. |
+ int cdm_registration_id_; |
+ |
+ // The MediaCrypto object is used in the MediaCodec.configure() in case of |
+ // an encrypted stream. |
+ media::MediaDrmBridge::JavaObjectPtr media_crypto_; |
+ |
// WeakPtrFactory for posting tasks back to |this|. |
base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; |