Class IcyHeaders
- java.lang.Object
-
- com.google.android.exoplayer2.metadata.icy.IcyHeaders
-
- All Implemented Interfaces:
Parcelable
,Metadata.Entry
public final class IcyHeaders extends Object implements Metadata.Entry
ICY headers.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description int
bitrate
Bitrate in bits per second ((icy-br * 1000)
), orFormat.NO_VALUE
if the header was not present.static Parcelable.Creator<IcyHeaders>
CREATOR
String
genre
The genre (icy-genre
).boolean
isPublic
Whether the radio station is listed (icy-pub
), orfalse
if the header was not present.int
metadataInterval
The interval in bytes between metadata chunks (icy-metaint
), orC.LENGTH_UNSET
if the header was not present.String
name
The stream name (icy-name
).static String
REQUEST_HEADER_ENABLE_METADATA_NAME
static String
REQUEST_HEADER_ENABLE_METADATA_VALUE
String
url
The URL of the radio station (icy-url
).-
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
-
Constructor Summary
Constructors Constructor Description IcyHeaders(int bitrate, String genre, String name, String url, boolean isPublic, int metadataInterval)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
describeContents()
boolean
equals(Object obj)
int
hashCode()
static IcyHeaders
parse(Map<String,List<String>> responseHeaders)
ParsesIcyHeaders
from response headers.void
populateMediaMetadata(MediaMetadata.Builder builder)
Updates theMediaMetadata.Builder
with the type specific values stored in this Entry.String
toString()
void
writeToParcel(Parcel dest, int flags)
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.google.android.exoplayer2.metadata.Metadata.Entry
getWrappedMetadataBytes, getWrappedMetadataFormat
-
-
-
-
Field Detail
-
REQUEST_HEADER_ENABLE_METADATA_NAME
public static final String REQUEST_HEADER_ENABLE_METADATA_NAME
- See Also:
- Constant Field Values
-
REQUEST_HEADER_ENABLE_METADATA_VALUE
public static final String REQUEST_HEADER_ENABLE_METADATA_VALUE
- See Also:
- Constant Field Values
-
bitrate
public final int bitrate
Bitrate in bits per second ((icy-br * 1000)
), orFormat.NO_VALUE
if the header was not present.
-
genre
@Nullable public final String genre
The genre (icy-genre
).
-
name
@Nullable public final String name
The stream name (icy-name
).
-
url
@Nullable public final String url
The URL of the radio station (icy-url
).
-
isPublic
public final boolean isPublic
Whether the radio station is listed (icy-pub
), orfalse
if the header was not present.
-
metadataInterval
public final int metadataInterval
The interval in bytes between metadata chunks (icy-metaint
), orC.LENGTH_UNSET
if the header was not present.
-
CREATOR
public static final Parcelable.Creator<IcyHeaders> CREATOR
-
-
Method Detail
-
parse
@Nullable public static IcyHeaders parse(Map<String,List<String>> responseHeaders)
ParsesIcyHeaders
from response headers.- Parameters:
responseHeaders
- The response headers.- Returns:
- The parsed
IcyHeaders
, ornull
if no ICY headers were present.
-
populateMediaMetadata
public void populateMediaMetadata(MediaMetadata.Builder builder)
Description copied from interface:Metadata.Entry
Updates theMediaMetadata.Builder
with the type specific values stored in this Entry.The order of the
Metadata.Entry
objects in theMetadata
matters. If twoMetadata.Entry
entries attempt to populate the sameMediaMetadata
field, then the last one in the list is used.- Specified by:
populateMediaMetadata
in interfaceMetadata.Entry
- Parameters:
builder
- The builder to be updated.
-
writeToParcel
public void writeToParcel(Parcel dest, int flags)
- Specified by:
writeToParcel
in interfaceParcelable
-
describeContents
public int describeContents()
- Specified by:
describeContents
in interfaceParcelable
-
-