Dump auxiliaryTrackType in a string format
PiperOrigin-RevId: 658372776
This commit is contained in:
parent
bd399eb601
commit
9d14b91d94
@ -1539,6 +1539,7 @@ public final class C {
|
||||
})
|
||||
public @interface AuxiliaryTrackType {}
|
||||
|
||||
// LINT.IfChange(auxiliary_track_type)
|
||||
/** Not an auxiliary track or an auxiliary track with an undefined type. */
|
||||
@UnstableApi public static final int AUXILIARY_TRACK_TYPE_UNDEFINED = 0;
|
||||
|
||||
|
@ -1450,7 +1450,9 @@ public final class Format {
|
||||
builder.append(", customData=").append(format.customData);
|
||||
}
|
||||
if ((format.roleFlags & C.ROLE_FLAG_AUXILIARY) != 0) {
|
||||
builder.append(", auxiliaryTrackType=").append(format.auxiliaryTrackType);
|
||||
builder
|
||||
.append(", auxiliaryTrackType=")
|
||||
.append(Util.getAuxiliaryTrackTypeString(format.auxiliaryTrackType));
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
@ -16,6 +16,11 @@
|
||||
package androidx.media3.common.util;
|
||||
|
||||
import static android.content.Context.UI_MODE_SERVICE;
|
||||
import static androidx.media3.common.C.AUXILIARY_TRACK_TYPE_DEPTH_INVERSE;
|
||||
import static androidx.media3.common.C.AUXILIARY_TRACK_TYPE_DEPTH_LINEAR;
|
||||
import static androidx.media3.common.C.AUXILIARY_TRACK_TYPE_DEPTH_METADATA;
|
||||
import static androidx.media3.common.C.AUXILIARY_TRACK_TYPE_ORIGINAL;
|
||||
import static androidx.media3.common.C.AUXILIARY_TRACK_TYPE_UNDEFINED;
|
||||
import static androidx.media3.common.Player.COMMAND_PLAY_PAUSE;
|
||||
import static androidx.media3.common.Player.COMMAND_PREPARE;
|
||||
import static androidx.media3.common.Player.COMMAND_SEEK_BACK;
|
||||
@ -3295,6 +3300,26 @@ public final class Util {
|
||||
return result;
|
||||
}
|
||||
|
||||
/** Returns a string representation of the {@link C.AuxiliaryTrackType}. */
|
||||
@UnstableApi
|
||||
public static String getAuxiliaryTrackTypeString(@C.AuxiliaryTrackType int auxiliaryTrackType) {
|
||||
// LINT.IfChange(auxiliary_track_type)
|
||||
switch (auxiliaryTrackType) {
|
||||
case AUXILIARY_TRACK_TYPE_UNDEFINED:
|
||||
return "undefined";
|
||||
case AUXILIARY_TRACK_TYPE_ORIGINAL:
|
||||
return "original";
|
||||
case AUXILIARY_TRACK_TYPE_DEPTH_LINEAR:
|
||||
return "depth-linear";
|
||||
case AUXILIARY_TRACK_TYPE_DEPTH_INVERSE:
|
||||
return "depth-inverse";
|
||||
case AUXILIARY_TRACK_TYPE_DEPTH_METADATA:
|
||||
return "depth metadata";
|
||||
default:
|
||||
throw new IllegalStateException("Unsupported auxiliary track type");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current time in milliseconds since the epoch.
|
||||
*
|
||||
|
@ -90,6 +90,11 @@ public final class DumpableFormat implements Dumper.Dumpable {
|
||||
format -> Util.getSelectionFlagStrings(format.selectionFlags));
|
||||
dumper.addIfNonDefault(
|
||||
"roleFlags", format, DEFAULT_FORMAT, format -> Util.getRoleFlagStrings(format.roleFlags));
|
||||
dumper.addIfNonDefault(
|
||||
"auxiliaryTrackType",
|
||||
format,
|
||||
DEFAULT_FORMAT,
|
||||
format -> Util.getAuxiliaryTrackTypeString(format.auxiliaryTrackType));
|
||||
dumper.addIfNonDefault("language", format, DEFAULT_FORMAT, format -> format.language);
|
||||
dumper.addIfNonDefault("label", format, DEFAULT_FORMAT, format -> format.label);
|
||||
if (!format.labels.isEmpty()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user