com.google.android.exoplayer2.source.EmptySampleStream Java Examples
The following examples show how to use
com.google.android.exoplayer2.source.EmptySampleStream.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MediaPeriodHolder.java From MediaSDK with Apache License 2.0 | 5 votes |
/** * For each renderer of type {@link C#TRACK_TYPE_NONE} that was enabled, we will associate it with * a dummy {@link EmptySampleStream}. */ private void associateNoSampleRenderersWithEmptySampleStream( @NullableType SampleStream[] sampleStreams) { for (int i = 0; i < rendererCapabilities.length; i++) { if (rendererCapabilities[i].getTrackType() == C.TRACK_TYPE_NONE && trackSelectorResult.isRendererEnabled(i)) { sampleStreams[i] = new EmptySampleStream(); } } }
Example #2
Source File: DashMediaPeriod.java From MediaSDK with Apache License 2.0 | 5 votes |
private void releaseOrphanEmbeddedStreams( TrackSelection[] selections, SampleStream[] streams, int[] streamIndexToTrackGroupIndex) { for (int i = 0; i < selections.length; i++) { if (streams[i] instanceof EmptySampleStream || streams[i] instanceof EmbeddedSampleStream) { // We need to release an embedded stream if the corresponding primary stream is released. int primaryStreamIndex = getPrimaryStreamIndex(i, streamIndexToTrackGroupIndex); boolean mayRetainStream; if (primaryStreamIndex == C.INDEX_UNSET) { // If the corresponding primary stream is not selected, we may retain an existing // EmptySampleStream. mayRetainStream = streams[i] instanceof EmptySampleStream; } else { // If the corresponding primary stream is selected, we may retain the embedded stream if // the stream's parent still matches. mayRetainStream = (streams[i] instanceof EmbeddedSampleStream) && ((EmbeddedSampleStream) streams[i]).parent == streams[primaryStreamIndex]; } if (!mayRetainStream) { if (streams[i] instanceof EmbeddedSampleStream) { ((EmbeddedSampleStream) streams[i]).release(); } streams[i] = null; } } } }
Example #3
Source File: MediaPeriodHolder.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
/** * For each renderer of type {@link C#TRACK_TYPE_NONE} that was enabled, we will associate it with * a dummy {@link EmptySampleStream}. */ private void associateNoSampleRenderersWithEmptySampleStream(SampleStream[] sampleStreams) { for (int i = 0; i < rendererCapabilities.length; i++) { if (rendererCapabilities[i].getTrackType() == C.TRACK_TYPE_NONE && trackSelectorResult.isRendererEnabled(i)) { sampleStreams[i] = new EmptySampleStream(); } } }
Example #4
Source File: DashMediaPeriod.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
private void releaseOrphanEmbeddedStreams( TrackSelection[] selections, SampleStream[] streams, int[] streamIndexToTrackGroupIndex) { for (int i = 0; i < selections.length; i++) { if (streams[i] instanceof EmptySampleStream || streams[i] instanceof EmbeddedSampleStream) { // We need to release an embedded stream if the corresponding primary stream is released. int primaryStreamIndex = getPrimaryStreamIndex(i, streamIndexToTrackGroupIndex); boolean mayRetainStream; if (primaryStreamIndex == C.INDEX_UNSET) { // If the corresponding primary stream is not selected, we may retain an existing // EmptySampleStream. mayRetainStream = streams[i] instanceof EmptySampleStream; } else { // If the corresponding primary stream is selected, we may retain the embedded stream if // the stream's parent still matches. mayRetainStream = (streams[i] instanceof EmbeddedSampleStream) && ((EmbeddedSampleStream) streams[i]).parent == streams[primaryStreamIndex]; } if (!mayRetainStream) { if (streams[i] instanceof EmbeddedSampleStream) { ((EmbeddedSampleStream) streams[i]).release(); } streams[i] = null; } } } }
Example #5
Source File: MediaPeriodHolder.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
/** * For each renderer of type {@link C#TRACK_TYPE_NONE} that was enabled, we will associate it with * a dummy {@link EmptySampleStream}. */ private void associateNoSampleRenderersWithEmptySampleStream(SampleStream[] sampleStreams) { for (int i = 0; i < rendererCapabilities.length; i++) { if (rendererCapabilities[i].getTrackType() == C.TRACK_TYPE_NONE && trackSelectorResult.isRendererEnabled(i)) { sampleStreams[i] = new EmptySampleStream(); } } }
Example #6
Source File: DashMediaPeriod.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
private void releaseOrphanEmbeddedStreams( TrackSelection[] selections, SampleStream[] streams, int[] streamIndexToTrackGroupIndex) { for (int i = 0; i < selections.length; i++) { if (streams[i] instanceof EmptySampleStream || streams[i] instanceof EmbeddedSampleStream) { // We need to release an embedded stream if the corresponding primary stream is released. int primaryStreamIndex = getPrimaryStreamIndex(i, streamIndexToTrackGroupIndex); boolean mayRetainStream; if (primaryStreamIndex == C.INDEX_UNSET) { // If the corresponding primary stream is not selected, we may retain an existing // EmptySampleStream. mayRetainStream = streams[i] instanceof EmptySampleStream; } else { // If the corresponding primary stream is selected, we may retain the embedded stream if // the stream's parent still matches. mayRetainStream = (streams[i] instanceof EmbeddedSampleStream) && ((EmbeddedSampleStream) streams[i]).parent == streams[primaryStreamIndex]; } if (!mayRetainStream) { if (streams[i] instanceof EmbeddedSampleStream) { ((EmbeddedSampleStream) streams[i]).release(); } streams[i] = null; } } } }
Example #7
Source File: MediaPeriodHolder.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
/** * For each renderer of type {@link C#TRACK_TYPE_NONE} that was enabled, we will associate it with * a dummy {@link EmptySampleStream}. */ private void associateNoSampleRenderersWithEmptySampleStream( @NullableType SampleStream[] sampleStreams) { TrackSelectorResult trackSelectorResult = Assertions.checkNotNull(this.trackSelectorResult); for (int i = 0; i < rendererCapabilities.length; i++) { if (rendererCapabilities[i].getTrackType() == C.TRACK_TYPE_NONE && trackSelectorResult.isRendererEnabled(i)) { sampleStreams[i] = new EmptySampleStream(); } } }
Example #8
Source File: DashMediaPeriod.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
private void releaseOrphanEmbeddedStreams( TrackSelection[] selections, SampleStream[] streams, int[] streamIndexToTrackGroupIndex) { for (int i = 0; i < selections.length; i++) { if (streams[i] instanceof EmptySampleStream || streams[i] instanceof EmbeddedSampleStream) { // We need to release an embedded stream if the corresponding primary stream is released. int primaryStreamIndex = getPrimaryStreamIndex(i, streamIndexToTrackGroupIndex); boolean mayRetainStream; if (primaryStreamIndex == C.INDEX_UNSET) { // If the corresponding primary stream is not selected, we may retain an existing // EmptySampleStream. mayRetainStream = streams[i] instanceof EmptySampleStream; } else { // If the corresponding primary stream is selected, we may retain the embedded stream if // the stream's parent still matches. mayRetainStream = (streams[i] instanceof EmbeddedSampleStream) && ((EmbeddedSampleStream) streams[i]).parent == streams[primaryStreamIndex]; } if (!mayRetainStream) { if (streams[i] instanceof EmbeddedSampleStream) { ((EmbeddedSampleStream) streams[i]).release(); } streams[i] = null; } } } }
Example #9
Source File: MediaPeriodHolder.java From Telegram with GNU General Public License v2.0 | 5 votes |
/** * For each renderer of type {@link C#TRACK_TYPE_NONE} that was enabled, we will associate it with * a dummy {@link EmptySampleStream}. */ private void associateNoSampleRenderersWithEmptySampleStream( @NullableType SampleStream[] sampleStreams) { TrackSelectorResult trackSelectorResult = Assertions.checkNotNull(this.trackSelectorResult); for (int i = 0; i < rendererCapabilities.length; i++) { if (rendererCapabilities[i].getTrackType() == C.TRACK_TYPE_NONE && trackSelectorResult.isRendererEnabled(i)) { sampleStreams[i] = new EmptySampleStream(); } } }
Example #10
Source File: DashMediaPeriod.java From Telegram with GNU General Public License v2.0 | 5 votes |
private void releaseOrphanEmbeddedStreams( TrackSelection[] selections, SampleStream[] streams, int[] streamIndexToTrackGroupIndex) { for (int i = 0; i < selections.length; i++) { if (streams[i] instanceof EmptySampleStream || streams[i] instanceof EmbeddedSampleStream) { // We need to release an embedded stream if the corresponding primary stream is released. int primaryStreamIndex = getPrimaryStreamIndex(i, streamIndexToTrackGroupIndex); boolean mayRetainStream; if (primaryStreamIndex == C.INDEX_UNSET) { // If the corresponding primary stream is not selected, we may retain an existing // EmptySampleStream. mayRetainStream = streams[i] instanceof EmptySampleStream; } else { // If the corresponding primary stream is selected, we may retain the embedded stream if // the stream's parent still matches. mayRetainStream = (streams[i] instanceof EmbeddedSampleStream) && ((EmbeddedSampleStream) streams[i]).parent == streams[primaryStreamIndex]; } if (!mayRetainStream) { if (streams[i] instanceof EmbeddedSampleStream) { ((EmbeddedSampleStream) streams[i]).release(); } streams[i] = null; } } } }