Sniffer
@UnstableApi
public final class Sniffer
Provides methods that peek data from an ExtractorInput and return whether the input appears to be in MP4 format.
Summary
Constants |
|
|---|---|
static final int |
BRAND_HEIC = 1751476579Brand stored in the ftyp atom for HEIC media. |
static final int |
BRAND_QUICKTIME = 1903435808Brand stored in the ftyp atom for QuickTime media. |
Public methods |
|
|---|---|
static @Nullable SniffFailure |
sniffFragmented(ExtractorInput input)Returns |
static @Nullable SniffFailure |
sniffUnfragmented(ExtractorInput input, boolean acceptHeic)Returns |
Constants
BRAND_HEIC
public static final int BRAND_HEIC = 1751476579
Brand stored in the ftyp atom for HEIC media.
BRAND_QUICKTIME
public static final int BRAND_QUICKTIME = 1903435808
Brand stored in the ftyp atom for QuickTime media.
Public methods
sniffFragmented
public static @Nullable SniffFailure sniffFragmented(ExtractorInput input)
Returns null if data peeked from the current position in input is consistent with the input being a fragmented MP4 file, otherwise returns a SniffFailure describing the first detected inconsistency..
| Parameters | |
|---|---|
ExtractorInput input |
The extractor input from which to peek data. The peek position will be modified. |
| Returns | |
|---|---|
@Nullable SniffFailure |
|
| Throws | |
|---|---|
java.io.IOException |
If an error occurs reading from the input. |
sniffUnfragmented
public static @Nullable SniffFailure sniffUnfragmented(ExtractorInput input, boolean acceptHeic)
Returns null if data peeked from the current position in input is consistent with the input being an unfragmented MP4 file, otherwise returns a SniffFailure describing the first detected inconsistency.
| Parameters | |
|---|---|
ExtractorInput input |
The extractor input from which to peek data. The peek position will be modified. |
boolean acceptHeic |
Whether |
| Returns | |
|---|---|
@Nullable SniffFailure |
|
| Throws | |
|---|---|
java.io.IOException |
If an error occurs reading from the input. |