OmniVideoLayout constructor

OmniVideoLayout({
  1. required List<double> timestamps,
  2. required List<double> groupStarts,
  3. required int tokensPerGroup,
  4. int? soundtrackTokens,
})

Implementation

OmniVideoLayout({
  required List<double> timestamps,
  required List<double> groupStarts,
  required this.tokensPerGroup,
  this.soundtrackTokens,
}) : timestamps = List.unmodifiable(timestamps),
     groupStarts = List.unmodifiable(groupStarts) {
  if (timestamps.isEmpty ||
      groupStarts.length != timestamps.length ||
      tokensPerGroup <= 0 ||
      (soundtrackTokens != null && soundtrackTokens! < 0)) {
    throw ArgumentError('invalid video layout');
  }
}