@UnstableApi
class Sniffer


Provides methods that peek data from an ExtractorInput and return whether the input appears to be in MP4 format.

Summary

Constants

const Int
BRAND_HEIC = 1751476579

Brand stored in the ftyp atom for HEIC media.

const Int
BRAND_QUICKTIME = 1903435808

Brand stored in the ftyp atom for QuickTime media.

Public functions

java-static 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 SniffFailure describing the first detected inconsistency..

java-static SniffFailure?
sniffUnfragmented(input: ExtractorInput!, acceptHeic: Boolean)

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.

Constants

BRAND_HEIC

const val BRAND_HEIC = 1751476579: Int

Brand stored in the ftyp atom for HEIC media.

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 SniffFailure describing the first detected inconsistency..

Parameters
input: ExtractorInput!

The extractor input from which to peek data. The peek position will be modified.

Returns
SniffFailure?

null if the input appears to be in the fragmented MP4 format, otherwise a SniffFailure describing why the input isn't deemed to be a fragmented MP4.

Throws
java.io.IOException

If an error occurs reading from the input.

sniffUnfragmented

java-static fun sniffUnfragmented(input: ExtractorInput!, acceptHeic: Boolean): 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 SniffFailure describing the first detected inconsistency.

Parameters
input: ExtractorInput!

The extractor input from which to peek data. The peek position will be modified.

acceptHeic: Boolean

Whether null should be returned for HEIC photos.

Returns
SniffFailure?

null if the input appears to be in the fragmented MP4 format, otherwise a SniffFailure describing why the input isn't deemed to be a fragmented MP4.

Throws
java.io.IOException

If an error occurs reading from the input.