Add toString to TrackGroup(Array)

These classes are often logged in error messages or tests. The
current output is just the hash code which makes it hard to debug.

PiperOrigin-RevId: 736799086
This commit is contained in:
tonihei 2025-03-14 02:56:12 -07:00 committed by Copybara-Service
parent d37f05238a
commit 54c64b41c4
2 changed files with 10 additions and 0 deletions

View File

@ -161,6 +161,11 @@ public final class TrackGroup {
return id.equals(other.id) && Arrays.equals(formats, other.formats);
}
@Override
public String toString() {
return id + ": " + Arrays.toString(formats);
}
private static final String FIELD_FORMATS = Util.intToStringMaxRadix(0);
private static final String FIELD_ID = Util.intToStringMaxRadix(1);

View File

@ -115,6 +115,11 @@ public final class TrackGroupArray {
return length == other.length && trackGroups.equals(other.trackGroups);
}
@Override
public String toString() {
return trackGroups.toString();
}
private static final String FIELD_TRACK_GROUPS = Util.intToStringMaxRadix(0);
public Bundle toBundle() {