Search in sources :

Example 11 with Representation

use of com.google.android.exoplayer2.source.dash.manifest.Representation in project ExoPlayer by google.

the class DashUtil method loadInitializationData.

private static void loadInitializationData(DataSource dataSource, Representation representation, ChunkExtractorWrapper extractorWrapper, RangedUri requestUri) throws IOException, InterruptedException {
    DataSpec dataSpec = new DataSpec(requestUri.resolveUri(representation.baseUrl), requestUri.start, requestUri.length, representation.getCacheKey());
    InitializationChunk initializationChunk = new InitializationChunk(dataSource, dataSpec, representation.format, C.SELECTION_REASON_UNKNOWN, null, /* trackSelectionData */
    extractorWrapper);
    initializationChunk.load();
}
Also used : InitializationChunk(com.google.android.exoplayer2.source.chunk.InitializationChunk) DataSpec(com.google.android.exoplayer2.upstream.DataSpec)

Example 12 with Representation

use of com.google.android.exoplayer2.source.dash.manifest.Representation in project ExoPlayer by google.

the class DefaultDashChunkSource method updateManifest.

@Override
public void updateManifest(DashManifest newManifest, int newPeriodIndex) {
    try {
        manifest = newManifest;
        periodIndex = newPeriodIndex;
        long periodDurationUs = manifest.getPeriodDurationUs(periodIndex);
        List<Representation> representations = getAdaptationSet().representations;
        for (int i = 0; i < representationHolders.length; i++) {
            Representation representation = representations.get(trackSelection.getIndexInTrackGroup(i));
            representationHolders[i].updateRepresentation(periodDurationUs, representation);
        }
    } catch (BehindLiveWindowException e) {
        fatalError = e;
    }
}
Also used : BehindLiveWindowException(com.google.android.exoplayer2.source.BehindLiveWindowException) Representation(com.google.android.exoplayer2.source.dash.manifest.Representation)

Aggregations

Format (com.google.android.exoplayer2.Format)5 Representation (com.google.android.exoplayer2.source.dash.manifest.Representation)5 RangedUri (com.google.android.exoplayer2.source.dash.manifest.RangedUri)3 ParserException (com.google.android.exoplayer2.ParserException)2 SchemeData (com.google.android.exoplayer2.drm.DrmInitData.SchemeData)2 BehindLiveWindowException (com.google.android.exoplayer2.source.BehindLiveWindowException)2 AdaptationSet (com.google.android.exoplayer2.source.dash.manifest.AdaptationSet)2 SingleSegmentBase (com.google.android.exoplayer2.source.dash.manifest.SegmentBase.SingleSegmentBase)2 DataSpec (com.google.android.exoplayer2.upstream.DataSpec)2 ArrayList (java.util.ArrayList)2 DrmInitData (com.google.android.exoplayer2.drm.DrmInitData)1 TrackGroup (com.google.android.exoplayer2.source.TrackGroup)1 TrackGroupArray (com.google.android.exoplayer2.source.TrackGroupArray)1 ChunkExtractorWrapper (com.google.android.exoplayer2.source.chunk.ChunkExtractorWrapper)1 ContainerMediaChunk (com.google.android.exoplayer2.source.chunk.ContainerMediaChunk)1 InitializationChunk (com.google.android.exoplayer2.source.chunk.InitializationChunk)1 SingleSampleMediaChunk (com.google.android.exoplayer2.source.chunk.SingleSampleMediaChunk)1 Period (com.google.android.exoplayer2.source.dash.manifest.Period)1 SegmentTemplate (com.google.android.exoplayer2.source.dash.manifest.SegmentBase.SegmentTemplate)1 SpsData (com.google.android.exoplayer2.util.NalUnitUtil.SpsData)1