mirror of
https://github.com/samsonjs/media.git
synced 2026-04-02 10:45:51 +00:00
Make factories return specific types
PiperOrigin-RevId: 272614917
This commit is contained in:
parent
e377e13d50
commit
3c235dfc1f
4 changed files with 5 additions and 7 deletions
|
|
@ -37,7 +37,7 @@ public final class RtmpDataSourceFactory implements DataSource.Factory {
|
|||
}
|
||||
|
||||
@Override
|
||||
public DataSource createDataSource() {
|
||||
public RtmpDataSource createDataSource() {
|
||||
RtmpDataSource dataSource = new RtmpDataSource();
|
||||
if (listener != null) {
|
||||
dataSource.addTransferListener(listener);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public final class FileDataSourceFactory implements DataSource.Factory {
|
|||
}
|
||||
|
||||
@Override
|
||||
public DataSource createDataSource() {
|
||||
public FileDataSource createDataSource() {
|
||||
FileDataSource dataSource = new FileDataSource();
|
||||
if (listener != null) {
|
||||
dataSource.addTransferListener(listener);
|
||||
|
|
|
|||
|
|
@ -64,9 +64,7 @@ public final class ResolvingDataSource implements DataSource {
|
|||
private final Resolver resolver;
|
||||
|
||||
/**
|
||||
* Creates factory for {@link ResolvingDataSource} instances.
|
||||
*
|
||||
* @param upstreamFactory The wrapped {@link DataSource.Factory} handling the resolved {@link
|
||||
* @param upstreamFactory The wrapped {@link DataSource.Factory} for handling resolved {@link
|
||||
* DataSpec DataSpecs}.
|
||||
* @param resolver The {@link Resolver} to resolve the {@link DataSpec DataSpecs}.
|
||||
*/
|
||||
|
|
@ -76,7 +74,7 @@ public final class ResolvingDataSource implements DataSource {
|
|||
}
|
||||
|
||||
@Override
|
||||
public DataSource createDataSource() {
|
||||
public ResolvingDataSource createDataSource() {
|
||||
return new ResolvingDataSource(upstreamFactory.createDataSource(), resolver);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public class FakeDataSource extends BaseDataSource {
|
|||
}
|
||||
|
||||
@Override
|
||||
public DataSource createDataSource() {
|
||||
public FakeDataSource createDataSource() {
|
||||
return new FakeDataSource(fakeDataSet, isNetwork);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue