@Test public void testNestedTimeline() throws IOException { ConcatenatingMediaSource nestedSource1 = new ConcatenatingMediaSource( false, new FakeShuffleOrder(0)); ConcatenatingMediaSource nestedSource2 = new ConcatenatingMediaSource( true, new FakeShuffleOrder(0)); mediaSource.addMediaSource(nestedSource1); mediaSource.addMediaSource(nestedSource2); testRunner.prepareSource(); FakeMediaSource[] childSources = createMediaSources(4); nestedSource1.addMediaSource(childSources[0]); testRunner.assertTimelineChangeBlocking(); nestedSource1.addMediaSource(childSources[1]); testRunner.assertTimelineChangeBlocking(); nestedSource2.addMediaSource(childSources[2]); testRunner.assertTimelineChangeBlocking(); nestedSource2.addMediaSource(childSources[3]); Timeline timeline = testRunner.assertTimelineChangeBlocking(); TimelineAsserts.assertWindowTags(timeline, 111, 222, 333, 444); TimelineAsserts.assertPeriodCounts(timeline, 1, 2, 3, 4); TimelineAsserts.assertPreviousWindowIndices( timeline, Player.REPEAT_MODE_OFF, false, C.INDEX_UNSET, 0, 1, 2); TimelineAsserts.assertPreviousWindowIndices( timeline, Player.REPEAT_MODE_ONE, false, 0, 1, 3, 2); TimelineAsserts.assertPreviousWindowIndices( timeline, Player.REPEAT_MODE_ALL, false, 3, 0, 1, 2); TimelineAsserts.assertNextWindowIndices( timeline, Player.REPEAT_MODE_OFF, false, 1, 2, 3, C.INDEX_UNSET); TimelineAsserts.assertNextWindowIndices( timeline, Player.REPEAT_MODE_ONE, false, 0, 1, 3, 2); TimelineAsserts.assertNextWindowIndices( timeline, Player.REPEAT_MODE_ALL, false, 1, 2, 3, 0); TimelineAsserts.assertPreviousWindowIndices( timeline, Player.REPEAT_MODE_OFF, true, 1, 3, C.INDEX_UNSET, 2); TimelineAsserts.assertPreviousWindowIndices( timeline, Player.REPEAT_MODE_ONE, true, 0, 1, 3, 2); TimelineAsserts.assertPreviousWindowIndices( timeline, Player.REPEAT_MODE_ALL, true, 1, 3, 0, 2); TimelineAsserts.assertNextWindowIndices( timeline, Player.REPEAT_MODE_OFF, true, C.INDEX_UNSET, 0, 3, 1); TimelineAsserts.assertNextWindowIndices( timeline, Player.REPEAT_MODE_ONE, true, 0, 1, 3, 2); TimelineAsserts.assertNextWindowIndices( timeline, Player.REPEAT_MODE_ALL, true, 2, 0, 3, 1); }
public final synchronized void addMediaSource(MediaSource mediaSource) { addMediaSource(mediaSourcesPublic.size(), mediaSource); }
ConcatenatingMediaSource extends CompositeMediaSource<MediaSourceHolder> { public final synchronized void addMediaSource(MediaSource mediaSource) { addMediaSource(mediaSourcesPublic.size(), mediaSource); } }
ConcatenatingMediaSource extends CompositeMediaSource<MediaSourceHolder> { public final synchronized void addMediaSource(MediaSource mediaSource) { addMediaSource(mediaSourcesPublic.size(), mediaSource); } ConcatenatingMediaSource(MediaSource... mediaSources);  ConcatenatingMediaSource(boolean isAtomic, MediaSource... mediaSources);  ConcatenatingMediaSource(
      boolean isAtomic, ShuffleOrder shuffleOrder, MediaSource... mediaSources); @SuppressWarnings("initialization")  ConcatenatingMediaSource(
      boolean isAtomic,
      boolean useLazyPreparation,
      ShuffleOrder shuffleOrder,
      MediaSource... mediaSources); }
