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 <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/android/scoped_java_ref.h" | 15 #include "base/android/scoped_java_ref.h" |
16 #include "base/callback.h" | 16 #include "base/callback.h" |
17 #include "base/macros.h" | 17 #include "base/macros.h" |
18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
20 #include "base/sequenced_task_runner_helpers.h" | 20 #include "base/sequenced_task_runner_helpers.h" |
21 #include "media/base/android/android_util.h" | |
21 #include "media/base/android/media_drm_bridge_cdm_context.h" | 22 #include "media/base/android/media_drm_bridge_cdm_context.h" |
23 #include "media/base/android/media_drm_storage_bridge.h" | |
22 #include "media/base/cdm_promise.h" | 24 #include "media/base/cdm_promise.h" |
23 #include "media/base/cdm_promise_adapter.h" | 25 #include "media/base/cdm_promise_adapter.h" |
24 #include "media/base/content_decryption_module.h" | 26 #include "media/base/content_decryption_module.h" |
25 #include "media/base/media_export.h" | 27 #include "media/base/media_export.h" |
26 #include "media/base/player_tracker.h" | 28 #include "media/base/player_tracker.h" |
27 #include "media/base/provision_fetcher.h" | 29 #include "media/base/provision_fetcher.h" |
28 #include "media/cdm/player_tracker_impl.h" | 30 #include "media/cdm/player_tracker_impl.h" |
29 #include "url/gurl.h" | 31 #include "url/gurl.h" |
30 | 32 |
31 namespace base { | 33 namespace base { |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
259 const SessionKeysChangeCB& session_keys_change_cb, | 261 const SessionKeysChangeCB& session_keys_change_cb, |
260 const SessionExpirationUpdateCB& session_expiration_update_cb); | 262 const SessionExpirationUpdateCB& session_expiration_update_cb); |
261 | 263 |
262 ~MediaDrmBridge() override; | 264 ~MediaDrmBridge() override; |
263 | 265 |
264 static bool IsSecureDecoderRequired(SecurityLevel security_level); | 266 static bool IsSecureDecoderRequired(SecurityLevel security_level); |
265 | 267 |
266 // Get the security level of the media. | 268 // Get the security level of the media. |
267 SecurityLevel GetSecurityLevel(); | 269 SecurityLevel GetSecurityLevel(); |
268 | 270 |
269 // A helper method to create a JavaObjectPtr. | |
270 JavaObjectPtr CreateJavaObjectPtr(jobject object); | |
271 | |
272 // A helper method that is called when MediaCrypto is ready. | 271 // A helper method that is called when MediaCrypto is ready. |
273 void NotifyMediaCryptoReady(JavaObjectPtr j_media_crypto); | 272 void NotifyMediaCryptoReady(JavaObjectPtr j_media_crypto); |
274 | 273 |
275 // Sends HTTP provisioning request to a provisioning server. | 274 // Sends HTTP provisioning request to a provisioning server. |
276 void SendProvisioningRequest(const std::string& default_url, | 275 void SendProvisioningRequest(const std::string& default_url, |
277 const std::string& request_data); | 276 const std::string& request_data); |
278 | 277 |
279 // Process the data received by provisioning server. | 278 // Process the data received by provisioning server. |
280 void ProcessProvisionResponse(bool success, const std::string& response); | 279 void ProcessProvisionResponse(bool success, const std::string& response); |
281 | 280 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
316 | 315 |
317 PlayerTrackerImpl player_tracker_; | 316 PlayerTrackerImpl player_tracker_; |
318 | 317 |
319 CdmPromiseAdapter cdm_promise_adapter_; | 318 CdmPromiseAdapter cdm_promise_adapter_; |
320 | 319 |
321 // Default task runner. | 320 // Default task runner. |
322 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 321 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
323 | 322 |
324 MediaDrmBridgeCdmContext media_drm_bridge_cdm_context_; | 323 MediaDrmBridgeCdmContext media_drm_bridge_cdm_context_; |
325 | 324 |
325 MediaDrmStorageBridge storage_; | |
xhwang
2017/03/30 23:33:42
Just in case |j_media_drm_| ties to talk to the |s
yucliu1
2017/03/31 00:57:17
Done.
| |
326 | |
326 // NOTE: Weak pointers must be invalidated before all other member variables. | 327 // NOTE: Weak pointers must be invalidated before all other member variables. |
327 base::WeakPtrFactory<MediaDrmBridge> weak_factory_; | 328 base::WeakPtrFactory<MediaDrmBridge> weak_factory_; |
328 | 329 |
329 DISALLOW_COPY_AND_ASSIGN(MediaDrmBridge); | 330 DISALLOW_COPY_AND_ASSIGN(MediaDrmBridge); |
330 }; | 331 }; |
331 | 332 |
332 } // namespace media | 333 } // namespace media |
333 | 334 |
334 #endif // MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_H_ | 335 #endif // MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_H_ |
OLD | NEW |