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 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/android/scoped_java_ref.h" | 13 #include "base/android/scoped_java_ref.h" |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "media/base/android/media_drm_bridge_cdm_context.h" |
18 #include "media/base/android/provision_fetcher.h" | 19 #include "media/base/android/provision_fetcher.h" |
19 #include "media/base/cdm_promise_adapter.h" | 20 #include "media/base/cdm_promise_adapter.h" |
20 #include "media/base/media_export.h" | 21 #include "media/base/media_export.h" |
21 #include "media/base/media_keys.h" | 22 #include "media/base/media_keys.h" |
22 #include "media/base/player_tracker.h" | 23 #include "media/base/player_tracker.h" |
23 #include "media/cdm/player_tracker_impl.h" | 24 #include "media/cdm/player_tracker_impl.h" |
24 #include "url/gurl.h" | 25 #include "url/gurl.h" |
25 | 26 |
26 class GURL; | 27 class GURL; |
27 | 28 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 void LoadSession(SessionType session_type, | 108 void LoadSession(SessionType session_type, |
108 const std::string& session_id, | 109 const std::string& session_id, |
109 scoped_ptr<media::NewSessionCdmPromise> promise) override; | 110 scoped_ptr<media::NewSessionCdmPromise> promise) override; |
110 void UpdateSession(const std::string& session_id, | 111 void UpdateSession(const std::string& session_id, |
111 const std::vector<uint8_t>& response, | 112 const std::vector<uint8_t>& response, |
112 scoped_ptr<media::SimpleCdmPromise> promise) override; | 113 scoped_ptr<media::SimpleCdmPromise> promise) override; |
113 void CloseSession(const std::string& session_id, | 114 void CloseSession(const std::string& session_id, |
114 scoped_ptr<media::SimpleCdmPromise> promise) override; | 115 scoped_ptr<media::SimpleCdmPromise> promise) override; |
115 void RemoveSession(const std::string& session_id, | 116 void RemoveSession(const std::string& session_id, |
116 scoped_ptr<media::SimpleCdmPromise> promise) override; | 117 scoped_ptr<media::SimpleCdmPromise> promise) override; |
| 118 CdmContext* GetCdmContext() override; |
117 void DeleteOnCorrectThread() const override; | 119 void DeleteOnCorrectThread() const override; |
118 | 120 |
119 // PlayerTracker implementation. Can be called on any thread. | 121 // PlayerTracker implementation. Can be called on any thread. |
120 // The registered callbacks will be fired on |task_runner_|. The caller | 122 // The registered callbacks will be fired on |task_runner_|. The caller |
121 // should make sure that the callbacks are posted to the correct thread. | 123 // should make sure that the callbacks are posted to the correct thread. |
122 // | 124 // |
123 // Note: RegisterPlayer() should be called before SetMediaCryptoReadyCB() to | 125 // Note: RegisterPlayer() should be called before SetMediaCryptoReadyCB() to |
124 // avoid missing any new key notifications. | 126 // avoid missing any new key notifications. |
125 int RegisterPlayer(const base::Closure& new_key_cb, | 127 int RegisterPlayer(const base::Closure& new_key_cb, |
126 const base::Closure& cdm_unset_cb) override; | 128 const base::Closure& cdm_unset_cb) override; |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 | 321 |
320 ResetCredentialsCB reset_credentials_cb_; | 322 ResetCredentialsCB reset_credentials_cb_; |
321 | 323 |
322 PlayerTrackerImpl player_tracker_; | 324 PlayerTrackerImpl player_tracker_; |
323 | 325 |
324 CdmPromiseAdapter cdm_promise_adapter_; | 326 CdmPromiseAdapter cdm_promise_adapter_; |
325 | 327 |
326 // Default task runner. | 328 // Default task runner. |
327 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 329 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
328 | 330 |
| 331 MediaDrmBridgeCdmContext media_drm_bridge_cdm_context_; |
| 332 |
329 // NOTE: Weak pointers must be invalidated before all other member variables. | 333 // NOTE: Weak pointers must be invalidated before all other member variables. |
330 base::WeakPtrFactory<MediaDrmBridge> weak_factory_; | 334 base::WeakPtrFactory<MediaDrmBridge> weak_factory_; |
331 | 335 |
332 DISALLOW_COPY_AND_ASSIGN(MediaDrmBridge); | 336 DISALLOW_COPY_AND_ASSIGN(MediaDrmBridge); |
333 }; | 337 }; |
334 | 338 |
335 } // namespace media | 339 } // namespace media |
336 | 340 |
337 #endif // MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_H_ | 341 #endif // MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_H_ |
OLD | NEW |