ConcatenatingMediaSource extends CompositeMediaSource<MediaSourceHolder> { public final synchronized void addMediaSource(MediaSource mediaSource) { addMediaSource(mediaSourcesPublic.size(), mediaSource); } ConcatenatingMediaSource(MediaSource... mediaSources);  ConcatenatingMediaSource(boolean isAtomic, MediaSource... mediaSources);  ConcatenatingMediaSource(
      boolean isAtomic, ShuffleOrder shuffleOrder, MediaSource... mediaSources); @SuppressWarnings("initialization")  ConcatenatingMediaSource(
      boolean isAtomic,
      boolean useLazyPreparation,
      ShuffleOrder shuffleOrder,
      MediaSource... mediaSources); final synchronized void addMediaSource(MediaSource mediaSource); final synchronized void addMediaSource(
      MediaSource mediaSource, Handler handler, Runnable onCompletionAction); final synchronized void addMediaSource(int index, MediaSource mediaSource); final synchronized void addMediaSource(
      int index, MediaSource mediaSource, Handler handler, Runnable onCompletionAction); final synchronized void addMediaSources(Collection<MediaSource> mediaSources); final synchronized void addMediaSources(
      Collection<MediaSource> mediaSources, Handler handler, Runnable onCompletionAction); final synchronized void addMediaSources(int index, Collection<MediaSource> mediaSources); final synchronized void addMediaSources(
      int index,
      Collection<MediaSource> mediaSources,
      Handler handler,
      Runnable onCompletionAction); final synchronized void removeMediaSource(int index); final synchronized void removeMediaSource(
      int index, Handler handler, Runnable onCompletionAction); final synchronized void removeMediaSourceRange(int fromIndex, int toIndex); final synchronized void removeMediaSourceRange(
      int fromIndex, int toIndex, Handler handler, Runnable onCompletionAction); final synchronized void moveMediaSource(int currentIndex, int newIndex); final synchronized void moveMediaSource(
      int currentIndex, int newIndex, Handler handler, Runnable onCompletionAction); final synchronized void clear(); final synchronized void clear(Handler handler, Runnable onCompletionAction); final synchronized int getSize(); final synchronized MediaSource getMediaSource(int index); final synchronized void setShuffleOrder(ShuffleOrder shuffleOrder); final synchronized void setShuffleOrder(
      ShuffleOrder shuffleOrder, Handler handler, Runnable onCompletionAction); @Override @Nullable Object getTag(); @Override final synchronized void prepareSourceInternal(
      @Nullable TransferListener mediaTransferListener); @Override @SuppressWarnings("MissingSuperCall") void maybeThrowSourceInfoRefreshError(); @Override final MediaPeriod createPeriod(
      MediaPeriodId id, Allocator allocator, long startPositionUs); @Override final void releasePeriod(MediaPeriod mediaPeriod); @Override final synchronized void releaseSourceInternal(); }
ConcatenatingMediaSource extends CompositeMediaSource<MediaSourceHolder> { public final synchronized void addMediaSource(MediaSource mediaSource) { addMediaSource(mediaSourcesPublic.size(), mediaSource); } ConcatenatingMediaSource(MediaSource... mediaSources);  ConcatenatingMediaSource(boolean isAtomic, MediaSource... mediaSources);  ConcatenatingMediaSource(
      boolean isAtomic, ShuffleOrder shuffleOrder, MediaSource... mediaSources); @SuppressWarnings("initialization")  ConcatenatingMediaSource(
      boolean isAtomic,
      boolean useLazyPreparation,
      ShuffleOrder shuffleOrder,
      MediaSource... mediaSources); final synchronized void addMediaSource(MediaSource mediaSource); final synchronized void addMediaSource(
      MediaSource mediaSource, Handler handler, Runnable onCompletionAction); final synchronized void addMediaSource(int index, MediaSource mediaSource); final synchronized void addMediaSource(
      int index, MediaSource mediaSource, Handler handler, Runnable onCompletionAction); final synchronized void addMediaSources(Collection<MediaSource> mediaSources); final synchronized void addMediaSources(
      Collection<MediaSource> mediaSources, Handler handler, Runnable onCompletionAction); final synchronized void addMediaSources(int index, Collection<MediaSource> mediaSources); final synchronized void addMediaSources(
      int index,
      Collection<MediaSource> mediaSources,
      Handler handler,
      Runnable onCompletionAction); final synchronized void removeMediaSource(int index); final synchronized void removeMediaSource(
      int index, Handler handler, Runnable onCompletionAction); final synchronized void removeMediaSourceRange(int fromIndex, int toIndex); final synchronized void removeMediaSourceRange(
      int fromIndex, int toIndex, Handler handler, Runnable onCompletionAction); final synchronized void moveMediaSource(int currentIndex, int newIndex); final synchronized void moveMediaSource(
      int currentIndex, int newIndex, Handler handler, Runnable onCompletionAction); final synchronized void clear(); final synchronized void clear(Handler handler, Runnable onCompletionAction); final synchronized int getSize(); final synchronized MediaSource getMediaSource(int index); final synchronized void setShuffleOrder(ShuffleOrder shuffleOrder); final synchronized void setShuffleOrder(
      ShuffleOrder shuffleOrder, Handler handler, Runnable onCompletionAction); @Override @Nullable Object getTag(); @Override final synchronized void prepareSourceInternal(
      @Nullable TransferListener mediaTransferListener); @Override @SuppressWarnings("MissingSuperCall") void maybeThrowSourceInfoRefreshError(); @Override final MediaPeriod createPeriod(
      MediaPeriodId id, Allocator allocator, long startPositionUs); @Override final void releasePeriod(MediaPeriod mediaPeriod); @Override final synchronized void releaseSourceInternal();  }