| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_H_ | 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_H_ |
| 6 #define MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_H_ | 6 #define MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 const base::android::JavaParamRef<jobject>&, | 236 const base::android::JavaParamRef<jobject>&, |
| 237 bool success); | 237 bool success); |
| 238 | 238 |
| 239 private: | 239 private: |
| 240 // For DeleteSoon() in DeleteOnCorrectThread(). | 240 // For DeleteSoon() in DeleteOnCorrectThread(). |
| 241 friend class base::DeleteHelper<MediaDrmBridge>; | 241 friend class base::DeleteHelper<MediaDrmBridge>; |
| 242 | 242 |
| 243 // Constructs a MediaDrmBridge for |scheme_uuid| and |security_level|. The | 243 // Constructs a MediaDrmBridge for |scheme_uuid| and |security_level|. The |
| 244 // default security level will be used if |security_level| is | 244 // default security level will be used if |security_level| is |
| 245 // SECURITY_LEVEL_DEFAULT. | 245 // SECURITY_LEVEL_DEFAULT. |
| 246 MediaDrmBridge(const std::vector<uint8>& scheme_uuid, | 246 MediaDrmBridge(const std::vector<uint8_t>& scheme_uuid, |
| 247 SecurityLevel security_level, | 247 SecurityLevel security_level, |
| 248 const CreateFetcherCB& create_fetcher_cb, | 248 const CreateFetcherCB& create_fetcher_cb, |
| 249 const SessionMessageCB& session_message_cb, | 249 const SessionMessageCB& session_message_cb, |
| 250 const SessionClosedCB& session_closed_cb, | 250 const SessionClosedCB& session_closed_cb, |
| 251 const LegacySessionErrorCB& legacy_session_error_cb, | 251 const LegacySessionErrorCB& legacy_session_error_cb, |
| 252 const SessionKeysChangeCB& session_keys_change_cb, | 252 const SessionKeysChangeCB& session_keys_change_cb, |
| 253 const SessionExpirationUpdateCB& session_expiration_update_cb); | 253 const SessionExpirationUpdateCB& session_expiration_update_cb); |
| 254 | 254 |
| 255 ~MediaDrmBridge() override; | 255 ~MediaDrmBridge() override; |
| 256 | 256 |
| 257 static bool IsSecureDecoderRequired(SecurityLevel security_level); | 257 static bool IsSecureDecoderRequired(SecurityLevel security_level); |
| 258 | 258 |
| 259 // Get the security level of the media. | 259 // Get the security level of the media. |
| 260 SecurityLevel GetSecurityLevel(); | 260 SecurityLevel GetSecurityLevel(); |
| 261 | 261 |
| 262 // A helper method to create a JavaObjectPtr. | 262 // A helper method to create a JavaObjectPtr. |
| 263 JavaObjectPtr CreateJavaObjectPtr(jobject object); | 263 JavaObjectPtr CreateJavaObjectPtr(jobject object); |
| 264 | 264 |
| 265 // A helper method that is called when MediaCrypto is ready. | 265 // A helper method that is called when MediaCrypto is ready. |
| 266 void NotifyMediaCryptoReady(JavaObjectPtr j_media_crypto); | 266 void NotifyMediaCryptoReady(JavaObjectPtr j_media_crypto); |
| 267 | 267 |
| 268 // Sends HTTP provisioning request to a provisioning server. | 268 // Sends HTTP provisioning request to a provisioning server. |
| 269 void SendProvisioningRequest(const std::string& default_url, | 269 void SendProvisioningRequest(const std::string& default_url, |
| 270 const std::string& request_data); | 270 const std::string& request_data); |
| 271 | 271 |
| 272 // Process the data received by provisioning server. | 272 // Process the data received by provisioning server. |
| 273 void ProcessProvisionResponse(bool success, const std::string& response); | 273 void ProcessProvisionResponse(bool success, const std::string& response); |
| 274 | 274 |
| 275 // UUID of the key system. | 275 // UUID of the key system. |
| 276 std::vector<uint8> scheme_uuid_; | 276 std::vector<uint8_t> scheme_uuid_; |
| 277 | 277 |
| 278 // Java MediaDrm instance. | 278 // Java MediaDrm instance. |
| 279 base::android::ScopedJavaGlobalRef<jobject> j_media_drm_; | 279 base::android::ScopedJavaGlobalRef<jobject> j_media_drm_; |
| 280 | 280 |
| 281 // Java MediaCrypto instance. Possible values are: | 281 // Java MediaCrypto instance. Possible values are: |
| 282 // !j_media_crypto_: | 282 // !j_media_crypto_: |
| 283 // MediaCrypto creation has not been notified via NotifyMediaCryptoReady(). | 283 // MediaCrypto creation has not been notified via NotifyMediaCryptoReady(). |
| 284 // !j_media_crypto_->is_null(): | 284 // !j_media_crypto_->is_null(): |
| 285 // MediaCrypto creation succeeded and it has been notified. | 285 // MediaCrypto creation succeeded and it has been notified. |
| 286 // j_media_crypto_->is_null(): | 286 // j_media_crypto_->is_null(): |
| (...skipping 27 matching lines...) Expand all Loading... |
| 314 | 314 |
| 315 // NOTE: Weak pointers must be invalidated before all other member variables. | 315 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 316 base::WeakPtrFactory<MediaDrmBridge> weak_factory_; | 316 base::WeakPtrFactory<MediaDrmBridge> weak_factory_; |
| 317 | 317 |
| 318 DISALLOW_COPY_AND_ASSIGN(MediaDrmBridge); | 318 DISALLOW_COPY_AND_ASSIGN(MediaDrmBridge); |
| 319 }; | 319 }; |
| 320 | 320 |
| 321 } // namespace media | 321 } // namespace media |
| 322 | 322 |
| 323 #endif // MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_H_ | 323 #endif // MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_H_ |
| OLD | NEW |