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.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.annotation.TargetApi; | 8 import android.annotation.TargetApi; |
9 import android.media.MediaCrypto; | 9 import android.media.MediaCrypto; |
10 import android.media.MediaDrm; | 10 import android.media.MediaDrm; |
11 import android.os.Build; | 11 import android.os.Build; |
12 | 12 |
13 import org.chromium.base.Log; | 13 import org.chromium.base.Log; |
14 import org.chromium.base.annotations.CalledByNative; | 14 import org.chromium.base.annotations.CalledByNative; |
15 import org.chromium.base.annotations.JNINamespace; | 15 import org.chromium.base.annotations.JNINamespace; |
16 import org.chromium.base.annotations.MainDex; | 16 import org.chromium.base.annotations.MainDex; |
17 | 17 |
18 import java.nio.ByteBuffer; | 18 import java.nio.ByteBuffer; |
19 import java.util.ArrayDeque; | 19 import java.util.ArrayDeque; |
20 import java.util.ArrayList; | 20 import java.util.ArrayList; |
21 import java.util.Arrays; | 21 import java.util.Arrays; |
22 import java.util.HashMap; | 22 import java.util.HashMap; |
23 import java.util.List; | 23 import java.util.List; |
24 import java.util.UUID; | 24 import java.util.UUID; |
25 | 25 |
26 /** | 26 /** |
27 * A wrapper of the android MediaDrm class. Each MediaDrmBridge manages multiple | 27 * A wrapper of the android MediaDrm class. Each MediaDrmBridge manages multiple |
28 * sessions for a single MediaSourcePlayer. | 28 * sessions for AndroidVideoDecodeAccelerators and MediaCodecAudioDecoders. |
29 */ | 29 */ |
30 @JNINamespace("media") | 30 @JNINamespace("media") |
31 @MainDex | 31 @MainDex |
32 @SuppressLint("WrongConstant") | 32 @SuppressLint("WrongConstant") |
33 @TargetApi(Build.VERSION_CODES.KITKAT) | 33 @TargetApi(Build.VERSION_CODES.KITKAT) |
34 public class MediaDrmBridge { | 34 public class MediaDrmBridge { |
35 // Implementation Notes: | 35 // Implementation Notes: |
36 // - A media crypto session (mMediaCryptoSession) is opened after MediaDrm | 36 // - A media crypto session (mMediaCryptoSession) is opened after MediaDrm |
37 // is created. This session will NOT be added to mSessionIds and will only | 37 // is created. This session will NOT be added to mSessionIds and will only |
38 // be used to create the MediaCrypto object. | 38 // be used to create the MediaCrypto object. |
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 long nativeMediaDrmBridge, byte[] sessionId, int requestType, byte[]
message); | 1050 long nativeMediaDrmBridge, byte[] sessionId, int requestType, byte[]
message); |
1051 private native void nativeOnSessionClosed(long nativeMediaDrmBridge, byte[]
sessionId); | 1051 private native void nativeOnSessionClosed(long nativeMediaDrmBridge, byte[]
sessionId); |
1052 private native void nativeOnSessionKeysChange(long nativeMediaDrmBridge, byt
e[] sessionId, | 1052 private native void nativeOnSessionKeysChange(long nativeMediaDrmBridge, byt
e[] sessionId, |
1053 Object[] keysInfo, boolean hasAdditionalUsableKey); | 1053 Object[] keysInfo, boolean hasAdditionalUsableKey); |
1054 private native void nativeOnSessionExpirationUpdate( | 1054 private native void nativeOnSessionExpirationUpdate( |
1055 long nativeMediaDrmBridge, byte[] sessionId, long expirationTime); | 1055 long nativeMediaDrmBridge, byte[] sessionId, long expirationTime); |
1056 | 1056 |
1057 private native void nativeOnResetDeviceCredentialsCompleted( | 1057 private native void nativeOnResetDeviceCredentialsCompleted( |
1058 long nativeMediaDrmBridge, boolean success); | 1058 long nativeMediaDrmBridge, boolean success); |
1059 } | 1059 } |
OLD | NEW |