Mp4LocationData


@UnstableApi
public final class Mp4LocationData implements Metadata.Entry


Stores MP4 location data.

The location data is typically read/written in the "udta" box (user data box, defined in ISO/IEC 14496-12).

Summary

Constants

static final float
ALTITUDE_UNSET = -3.4028235E38f

Represents an unset or unknown altitude.

Public fields

final float

The altitude, in meters, or ALTITUDE_UNSET if unset.

final float

The latitude, in degrees.

final float

The longitude, in degrees.

Public constructors

Mp4LocationData(
    @FloatRange(from = "-90.0", to = 90.0) float latitude,
    @FloatRange(from = "-180.0", to = 180.0) float longitude
)

Creates an instance with latitude and longitude only.

Mp4LocationData(
    @FloatRange(from = "-90.0", to = 90.0) float latitude,
    @FloatRange(from = "-180.0", to = 180.0) float longitude,
    float altitude
)

Creates an instance with latitude, longitude, and altitude.

Public methods

boolean
int
String

Inherited methods

From androidx.media3.common.Metadata.Entry
@Nullable byte[]

Returns the bytes of the wrapped metadata in this Entry, or null if it doesn't contain wrapped metadata.

@Nullable Format

Returns the Format that can be used to decode the wrapped metadata in getWrappedMetadataBytes, or null if this Entry doesn't contain wrapped metadata.

void

Updates the MediaMetadata.Builder with the type-specific values stored in this Entry.

Constants

ALTITUDE_UNSET

public static final float ALTITUDE_UNSET = -3.4028235E38f

Represents an unset or unknown altitude.

Public fields

altitude

public final float altitude

The altitude, in meters, or ALTITUDE_UNSET if unset.

latitude

public final float latitude

The latitude, in degrees.

longitude

public final float longitude

The longitude, in degrees.

Public constructors

Mp4LocationData

public Mp4LocationData(
    @FloatRange(from = "-90.0", to = 90.0) float latitude,
    @FloatRange(from = "-180.0", to = 180.0) float longitude
)

Creates an instance with latitude and longitude only.

The altitude is set to ALTITUDE_UNSET.

Parameters
@FloatRange(from = "-90.0", to = 90.0) float latitude

The latitude, in degrees. Its value must be in the range [-90, 90].

@FloatRange(from = "-180.0", to = 180.0) float longitude

The longitude, in degrees. Its value must be in the range [-180, 180].

Mp4LocationData

public Mp4LocationData(
    @FloatRange(from = "-90.0", to = 90.0) float latitude,
    @FloatRange(from = "-180.0", to = 180.0) float longitude,
    float altitude
)

Creates an instance with latitude, longitude, and altitude.

Parameters
@FloatRange(from = "-90.0", to = 90.0) float latitude

The latitude, in degrees. Its value must be in the range [-90, 90].

@FloatRange(from = "-180.0", to = 180.0) float longitude

The longitude, in degrees. Its value must be in the range [-180, 180].

float altitude

The altitude, in meters, or ALTITUDE_UNSET if unset.

Public methods

equals

public boolean equals(@Nullable Object obj)

hashCode

public int hashCode()

toString

public String toString()