From 810cb6de649dfedc1f839503a813ae920e3fc2d1 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Tue, 14 Mar 2023 10:17:10 +0000 Subject: [PATCH 1/7] Shorten labels to fix transformer demo UI --- demos/transformer/src/main/res/values/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demos/transformer/src/main/res/values/strings.xml b/demos/transformer/src/main/res/values/strings.xml index 6f26949a59..cae40d8b3b 100644 --- a/demos/transformer/src/main/res/values/strings.xml +++ b/demos/transformer/src/main/res/values/strings.xml @@ -31,8 +31,8 @@ Enable debug preview Trim Request SDR tone-mapping (API 31+) - [Experimental] Force interpret HDR video as SDR (API 29+) - [Experimental] HDR editing (API 31+) + Interpret HDR as SDR (API 29+) + HDR editing (API 31+) Add demo effects Periodic vignette options Failed to load MediaPipe processor. Check the README for instructions. From 14b0dcb957435101df02f2ad835256d051571f7c Mon Sep 17 00:00:00 2001 From: ibaker Date: Fri, 3 Mar 2023 19:08:33 +0000 Subject: [PATCH 2/7] Add missing `@param` tags Dackka generates a warning if a method has at least one `@param` tag, but not all of them are documented. PiperOrigin-RevId: 513873453 (cherry picked from commit cb7d565fd47fc0b818ec0d5c7529e19df44022b5) --- .../src/main/java/androidx/media3/common/Timeline.java | 1 + .../src/main/java/androidx/media3/common/Tracks.java | 1 + .../src/main/java/androidx/media3/common/util/Util.java | 1 + .../java/androidx/media3/datasource/DataSourceUtil.java | 1 + .../java/androidx/media3/datasource/DefaultDataSource.java | 1 + .../java/androidx/media3/effect/BitmapTestUtil.java | 2 ++ .../androidx/media3/exoplayer/ExoPlaybackException.java | 2 ++ .../media3/exoplayer/drm/OfflineLicenseHelper.java | 1 + .../media3/exoplayer/mediacodec/MediaCodecRenderer.java | 1 + .../media3/exoplayer/offline/SegmentDownloader.java | 1 + .../exoplayer/trackselection/DefaultTrackSelector.java | 1 + .../exoplayer/trackselection/MappingTrackSelector.java | 1 + .../exoplayer/trackselection/RandomTrackSelection.java | 5 ++++- .../media3/exoplayer/video/DecoderVideoRenderer.java | 1 + .../androidx/media3/exoplayer/dash/DashChunkSource.java | 5 ++++- .../java/androidx/media3/exoplayer/hls/HlsMediaPeriod.java | 4 ++++ .../media3/exoplayer/hls/playlist/HlsMediaPlaylist.java | 4 ++++ .../java/androidx/media3/extractor/FlacFrameReader.java | 1 + .../media3/extractor/text/webvtt/WebvttCssStyle.java | 3 ++- .../main/java/androidx/media3/session/MediaSession.java | 1 + .../src/main/java/androidx/media3/test/utils/Action.java | 3 +++ .../java/androidx/media3/test/utils/ActionSchedule.java | 7 +++++-- .../java/androidx/media3/test/utils/ExtractorAsserts.java | 3 +++ .../java/androidx/media3/test/utils/FakeMediaPeriod.java | 1 + .../java/androidx/media3/test/utils/FakeMediaSource.java | 1 + .../main/java/androidx/media3/test/utils/FakeTimeline.java | 3 +++ .../androidx/media3/test/utils/MediaSourceTestRunner.java | 1 + .../java/androidx/media3/test/utils/TimelineAsserts.java | 1 + 28 files changed, 53 insertions(+), 5 deletions(-) diff --git a/libraries/common/src/main/java/androidx/media3/common/Timeline.java b/libraries/common/src/main/java/androidx/media3/common/Timeline.java index d470b37b52..81459888a1 100644 --- a/libraries/common/src/main/java/androidx/media3/common/Timeline.java +++ b/libraries/common/src/main/java/androidx/media3/common/Timeline.java @@ -813,6 +813,7 @@ public abstract class Timeline implements Bundleable { * adGroupIndex}, or {@link AdPlaybackState#AD_STATE_UNAVAILABLE} if not yet known. * * @param adGroupIndex The ad group index. + * @param adIndexInAdGroup The index of the ad in the ad group. * @return The state of the ad, or {@link AdPlaybackState#AD_STATE_UNAVAILABLE} if not yet * known. */ diff --git a/libraries/common/src/main/java/androidx/media3/common/Tracks.java b/libraries/common/src/main/java/androidx/media3/common/Tracks.java index 28d2e89a97..734a8306b8 100644 --- a/libraries/common/src/main/java/androidx/media3/common/Tracks.java +++ b/libraries/common/src/main/java/androidx/media3/common/Tracks.java @@ -297,6 +297,7 @@ public final class Tracks implements Bundleable { * Returns true if at least one track of type {@code trackType} is {@link * Group#isTrackSupported(int, boolean) supported}. * + * @param trackType The track type to query support for. * @param allowExceedsCapabilities Whether to consider the track as supported if it has a * supported {@link Format#sampleMimeType MIME type}, but otherwise exceeds the advertised * capabilities of the device. For example, a video track for which there's a corresponding diff --git a/libraries/common/src/main/java/androidx/media3/common/util/Util.java b/libraries/common/src/main/java/androidx/media3/common/util/Util.java index a079c488d9..638dce5813 100644 --- a/libraries/common/src/main/java/androidx/media3/common/util/Util.java +++ b/libraries/common/src/main/java/androidx/media3/common/util/Util.java @@ -1555,6 +1555,7 @@ public final class Util { * Returns the playout duration of {@code mediaDuration} of media. * * @param mediaDuration The duration to scale. + * @param speed The factor by which playback is sped up. * @return The scaled duration, in the same units as {@code mediaDuration}. */ @UnstableApi diff --git a/libraries/datasource/src/main/java/androidx/media3/datasource/DataSourceUtil.java b/libraries/datasource/src/main/java/androidx/media3/datasource/DataSourceUtil.java index e604619c7a..aa14615c8e 100644 --- a/libraries/datasource/src/main/java/androidx/media3/datasource/DataSourceUtil.java +++ b/libraries/datasource/src/main/java/androidx/media3/datasource/DataSourceUtil.java @@ -56,6 +56,7 @@ public final class DataSourceUtil { * array containing the read data. * * @param dataSource The source from which to read. + * @param length The number of bytes to read. * @return The read data. * @throws IOException If an error occurs reading from the source. * @throws IllegalStateException If the end of the source was reached before {@code length} bytes diff --git a/libraries/datasource/src/main/java/androidx/media3/datasource/DefaultDataSource.java b/libraries/datasource/src/main/java/androidx/media3/datasource/DefaultDataSource.java index 8a5e9d7df0..83de6a66e2 100644 --- a/libraries/datasource/src/main/java/androidx/media3/datasource/DefaultDataSource.java +++ b/libraries/datasource/src/main/java/androidx/media3/datasource/DefaultDataSource.java @@ -148,6 +148,7 @@ public final class DefaultDataSource implements DataSource { * Constructs a new instance, optionally configured to follow cross-protocol redirects. * * @param context A context. + * @param allowCrossProtocolRedirects Whether to allow cross-protocol redirects. */ @UnstableApi public DefaultDataSource(Context context, boolean allowCrossProtocolRedirects) { diff --git a/libraries/effect/src/androidTest/java/androidx/media3/effect/BitmapTestUtil.java b/libraries/effect/src/androidTest/java/androidx/media3/effect/BitmapTestUtil.java index dcab6d098e..5892df10cf 100644 --- a/libraries/effect/src/androidTest/java/androidx/media3/effect/BitmapTestUtil.java +++ b/libraries/effect/src/androidTest/java/androidx/media3/effect/BitmapTestUtil.java @@ -106,6 +106,8 @@ public class BitmapTestUtil { /** * Returns a solid {@link Bitmap} with every pixel having the same color. * + * @param width The width of image to create, in pixels. + * @param height The height of image to create, in pixels. * @param color An RGBA color created by {@link Color}. */ public static Bitmap createArgb8888BitmapWithSolidColor(int width, int height, int color) { diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/ExoPlaybackException.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/ExoPlaybackException.java index 82a958ce16..3dc08580af 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/ExoPlaybackException.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/ExoPlaybackException.java @@ -131,6 +131,8 @@ public final class ExoPlaybackException extends PlaybackException { * Creates an instance of type {@link #TYPE_RENDERER}. * * @param cause The cause of the failure. + * @param rendererName The {@linkplain Renderer#getName() name} of the renderer in which the + * failure occurred. * @param rendererIndex The index of the renderer in which the failure occurred. * @param rendererFormat The {@link Format} the renderer was using at the time of the exception, * or null if the renderer wasn't using a {@link Format}. diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/drm/OfflineLicenseHelper.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/drm/OfflineLicenseHelper.java index 3da5a1dbcd..ab7d4745d1 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/drm/OfflineLicenseHelper.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/drm/OfflineLicenseHelper.java @@ -100,6 +100,7 @@ public final class OfflineLicenseHelper { * their own license URL. * @param forceDefaultLicenseUrl Whether to use {@code defaultLicenseUrl} for key requests that * include their own license URL. + * @param dataSourceFactory A factory from which to obtain {@link DataSource} instances. * @param optionalKeyRequestParameters An optional map of parameters to pass as the last argument * to {@link MediaDrm#getKeyRequest}. May be null. * @param eventDispatcher A {@link DrmSessionEventListener.EventDispatcher} used to distribute diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/mediacodec/MediaCodecRenderer.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/mediacodec/MediaCodecRenderer.java index a752432fa0..1263bad907 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/mediacodec/MediaCodecRenderer.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/mediacodec/MediaCodecRenderer.java @@ -362,6 +362,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer { /** * @param trackType The {@link C.TrackType track type} that the renderer handles. + * @param codecAdapterFactory A factory for {@link MediaCodecAdapter} instances. * @param mediaCodecSelector A decoder selector. * @param enableDecoderFallback Whether to enable fallback to lower-priority decoders if decoder * initialization fails. This may result in using a decoder that is less efficient or slower diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/offline/SegmentDownloader.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/offline/SegmentDownloader.java index 7a8ac0ba2b..9026fe11fa 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/offline/SegmentDownloader.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/offline/SegmentDownloader.java @@ -326,6 +326,7 @@ public abstract class SegmentDownloader> impleme /** * Loads and parses a manifest. * + * @param dataSource The source to use when loading the manifest. * @param dataSpec The manifest {@link DataSpec}. * @param removing Whether the manifest is being loaded as part of the download being removed. * @return The loaded manifest. diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/DefaultTrackSelector.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/DefaultTrackSelector.java index 50a0ab216d..fcb61e3e8c 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/DefaultTrackSelector.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/DefaultTrackSelector.java @@ -2446,6 +2446,7 @@ public class DefaultTrackSelector extends MappingTrackSelector { * renderer, track group and track (in that order). * @param rendererMixedMimeTypeAdaptationSupports The {@link AdaptiveSupport} for mixed MIME type * adaptation for the renderer. + * @param params The parameters to use for the track selection. * @return The {@link ExoTrackSelection.Definition}s for the renderers. A null entry indicates no * selection was made. * @throws ExoPlaybackException If an error occurs while selecting the tracks. diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/MappingTrackSelector.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/MappingTrackSelector.java index 8f111e73ab..de8f026c39 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/MappingTrackSelector.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/MappingTrackSelector.java @@ -289,6 +289,7 @@ public abstract class MappingTrackSelector extends TrackSelector { * * @param rendererIndex The renderer index. * @param groupIndex The index of the track group. + * @param trackIndices The indices of the tracks in the track group for which to query support. * @return The {@link AdaptiveSupport}. */ public @AdaptiveSupport int getAdaptiveSupport( diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/RandomTrackSelection.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/RandomTrackSelection.java index 0db95a86bc..9e5d9a1b71 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/RandomTrackSelection.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/RandomTrackSelection.java @@ -68,12 +68,15 @@ public final class RandomTrackSelection extends BaseTrackSelection { private int selectedIndex; /** + * Creates a new instance. + * * @param group The {@link TrackGroup}. Must not be null. * @param tracks The indices of the selected tracks within the {@link TrackGroup}. Must not be * null or empty. May be in any order. + * @param type The {@link Type} of this track selection. * @param random A source of random numbers. */ - public RandomTrackSelection(TrackGroup group, int[] tracks, int type, Random random) { + public RandomTrackSelection(TrackGroup group, int[] tracks, @Type int type, Random random) { super(group, tracks, type); this.random = random; selectedIndex = random.nextInt(length); diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/DecoderVideoRenderer.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/DecoderVideoRenderer.java index 2f247237d2..e1e03f875b 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/DecoderVideoRenderer.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/DecoderVideoRenderer.java @@ -651,6 +651,7 @@ public abstract class DecoderVideoRenderer extends BaseRenderer { * *

The default implementation does not allow decoder reuse. * + * @param decoderName The name of the decoder. * @param oldFormat The previous format. * @param newFormat The new format. * @return The result of the evaluation. diff --git a/libraries/exoplayer_dash/src/main/java/androidx/media3/exoplayer/dash/DashChunkSource.java b/libraries/exoplayer_dash/src/main/java/androidx/media3/exoplayer/dash/DashChunkSource.java index 11c18a3970..f26c8fd734 100644 --- a/libraries/exoplayer_dash/src/main/java/androidx/media3/exoplayer/dash/DashChunkSource.java +++ b/libraries/exoplayer_dash/src/main/java/androidx/media3/exoplayer/dash/DashChunkSource.java @@ -50,6 +50,8 @@ public interface DashChunkSource extends ChunkSource { * if unknown. * @param enableEventMessageTrack Whether to output an event message track. * @param closedCaptionFormats The {@link Format Formats} of closed caption tracks to be output. + * @param playerEmsgHandler The track output to write emsg messages to, or null if emsgs + * shouldn't be written. * @param transferListener The transfer listener which should be informed of any data transfers. * May be null if no listener is available. * @param playerId The {@link PlayerId} of the player using this chunk source. @@ -75,8 +77,9 @@ public interface DashChunkSource extends ChunkSource { * Updates the manifest. * * @param newManifest The new manifest. + * @param newPeriodIndex The index of the period covered by {@code newManifest}. */ - void updateManifest(DashManifest newManifest, int periodIndex); + void updateManifest(DashManifest newManifest, int newPeriodIndex); /** * Updates the track selection. diff --git a/libraries/exoplayer_hls/src/main/java/androidx/media3/exoplayer/hls/HlsMediaPeriod.java b/libraries/exoplayer_hls/src/main/java/androidx/media3/exoplayer/hls/HlsMediaPeriod.java index c4bcfc50ec..63d2b931d1 100644 --- a/libraries/exoplayer_hls/src/main/java/androidx/media3/exoplayer/hls/HlsMediaPeriod.java +++ b/libraries/exoplayer_hls/src/main/java/androidx/media3/exoplayer/hls/HlsMediaPeriod.java @@ -104,13 +104,17 @@ public final class HlsMediaPeriod implements MediaPeriod, HlsPlaylistTracker.Pla * be null if no listener is available. * @param drmSessionManager The {@link DrmSessionManager} to acquire {@link DrmSession * DrmSessions} with. + * @param drmEventDispatcher A {@link DrmSessionEventListener.EventDispatcher} used to distribute + * DRM-related events. * @param loadErrorHandlingPolicy A {@link LoadErrorHandlingPolicy}. * @param eventDispatcher A dispatcher to notify of events. * @param allocator An {@link Allocator} from which to obtain media buffer allocations. * @param compositeSequenceableLoaderFactory A factory to create composite {@link * SequenceableLoader}s for when this media source loads data from multiple streams. * @param allowChunklessPreparation Whether chunkless preparation is allowed. + * @param metadataType The type of metadata to extract from the period. * @param useSessionKeys Whether to use #EXT-X-SESSION-KEY tags. + * @param playerId The ID of the current player. */ public HlsMediaPeriod( HlsExtractorFactory extractorFactory, diff --git a/libraries/exoplayer_hls/src/main/java/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.java b/libraries/exoplayer_hls/src/main/java/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.java index fb2444d4bb..5e6baec46b 100644 --- a/libraries/exoplayer_hls/src/main/java/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.java +++ b/libraries/exoplayer_hls/src/main/java/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.java @@ -462,16 +462,20 @@ public final class HlsMediaPlaylist extends HlsPlaylist { public final ServerControl serverControl; /** + * Constructs an instance. + * * @param playlistType See {@link #playlistType}. * @param baseUri See {@link #baseUri}. * @param tags See {@link #tags}. * @param startOffsetUs See {@link #startOffsetUs}. + * @param preciseStart See {@link #preciseStart}. * @param startTimeUs See {@link #startTimeUs}. * @param hasDiscontinuitySequence See {@link #hasDiscontinuitySequence}. * @param discontinuitySequence See {@link #discontinuitySequence}. * @param mediaSequence See {@link #mediaSequence}. * @param version See {@link #version}. * @param targetDurationUs See {@link #targetDurationUs}. + * @param partTargetDurationUs See {@link #partTargetDurationUs}. * @param hasIndependentSegments See {@link #hasIndependentSegments}. * @param hasEndTag See {@link #hasEndTag}. * @param hasProgramDateTime See {@link #hasProgramDateTime}. diff --git a/libraries/extractor/src/main/java/androidx/media3/extractor/FlacFrameReader.java b/libraries/extractor/src/main/java/androidx/media3/extractor/FlacFrameReader.java index 078982c6f0..79123d3c69 100644 --- a/libraries/extractor/src/main/java/androidx/media3/extractor/FlacFrameReader.java +++ b/libraries/extractor/src/main/java/androidx/media3/extractor/FlacFrameReader.java @@ -132,6 +132,7 @@ public final class FlacFrameReader { * there is no guarantee on the peek position. * * @param input Input stream to get the sample number from (starting from the read position). + * @param flacStreamMetadata The FLAC metadata of the stream. * @return The frame first sample number. * @throws ParserException If an error occurs parsing the sample number. * @throws IOException If peeking from the input fails. diff --git a/libraries/extractor/src/main/java/androidx/media3/extractor/text/webvtt/WebvttCssStyle.java b/libraries/extractor/src/main/java/androidx/media3/extractor/text/webvtt/WebvttCssStyle.java index e27eefdb0f..9908fe5a7b 100644 --- a/libraries/extractor/src/main/java/androidx/media3/extractor/text/webvtt/WebvttCssStyle.java +++ b/libraries/extractor/src/main/java/androidx/media3/extractor/text/webvtt/WebvttCssStyle.java @@ -152,12 +152,13 @@ public final class WebvttCssStyle { *

  • Universal selector matching scores 1. * * + *

    See also CSS Cascading. + * * @param id The id of the cue if present, {@code null} otherwise. * @param tag Name of the tag, {@code null} if it refers to the entire cue. * @param classes An array containing the classes the tag belongs to. Must not be null. * @param voice Annotated voice if present, {@code null} otherwise. * @return The score of the match, zero if there is no match. - * @see CSS Cascading */ public int getSpecificityScore( @Nullable String id, @Nullable String tag, Set classes, @Nullable String voice) { diff --git a/libraries/session/src/main/java/androidx/media3/session/MediaSession.java b/libraries/session/src/main/java/androidx/media3/session/MediaSession.java index c1cd0c6e4a..601920bbdc 100644 --- a/libraries/session/src/main/java/androidx/media3/session/MediaSession.java +++ b/libraries/session/src/main/java/androidx/media3/session/MediaSession.java @@ -816,6 +816,7 @@ public class MediaSession { * *

    A command is not accepted if it is not a custom command. * + * @param controller The controller to send the custom command to. * @param command A custom command. * @param args A {@link Bundle} for additional arguments. May be empty. * @return A {@link ListenableFuture} of {@link SessionResult} from the controller. diff --git a/libraries/test_utils/src/main/java/androidx/media3/test/utils/Action.java b/libraries/test_utils/src/main/java/androidx/media3/test/utils/Action.java index 5b5ed5b678..ac5aff5611 100644 --- a/libraries/test_utils/src/main/java/androidx/media3/test/utils/Action.java +++ b/libraries/test_utils/src/main/java/androidx/media3/test/utils/Action.java @@ -1098,7 +1098,10 @@ public abstract class Action { private final Runnable runnable; /** + * Constructs an instance. + * * @param tag A tag to use for logging. + * @param runnable The runnable to run. */ public ExecuteRunnable(@Size(max = 23) String tag, Runnable runnable) { super(tag, "ExecuteRunnable"); diff --git a/libraries/test_utils/src/main/java/androidx/media3/test/utils/ActionSchedule.java b/libraries/test_utils/src/main/java/androidx/media3/test/utils/ActionSchedule.java index 019b9c4699..beafa0419e 100644 --- a/libraries/test_utils/src/main/java/androidx/media3/test/utils/ActionSchedule.java +++ b/libraries/test_utils/src/main/java/androidx/media3/test/utils/ActionSchedule.java @@ -349,7 +349,7 @@ public final class ActionSchedule { } /** - * Schedules a set media items action to be executed. + * Schedules a set media source actions to be executed. * * @param mediaItemIndex The media item index to start playback from or {@link C#INDEX_UNSET} if * the playback position should not be reset. @@ -357,6 +357,7 @@ public final class ActionSchedule { * C#TIME_UNSET} is passed the default position is used. In any case, if {@code * mediaItemIndex} is set to {@link C#INDEX_UNSET} the position is not reset at all and this * parameter is ignored. + * @param sources The media sources to be set on the player. * @return The builder, for convenience. */ @CanIgnoreReturnValue @@ -365,9 +366,10 @@ public final class ActionSchedule { } /** - * Schedules a set media items action to be executed. + * Schedules a set media sources action to be executed. * * @param resetPosition Whether the playback position should be reset. + * @param sources The media sources to be set on the player. * @return The builder, for convenience. */ @CanIgnoreReturnValue @@ -490,6 +492,7 @@ public final class ActionSchedule { /** * Schedules sending a {@link PlayerMessage}. * + * @param target A message target. * @param positionMs The position in the current media item at which the message should be sent, * in milliseconds. * @return The builder, for convenience. diff --git a/libraries/test_utils/src/main/java/androidx/media3/test/utils/ExtractorAsserts.java b/libraries/test_utils/src/main/java/androidx/media3/test/utils/ExtractorAsserts.java index 3ed82c380a..979ac9d097 100644 --- a/libraries/test_utils/src/main/java/androidx/media3/test/utils/ExtractorAsserts.java +++ b/libraries/test_utils/src/main/java/androidx/media3/test/utils/ExtractorAsserts.java @@ -360,6 +360,9 @@ public final class ExtractorAsserts { * *

    The output of the extractor is compared against prerecorded dump files. * + * @param factory An {@link ExtractorFactory} which creates instances of the {@link Extractor} + * class which is to be tested. + * @param file The input file to pass to the extractor. * @param assertionConfig Details of how to read and process the source and dump files. * @param simulationConfig Details on the environment to simulate and behaviours to assert. * @throws IOException If reading from the input fails. diff --git a/libraries/test_utils/src/main/java/androidx/media3/test/utils/FakeMediaPeriod.java b/libraries/test_utils/src/main/java/androidx/media3/test/utils/FakeMediaPeriod.java index cd804fe5fe..7ec904028e 100644 --- a/libraries/test_utils/src/main/java/androidx/media3/test/utils/FakeMediaPeriod.java +++ b/libraries/test_utils/src/main/java/androidx/media3/test/utils/FakeMediaPeriod.java @@ -375,6 +375,7 @@ public class FakeMediaPeriod implements MediaPeriod { /** * Creates a new {@link FakeSampleStream}. * + * @param allocator An {@link Allocator} from which to obtain media buffer allocations. * @param mediaSourceEventDispatcher A {@link MediaSourceEventListener.EventDispatcher} to notify * of media events. * @param drmSessionManager A {@link DrmSessionManager} for DRM interactions. diff --git a/libraries/test_utils/src/main/java/androidx/media3/test/utils/FakeMediaSource.java b/libraries/test_utils/src/main/java/androidx/media3/test/utils/FakeMediaSource.java index c1c206ebf1..ee34c7db65 100644 --- a/libraries/test_utils/src/main/java/androidx/media3/test/utils/FakeMediaSource.java +++ b/libraries/test_utils/src/main/java/androidx/media3/test/utils/FakeMediaSource.java @@ -339,6 +339,7 @@ public class FakeMediaSource extends BaseMediaSource { * @param allocator An {@link Allocator} from which to obtain media buffer allocations. * @param mediaSourceEventDispatcher An {@link MediaSourceEventListener.EventDispatcher} to * dispatch media source events. + * @param drmSessionManager A {@link DrmSessionManager} to allow DRM interactions. * @param drmEventDispatcher An {@link MediaSourceEventListener.EventDispatcher} to dispatch DRM * events. * @param transferListener The transfer listener which should be informed of any data transfers. diff --git a/libraries/test_utils/src/main/java/androidx/media3/test/utils/FakeTimeline.java b/libraries/test_utils/src/main/java/androidx/media3/test/utils/FakeTimeline.java index 668da3bfdc..8b7ff8cad4 100644 --- a/libraries/test_utils/src/main/java/androidx/media3/test/utils/FakeTimeline.java +++ b/libraries/test_utils/src/main/java/androidx/media3/test/utils/FakeTimeline.java @@ -393,6 +393,7 @@ public final class FakeTimeline extends Timeline { /** * Creates a fake timeline with the given window definitions. * + * @param manifests The manifests of the windows. * @param windowDefinitions A list of {@link TimelineWindowDefinition}s. */ public FakeTimeline(Object[] manifests, TimelineWindowDefinition... windowDefinitions) { @@ -403,6 +404,8 @@ public final class FakeTimeline extends Timeline { * Creates a fake timeline with the given window definitions and {@link * androidx.media3.exoplayer.source.ShuffleOrder}. * + * @param manifests The manifests of the windows. + * @param shuffleOrder A shuffle ordering for the windows. * @param windowDefinitions A list of {@link TimelineWindowDefinition}s. */ public FakeTimeline( diff --git a/libraries/test_utils/src/main/java/androidx/media3/test/utils/MediaSourceTestRunner.java b/libraries/test_utils/src/main/java/androidx/media3/test/utils/MediaSourceTestRunner.java index c6c3970a79..7946e94345 100644 --- a/libraries/test_utils/src/main/java/androidx/media3/test/utils/MediaSourceTestRunner.java +++ b/libraries/test_utils/src/main/java/androidx/media3/test/utils/MediaSourceTestRunner.java @@ -152,6 +152,7 @@ public class MediaSourceTestRunner { * playback thread, asserting that a non-null {@link MediaPeriod} is returned. * * @param periodId The id of the period to create. + * @param startPositionUs The expected start position, in microseconds. * @return The created {@link MediaPeriod}. */ public MediaPeriod createPeriod(final MediaPeriodId periodId, long startPositionUs) { diff --git a/libraries/test_utils/src/main/java/androidx/media3/test/utils/TimelineAsserts.java b/libraries/test_utils/src/main/java/androidx/media3/test/utils/TimelineAsserts.java index 241a179fc4..c28e0f0926 100644 --- a/libraries/test_utils/src/main/java/androidx/media3/test/utils/TimelineAsserts.java +++ b/libraries/test_utils/src/main/java/androidx/media3/test/utils/TimelineAsserts.java @@ -50,6 +50,7 @@ public final class TimelineAsserts { /** * Asserts that window tags are set correctly. * + * @param timeline The timeline to read actual window tags from. * @param expectedWindowTags A list of expected window tags. If a tag is unknown or not important * {@code null} can be passed to skip this window. */ From e7f49a8cc8110dce8e6e7ec5d3d55d8b066a23f5 Mon Sep 17 00:00:00 2001 From: ibaker Date: Mon, 6 Mar 2023 12:17:13 +0000 Subject: [PATCH 3/7] Update templates to more clearly signpost between exoplayer2 and media3 Issue: google/ExoPlayer#11031 #minor-release PiperOrigin-RevId: 514366016 (cherry picked from commit 9c82923094400e0b840a983e55be26b1dd76e7d2) --- .github/ISSUE_TEMPLATE/bug.yml | 9 ++++++--- .github/ISSUE_TEMPLATE/feature_request.md | 9 +++++---- .github/ISSUE_TEMPLATE/question.md | 3 ++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index ab94d9922e..beaa1934a8 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -5,13 +5,16 @@ body: - type: markdown attributes: value: | - We can only process bug reports that are actionable. Unclear bug reports or reports with insufficient information may not get attention. + We can only process bug reports that are actionable. Unclear bug reports or reports with + insufficient information may not get attention. Before filing a bug: ------------------------- - - Search existing issues, including issues that are closed: https://github.com/androidx/media/issues?q=is%3Aissue - - For ExoPlayer-related bugs, please also check the ExoPlayer tracker: https://github.com/google/ExoPlayer/issues?q=is%3Aissue + - Search existing issues, including issues that are closed: + https://github.com/androidx/media/issues?q=is%3Aissue + - For ExoPlayer-related bugs, please also check for existing issues on the ExoPlayer + tracker: https://github.com/google/ExoPlayer/issues?q=is%3Aissue - type: dropdown attributes: label: Media3 Version diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 28967398b7..df760b72db 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -10,11 +10,12 @@ Before filing a feature request: ----------------------- - Search existing open issues, specifically with the label ‘enhancement’: https://github.com/androidx/media/labels/enhancement -- For ExoPlayer-related feature requests, please also check the ExoPlayer - tracker: +- For ExoPlayer-related feature requests, please also check for existing feature + requests on the ExoPlayer tracker: https://github.com/google/ExoPlayer/labels/enhancement -- Search existing pull requests: https://github.com/androidx/media/pulls, - https://github.com/google/ExoPlayer/pulls +- Search existing pull requests: + - On this tracker: https://github.com/androidx/media/pulls, + - On the ExoPlayer tracker: https://github.com/google/ExoPlayer/pulls When filing a feature request: ----------------------- diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index 820c3149c5..725b774911 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -15,7 +15,8 @@ Before filing a question: - Ask general Android development questions on Stack Overflow - Search existing issues, including issues that are closed https://github.com/androidx/media/issues?q=is%3Aissue -- For ExoPlayer-related questions, please also check the ExoPlayer tracker: +- For ExoPlayer-related questions, please also check for existing questions on + the ExoPlayer tracker: https://github.com/google/ExoPlayer/issues?q=is%3Aissue When filing a question: From 687362e6fe6f4af7a2f6a0a6bdf7b9bb021559b2 Mon Sep 17 00:00:00 2001 From: tonihei Date: Tue, 7 Mar 2023 16:00:41 +0000 Subject: [PATCH 4/7] Document that custom commands can only be sent if they are defined Custom commands from controller to session are blocked if they are not listed in the available session command list. This isn't well documented in the Javadoc currently. #minor-release PiperOrigin-RevId: 514733568 (cherry picked from commit 20669fca275554698c9176250005055b230485b3) --- .../main/java/androidx/media3/session/MediaController.java | 5 +++-- .../src/main/java/androidx/media3/session/MediaSession.java | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libraries/session/src/main/java/androidx/media3/session/MediaController.java b/libraries/session/src/main/java/androidx/media3/session/MediaController.java index 529be85dcc..44acda8293 100644 --- a/libraries/session/src/main/java/androidx/media3/session/MediaController.java +++ b/libraries/session/src/main/java/androidx/media3/session/MediaController.java @@ -905,13 +905,14 @@ public class MediaController implements Player { /** * Sends a custom command to the session. * + *

    A command is not accepted if it is not a custom command or the command is not in the list of + * {@linkplain #getAvailableSessionCommands() available session commands}. + * *

    Interoperability: When connected to {@link * android.support.v4.media.session.MediaSessionCompat}, {@link SessionResult#resultCode} will * return the custom result code from the {@code android.os.ResultReceiver#onReceiveResult(int, * Bundle)} instead of the standard result codes defined in the {@link SessionResult}. * - *

    A command is not accepted if it is not a custom command. - * * @param command The custom command. * @param args The additional arguments. May be empty. * @return A {@link ListenableFuture} of {@link SessionResult} representing the pending diff --git a/libraries/session/src/main/java/androidx/media3/session/MediaSession.java b/libraries/session/src/main/java/androidx/media3/session/MediaSession.java index 601920bbdc..3c82ec75d2 100644 --- a/libraries/session/src/main/java/androidx/media3/session/MediaSession.java +++ b/libraries/session/src/main/java/androidx/media3/session/MediaSession.java @@ -1042,6 +1042,10 @@ public class MediaSession { * Called when a controller sent a custom command through {@link * MediaController#sendCustomCommand(SessionCommand, Bundle)}. * + *

    {@link MediaController} instances are only allowed to send a command if the command has + * been added to the {@link MediaSession.ConnectionResult#availableSessionCommands list of + * available session commands} in {@link #onConnect} or set via {@link #setAvailableCommands}. + * *

    Interoperability: This will be also called by {@link * android.support.v4.media.MediaBrowserCompat#sendCustomAction}. If so, {@code extras} from * {@link android.support.v4.media.MediaBrowserCompat#sendCustomAction} will be considered as From bfdd09b3668bf64693e3dd1758f309a346c36676 Mon Sep 17 00:00:00 2001 From: tonihei Date: Mon, 13 Mar 2023 16:34:00 +0000 Subject: [PATCH 5/7] Update docs and READMEs for media3 stable release - The ExoPlayer docs will link to the media3 ones (for now, we can permanently redirect once no further stand-alone ExoPlayer release is published). - Contibuting issues and PRs should only happen on the media3 repo. - The media3 README is updated to remove any pre-release status information. PiperOrigin-RevId: 516234594 (cherry picked from commit bc873536f35e490a1c3d044182ecaf96dc781d3c) --- CONTRIBUTING.md | 6 ++---- README.md | 37 ++++++++++++++++++------------------- 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 18b494425a..87bf328019 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,12 +5,10 @@ We use the [AndroidX Media issue tracker][] to track bugs, feature requests and questions. -We are still handling ExoPlayer issues on the [ExoPlayer GitHub issue tracker][] -while the ExoPlayer and AndroidX Media projects coexist. - Before filing a new issue, please search the trackers to check if it's already covered by an existing report. Avoiding duplicates helps us maximize the time we -can spend fixing bugs and adding new features. +can spend fixing bugs and adding new features. You will also find older issues +on our [ExoPlayer GitHub issue tracker][]. When filing an issue, be sure to provide enough information for us to efficiently diagnose and reproduce the problem. In particular, please include diff --git a/README.md b/README.md index d0b375b92d..39a1e3e868 100644 --- a/README.md +++ b/README.md @@ -3,18 +3,27 @@ AndroidX Media is a collection of libraries for implementing media use cases on Android, including local playback (via ExoPlayer) and media sessions. -## Current status +## Documentation -AndroidX Media is currently in release candidate and we welcome your feedback -via the [issue tracker][]. Please consult the [release notes][] for more details -about the current release. +* The [developer guide][] provides a wealth of information. +* The [class reference][] documents the classes and methods. +* The [release notes][] document the major changes in each release. +* Follow our [developer blog][] to keep up to date with the latest + developments! -ExoPlayer's new home will be in AndroidX Media, but for now we are publishing it -both in AndroidX Media and via the existing [ExoPlayer project][] and we are -still handling ExoPlayer issues on the [ExoPlayer issue tracker][]. +[developer guide]: https://developer.android.com/guide/topics/media/media3 +[class reference]: https://developer.android.com/reference/androidx/media3/common/package-summary +[release notes]: RELEASENOTES.md +[developer blog]: https://medium.com/google-exoplayer -You'll find some [Media3 documentation on developer.android.com][], including a -[migration guide for existing ExoPlayer and MediaSession users][]. +## Migration for existing ExoPlayer and MediaSession projects + +You'll find a [migration guide for existing ExoPlayer and MediaSession users][] +on developer.android.com. + +[migration guide for existing ExoPlayer and MediaSession users]: https://developer.android.com/guide/topics/media/media3/getting-started/migration-guide + +## API stability AndroidX Media releases provide API stability guarantees, ensuring that the API surface remains backwards compatible for the most commonly used APIs. APIs @@ -22,17 +31,7 @@ intended for more advanced use cases are marked as unstable. To use an unstable method or class without lint warnings, you’ll need to add the OptIn annotation before using it. For more information see the [UnstableApi][] documentation. -For a high level overview of the initial version of AndroidX Media please see -the Android Dev Summit talk [What's next for AndroidX Media and ExoPlayer][]. - -[release notes]: RELEASENOTES.md -[issue tracker]: https://github.com/androidx/media/issues/new -[ExoPlayer project]: https://github.com/google/ExoPlayer -[ExoPlayer issue tracker]: https://github.com/google/ExoPlayer/issues [UnstableApi]: https://github.com/androidx/media/blob/main/libraries/common/src/main/java/androidx/media3/common/util/UnstableApi.java -[What's next for AndroidX Media and ExoPlayer]: https://youtu.be/sTIBDcyCmCg -[Media3 documentation on developer.android.com]: https://developer.android.com/guide/topics/media/media3 -[migration guide for existing ExoPlayer and MediaSession users]: https://developer.android.com/guide/topics/media/media3/getting-started/migration-guide ## Using the libraries From 7f435f0c7dad677772f9d00a04da2001ef10fc17 Mon Sep 17 00:00:00 2001 From: tonihei Date: Tue, 14 Mar 2023 10:44:41 +0000 Subject: [PATCH 6/7] Update release notes for Media3 1.0.0 / ExoPlayer 2.18.5 PiperOrigin-RevId: 516478351 (cherry picked from commit 2fe2161d1bd0a31ce99a45de8b59a6358fe582fd) --- RELEASENOTES.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index b5a6a75e46..535e4e4f1f 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,5 +1,12 @@ # Release notes +### 1.0.0 (2023-03-22) + +This release corresponds to the +[ExoPlayer 2.18.5 release](https://github.com/google/ExoPlayer/releases/tag/r2.18.5). + +There are no changes since 1.0.0-rc02. + ### 1.0.0-rc02 (2023-03-02) This release corresponds to the From dd2008b9ed5616e349a8dc76ff7d973863c0c532 Mon Sep 17 00:00:00 2001 From: tonihei Date: Tue, 14 Mar 2023 14:05:26 +0000 Subject: [PATCH 7/7] Bump version numbers to Media3 1.0.0 and ExoPlayer 2.18.5 #minor-release PiperOrigin-RevId: 516514583 (cherry picked from commit 137b40b76fe4f4d92ac02fbe56eb459693d80e2f) --- .github/ISSUE_TEMPLATE/bug.yml | 1 + constants.gradle | 4 ++-- .../main/java/androidx/media3/common/MediaLibraryInfo.java | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index beaa1934a8..ed6cef06fd 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -20,6 +20,7 @@ body: label: Media3 Version description: What version of Media3 are you using? options: + - 1.0.0 - 1.0.0-rc02 - 1.0.0-rc01 - 1.0.0-beta03 diff --git a/constants.gradle b/constants.gradle index f1fa589e94..c07fb57692 100644 --- a/constants.gradle +++ b/constants.gradle @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. project.ext { - releaseVersion = '1.0.0-rc02' - releaseVersionCode = 1_000_000_2_02 + releaseVersion = '1.0.0' + releaseVersionCode = 1_000_000_3_00 minSdkVersion = 16 appTargetSdkVersion = 33 // API version before restricting local file access. diff --git a/libraries/common/src/main/java/androidx/media3/common/MediaLibraryInfo.java b/libraries/common/src/main/java/androidx/media3/common/MediaLibraryInfo.java index 64cdc2d996..f1f2f0a81c 100644 --- a/libraries/common/src/main/java/androidx/media3/common/MediaLibraryInfo.java +++ b/libraries/common/src/main/java/androidx/media3/common/MediaLibraryInfo.java @@ -29,11 +29,11 @@ public final class MediaLibraryInfo { /** The version of the library expressed as a string, for example "1.2.3" or "1.2.3-beta01". */ // Intentionally hardcoded. Do not derive from other constants (e.g. VERSION_INT) or vice versa. - public static final String VERSION = "1.0.0-rc02"; + public static final String VERSION = "1.0.0"; /** The version of the library expressed as {@code TAG + "/" + VERSION}. */ // Intentionally hardcoded. Do not derive from other constants (e.g. VERSION) or vice versa. - public static final String VERSION_SLASHY = "AndroidXMedia3/1.0.0-rc02"; + public static final String VERSION_SLASHY = "AndroidXMedia3/1.0.0"; /** * The version of the library expressed as an integer, for example 1002003300. @@ -47,7 +47,7 @@ public final class MediaLibraryInfo { * (123-045-006-3-00). */ // Intentionally hardcoded. Do not derive from other constants (e.g. VERSION) or vice versa. - public static final int VERSION_INT = 1_000_000_2_02; + public static final int VERSION_INT = 1_000_000_3_00; /** Whether the library was compiled with {@link Assertions} checks enabled. */ public static final boolean ASSERTIONS_ENABLED = true;