OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 package org.chromium.media; | 5 package org.chromium.media; |
6 | 6 |
7 import android.media.MediaCrypto; | 7 import android.media.MediaCrypto; |
8 import android.media.MediaDrm; | 8 import android.media.MediaDrm; |
9 import android.os.AsyncTask; | 9 import android.os.AsyncTask; |
10 import android.os.Handler; | 10 import android.os.Handler; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 } catch (Exception e) { | 121 } catch (Exception e) { |
122 Log.e(TAG, "Cannot open a new session: " + e.toString()); | 122 Log.e(TAG, "Cannot open a new session: " + e.toString()); |
123 return false; | 123 return false; |
124 } | 124 } |
125 | 125 |
126 assert(mSessionId != null); | 126 assert(mSessionId != null); |
127 return createMediaCrypto(); | 127 return createMediaCrypto(); |
128 } | 128 } |
129 | 129 |
130 @CalledByNative | 130 @CalledByNative |
131 private static boolean isCryptoSchemeSupported(byte[] schemeUUID, String con
tainerMimeType) { | 131 private static boolean isCryptoSchemeSupported(byte[] schemeUUID) { |
132 UUID cryptoScheme = getUUIDFromBytes(schemeUUID); | 132 UUID cryptoScheme = getUUIDFromBytes(schemeUUID); |
133 return MediaDrm.isCryptoSchemeSupported(cryptoScheme); | 133 return MediaDrm.isCryptoSchemeSupported(cryptoScheme); |
134 } | 134 } |
135 | 135 |
136 /** | 136 /** |
137 * Create a new MediaDrmBridge from the crypto scheme UUID. | 137 * Create a new MediaDrmBridge from the crypto scheme UUID. |
138 * | 138 * |
139 * @param schemeUUID Crypto scheme UUID. | 139 * @param schemeUUID Crypto scheme UUID. |
140 * @param securityLevel Security level to be used. | 140 * @param securityLevel Security level to be used. |
141 * @param nativeMediaDrmBridge Native object of this class. | 141 * @param nativeMediaDrmBridge Native object of this class. |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 | 451 |
452 private native void nativeOnMediaCryptoReady(int nativeMediaDrmBridge); | 452 private native void nativeOnMediaCryptoReady(int nativeMediaDrmBridge); |
453 | 453 |
454 private native void nativeOnKeyMessage(int nativeMediaDrmBridge, String sess
ionId, | 454 private native void nativeOnKeyMessage(int nativeMediaDrmBridge, String sess
ionId, |
455 byte[] message, String destinationUrl
); | 455 byte[] message, String destinationUrl
); |
456 | 456 |
457 private native void nativeOnKeyAdded(int nativeMediaDrmBridge, String sessio
nId); | 457 private native void nativeOnKeyAdded(int nativeMediaDrmBridge, String sessio
nId); |
458 | 458 |
459 private native void nativeOnKeyError(int nativeMediaDrmBridge, String sessio
nId); | 459 private native void nativeOnKeyError(int nativeMediaDrmBridge, String sessio
nId); |
460 } | 460 } |
OLD | NEW |