Class SimpleMetadataDecoder
- java.lang.Object
-
- com.google.android.exoplayer2.metadata.SimpleMetadataDecoder
-
- All Implemented Interfaces:
MetadataDecoder
- Direct Known Subclasses:
AppInfoTableDecoder
,EventMessageDecoder
,IcyDecoder
,Id3Decoder
,SpliceInfoDecoder
public abstract class SimpleMetadataDecoder extends Object implements MetadataDecoder
AMetadataDecoder
base class that validates input buffers and discards any for whichBuffer.isDecodeOnly()
istrue
.
-
-
Constructor Summary
Constructors Constructor Description SimpleMetadataDecoder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Metadata
decode(MetadataInputBuffer inputBuffer)
Decodes aMetadata
element from the provided input buffer.protected abstract Metadata
decode(MetadataInputBuffer inputBuffer, ByteBuffer buffer)
Called bydecode(MetadataInputBuffer)
after input buffer validation has been performed, except in the case thatBuffer.isDecodeOnly()
istrue
.
-
-
-
Method Detail
-
decode
@Nullable public final Metadata decode(MetadataInputBuffer inputBuffer)
Description copied from interface:MetadataDecoder
Decodes aMetadata
element from the provided input buffer.Respects
Buffer.limit()
ofinputBuffer.data
, but assumesBuffer.position()
andByteBuffer.arrayOffset()
are both zero andByteBuffer.hasArray()
is true.- Specified by:
decode
in interfaceMetadataDecoder
- Parameters:
inputBuffer
- The input buffer to decode.- Returns:
- The decoded metadata object, or
null
if the metadata could not be decoded or ifBuffer.isDecodeOnly()
was set on the input buffer.
-
decode
@Nullable protected abstract Metadata decode(MetadataInputBuffer inputBuffer, ByteBuffer buffer)
Called bydecode(MetadataInputBuffer)
after input buffer validation has been performed, except in the case thatBuffer.isDecodeOnly()
istrue
.- Parameters:
inputBuffer
- The input buffer to decode.buffer
- The input buffer'sdata buffer
, for convenience. Validation bydecode(com.google.android.exoplayer2.metadata.MetadataInputBuffer)
guarantees thatByteBuffer.hasArray()
,Buffer.position()
andByteBuffer.arrayOffset()
aretrue
,0
and0
respectively.- Returns:
- The decoded metadata object, or
null
if the metadata could not be decoded.
-
-