Commit 22948f2e by tonihei Committed by Andrew Lewis

Use TrackSelector in DownloadHelper.

This adds the basic track selection capabilties (including tests).
The new capabilities are not exposed yet through the DownloadHelper implementations
and there will also be more helper methods (e.g. to select multiple audio lanuages at
once).

PiperOrigin-RevId: 224518477
parent 771aa080
......@@ -15,6 +15,8 @@
*/
package com.google.android.exoplayer2.offline;
import android.support.annotation.Nullable;
/**
* Identifies a given track by the index of the containing period, the index of the containing group
* within the period, and the index of the track within the group.
......@@ -38,4 +40,23 @@ public final class TrackKey {
this.groupIndex = groupIndex;
this.trackIndex = trackIndex;
}
@Override
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
if (other == null || getClass() != other.getClass()) {
return false;
}
TrackKey that = (TrackKey) other;
return periodIndex == that.periodIndex
&& groupIndex == that.groupIndex
&& trackIndex == that.trackIndex;
}
@Override
public int hashCode() {
return 31 * (31 * periodIndex + groupIndex) + trackIndex;
}
}
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