com.google.android.exoplayer2.source.dash.DashUtil Java Examples
The following examples show how to use
com.google.android.exoplayer2.source.dash.DashUtil.
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: DashDownloader.java From MediaSDK with Apache License 2.0 | 5 votes |
private static @Nullable DashSegmentIndex getSegmentIndex( DataSource dataSource, int trackType, Representation representation) throws IOException, InterruptedException { DashSegmentIndex index = representation.getIndex(); if (index != null) { return index; } ChunkIndex seekMap = DashUtil.loadChunkIndex(dataSource, trackType, representation); return seekMap == null ? null : new DashWrappingSegmentIndex(seekMap, representation.presentationTimeOffsetUs); }
Example #2
Source File: DashDownloader.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
private static @Nullable DashSegmentIndex getSegmentIndex( DataSource dataSource, int trackType, Representation representation) throws IOException, InterruptedException { DashSegmentIndex index = representation.getIndex(); if (index != null) { return index; } ChunkIndex seekMap = DashUtil.loadChunkIndex(dataSource, trackType, representation); return seekMap == null ? null : new DashWrappingSegmentIndex(seekMap, representation.presentationTimeOffsetUs); }
Example #3
Source File: DashDownloader.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
private static @Nullable DashSegmentIndex getSegmentIndex( DataSource dataSource, int trackType, Representation representation) throws IOException, InterruptedException { DashSegmentIndex index = representation.getIndex(); if (index != null) { return index; } ChunkIndex seekMap = DashUtil.loadChunkIndex(dataSource, trackType, representation); return seekMap == null ? null : new DashWrappingSegmentIndex(seekMap, representation.presentationTimeOffsetUs); }
Example #4
Source File: OfflineLicenseHelper.java From K-Sonic with MIT License | 5 votes |
/** * Downloads an offline license. * * @param dataSource The {@link HttpDataSource} to be used for download. * @param dashManifest The {@link DashManifest} of the DASH content. * @return The downloaded offline license key set id. * @throws IOException If an error occurs reading data from the stream. * @throws InterruptedException If the thread has been interrupted. * @throws DrmSessionException Thrown when there is an error during DRM session. */ public byte[] download(HttpDataSource dataSource, DashManifest dashManifest) throws IOException, InterruptedException, DrmSessionException { // Get DrmInitData // Prefer drmInitData obtained from the manifest over drmInitData obtained from the stream, // as per DASH IF Interoperability Recommendations V3.0, 7.5.3. if (dashManifest.getPeriodCount() < 1) { return null; } Period period = dashManifest.getPeriod(0); int adaptationSetIndex = period.getAdaptationSetIndex(C.TRACK_TYPE_VIDEO); if (adaptationSetIndex == C.INDEX_UNSET) { adaptationSetIndex = period.getAdaptationSetIndex(C.TRACK_TYPE_AUDIO); if (adaptationSetIndex == C.INDEX_UNSET) { return null; } } AdaptationSet adaptationSet = period.adaptationSets.get(adaptationSetIndex); if (adaptationSet.representations.isEmpty()) { return null; } Representation representation = adaptationSet.representations.get(0); DrmInitData drmInitData = representation.format.drmInitData; if (drmInitData == null) { Format sampleFormat = DashUtil.loadSampleFormat(dataSource, representation); if (sampleFormat != null) { drmInitData = sampleFormat.drmInitData; } if (drmInitData == null) { return null; } } blockingKeyRequest(DefaultDrmSessionManager.MODE_DOWNLOAD, null, drmInitData); return drmSessionManager.getOfflineLicenseKeySetId(); }
Example #5
Source File: DashDownloader.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
private static @Nullable DashSegmentIndex getSegmentIndex( DataSource dataSource, int trackType, Representation representation) throws IOException, InterruptedException { DashSegmentIndex index = representation.getIndex(); if (index != null) { return index; } ChunkIndex seekMap = DashUtil.loadChunkIndex(dataSource, trackType, representation); return seekMap == null ? null : new DashWrappingSegmentIndex(seekMap, representation.presentationTimeOffsetUs); }
Example #6
Source File: DashDownloader.java From Telegram with GNU General Public License v2.0 | 5 votes |
private static @Nullable DashSegmentIndex getSegmentIndex( DataSource dataSource, int trackType, Representation representation) throws IOException, InterruptedException { DashSegmentIndex index = representation.getIndex(); if (index != null) { return index; } ChunkIndex seekMap = DashUtil.loadChunkIndex(dataSource, trackType, representation); return seekMap == null ? null : new DashWrappingSegmentIndex(seekMap, representation.presentationTimeOffsetUs); }
Example #7
Source File: DashDownloader.java From TelePlus-Android with GNU General Public License v2.0 | 4 votes |
@Override protected DashManifest getManifest(DataSource dataSource, Uri uri) throws IOException { return DashUtil.loadManifest(dataSource, uri); }
Example #8
Source File: DashDownloader.java From TelePlus-Android with GNU General Public License v2.0 | 4 votes |
@Override protected DashManifest getManifest(DataSource dataSource, Uri uri) throws IOException { return DashUtil.loadManifest(dataSource, uri); }
Example #9
Source File: OfflineLicenseHelper.java From K-Sonic with MIT License | 2 votes |
/** * Downloads an offline license. * * @param dataSource The {@link HttpDataSource} to be used for download. * @param manifestUriString The URI of the manifest to be read. * @return The downloaded offline license key set id. * @throws IOException If an error occurs reading data from the stream. * @throws InterruptedException If the thread has been interrupted. * @throws DrmSessionException Thrown when there is an error during DRM session. */ public byte[] download(HttpDataSource dataSource, String manifestUriString) throws IOException, InterruptedException, DrmSessionException { return download(dataSource, DashUtil.loadManifest(dataSource, manifestUriString)); }