BandwidthMeter shouldn't extend TransferListener
There may be other ways to estimate bandwidth that don't require listening to our own transfers. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=127741651
This commit is contained in:
parent
74b43e26bd
commit
6c2a967763
@ -53,7 +53,6 @@ import com.google.android.exoplayer2.trackselection.MappingTrackSelector.TrackIn
|
||||
import com.google.android.exoplayer2.ui.AspectRatioFrameLayout;
|
||||
import com.google.android.exoplayer2.ui.DebugTextViewHelper;
|
||||
import com.google.android.exoplayer2.ui.PlayerControl;
|
||||
import com.google.android.exoplayer2.upstream.BandwidthMeter;
|
||||
import com.google.android.exoplayer2.upstream.DataSource;
|
||||
import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter;
|
||||
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
|
||||
@ -152,7 +151,7 @@ public class PlayerActivity extends Activity implements SurfaceHolder.Callback,
|
||||
super.onCreate(savedInstanceState);
|
||||
String userAgent = Util.getUserAgent(this, "ExoPlayerDemo");
|
||||
manifestDataSourceFactory = new DefaultDataSourceFactory(this, userAgent);
|
||||
BandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
|
||||
DefaultBandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
|
||||
mediaDataSourceFactory = new DefaultDataSourceFactory(this, userAgent, bandwidthMeter);
|
||||
formatEvaluatorFactory = new AdaptiveEvaluator.Factory(bandwidthMeter);
|
||||
|
||||
|
@ -18,7 +18,7 @@ package com.google.android.exoplayer2.upstream;
|
||||
/**
|
||||
* Provides estimates of the currently available bandwidth.
|
||||
*/
|
||||
public interface BandwidthMeter extends TransferListener {
|
||||
public interface BandwidthMeter {
|
||||
|
||||
/**
|
||||
* Interface definition for a callback to be notified of {@link BandwidthMeter} events.
|
||||
|
@ -25,7 +25,7 @@ import android.os.SystemClock;
|
||||
* Counts transferred bytes while transfers are open and creates a bandwidth sample and updated
|
||||
* bandwidth estimate each time a transfer ends.
|
||||
*/
|
||||
public final class DefaultBandwidthMeter implements BandwidthMeter {
|
||||
public final class DefaultBandwidthMeter implements BandwidthMeter, TransferListener {
|
||||
|
||||
public static final int DEFAULT_MAX_WEIGHT = 2000;
|
||||
|
||||
|
@ -37,7 +37,6 @@ import com.google.android.exoplayer2.source.dash.DashMediaSource;
|
||||
import com.google.android.exoplayer2.source.dash.DefaultDashChunkSource;
|
||||
import com.google.android.exoplayer2.trackselection.MappingTrackSelector;
|
||||
import com.google.android.exoplayer2.trackselection.TrackSelection;
|
||||
import com.google.android.exoplayer2.upstream.BandwidthMeter;
|
||||
import com.google.android.exoplayer2.upstream.DataSource;
|
||||
import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter;
|
||||
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
|
||||
@ -425,7 +424,7 @@ public final class DashTest extends ActivityInstrumentationTestCase2<HostActivit
|
||||
@Override
|
||||
public MediaSource buildSource(HostActivity host, String userAgent) {
|
||||
DataSource.Factory manifestDataSourceFactory = new DefaultDataSourceFactory(host, userAgent);
|
||||
BandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
|
||||
DefaultBandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
|
||||
DataSource.Factory mediaDataSourceFactory = new DefaultDataSourceFactory(host, userAgent,
|
||||
bandwidthMeter);
|
||||
FormatEvaluator.Factory formatEvaluatorFactory = new AdaptiveEvaluator.Factory(
|
||||
|
Loading…
x
Reference in New Issue
Block a user