mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Exclude TrackGroup fields/methods from the stable API
App code should get all of this information from TrackGroupInfo, and should only need TrackGroup as a key to use for overrides. PiperOrigin-RevId: 438840925
This commit is contained in:
parent
166f04d5e9
commit
f8f8b75500
2 changed files with 8 additions and 8 deletions
|
|
@ -54,11 +54,11 @@ public final class TrackGroup implements Bundleable {
|
||||||
private static final String TAG = "TrackGroup";
|
private static final String TAG = "TrackGroup";
|
||||||
|
|
||||||
/** The number of tracks in the group. */
|
/** The number of tracks in the group. */
|
||||||
public final int length;
|
@UnstableApi public final int length;
|
||||||
/** An identifier for the track group. */
|
/** An identifier for the track group. */
|
||||||
public final String id;
|
@UnstableApi public final String id;
|
||||||
/** The type of tracks in the group. */
|
/** The type of tracks in the group. */
|
||||||
public final @C.TrackType int type;
|
@UnstableApi public final @C.TrackType int type;
|
||||||
|
|
||||||
private final Format[] formats;
|
private final Format[] formats;
|
||||||
|
|
||||||
|
|
@ -113,6 +113,7 @@ public final class TrackGroup implements Bundleable {
|
||||||
* @param index The index of the track.
|
* @param index The index of the track.
|
||||||
* @return The track's format.
|
* @return The track's format.
|
||||||
*/
|
*/
|
||||||
|
@UnstableApi
|
||||||
public Format getFormat(int index) {
|
public Format getFormat(int index) {
|
||||||
return formats[index];
|
return formats[index];
|
||||||
}
|
}
|
||||||
|
|
@ -126,6 +127,7 @@ public final class TrackGroup implements Bundleable {
|
||||||
* @return The index of the track, or {@link C#INDEX_UNSET} if no such track exists.
|
* @return The index of the track, or {@link C#INDEX_UNSET} if no such track exists.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("ReferenceEquality")
|
@SuppressWarnings("ReferenceEquality")
|
||||||
|
@UnstableApi
|
||||||
public int indexOf(Format format) {
|
public int indexOf(Format format) {
|
||||||
for (int i = 0; i < formats.length; i++) {
|
for (int i = 0; i < formats.length; i++) {
|
||||||
if (format == formats[i]) {
|
if (format == formats[i]) {
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ import androidx.media3.common.PlaybackParameters;
|
||||||
import androidx.media3.common.Player;
|
import androidx.media3.common.Player;
|
||||||
import androidx.media3.common.Player.PlaybackSuppressionReason;
|
import androidx.media3.common.Player.PlaybackSuppressionReason;
|
||||||
import androidx.media3.common.Timeline;
|
import androidx.media3.common.Timeline;
|
||||||
import androidx.media3.common.TrackGroup;
|
|
||||||
import androidx.media3.common.TracksInfo;
|
import androidx.media3.common.TracksInfo;
|
||||||
import androidx.media3.common.VideoSize;
|
import androidx.media3.common.VideoSize;
|
||||||
import androidx.media3.common.util.Log;
|
import androidx.media3.common.util.Log;
|
||||||
|
|
@ -288,11 +287,10 @@ public class EventLogger implements AnalyticsListener {
|
||||||
// Log metadata for at most one of the selected tracks.
|
// Log metadata for at most one of the selected tracks.
|
||||||
boolean loggedMetadata = false;
|
boolean loggedMetadata = false;
|
||||||
for (int groupIndex = 0; !loggedMetadata && groupIndex < trackGroupInfos.size(); groupIndex++) {
|
for (int groupIndex = 0; !loggedMetadata && groupIndex < trackGroupInfos.size(); groupIndex++) {
|
||||||
TracksInfo.TrackGroupInfo trackGroupInfo = trackGroupInfos.get(groupIndex);
|
TracksInfo.TrackGroupInfo trackGroup = trackGroupInfos.get(groupIndex);
|
||||||
TrackGroup trackGroup = trackGroupInfo.getTrackGroup();
|
|
||||||
for (int trackIndex = 0; !loggedMetadata && trackIndex < trackGroup.length; trackIndex++) {
|
for (int trackIndex = 0; !loggedMetadata && trackIndex < trackGroup.length; trackIndex++) {
|
||||||
if (trackGroupInfo.isTrackSelected(trackIndex)) {
|
if (trackGroup.isTrackSelected(trackIndex)) {
|
||||||
@Nullable Metadata metadata = trackGroup.getFormat(trackIndex).metadata;
|
@Nullable Metadata metadata = trackGroup.getTrackFormat(trackIndex).metadata;
|
||||||
if (metadata != null && metadata.length() > 0) {
|
if (metadata != null && metadata.length() > 0) {
|
||||||
logd(" Metadata [");
|
logd(" Metadata [");
|
||||||
printMetadata(metadata, " ");
|
printMetadata(metadata, " ");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue