mirror of
https://github.com/samsonjs/media.git
synced 2026-04-04 11:05:47 +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";
|
||||
|
||||
/** The number of tracks in the group. */
|
||||
public final int length;
|
||||
@UnstableApi public final int length;
|
||||
/** An identifier for the track group. */
|
||||
public final String id;
|
||||
@UnstableApi public final String id;
|
||||
/** The type of tracks in the group. */
|
||||
public final @C.TrackType int type;
|
||||
@UnstableApi public final @C.TrackType int type;
|
||||
|
||||
private final Format[] formats;
|
||||
|
||||
|
|
@ -113,6 +113,7 @@ public final class TrackGroup implements Bundleable {
|
|||
* @param index The index of the track.
|
||||
* @return The track's format.
|
||||
*/
|
||||
@UnstableApi
|
||||
public Format getFormat(int 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.
|
||||
*/
|
||||
@SuppressWarnings("ReferenceEquality")
|
||||
@UnstableApi
|
||||
public int indexOf(Format format) {
|
||||
for (int i = 0; i < formats.length; i++) {
|
||||
if (format == formats[i]) {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ import androidx.media3.common.PlaybackParameters;
|
|||
import androidx.media3.common.Player;
|
||||
import androidx.media3.common.Player.PlaybackSuppressionReason;
|
||||
import androidx.media3.common.Timeline;
|
||||
import androidx.media3.common.TrackGroup;
|
||||
import androidx.media3.common.TracksInfo;
|
||||
import androidx.media3.common.VideoSize;
|
||||
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.
|
||||
boolean loggedMetadata = false;
|
||||
for (int groupIndex = 0; !loggedMetadata && groupIndex < trackGroupInfos.size(); groupIndex++) {
|
||||
TracksInfo.TrackGroupInfo trackGroupInfo = trackGroupInfos.get(groupIndex);
|
||||
TrackGroup trackGroup = trackGroupInfo.getTrackGroup();
|
||||
TracksInfo.TrackGroupInfo trackGroup = trackGroupInfos.get(groupIndex);
|
||||
for (int trackIndex = 0; !loggedMetadata && trackIndex < trackGroup.length; trackIndex++) {
|
||||
if (trackGroupInfo.isTrackSelected(trackIndex)) {
|
||||
@Nullable Metadata metadata = trackGroup.getFormat(trackIndex).metadata;
|
||||
if (trackGroup.isTrackSelected(trackIndex)) {
|
||||
@Nullable Metadata metadata = trackGroup.getTrackFormat(trackIndex).metadata;
|
||||
if (metadata != null && metadata.length() > 0) {
|
||||
logd(" Metadata [");
|
||||
printMetadata(metadata, " ");
|
||||
|
|
|
|||
Loading…
Reference in a new issue