Commit b4879236 by Oliver Woodman

Document usage of MATCH_LONGEST_US.

Handling of this constant is already in place everywhere, this
just documents that its use is allowed.
parent 23580049
...@@ -30,6 +30,12 @@ public final class C { ...@@ -30,6 +30,12 @@ public final class C {
public static final long UNKNOWN_TIME_US = -1L; public static final long UNKNOWN_TIME_US = -1L;
/** /**
* Represents a microsecond duration whose exact value is unknown, but which should match the
* longest of some other known durations.
*/
public static final long MATCH_LONGEST_US = -2L;
/**
* The number of microseconds in one second. * The number of microseconds in one second.
*/ */
public static final long MICROS_PER_SECOND = 1000000L; public static final long MICROS_PER_SECOND = 1000000L;
......
...@@ -26,14 +26,17 @@ public final class TrackInfo { ...@@ -26,14 +26,17 @@ public final class TrackInfo {
public final String mimeType; public final String mimeType;
/** /**
* The duration in microseconds, or {@link C#UNKNOWN_TIME_US} if the duration is unknown. * The duration in microseconds, or {@link C#UNKNOWN_TIME_US} if the duration is unknown, or
* {@link C#MATCH_LONGEST_US} if the duration should match the duration of the longest track whose
* duration is known.
*/ */
public final long durationUs; public final long durationUs;
/** /**
* @param mimeType The mime type. * @param mimeType The mime type.
* @param durationUs The duration in microseconds, or {@link C#UNKNOWN_TIME_US} if the duration * @param durationUs The duration in microseconds, or {@link C#UNKNOWN_TIME_US} if the duration
* is unknown. * is unknown, or {@link C#MATCH_LONGEST_US} if the duration should match the duration of the
* longest track whose duration is known.
*/ */
public TrackInfo(String mimeType, long durationUs) { public TrackInfo(String mimeType, long durationUs) {
this.mimeType = mimeType; this.mimeType = mimeType;
......
...@@ -70,9 +70,9 @@ public abstract class TrackRenderer implements ExoPlayerComponent { ...@@ -70,9 +70,9 @@ public abstract class TrackRenderer implements ExoPlayerComponent {
public static final long UNKNOWN_TIME_US = C.UNKNOWN_TIME_US; // -1 public static final long UNKNOWN_TIME_US = C.UNKNOWN_TIME_US; // -1
/** /**
* Represents a time or duration that should match the duration of the longest track whose * Represents a time or duration that should match the duration of the longest track whose
* duration is known. * duration is known. Equal to {@link C#MATCH_LONGEST_US}.
*/ */
public static final long MATCH_LONGEST_US = -2; public static final long MATCH_LONGEST_US = C.MATCH_LONGEST_US; // -2
/** /**
* Represents the time of the end of the track. * Represents the time of the end of the track.
*/ */
......
...@@ -44,7 +44,8 @@ public class SingleSampleChunkSource implements ChunkSource { ...@@ -44,7 +44,8 @@ public class SingleSampleChunkSource implements ChunkSource {
* @param dataSpec Defines the location of the sample. * @param dataSpec Defines the location of the sample.
* @param format The format of the sample. * @param format The format of the sample.
* @param durationUs The duration of the sample in microseconds, or {@link C#UNKNOWN_TIME_US} if * @param durationUs The duration of the sample in microseconds, or {@link C#UNKNOWN_TIME_US} if
* the duration is unknown. * the duration is unknown, or {@link C#MATCH_LONGEST_US} if the duration should match the
* duration of the longest track whose duration is known.
* @param mediaFormat The sample media format. May be null. * @param mediaFormat The sample media format. May be null.
*/ */
public SingleSampleChunkSource(DataSource dataSource, DataSpec dataSpec, Format format, public SingleSampleChunkSource(DataSource dataSource, DataSpec dataSpec, Format format,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment