Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -24465,6 +24465,7 @@ package android.media { } public static final class MediaExtractor.CasInfo { method public byte[] getPrivateData(); method public android.media.MediaCas.Session getSession(); method public int getSystemId(); } media/java/android/media/MediaExtractor.java +32 −3 Original line number Diff line number Diff line Loading @@ -272,10 +272,12 @@ final public class MediaExtractor { public static final class CasInfo { private final int mSystemId; private final MediaCas.Session mSession; private final byte[] mPrivateData; CasInfo(int systemId, @Nullable MediaCas.Session session) { CasInfo(int systemId, @Nullable MediaCas.Session session, @Nullable byte[] privateData) { mSystemId = systemId; mSession = session; mPrivateData = privateData; } /** Loading @@ -287,11 +289,31 @@ final public class MediaExtractor { return mSystemId; } /** * Retrieves the private data in the CA_Descriptor associated with a track. * Some CAS systems may need this to initialize the CAS plugin object. This * private data can only be retrieved before a valid {@link MediaCas} object * is set on the extractor. * <p> * @see MediaExtractor#setMediaCas * <p> * @return a byte array containing the private data. A null return value * indicates that the private data is unavailable. An empty array, * on the other hand, indicates that the private data is empty * (zero in length). */ @Nullable public byte[] getPrivateData() { return mPrivateData; } /** * Retrieves the {@link MediaCas.Session} associated with a track. The * session is needed to initialize a descrambler in order to decode the * scrambled track. * scrambled track. The session object can only be retrieved after a valid * {@link MediaCas} object is set on the extractor. * <p> * @see MediaExtractor#setMediaCas * @see MediaDescrambler#setMediaCasSession * <p> * @return a {@link MediaCas.Session} object associated with a track. Loading Loading @@ -321,6 +343,13 @@ final public class MediaExtractor { if (formatMap.containsKey(MediaFormat.KEY_CA_SYSTEM_ID)) { int systemId = ((Integer)formatMap.get(MediaFormat.KEY_CA_SYSTEM_ID)).intValue(); MediaCas.Session session = null; byte[] privateData = null; if (formatMap.containsKey(MediaFormat.KEY_CA_PRIVATE_DATA)) { ByteBuffer buf = (ByteBuffer) formatMap.get(MediaFormat.KEY_CA_PRIVATE_DATA); buf.rewind(); privateData = new byte[buf.remaining()]; buf.get(privateData); } if (mMediaCas != null && formatMap.containsKey(MediaFormat.KEY_CA_SESSION_ID)) { ByteBuffer buf = (ByteBuffer) formatMap.get(MediaFormat.KEY_CA_SESSION_ID); buf.rewind(); Loading @@ -328,7 +357,7 @@ final public class MediaExtractor { buf.get(sessionId); session = mMediaCas.createFromSessionId(toByteArray(sessionId)); } return new CasInfo(systemId, session); return new CasInfo(systemId, session, privateData); } return null; } Loading media/java/android/media/MediaFormat.java +14 −2 Original line number Diff line number Diff line Loading @@ -919,7 +919,7 @@ public final class MediaFormat { * a media track. * <p> * This key is set by {@link MediaExtractor} if the track is scrambled with a conditional * access system. * access system, regardless of the presence of a valid {@link MediaCas} object. * <p> * The associated value is an integer. * @hide Loading @@ -930,13 +930,25 @@ public final class MediaFormat { * A key describing the {@link MediaCas.Session} object associated with a media track. * <p> * This key is set by {@link MediaExtractor} if the track is scrambled with a conditional * access system. * access system, after it receives a valid {@link MediaCas} object. * <p> * The associated value is a ByteBuffer. * @hide */ public static final String KEY_CA_SESSION_ID = "ca-session-id"; /** * A key describing the private data in the CA_descriptor associated with a media track. * <p> * This key is set by {@link MediaExtractor} if the track is scrambled with a conditional * access system, before it receives a valid {@link MediaCas} object. * <p> * The associated value is a ByteBuffer. * @hide */ public static final String KEY_CA_PRIVATE_DATA = "ca-private-data"; /* package private */ MediaFormat(Map<String, Object> map) { mMap = map; } Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -24465,6 +24465,7 @@ package android.media { } public static final class MediaExtractor.CasInfo { method public byte[] getPrivateData(); method public android.media.MediaCas.Session getSession(); method public int getSystemId(); }
media/java/android/media/MediaExtractor.java +32 −3 Original line number Diff line number Diff line Loading @@ -272,10 +272,12 @@ final public class MediaExtractor { public static final class CasInfo { private final int mSystemId; private final MediaCas.Session mSession; private final byte[] mPrivateData; CasInfo(int systemId, @Nullable MediaCas.Session session) { CasInfo(int systemId, @Nullable MediaCas.Session session, @Nullable byte[] privateData) { mSystemId = systemId; mSession = session; mPrivateData = privateData; } /** Loading @@ -287,11 +289,31 @@ final public class MediaExtractor { return mSystemId; } /** * Retrieves the private data in the CA_Descriptor associated with a track. * Some CAS systems may need this to initialize the CAS plugin object. This * private data can only be retrieved before a valid {@link MediaCas} object * is set on the extractor. * <p> * @see MediaExtractor#setMediaCas * <p> * @return a byte array containing the private data. A null return value * indicates that the private data is unavailable. An empty array, * on the other hand, indicates that the private data is empty * (zero in length). */ @Nullable public byte[] getPrivateData() { return mPrivateData; } /** * Retrieves the {@link MediaCas.Session} associated with a track. The * session is needed to initialize a descrambler in order to decode the * scrambled track. * scrambled track. The session object can only be retrieved after a valid * {@link MediaCas} object is set on the extractor. * <p> * @see MediaExtractor#setMediaCas * @see MediaDescrambler#setMediaCasSession * <p> * @return a {@link MediaCas.Session} object associated with a track. Loading Loading @@ -321,6 +343,13 @@ final public class MediaExtractor { if (formatMap.containsKey(MediaFormat.KEY_CA_SYSTEM_ID)) { int systemId = ((Integer)formatMap.get(MediaFormat.KEY_CA_SYSTEM_ID)).intValue(); MediaCas.Session session = null; byte[] privateData = null; if (formatMap.containsKey(MediaFormat.KEY_CA_PRIVATE_DATA)) { ByteBuffer buf = (ByteBuffer) formatMap.get(MediaFormat.KEY_CA_PRIVATE_DATA); buf.rewind(); privateData = new byte[buf.remaining()]; buf.get(privateData); } if (mMediaCas != null && formatMap.containsKey(MediaFormat.KEY_CA_SESSION_ID)) { ByteBuffer buf = (ByteBuffer) formatMap.get(MediaFormat.KEY_CA_SESSION_ID); buf.rewind(); Loading @@ -328,7 +357,7 @@ final public class MediaExtractor { buf.get(sessionId); session = mMediaCas.createFromSessionId(toByteArray(sessionId)); } return new CasInfo(systemId, session); return new CasInfo(systemId, session, privateData); } return null; } Loading
media/java/android/media/MediaFormat.java +14 −2 Original line number Diff line number Diff line Loading @@ -919,7 +919,7 @@ public final class MediaFormat { * a media track. * <p> * This key is set by {@link MediaExtractor} if the track is scrambled with a conditional * access system. * access system, regardless of the presence of a valid {@link MediaCas} object. * <p> * The associated value is an integer. * @hide Loading @@ -930,13 +930,25 @@ public final class MediaFormat { * A key describing the {@link MediaCas.Session} object associated with a media track. * <p> * This key is set by {@link MediaExtractor} if the track is scrambled with a conditional * access system. * access system, after it receives a valid {@link MediaCas} object. * <p> * The associated value is a ByteBuffer. * @hide */ public static final String KEY_CA_SESSION_ID = "ca-session-id"; /** * A key describing the private data in the CA_descriptor associated with a media track. * <p> * This key is set by {@link MediaExtractor} if the track is scrambled with a conditional * access system, before it receives a valid {@link MediaCas} object. * <p> * The associated value is a ByteBuffer. * @hide */ public static final String KEY_CA_PRIVATE_DATA = "ca-private-data"; /* package private */ MediaFormat(Map<String, Object> map) { mMap = map; } Loading