/external/exoplayer/tree/library/common/src/test/java/com/google/android/exoplayer2/upstream/ |
D | DataSpecTest.java | 40 DataSpec dataSpec = new DataSpec(uri); in createDataSpec_withDefaultValues() local 41 assertDefaultDataSpec(dataSpec, uri); in createDataSpec_withDefaultValues() 43 dataSpec = new DataSpec(uri, /* flags= */ 0); in createDataSpec_withDefaultValues() 44 assertDefaultDataSpec(dataSpec, uri); in createDataSpec_withDefaultValues() 46 dataSpec = new DataSpec(uri, /* position= */ 0, C.LENGTH_UNSET, /* key= */ null); in createDataSpec_withDefaultValues() 47 assertDefaultDataSpec(dataSpec, uri); in createDataSpec_withDefaultValues() 49 dataSpec = in createDataSpec_withDefaultValues() 51 assertDefaultDataSpec(dataSpec, uri); in createDataSpec_withDefaultValues() 53 dataSpec = in createDataSpec_withDefaultValues() 61 assertDefaultDataSpec(dataSpec, uri); in createDataSpec_withDefaultValues() [all …]
|
/external/exoplayer/tree/library/core/src/test/java/com/google/android/exoplayer2/upstream/ |
D | BaseDataSourceTest.java | 38 DataSpec dataSpec = new DataSpec(Uri.EMPTY); in dataTransfer_withLocalSource_isReported() local 39 testSource.open(dataSpec); in dataTransfer_withLocalSource_isReported() 48 assertThat(transferListener.lastTransferInitializingDataSpec).isEqualTo(dataSpec); in dataTransfer_withLocalSource_isReported() 49 assertThat(transferListener.lastTransferStartDataSpec).isEqualTo(dataSpec); in dataTransfer_withLocalSource_isReported() 50 assertThat(transferListener.lastBytesTransferredDataSpec).isEqualTo(dataSpec); in dataTransfer_withLocalSource_isReported() 51 assertThat(transferListener.lastTransferEndDataSpec).isEqualTo(dataSpec); in dataTransfer_withLocalSource_isReported() 67 DataSpec dataSpec = new DataSpec(Uri.EMPTY); in dataTransfer_withRemoteSource_isReported() local 68 testSource.open(dataSpec); in dataTransfer_withRemoteSource_isReported() 77 assertThat(transferListener.lastTransferInitializingDataSpec).isEqualTo(dataSpec); in dataTransfer_withRemoteSource_isReported() 78 assertThat(transferListener.lastTransferStartDataSpec).isEqualTo(dataSpec); in dataTransfer_withRemoteSource_isReported() [all …]
|
D | DataSchemeDataSourceTest.java | 48 DataSpec dataSpec = buildDataSpec(DATA_SCHEME_URI); in base64Data() local 51 dataSpec, in base64Data() 68 DataSpec dataSpec = buildDataSpec("data:,012345678901234567"); in partialReads() local 69 assertThat(schemeDataDataSource.open(dataSpec)).isEqualTo(18); in partialReads() 80 DataSpec dataSpec = in sequentialRangeRequests() local 84 dataSpec, in sequentialRangeRequests() 88 dataSpec = buildDataSpec(DATA_SCHEME_URI, /* position= */ 10, /* length= */ C.LENGTH_UNSET); in sequentialRangeRequests() 91 dataSpec, in sequentialRangeRequests() 95 dataSpec = buildDataSpec(DATA_SCHEME_URI, /* position= */ 15, /* length= */ 5); in sequentialRangeRequests() 96 assertDataSourceContent(schemeDataDataSource, dataSpec, Util.getUtf8Bytes("devin")); in sequentialRangeRequests() [all …]
|
/external/exoplayer/tree/library/core/src/main/java/com/google/android/exoplayer2/upstream/ |
D | BaseDataSource.java | 36 @Nullable private DataSpec dataSpec; field in BaseDataSource 61 protected final void transferInitializing(DataSpec dataSpec) { in transferInitializing() argument 63 listeners.get(i).onTransferInitializing(/* source= */ this, dataSpec, isNetwork); in transferInitializing() 72 protected final void transferStarted(DataSpec dataSpec) { in transferStarted() argument 73 this.dataSpec = dataSpec; in transferStarted() 75 listeners.get(i).onTransferStart(/* source= */ this, dataSpec, isNetwork); in transferStarted() 86 DataSpec dataSpec = castNonNull(this.dataSpec); in bytesTransferred() local 90 .onBytesTransferred(/* source= */ this, dataSpec, isNetwork, bytesTransferred); in bytesTransferred() 96 DataSpec dataSpec = castNonNull(this.dataSpec); in transferEnded() local 98 listeners.get(i).onTransferEnd(/* source= */ this, dataSpec, isNetwork); in transferEnded() [all …]
|
D | DataSchemeDataSource.java | 34 @Nullable private DataSpec dataSpec; field in DataSchemeDataSource 44 public long open(DataSpec dataSpec) throws IOException { in open() argument 45 transferInitializing(dataSpec); in open() 46 this.dataSpec = dataSpec; in open() 47 readPosition = (int) dataSpec.position; in open() 48 Uri uri = dataSpec.uri; in open() 69 dataSpec.length != C.LENGTH_UNSET ? (int) dataSpec.length + readPosition : data.length; in open() 74 transferStarted(dataSpec); in open() 97 return dataSpec != null ? dataSpec.uri : null; in getUri() 106 dataSpec = null; in close()
|
D | ByteArrayDataSource.java | 45 public long open(DataSpec dataSpec) throws IOException { in open() argument 46 uri = dataSpec.uri; in open() 47 transferInitializing(dataSpec); in open() 48 readPosition = (int) dataSpec.position; in open() 49 bytesRemaining = (int) ((dataSpec.length == C.LENGTH_UNSET) in open() 50 ? (data.length - dataSpec.position) : dataSpec.length); in open() 52 throw new IOException("Unsatisfiable range: [" + readPosition + ", " + dataSpec.length in open() 56 transferStarted(dataSpec); in open()
|
D | DefaultHttpDataSource.java | 85 @Nullable private DataSpec dataSpec; field in DefaultHttpDataSource 274 public long open(DataSpec dataSpec) throws HttpDataSourceException { in open() argument 275 this.dataSpec = dataSpec; in open() 278 transferInitializing(dataSpec); in open() 280 connection = makeConnection(dataSpec); in open() 283 "Unable to connect", e, dataSpec, HttpDataSourceException.TYPE_OPEN); in open() 293 "Unable to connect", e, dataSpec, HttpDataSourceException.TYPE_OPEN); in open() 301 new InvalidResponseCodeException(responseCode, responseMessage, headers, dataSpec); in open() 312 throw new InvalidContentTypeException(contentType, dataSpec); in open() 318 bytesToSkip = responseCode == 200 && dataSpec.position != 0 ? dataSpec.position : 0; in open() [all …]
|
D | AssetDataSource.java | 58 public long open(DataSpec dataSpec) throws AssetDataSourceException { in open() argument 60 uri = dataSpec.uri; in open() 67 transferInitializing(dataSpec); in open() 69 long skipped = inputStream.skip(dataSpec.position); in open() 70 if (skipped < dataSpec.position) { in open() 75 if (dataSpec.length != C.LENGTH_UNSET) { in open() 76 bytesRemaining = dataSpec.length; in open() 91 transferStarted(dataSpec); in open()
|
D | RawResourceDataSource.java | 85 public long open(DataSpec dataSpec) throws RawResourceDataSourceException { in open() argument 87 Uri uri = dataSpec.uri; in open() 100 transferInitializing(dataSpec); in open() 110 long skipped = inputStream.skip(dataSpec.position); in open() 111 if (skipped < dataSpec.position) { in open() 116 if (dataSpec.length != C.LENGTH_UNSET) { in open() 117 bytesRemaining = dataSpec.length; in open() 122 ? C.LENGTH_UNSET : (assetFileDescriptorLength - dataSpec.position); in open() 129 transferStarted(dataSpec); in open()
|
D | FileDataSource.java | 81 public long open(DataSpec dataSpec) throws FileDataSourceException { in open() argument 83 Uri uri = dataSpec.uri; in open() 86 transferInitializing(dataSpec); in open() 89 file.seek(dataSpec.position); in open() 90 bytesRemaining = dataSpec.length == C.LENGTH_UNSET ? file.length() - dataSpec.position in open() 91 : dataSpec.length; in open() 100 transferStarted(dataSpec); in open()
|
D | ContentDataSource.java | 63 public long open(DataSpec dataSpec) throws ContentDataSourceException { in open() argument 65 Uri uri = dataSpec.uri; in open() 68 transferInitializing(dataSpec); in open() 78 long skipped = inputStream.skip(assetStartOffset + dataSpec.position) - assetStartOffset; in open() 79 if (skipped != dataSpec.position) { in open() 84 if (dataSpec.length != C.LENGTH_UNSET) { in open() 85 bytesRemaining = dataSpec.length; in open() 103 transferStarted(dataSpec); in open()
|
D | TeeDataSource.java | 52 public long open(DataSpec dataSpec) throws IOException { in open() argument 53 bytesRemaining = upstream.open(dataSpec); in open() 57 if (dataSpec.length == C.LENGTH_UNSET && bytesRemaining != C.LENGTH_UNSET) { in open() 59 dataSpec = dataSpec.subrange(0, bytesRemaining); in open() 62 dataSink.open(dataSpec); in open()
|
D | ParsingLoadable.java | 83 DataSource dataSource, Parser<? extends T> parser, DataSpec dataSpec, int type) in load() argument 85 ParsingLoadable<T> loadable = new ParsingLoadable<>(dataSource, dataSpec, type, parser); in load() 93 public final DataSpec dataSpec; field in ParsingLoadable 125 public ParsingLoadable(DataSource dataSource, DataSpec dataSpec, int type, in ParsingLoadable() argument 128 this.dataSpec = dataSpec; in ParsingLoadable() 173 DataSourceInputStream inputStream = new DataSourceInputStream(dataSource, dataSpec); in load()
|
D | DataSourceInputStream.java | 30 private final DataSpec dataSpec; field in DataSourceInputStream 41 public DataSourceInputStream(DataSource dataSource, DataSpec dataSpec) { in DataSourceInputStream() argument 43 this.dataSpec = dataSpec; in DataSourceInputStream() 101 dataSource.open(dataSpec); in checkOpened()
|
/external/exoplayer/tree/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/ |
D | CacheUtil.java | 59 (dataSpec) -> dataSpec.key != null ? dataSpec.key : generateKey(dataSpec.uri); 80 DataSpec dataSpec, Cache cache, @Nullable CacheKeyFactory cacheKeyFactory) { in getCached() argument 81 String key = buildCacheKey(dataSpec, cacheKeyFactory); in getCached() 82 long position = dataSpec.position; in getCached() 83 long requestLength = getRequestLength(dataSpec, cache, key); in getCached() 121 DataSpec dataSpec, in cache() argument 128 dataSpec, in cache() 158 DataSpec dataSpec, in cache() argument 169 String key = buildCacheKey(dataSpec, cacheKeyFactory); in cache() 174 Pair<Long, Long> lengthAndBytesAlreadyCached = getCached(dataSpec, cache, cacheKeyFactory); in cache() [all …]
|
D | CacheDataSink.java | 126 @Nullable private DataSpec dataSpec; field in CacheDataSink 175 public void open(DataSpec dataSpec) throws CacheDataSinkException { in open() argument 176 if (dataSpec.length == C.LENGTH_UNSET in open() 177 && dataSpec.isFlagSet(DataSpec.FLAG_DONT_CACHE_IF_LENGTH_UNKNOWN)) { in open() 178 this.dataSpec = null; in open() 181 this.dataSpec = dataSpec; in open() 183 dataSpec.isFlagSet(DataSpec.FLAG_ALLOW_CACHE_FRAGMENTATION) ? fragmentSize : Long.MAX_VALUE; in open() 194 if (dataSpec == null) { in write() 218 if (dataSpec == null) { in close() 230 dataSpec.length == C.LENGTH_UNSET in openNextOutputStream() [all …]
|
/external/exoplayer/tree/library/common/src/main/java/com/google/android/exoplayer2/upstream/ |
D | HttpDataSource.java | 248 public final DataSpec dataSpec; field in HttpDataSource.HttpDataSourceException 250 public HttpDataSourceException(DataSpec dataSpec, @Type int type) { in HttpDataSourceException() argument 252 this.dataSpec = dataSpec; in HttpDataSourceException() 256 public HttpDataSourceException(String message, DataSpec dataSpec, @Type int type) { in HttpDataSourceException() argument 258 this.dataSpec = dataSpec; in HttpDataSourceException() 262 public HttpDataSourceException(IOException cause, DataSpec dataSpec, @Type int type) { in HttpDataSourceException() argument 264 this.dataSpec = dataSpec; in HttpDataSourceException() 268 public HttpDataSourceException(String message, IOException cause, DataSpec dataSpec, in HttpDataSourceException() argument 271 this.dataSpec = dataSpec; in HttpDataSourceException() 284 public InvalidContentTypeException(String contentType, DataSpec dataSpec) { in InvalidContentTypeException() argument [all …]
|
D | TransferListener.java | 47 void onTransferInitializing(DataSource source, DataSpec dataSpec, boolean isNetwork); in onTransferInitializing() argument 56 void onTransferStart(DataSource source, DataSpec dataSpec, boolean isNetwork); in onTransferStart() argument 67 DataSource source, DataSpec dataSpec, boolean isNetwork, int bytesTransferred); in onBytesTransferred() argument 76 void onTransferEnd(DataSource source, DataSpec dataSpec, boolean isNetwork); in onTransferEnd() argument
|
/external/exoplayer/tree/extensions/okhttp/src/main/java/com/google/android/exoplayer2/ext/okhttp/ |
D | OkHttpDataSource.java | 71 @Nullable private DataSpec dataSpec; field in OkHttpDataSource 210 public long open(DataSpec dataSpec) throws HttpDataSourceException { in open() argument 211 this.dataSpec = dataSpec; in open() 214 transferInitializing(dataSpec); in open() 216 Request request = makeRequest(dataSpec); in open() 226 "Unable to connect", e, dataSpec, HttpDataSourceException.TYPE_OPEN); in open() 236 new InvalidResponseCodeException(responseCode, response.message(), headers, dataSpec); in open() 248 throw new InvalidContentTypeException(contentType, dataSpec); in open() 254 bytesToSkip = responseCode == 200 && dataSpec.position != 0 ? dataSpec.position : 0; in open() 257 if (dataSpec.length != C.LENGTH_UNSET) { in open() [all …]
|
/external/exoplayer/tree/testutils/src/main/java/com/google/android/exoplayer2/testutil/ |
D | FakeDataSource.java | 93 public final long open(DataSpec dataSpec) throws IOException { in open() argument 98 uri = dataSpec.uri; in open() 99 openedDataSpecs.add(dataSpec); in open() 101 transferInitializing(dataSpec); in open() 102 FakeData fakeData = fakeDataSet.getData(dataSpec.uri.toString()); in open() 104 throw new IOException("Data not found: " + dataSpec.uri); in open() 114 throw new IOException("Data is empty: " + dataSpec.uri); in open() 118 if (dataSpec.position >= totalLength || (dataSpec.length != C.LENGTH_UNSET in open() 119 && (dataSpec.position + dataSpec.length > totalLength))) { in open() 128 (int) Math.min(Math.max(0, dataSpec.position - scannedLength), segment.length); in open() [all …]
|
/external/exoplayer/tree/extensions/cronet/src/main/java/com/google/android/exoplayer2/ext/cronet/ |
D | CronetDataSource.java | 74 public OpenException(IOException cause, DataSpec dataSpec, int cronetConnectionStatus) { in OpenException() argument 75 super(cause, dataSpec, TYPE_OPEN); in OpenException() 79 public OpenException(String errorMessage, DataSpec dataSpec, int cronetConnectionStatus) { in OpenException() argument 80 super(errorMessage, dataSpec, TYPE_OPEN); in OpenException() 416 public long open(DataSpec dataSpec) throws HttpDataSourceException { in open() argument 417 Assertions.checkNotNull(dataSpec); in open() 422 currentDataSpec = dataSpec; in open() 425 urlRequest = buildRequestBuilder(dataSpec).build(); in open() 428 throw new OpenException(e, dataSpec, Status.IDLE); in open() 432 transferInitializing(dataSpec); in open() [all …]
|
/external/exoplayer/tree/library/core/src/main/java/com/google/android/exoplayer2/source/ |
D | LoadEventInfo.java | 38 public final DataSpec dataSpec; field in LoadEventInfo 58 public LoadEventInfo(DataSpec dataSpec, long elapsedRealtimeMs) { in LoadEventInfo() argument 60 dataSpec, in LoadEventInfo() 61 dataSpec.uri, in LoadEventInfo() 84 DataSpec dataSpec, in LoadEventInfo() argument 90 this.dataSpec = dataSpec; in LoadEventInfo()
|
D | SingleSampleMediaPeriod.java | 54 private final DataSpec dataSpec; field in SingleSampleMediaPeriod 74 DataSpec dataSpec, in SingleSampleMediaPeriod() argument 82 this.dataSpec = dataSpec; in SingleSampleMediaPeriod() 159 new SourceLoadable(dataSpec, dataSource), in continueLoading() 163 new LoadEventInfo(dataSpec, elapsedRealtimeMs), in continueLoading() 222 loadable.dataSpec, in onLoadCompleted() 243 loadable.dataSpec, in onLoadCanceled() 286 loadable.dataSpec, in onLoadError() 385 public final DataSpec dataSpec; field in SingleSampleMediaPeriod.SourceLoadable 391 public SourceLoadable(DataSpec dataSpec, DataSource dataSource) { in SourceLoadable() argument [all …]
|
/external/exoplayer/tree/library/core/src/test/java/com/google/android/exoplayer2/upstream/cache/ |
D | CacheDataSourceTest.java | 80 cacheKeyFactory = dataSpec -> customCacheKey; in setUp() 129 DataSpec dataSpec = buildDataSpec(/* position= */ 2, /* length= */ 5); in propagatesHttpHeadersUpstream() local 130 cacheDataSource.open(dataSpec); in propagatesHttpHeadersUpstream() 267 DataSpec dataSpec = buildDataSpec(TEST_DATA.length - 2, 2); in contentLengthEdgeCases() local 271 assertReadData(cacheDataSource, dataSpec, true); in contentLengthEdgeCases() 287 dataSpec = in contentLengthEdgeCases() 289 assertThat(cacheDataSource.open(dataSpec)).isEqualTo(C.LENGTH_UNSET); in contentLengthEdgeCases() 422 DataSpec dataSpec = buildDataSpec(halfDataLength, C.LENGTH_UNSET); in deleteCachedWhileReadingFromUpstreamWithReadOnlyCacheDataSourceDoesNotCrash() local 424 cache, dataSpec, upstream, /* progressListener= */ null, /* isCanceled= */ null); in deleteCachedWhileReadingFromUpstreamWithReadOnlyCacheDataSourceDoesNotCrash() 453 DataSpec dataSpec = buildDataSpec(/* position= */ 0, halfDataLength); in deleteCachedWhileReadingFromUpstreamWithBlockingCacheDataSourceDoesNotBlock() local [all …]
|
/external/exoplayer/tree/library/core/src/main/java/com/google/android/exoplayer2/offline/ |
D | SegmentDownloader.java | 53 public final DataSpec dataSpec; field in SegmentDownloader.Segment 56 public Segment(long startTimeUs, DataSpec dataSpec) { in Segment() argument 58 this.dataSpec = dataSpec; in Segment() 132 segment.dataSpec, dataSource.getCache(), dataSource.getCacheKeyFactory()); in download() 165 segments.get(i).dataSpec, in download() 195 CacheUtil.remove(segments.get(i).dataSpec, cache, cacheKeyFactory); in remove() 215 protected abstract M getManifest(DataSource dataSource, DataSpec dataSpec) throws IOException; in getManifest() argument 243 String cacheKey = keyFactory.buildCacheKey(segment.dataSpec); in mergeSegments() 248 || !canMergeSegments(lastSegment.dataSpec, segment.dataSpec)) { in mergeSegments() 254 segment.dataSpec.length == C.LENGTH_UNSET in mergeSegments() [all …]
|