Skip to content

Commit

Permalink
Refactor #6.HLS.1
Browse files Browse the repository at this point in the history
1. Merge HlsOutput and HlsSampleSource -> HlsTrackStreamWrapper.
2. Rename HlsSource -> HlsSampleSource2. This will be renamed to
   HlsSampleSource in a subsequent CL.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122415970
  • Loading branch information
ojw28 committed Jun 15, 2016
1 parent 51cf8be commit 770f2c2
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 224 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import com.google.android.exoplayer.demo.ui.TrackSelectionHelper;
import com.google.android.exoplayer.drm.UnsupportedDrmException;
import com.google.android.exoplayer.extractor.ExtractorSampleSource;
import com.google.android.exoplayer.hls.HlsSource;
import com.google.android.exoplayer.hls.HlsSampleSource2;
import com.google.android.exoplayer.metadata.id3.GeobFrame;
import com.google.android.exoplayer.metadata.id3.Id3Frame;
import com.google.android.exoplayer.metadata.id3.PrivFrame;
Expand Down Expand Up @@ -278,7 +278,7 @@ private SampleSource buildSource(Uri uri, String id, String provider, int type)
return new DashSampleSource(uri, dataSourceFactory, player.getBandwidthMeter(),
player.getMainHandler(), player);
case Util.TYPE_HLS:
return new HlsSource(uri, dataSourceFactory, player.getBandwidthMeter(),
return new HlsSampleSource2(uri, dataSourceFactory, player.getBandwidthMeter(),
player.getMainHandler(), player);
case Util.TYPE_OTHER:
Allocator allocator = new DefaultAllocator(C.DEFAULT_BUFFER_SEGMENT_SIZE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ public void getNextChunk(HlsMediaChunk previous, long playbackPositionUs, ChunkH
}

/**
* Invoked when the {@link HlsSampleSource} has finished loading a chunk obtained from this
* Invoked when the {@link HlsTrackStreamWrapper} has finished loading a chunk obtained from this
* source.
*
* @param chunk The chunk whose load has been completed.
Expand All @@ -480,8 +480,8 @@ public void onChunkLoadCompleted(Chunk chunk) {
}

/**
* Invoked when the {@link HlsSampleSource} encounters an error loading a chunk obtained from
* this source.
* Invoked when the {@link HlsTrackStreamWrapper} encounters an error loading a chunk obtained
* from this source.
*
* @param chunk The chunk whose load encountered the error.
* @param cancelable Whether the load can be canceled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
* @param discontinuitySequenceNumber The discontinuity sequence number of the chunk.
* @param extractor The extractor to parse samples from the data.
* @param extractorNeedsInit Whether the extractor needs initializing with the target
* {@link HlsOutput}.
* {@link HlsTrackStreamWrapper}.
* @param shouldSpliceIn Whether the samples parsed from this chunk should be spliced into any
* samples already queued to the {@link HlsOutput}.
* samples already queued to the {@link HlsTrackStreamWrapper}.
* @param encryptionKey For AES encryption chunks, the encryption key.
* @param encryptionIv For AES encryption chunks, the encryption initialization vector.
*/
Expand All @@ -80,12 +80,12 @@ public HlsMediaChunk(DataSource dataSource, DataSpec dataSpec, int trigger, Form
}

/**
* Initializes the chunk for loading, setting the {@link HlsOutput} that will receive samples as
* they are loaded.
* Initializes the chunk for loading, setting the {@link HlsTrackStreamWrapper} that will receive
* samples as they are loaded.
*
* @param output The output that will receive the loaded samples.
*/
public void init(HlsOutput output) {
public void init(HlsTrackStreamWrapper output) {
if (shouldSpliceIn) {
output.splice();
}
Expand Down
119 changes: 0 additions & 119 deletions library/src/main/java/com/google/android/exoplayer/hls/HlsOutput.java

This file was deleted.

Loading

0 comments on commit 770f2c2

Please sign in to comment.