# MediaExtractor.CasInfo

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# CasInfo

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/media/MediaExtractor.CasInfo "View this page in Java")  

```
class CasInfo
```

|---|------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                               ||
| ↳ | [android.media.MediaExtractor.CasInfo](https://developer.android.com/reference/kotlin/android/media/MediaExtractor.CasInfo#) |

Describes the conditional access system used to scramble a track.

## Summary

|                                                                                                                                                                        Public methods                                                                                                                                                                         ||
|----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)?           | [getPrivateData](https://developer.android.com/reference/kotlin/android/media/MediaExtractor.CasInfo#getPrivateData())`()` Retrieves the private data in the CA_Descriptor associated with a track.                                                       |
| [MediaCas.Session](https://developer.android.com/reference/kotlin/android/media/MediaCas.Session)! | [getSession](https://developer.android.com/reference/kotlin/android/media/MediaExtractor.CasInfo#getSession())`()` Retrieves the[MediaCas.Session](https://developer.android.com/reference/kotlin/android/media/MediaCas.Session)associated with a track. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                         | [getSystemId](https://developer.android.com/reference/kotlin/android/media/MediaExtractor.CasInfo#getSystemId())`()` Retrieves the system id of the conditional access system.                                                                            |

## Public methods

### getPrivateData

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getPrivateData(): ByteArray?
```

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[MediaCas](https://developer.android.com/reference/kotlin/android/media/MediaCas)object is set on the extractor.

<br />

|                                                                                                                                                Return                                                                                                                                                 ||
|------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)? | 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). |

**See Also**

- [android.media.MediaExtractor#setMediaCas](https://developer.android.com/reference/kotlin/android/media/MediaExtractor#setMediaCas(android.media.MediaCas))  

### getSession

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getSession(): MediaCas.Session!
```

Retrieves the[MediaCas.Session](https://developer.android.com/reference/kotlin/android/media/MediaCas.Session)associated with a track. The session is needed to initialize a descrambler in order to decode the scrambled track. The session object can only be retrieved after a valid[MediaCas](https://developer.android.com/reference/kotlin/android/media/MediaCas)object is set on the extractor.

<br />

|                                                                                                                Return                                                                                                                 ||
|----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
| [MediaCas.Session](https://developer.android.com/reference/kotlin/android/media/MediaCas.Session)! | a[MediaCas.Session](https://developer.android.com/reference/kotlin/android/media/MediaCas.Session)object associated with a track. |

**See Also**

- [android.media.MediaExtractor#setMediaCas](https://developer.android.com/reference/kotlin/android/media/MediaExtractor#setMediaCas(android.media.MediaCas))
- [android.media.MediaDescrambler#setMediaCasSession](https://developer.android.com/reference/kotlin/android/media/MediaDescrambler#setMediaCasSession(android.media.MediaCas.Session))  

### getSystemId

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getSystemId(): Int
```

Retrieves the system id of the conditional access system.

|                                                             Return                                                              ||
|----------------------------------------------------------------------------|-----------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | CA system id of the CAS used to scramble the track. |