From 1b0e2fb75e53bea75544a35f69deafb3031e1253 Mon Sep 17 00:00:00 2001 From: sheenachhabra Date: Fri, 20 Dec 2024 07:55:32 -0800 Subject: [PATCH] Rename "setSampleCopyEnabled" to "setSampleCopyingEnabled" in muxer PiperOrigin-RevId: 708322440 --- RELEASENOTES.md | 2 ++ .../androidx/media3/muxer/FragmentedMp4Muxer.java | 14 +++++++------- .../main/java/androidx/media3/muxer/Mp4Muxer.java | 12 ++++++------ 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index f16a4bb256..6437d7aa29 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -26,6 +26,8 @@ * DRM: * Effect: * Muxers: + * Renamed `setSampleCopyEnabled()` method to `setSampleCopyingEnabled()` + in both `Mp4Muxer.Builder` and `FragmentedMp4Muxer.Builder`. * IMA extension: * Session: * UI: diff --git a/libraries/muxer/src/main/java/androidx/media3/muxer/FragmentedMp4Muxer.java b/libraries/muxer/src/main/java/androidx/media3/muxer/FragmentedMp4Muxer.java index 0c6551139a..07e5740c7c 100644 --- a/libraries/muxer/src/main/java/androidx/media3/muxer/FragmentedMp4Muxer.java +++ b/libraries/muxer/src/main/java/androidx/media3/muxer/FragmentedMp4Muxer.java @@ -128,7 +128,7 @@ public final class FragmentedMp4Muxer implements Muxer { *

The default value is {@code true}. */ @CanIgnoreReturnValue - public Builder setSampleCopyEnabled(boolean enabled) { + public Builder setSampleCopyingEnabled(boolean enabled) { this.sampleCopyEnabled = enabled; return this; } @@ -163,17 +163,17 @@ public final class FragmentedMp4Muxer implements Muxer { /** * {@inheritDoc} * - *

Samples are written to the disk in batches. If {@link Builder#setSampleCopyEnabled(boolean) - * sample copying} is disabled, the {@code byteBuffer} and the {@code bufferInfo} must not be - * modified after calling this method. Otherwise, they are copied and it is safe to modify them - * after this method returns. + *

Samples are written to the disk in batches. If {@link + * Builder#setSampleCopyingEnabled(boolean) sample copying} is disabled, the {@code byteBuffer} + * and the {@code bufferInfo} must not be modified after calling this method. Otherwise, they are + * copied and it is safe to modify them after this method returns. * *

Note: Out of order B-frames are currently not supported. * * @param trackToken The {@link TrackToken} for which this sample is being written. * @param byteBuffer The encoded sample. The muxer takes ownership of the buffer if {@link - * Builder#setSampleCopyEnabled(boolean) sample copying} is disabled. Otherwise, the position - * of the buffer is updated but the caller retains ownership. + * Builder#setSampleCopyingEnabled(boolean) sample copying} is disabled. Otherwise, the + * position of the buffer is updated but the caller retains ownership. * @param bufferInfo The {@link BufferInfo} related to this sample. * @throws MuxerException If there is any error while writing data to the disk. */ diff --git a/libraries/muxer/src/main/java/androidx/media3/muxer/Mp4Muxer.java b/libraries/muxer/src/main/java/androidx/media3/muxer/Mp4Muxer.java index f1d976974a..16f5c9b1b8 100644 --- a/libraries/muxer/src/main/java/androidx/media3/muxer/Mp4Muxer.java +++ b/libraries/muxer/src/main/java/androidx/media3/muxer/Mp4Muxer.java @@ -259,7 +259,7 @@ public final class Mp4Muxer implements Muxer { *

The default value is {@code true}. */ @CanIgnoreReturnValue - public Mp4Muxer.Builder setSampleCopyEnabled(boolean enabled) { + public Mp4Muxer.Builder setSampleCopyingEnabled(boolean enabled) { this.sampleCopyEnabled = enabled; return this; } @@ -442,15 +442,15 @@ public final class Mp4Muxer implements Muxer { *

When sample batching is {@linkplain Mp4Muxer.Builder#setSampleBatchingEnabled(boolean) * enabled}, provide sample data ({@link ByteBuffer}, {@link BufferInfo}) that won't be modified * after calling the {@link #writeSampleData(TrackToken, ByteBuffer, BufferInfo)} method, unless - * sample copying is also {@linkplain Mp4Muxer.Builder#setSampleCopyEnabled(boolean) enabled}. + * sample copying is also {@linkplain Mp4Muxer.Builder#setSampleCopyingEnabled(boolean) enabled}. * This ensures data integrity within the batch. If sample copying is {@linkplain - * Mp4Muxer.Builder#setSampleCopyEnabled(boolean) enabled}, it's safe to modify the data after the - * method returns, as the muxer internally creates a sample copy. + * Mp4Muxer.Builder#setSampleCopyingEnabled(boolean) enabled}, it's safe to modify the data after + * the method returns, as the muxer internally creates a sample copy. * * @param trackToken The {@link TrackToken} for which this sample is being written. * @param byteBuffer The encoded sample. The muxer takes ownership of the buffer if {@link - * Builder#setSampleCopyEnabled(boolean) sample copying} is disabled. Otherwise, the position - * of the buffer is updated but the caller retains ownership. + * Builder#setSampleCopyingEnabled(boolean) sample copying} is disabled. Otherwise, the + * position of the buffer is updated but the caller retains ownership. * @param bufferInfo The {@link BufferInfo} related to this sample. * @throws MuxerException If an error occurs while writing data to the output file. */