From cebd57edc9116cddaf1148914a450b95af6c0bd5 Mon Sep 17 00:00:00 2001 From: tonihei Date: Mon, 25 Mar 2024 11:59:35 +0000 Subject: [PATCH] Additional clean-up and formatting --- RELEASENOTES.md | 3 + .../java/androidx/media3/common/Format.java | 90 +++++++++-------- .../java/androidx/media3/common/Label.java | 98 +++++++++---------- .../androidx/media3/common/FormatTest.java | 56 +++++++---- .../dash/manifest/DashManifestParser.java | 5 +- .../dash/manifest/DashManifestParserTest.java | 12 ++- .../media3/exoplayer/hls/HlsMediaPeriod.java | 2 +- .../media3/test/utils/DumpableFormat.java | 2 +- 8 files changed, 144 insertions(+), 124 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 0ccde8e7026..4b08366d420 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -3,6 +3,7 @@ ### Unreleased changes * Common Library: + * Add `Format.labels` to allow localized or other alternatives labels. * ExoPlayer: * Fix issue where `PreloadMediaPeriod` cannot retain the streams when it is preloaded again. @@ -100,6 +101,8 @@ * RTMP Extension: * HLS Extension: * DASH Extension: + * Populate all `Label` elements from the manifest into `Format.labels` + ([#1054](https://github.com/androidx/media/pull/1054)). * Smooth Streaming Extension: * RTSP Extension: * Skip empty session information values (i-tags) in SDP parsing diff --git a/libraries/common/src/main/java/androidx/media3/common/Format.java b/libraries/common/src/main/java/androidx/media3/common/Format.java index 28e19abed56..c27be24065c 100644 --- a/libraries/common/src/main/java/androidx/media3/common/Format.java +++ b/libraries/common/src/main/java/androidx/media3/common/Format.java @@ -15,6 +15,7 @@ */ package androidx.media3.common; +import static androidx.media3.common.util.Assertions.checkState; import static java.lang.annotation.ElementType.TYPE_USE; import android.os.Bundle; @@ -140,7 +141,7 @@ public static final class Builder { @Nullable private String id; @Nullable private String label; - @Nullable private List