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 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 136 |
137 // Reset the device credentials. | 137 // Reset the device credentials. |
138 void ResetDeviceCredentials(const ResetCredentialsCB& callback); | 138 void ResetDeviceCredentials(const ResetCredentialsCB& callback); |
139 | 139 |
140 // Helper functions to resolve promises. | 140 // Helper functions to resolve promises. |
141 void ResolvePromise(uint32_t promise_id); | 141 void ResolvePromise(uint32_t promise_id); |
142 void ResolvePromiseWithSession(uint32_t promise_id, | 142 void ResolvePromiseWithSession(uint32_t promise_id, |
143 const std::string& session_id); | 143 const std::string& session_id); |
144 void RejectPromise(uint32_t promise_id, const std::string& error_message); | 144 void RejectPromise(uint32_t promise_id, const std::string& error_message); |
145 | 145 |
146 // Returns a MediaCrypto object. Can only be called after |j_media_crypto_| | |
147 // is set. | |
148 // TODO(xhwang): This is only used by MediaSourcePlayer et al. Remove this | |
149 // method when MediaSourcePlayer is deprecated. | |
150 jobject GetMediaCrypto(); | |
151 | |
152 // Registers a callback which will be called when MediaCrypto is ready. | 146 // Registers a callback which will be called when MediaCrypto is ready. |
153 // Can be called on any thread. Only one callback should be registered. | 147 // Can be called on any thread. Only one callback should be registered. |
154 // The registered callbacks will be fired on |task_runner_|. The caller | 148 // The registered callbacks will be fired on |task_runner_|. The caller |
155 // should make sure that the callbacks are posted to the correct thread. | 149 // should make sure that the callbacks are posted to the correct thread. |
156 // TODO(xhwang): Move this up to be close to RegisterPlayer(). | 150 // TODO(xhwang): Move this up to be close to RegisterPlayer(). |
157 void SetMediaCryptoReadyCB(const MediaCryptoReadyCB& media_crypto_ready_cb); | 151 void SetMediaCryptoReadyCB(const MediaCryptoReadyCB& media_crypto_ready_cb); |
158 | 152 |
159 // All the OnXxx functions below are called from Java. The implementation must | 153 // All the OnXxx functions below are called from Java. The implementation must |
160 // only do minimal work and then post tasks to avoid reentrancy issues. | 154 // only do minimal work and then post tasks to avoid reentrancy issues. |
161 | 155 |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 | 312 |
319 // NOTE: Weak pointers must be invalidated before all other member variables. | 313 // NOTE: Weak pointers must be invalidated before all other member variables. |
320 base::WeakPtrFactory<MediaDrmBridge> weak_factory_; | 314 base::WeakPtrFactory<MediaDrmBridge> weak_factory_; |
321 | 315 |
322 DISALLOW_COPY_AND_ASSIGN(MediaDrmBridge); | 316 DISALLOW_COPY_AND_ASSIGN(MediaDrmBridge); |
323 }; | 317 }; |
324 | 318 |
325 } // namespace media | 319 } // namespace media |
326 | 320 |
327 #endif // MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_H_ | 321 #endif // MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_H_ |
OLD | NEW |