# Sniffer

Artifact: [androidx.media3:media3-extractor](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/extractor/mp4/Sniffer.java+class:androidx.media3.extractor.mp4.Sniffer)

*** ** * ** ***


```
@UnstableApi
class Sniffer
```

<br />

*** ** * ** ***

Provides methods that peek data from an `https://developer.android.com/reference/kotlin/androidx/media3/extractor/ExtractorInput` and return whether the input appears to be in MP4 format.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/mp4/Sniffer#BRAND_QUICKTIME() = 1903435808` Brand stored in the ftyp atom for QuickTime media. |

| ### Public functions |
|---|---|
| `java-static https://developer.android.com/reference/kotlin/androidx/media3/extractor/SniffFailure?` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/mp4/Sniffer#sniffFragmented(androidx.media3.extractor.ExtractorInput)(input: https://developer.android.com/reference/kotlin/androidx/media3/extractor/ExtractorInput!)` Returns `null` if data peeked from the current position in `input` is consistent with the input being a fragmented MP4 file, otherwise returns a `https://developer.android.com/reference/kotlin/androidx/media3/extractor/SniffFailure` describing the first detected inconsistency.. |
| `java-static https://developer.android.com/reference/kotlin/androidx/media3/extractor/SniffFailure?` | `https://developer.android.com/reference/kotlin/androidx/media3/extractor/mp4/Sniffer#sniffUnfragmented(androidx.media3.extractor.ExtractorInput)(input: https://developer.android.com/reference/kotlin/androidx/media3/extractor/ExtractorInput!)` Returns `null` if data peeked from the current position in `input` is consistent with the input being an unfragmented MP4 file, otherwise returns a `https://developer.android.com/reference/kotlin/androidx/media3/extractor/SniffFailure` describing the first detected inconsistency. |

## Constants

### BRAND_QUICKTIME

```
const val BRAND_QUICKTIME = 1903435808: Int
```

Brand stored in the ftyp atom for QuickTime media.

## Public functions

### sniffFragmented

```
java-static fun sniffFragmented(input: ExtractorInput!): SniffFailure?
```

Returns `null` if data peeked from the current position in `input` is consistent with the input being a fragmented MP4 file, otherwise returns a `https://developer.android.com/reference/kotlin/androidx/media3/extractor/SniffFailure` describing the first detected inconsistency..

| Parameters |
|---|---|
| `input: https://developer.android.com/reference/kotlin/androidx/media3/extractor/ExtractorInput!` | The extractor input from which to peek data. The peek position will be modified. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/extractor/SniffFailure?` | `null` if the input appears to be in the fragmented MP4 format, otherwise a `https://developer.android.com/reference/kotlin/androidx/media3/extractor/SniffFailure` describing why the input isn't deemed to be a fragmented MP4. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/io/IOException.html` | If an error occurs reading from the input. |

### sniffUnfragmented

```
java-static fun sniffUnfragmented(input: ExtractorInput!): SniffFailure?
```

Returns `null` if data peeked from the current position in `input` is consistent with the input being an unfragmented MP4 file, otherwise returns a `https://developer.android.com/reference/kotlin/androidx/media3/extractor/SniffFailure` describing the first detected inconsistency.

| Parameters |
|---|---|
| `input: https://developer.android.com/reference/kotlin/androidx/media3/extractor/ExtractorInput!` | The extractor input from which to peek data. The peek position will be modified. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/extractor/SniffFailure?` | `null` if the input appears to be in the fragmented MP4 format, otherwise a `https://developer.android.com/reference/kotlin/androidx/media3/extractor/SniffFailure` describing why the input isn't deemed to be a fragmented MP4. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/io/IOException.html` | If an error occurs reading from the input. |