TrackSampleTable(long[] offsets, int[] sizes, long[] timestampsUs, int[] flags) {
    Assertions.checkArgument(sizes.length == timestampsUs.length);
    Assertions.checkArgument(offsets.length == timestampsUs.length);
    Assertions.checkArgument(flags.length == timestampsUs.length);

    this.offsets = offsets;
    this.sizes = sizes;
    this.timestampsUs = timestampsUs;
    this.flags = flags;
    sampleCount = offsets.length;
  }
예제 #2
0
 /**
  * Construct a {@link com.google.android.exoplayer.upstream.DataSpec}.
  *
  * @param uri {@link #uri}.
  * @param absoluteStreamPosition {@link #absoluteStreamPosition}.
  * @param length {@link #length}.
  * @param key {@link #key}.
  * @param position {@link #position}.
  * @param uriIsFullStream {@link #uriIsFullStream}.
  */
 public DataSpec(
     Uri uri,
     long absoluteStreamPosition,
     long length,
     String key,
     long position,
     boolean uriIsFullStream) {
   Assertions.checkArgument(absoluteStreamPosition >= 0);
   Assertions.checkArgument(position >= 0);
   Assertions.checkArgument(length > 0 || length == LENGTH_UNBOUNDED);
   Assertions.checkArgument(absoluteStreamPosition == position || !uriIsFullStream);
   this.uri = uri;
   this.uriIsFullStream = uriIsFullStream;
   this.absoluteStreamPosition = absoluteStreamPosition;
   this.position = position;
   this.length = length;
   this.key = key;
 }
 public final DataSink open(DataSpec dataspec) {
   if (dataspec.length == -1L) {
     stream = new ByteArrayOutputStream();
     return this;
   }
   boolean flag;
   if (dataspec.length <= 0x7fffffffL) {
     flag = true;
   } else {
     flag = false;
   }
   Assertions.checkArgument(flag);
   stream = new ByteArrayOutputStream((int) dataspec.length);
   return this;
 }