Commit aa1b41bf by eguven Committed by Oliver Woodman

Generalize parameter type in DemoApplication build methods

Instead of DefaultBandwidthMeter, TransferListener<? super DataSource>
is used.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182785785
parent 32e6cf55
...@@ -17,10 +17,10 @@ package com.google.android.exoplayer2.demo; ...@@ -17,10 +17,10 @@ package com.google.android.exoplayer2.demo;
import android.app.Application; import android.app.Application;
import com.google.android.exoplayer2.upstream.DataSource; import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter;
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory; import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory; import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory;
import com.google.android.exoplayer2.upstream.HttpDataSource; import com.google.android.exoplayer2.upstream.HttpDataSource;
import com.google.android.exoplayer2.upstream.TransferListener;
import com.google.android.exoplayer2.util.Util; import com.google.android.exoplayer2.util.Util;
/** /**
...@@ -36,13 +36,15 @@ public class DemoApplication extends Application { ...@@ -36,13 +36,15 @@ public class DemoApplication extends Application {
userAgent = Util.getUserAgent(this, "ExoPlayerDemo"); userAgent = Util.getUserAgent(this, "ExoPlayerDemo");
} }
public DataSource.Factory buildDataSourceFactory(DefaultBandwidthMeter bandwidthMeter) { /** Returns a {@link DataSource.Factory}. */
return new DefaultDataSourceFactory(this, bandwidthMeter, public DataSource.Factory buildDataSourceFactory(TransferListener<? super DataSource> listener) {
buildHttpDataSourceFactory(bandwidthMeter)); return new DefaultDataSourceFactory(this, listener, buildHttpDataSourceFactory(listener));
} }
public HttpDataSource.Factory buildHttpDataSourceFactory(DefaultBandwidthMeter bandwidthMeter) { /** Returns a {@link HttpDataSource.Factory}. */
return new DefaultHttpDataSourceFactory(userAgent, bandwidthMeter); public HttpDataSource.Factory buildHttpDataSourceFactory(
TransferListener<? super DataSource> listener) {
return new DefaultHttpDataSourceFactory(userAgent, listener);
} }
public boolean useExtensionRenderers() { public boolean useExtensionRenderers() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment