use of com.google.android.exoplayer2.Bundleable in project ExoPlayer by google.
the class DefaultTrackSelectorTest method roundTripViaBundle_ofSelectionOverride_yieldsEqualInstance.
/**
* Tests {@link SelectionOverride}'s {@link Bundleable} implementation.
*/
@Test
public void roundTripViaBundle_ofSelectionOverride_yieldsEqualInstance() {
SelectionOverride selectionOverrideToBundle = new SelectionOverride(/* groupIndex= */
1, /* tracks...= */
2, 3);
SelectionOverride selectionOverrideFromBundle = DefaultTrackSelector.SelectionOverride.CREATOR.fromBundle(selectionOverrideToBundle.toBundle());
assertThat(selectionOverrideFromBundle).isEqualTo(selectionOverrideToBundle);
}
use of com.google.android.exoplayer2.Bundleable in project ExoPlayer by google.
the class DefaultTrackSelectorTest method roundTripViaBundle_ofParameters_yieldsEqualInstance.
/**
* Tests {@link Parameters} {@link Bundleable} implementation.
*/
@Test
public void roundTripViaBundle_ofParameters_yieldsEqualInstance() {
Parameters parametersToBundle = buildParametersForEqualsTest();
Parameters parametersFromBundle = Parameters.CREATOR.fromBundle(parametersToBundle.toBundle());
assertThat(parametersFromBundle).isEqualTo(parametersToBundle);
}
use of com.google.android.exoplayer2.Bundleable in project ExoPlayer by google.
the class BundleableUtil method toBundleList.
/**
* Converts a list of {@link Bundleable} to a list {@link Bundle}.
*/
public static <T extends Bundleable> ImmutableList<Bundle> toBundleList(List<T> bundleableList) {
ImmutableList.Builder<Bundle> builder = ImmutableList.builder();
for (int i = 0; i < bundleableList.size(); i++) {
Bundleable bundleable = bundleableList.get(i);
builder.add(bundleable.toBundle());
}
return builder.build();
}
Aggregations