mirror of
https://github.com/androidx/media.git
synced 2025-05-11 01:31:40 +08:00
Add rebuffer test metrics to ABR playback tests.
This includes a metric logger class which logs events and generates metrics, and some changes to the Perfgate benchmark config to add the metrics. So far, only rebuffer counts, rebuffer time and startup time are measured, together with auxiliary values of total playback time used for testing and number of playback failures. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=161513672
This commit is contained in:
parent
0052a70f60
commit
6f2f8e49b8
@ -78,6 +78,7 @@ public abstract class ExoHostedTest implements HostedTest, ExoPlayer.EventListen
|
||||
private SimpleExoPlayer player;
|
||||
private Surface surface;
|
||||
private ExoPlaybackException playerError;
|
||||
private ExoPlayer.EventListener playerEventListener;
|
||||
private boolean playerWasPrepared;
|
||||
private boolean playerFinished;
|
||||
private boolean playing;
|
||||
@ -129,6 +130,16 @@ public abstract class ExoHostedTest implements HostedTest, ExoPlayer.EventListen
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets an {@link ExoPlayer.EventListener} to listen for ExoPlayer events during the test.
|
||||
*/
|
||||
public final void setEventListener(ExoPlayer.EventListener eventListener) {
|
||||
this.playerEventListener = eventListener;
|
||||
if (player != null) {
|
||||
player.addListener(eventListener);
|
||||
}
|
||||
}
|
||||
|
||||
// HostedTest implementation
|
||||
|
||||
@Override
|
||||
@ -141,6 +152,9 @@ public abstract class ExoHostedTest implements HostedTest, ExoPlayer.EventListen
|
||||
DrmSessionManager<FrameworkMediaCrypto> drmSessionManager = buildDrmSessionManager(userAgent);
|
||||
player = buildExoPlayer(host, surface, trackSelector, drmSessionManager);
|
||||
player.prepare(buildSource(host, Util.getUserAgent(host, userAgent), bandwidthMeter));
|
||||
if (playerEventListener != null) {
|
||||
player.addListener(playerEventListener);
|
||||
}
|
||||
player.addListener(this);
|
||||
player.setAudioDebugListener(this);
|
||||
player.setVideoDebugListener(this);
|
||||
|
Loading…
x
Reference in New Issue
Block a user