Back to Exoplayer

FlacMetadataReader (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/extractor/FlacMetadataReader.html

latest8.9 KB
Original Source

Package com.google.android.exoplayer2.extractor

Class FlacMetadataReader


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classFlacMetadataReaderextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")

Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.

Reads and peeks FLAC stream metadata elements according to the FLAC format specification.

Nested Class Summary

Nested Classes | Modifier and Type | Class | Description | | --- | --- | --- | | static class | FlacMetadataReader.FlacStreamMetadataHolder | Deprecated.

Holds a FlacStreamMetadata. |

Method Summary

All Methods Static Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | static boolean | checkAndPeekStreamMarker​(ExtractorInput input) | Deprecated.

Peeks the FLAC stream marker. | | static int | getFrameStartMarker​(ExtractorInput input) | Deprecated.

Returns the frame start marker, consisting of the 2 first bytes of the first frame. | | static Metadata | peekId3Metadata​(ExtractorInput input, boolean parseData) | Deprecated.

Peeks ID3 Data. | | static Metadata | readId3Metadata​(ExtractorInput input, boolean parseData) | Deprecated.

Reads ID3 Data. | | static boolean | readMetadataBlock​(ExtractorInput input, FlacMetadataReader.FlacStreamMetadataHolder metadataHolder) | Deprecated.

Reads one FLAC metadata block. | | static FlacStreamMetadata.SeekTable | readSeekTableMetadataBlock​(ParsableByteArray data) | Deprecated.

Reads a FLAC seek table metadata block. | | static void | readStreamMarker​(ExtractorInput input) | Deprecated.

Reads the FLAC stream marker. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

- 

peekId3Metadata

@Nullable
public static[Metadata](../metadata/Metadata.html "class in com.google.android.exoplayer2.metadata")peekId3Metadata​([ExtractorInput](ExtractorInput.html "interface in com.google.android.exoplayer2.extractor")input,
                                       boolean parseData)
                                throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Peeks ID3 Data. Parameters:input - Input stream to peek the ID3 data from.parseData - Whether to parse the ID3 frames.Returns:The parsed ID3 data, or null if there is no such data or if parseData is false.Throws:IOException - If peeking from the input fails. In this case, there is no guarantee on the peek position.

- 

checkAndPeekStreamMarker

public static boolean checkAndPeekStreamMarker​([ExtractorInput](ExtractorInput.html "interface in com.google.android.exoplayer2.extractor")input)
                                        throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Peeks the FLAC stream marker. Parameters:input - Input stream to peek the stream marker from.Returns:Whether the data peeked is the FLAC stream marker.Throws:IOException - If peeking from the input fails. In this case, the peek position is left unchanged.

- 

readId3Metadata

@Nullable
public static[Metadata](../metadata/Metadata.html "class in com.google.android.exoplayer2.metadata")readId3Metadata​([ExtractorInput](ExtractorInput.html "interface in com.google.android.exoplayer2.extractor")input,
                                       boolean parseData)
                                throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Reads ID3 Data.

If no exception is thrown, the peek position of input is aligned with the read position.

Parameters:input - Input stream to read the ID3 data from.parseData - Whether to parse the ID3 frames.Returns:The parsed ID3 data, or null if there is no such data or if parseData is false.Throws:IOException - If reading from the input fails. In this case, the read position is left unchanged and there is no guarantee on the peek position.

- 

readStreamMarker

public static void readStreamMarker​([ExtractorInput](ExtractorInput.html "interface in com.google.android.exoplayer2.extractor")input)
                             throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Reads the FLAC stream marker. Parameters:input - Input stream to read the stream marker from.Throws:ParserException - If an error occurs parsing the stream marker. In this case, the position of input is advanced by FlacConstants.STREAM_MARKER_SIZE bytes.IOException - If reading from the input fails. In this case, the position is left unchanged.

- 

readMetadataBlock

public static boolean readMetadataBlock​([ExtractorInput](ExtractorInput.html "interface in com.google.android.exoplayer2.extractor")input,[FlacMetadataReader.FlacStreamMetadataHolder](FlacMetadataReader.FlacStreamMetadataHolder.html "class in com.google.android.exoplayer2.extractor")metadataHolder)
                                 throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Reads one FLAC metadata block.

If no exception is thrown, the peek position of input is aligned with the read position.

Parameters:input - Input stream to read the metadata block from (header included).metadataHolder - A holder for the metadata read. If the stream info block (which must be the first metadata block) is read, the holder contains a new instance representing the stream info data. If the block read is a Vorbis comment block or a picture block, the holder contains a copy of the existing stream metadata with the corresponding metadata added. Otherwise, the metadata in the holder is unchanged.Returns:Whether the block read is the last metadata block.Throws:IllegalArgumentException - If the block read is not a stream info block and the metadata in metadataHolder is null. In this case, the read position will be at the start of a metadata block and there is no guarantee on the peek position.IOException - If reading from the input fails. In this case, the read position will be at the start of a metadata block and there is no guarantee on the peek position.

- 

readSeekTableMetadataBlock

public static[FlacStreamMetadata.SeekTable](FlacStreamMetadata.SeekTable.html "class in com.google.android.exoplayer2.extractor")readSeekTableMetadataBlock​([ParsableByteArray](../util/ParsableByteArray.html "class in com.google.android.exoplayer2.util")data)

Deprecated.

Reads a FLAC seek table metadata block.

The position of data is moved to the byte following the seek table metadata block (placeholder points included).

Parameters:data - The array to read the data from, whose position must correspond to the seek table metadata block (header included).Returns:The seek table, without the placeholder points.

- 

getFrameStartMarker

public static int getFrameStartMarker​([ExtractorInput](ExtractorInput.html "interface in com.google.android.exoplayer2.extractor")input)
                               throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Returns the frame start marker, consisting of the 2 first bytes of the first frame.

The read position of input is left unchanged and the peek position is aligned with the read position.

Parameters:input - Input stream to get the start marker from (starting from the read position).Returns:The frame start marker (which must be the same for all the frames in the stream).Throws:ParserException - If an error occurs parsing the frame start marker.IOException - If peeking from the input fails.