mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Rename last sample duration behaviour enums
This is to improve readability. PiperOrigin-RevId: 670563611
This commit is contained in:
parent
1c61fbadf7
commit
a7788e0d60
@ -1241,16 +1241,15 @@ import org.checkerframework.checker.nullness.qual.PolyNull;
|
|||||||
@Mp4Muxer.LastSampleDurationBehavior int lastSampleDurationBehavior,
|
@Mp4Muxer.LastSampleDurationBehavior int lastSampleDurationBehavior,
|
||||||
int lastSampleDurationVuFromEndOfStream) {
|
int lastSampleDurationVuFromEndOfStream) {
|
||||||
switch (lastSampleDurationBehavior) {
|
switch (lastSampleDurationBehavior) {
|
||||||
case Mp4Muxer.LAST_SAMPLE_DURATION_BEHAVIOR_DUPLICATE_PREV_DURATION:
|
case Mp4Muxer.LAST_SAMPLE_DURATION_BEHAVIOR_DUPLICATE_PREVIOUS:
|
||||||
// For a track having less than 3 samples, duplicating the last frame duration will
|
// For a track having less than 3 samples, duplicating the last frame duration will
|
||||||
// significantly increase the overall track duration, so avoid that.
|
// significantly increase the overall track duration, so avoid that.
|
||||||
return sampleDurationsExceptLast.size() < 2
|
return sampleDurationsExceptLast.size() < 2
|
||||||
? 0
|
? 0
|
||||||
: Iterables.getLast(sampleDurationsExceptLast);
|
: Iterables.getLast(sampleDurationsExceptLast);
|
||||||
case Mp4Muxer.LAST_SAMPLE_DURATION_BEHAVIOR_INSERT_SHORT_SAMPLE:
|
case Mp4Muxer.LAST_SAMPLE_DURATION_BEHAVIOR_SET_TO_ZERO:
|
||||||
// Keep the last sample duration as short as possible.
|
|
||||||
return 0;
|
return 0;
|
||||||
case Mp4Muxer.LAST_SAMPLE_DURATION_BEHAVIOR_USING_END_OF_STREAM_FLAG:
|
case Mp4Muxer.LAST_SAMPLE_DURATION_BEHAVIOR_SET_FROM_END_OF_STREAM_BUFFER:
|
||||||
return lastSampleDurationVuFromEndOfStream;
|
return lastSampleDurationVuFromEndOfStream;
|
||||||
default:
|
default:
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
|
@ -23,6 +23,7 @@ import static androidx.media3.muxer.Boxes.BOX_HEADER_SIZE;
|
|||||||
import static androidx.media3.muxer.Boxes.MFHD_BOX_CONTENT_SIZE;
|
import static androidx.media3.muxer.Boxes.MFHD_BOX_CONTENT_SIZE;
|
||||||
import static androidx.media3.muxer.Boxes.TFHD_BOX_CONTENT_SIZE;
|
import static androidx.media3.muxer.Boxes.TFHD_BOX_CONTENT_SIZE;
|
||||||
import static androidx.media3.muxer.Boxes.getTrunBoxContentSize;
|
import static androidx.media3.muxer.Boxes.getTrunBoxContentSize;
|
||||||
|
import static androidx.media3.muxer.Mp4Muxer.LAST_SAMPLE_DURATION_BEHAVIOR_DUPLICATE_PREVIOUS;
|
||||||
import static androidx.media3.muxer.MuxerUtil.UNSIGNED_INT_MAX_VALUE;
|
import static androidx.media3.muxer.MuxerUtil.UNSIGNED_INT_MAX_VALUE;
|
||||||
import static java.lang.Math.max;
|
import static java.lang.Math.max;
|
||||||
import static java.lang.Math.min;
|
import static java.lang.Math.min;
|
||||||
@ -100,7 +101,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|||||||
this.annexBToAvccConverter = annexBToAvccConverter;
|
this.annexBToAvccConverter = annexBToAvccConverter;
|
||||||
this.fragmentDurationUs = fragmentDurationMs * 1_000;
|
this.fragmentDurationUs = fragmentDurationMs * 1_000;
|
||||||
this.sampleCopyEnabled = sampleCopyEnabled;
|
this.sampleCopyEnabled = sampleCopyEnabled;
|
||||||
lastSampleDurationBehavior = Mp4Muxer.LAST_SAMPLE_DURATION_BEHAVIOR_DUPLICATE_PREV_DURATION;
|
lastSampleDurationBehavior = LAST_SAMPLE_DURATION_BEHAVIOR_DUPLICATE_PREVIOUS;
|
||||||
tracks = new ArrayList<>();
|
tracks = new ArrayList<>();
|
||||||
minInputPresentationTimeUs = Long.MAX_VALUE;
|
minInputPresentationTimeUs = Long.MAX_VALUE;
|
||||||
currentFragmentSequenceNumber = 1;
|
currentFragmentSequenceNumber = 1;
|
||||||
@ -333,7 +334,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|||||||
? minInputPresentationTimeUs
|
? minInputPresentationTimeUs
|
||||||
: pendingSamplesBufferInfo.get(0).presentationTimeUs,
|
: pendingSamplesBufferInfo.get(0).presentationTimeUs,
|
||||||
track.videoUnitTimebase(),
|
track.videoUnitTimebase(),
|
||||||
Mp4Muxer.LAST_SAMPLE_DURATION_BEHAVIOR_DUPLICATE_PREV_DURATION,
|
LAST_SAMPLE_DURATION_BEHAVIOR_DUPLICATE_PREVIOUS,
|
||||||
track.endOfStreamTimestampUs);
|
track.endOfStreamTimestampUs);
|
||||||
|
|
||||||
List<Integer> sampleCompositionTimeOffsets =
|
List<Integer> sampleCompositionTimeOffsets =
|
||||||
|
@ -146,20 +146,20 @@ public final class Mp4Muxer implements Muxer {
|
|||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
@Target(TYPE_USE)
|
@Target(TYPE_USE)
|
||||||
@IntDef({
|
@IntDef({
|
||||||
LAST_SAMPLE_DURATION_BEHAVIOR_INSERT_SHORT_SAMPLE,
|
LAST_SAMPLE_DURATION_BEHAVIOR_SET_TO_ZERO,
|
||||||
LAST_SAMPLE_DURATION_BEHAVIOR_DUPLICATE_PREV_DURATION,
|
LAST_SAMPLE_DURATION_BEHAVIOR_DUPLICATE_PREVIOUS,
|
||||||
LAST_SAMPLE_DURATION_BEHAVIOR_USING_END_OF_STREAM_FLAG
|
LAST_SAMPLE_DURATION_BEHAVIOR_SET_FROM_END_OF_STREAM_BUFFER
|
||||||
})
|
})
|
||||||
public @interface LastSampleDurationBehavior {}
|
public @interface LastSampleDurationBehavior {}
|
||||||
|
|
||||||
/** The duration of the last sample is set to 0. */
|
/** The duration of the last sample is set to 0. */
|
||||||
public static final int LAST_SAMPLE_DURATION_BEHAVIOR_INSERT_SHORT_SAMPLE = 0;
|
public static final int LAST_SAMPLE_DURATION_BEHAVIOR_SET_TO_ZERO = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use the difference between the last timestamp and the one before that as the duration of the
|
* Use the difference between the last timestamp and the one before that as the duration of the
|
||||||
* last sample.
|
* last sample.
|
||||||
*/
|
*/
|
||||||
public static final int LAST_SAMPLE_DURATION_BEHAVIOR_DUPLICATE_PREV_DURATION = 1;
|
public static final int LAST_SAMPLE_DURATION_BEHAVIOR_DUPLICATE_PREVIOUS = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use the {@link MediaCodec#BUFFER_FLAG_END_OF_STREAM end of stream sample} to set the duration
|
* Use the {@link MediaCodec#BUFFER_FLAG_END_OF_STREAM end of stream sample} to set the duration
|
||||||
@ -176,7 +176,7 @@ public final class Mp4Muxer implements Muxer {
|
|||||||
* <p>If no explicit {@link MediaCodec#BUFFER_FLAG_END_OF_STREAM} sample is passed, then the
|
* <p>If no explicit {@link MediaCodec#BUFFER_FLAG_END_OF_STREAM} sample is passed, then the
|
||||||
* duration of the last sample will be set to 0.
|
* duration of the last sample will be set to 0.
|
||||||
*/
|
*/
|
||||||
public static final int LAST_SAMPLE_DURATION_BEHAVIOR_USING_END_OF_STREAM_FLAG = 2;
|
public static final int LAST_SAMPLE_DURATION_BEHAVIOR_SET_FROM_END_OF_STREAM_BUFFER = 2;
|
||||||
|
|
||||||
/** The specific MP4 file format. */
|
/** The specific MP4 file format. */
|
||||||
@Documented
|
@Documented
|
||||||
@ -216,7 +216,7 @@ public final class Mp4Muxer implements Muxer {
|
|||||||
*/
|
*/
|
||||||
public Builder(FileOutputStream outputStream) {
|
public Builder(FileOutputStream outputStream) {
|
||||||
this.outputStream = outputStream;
|
this.outputStream = outputStream;
|
||||||
lastSampleDurationBehavior = LAST_SAMPLE_DURATION_BEHAVIOR_INSERT_SHORT_SAMPLE;
|
lastSampleDurationBehavior = LAST_SAMPLE_DURATION_BEHAVIOR_SET_TO_ZERO;
|
||||||
sampleCopyEnabled = true;
|
sampleCopyEnabled = true;
|
||||||
attemptStreamableOutputEnabled = true;
|
attemptStreamableOutputEnabled = true;
|
||||||
outputFileFormat = FILE_FORMAT_DEFAULT;
|
outputFileFormat = FILE_FORMAT_DEFAULT;
|
||||||
@ -225,7 +225,7 @@ public final class Mp4Muxer implements Muxer {
|
|||||||
/**
|
/**
|
||||||
* Sets the {@link LastSampleDurationBehavior}.
|
* Sets the {@link LastSampleDurationBehavior}.
|
||||||
*
|
*
|
||||||
* <p>The default value is {@link #LAST_SAMPLE_DURATION_BEHAVIOR_INSERT_SHORT_SAMPLE}.
|
* <p>The default value is {@link #LAST_SAMPLE_DURATION_BEHAVIOR_SET_TO_ZERO}.
|
||||||
*/
|
*/
|
||||||
@CanIgnoreReturnValue
|
@CanIgnoreReturnValue
|
||||||
public Mp4Muxer.Builder setLastSampleDurationBehavior(
|
public Mp4Muxer.Builder setLastSampleDurationBehavior(
|
||||||
|
@ -15,8 +15,9 @@
|
|||||||
*/
|
*/
|
||||||
package androidx.media3.muxer;
|
package androidx.media3.muxer;
|
||||||
|
|
||||||
import static androidx.media3.muxer.Mp4Muxer.LAST_SAMPLE_DURATION_BEHAVIOR_DUPLICATE_PREV_DURATION;
|
import static androidx.media3.muxer.Mp4Muxer.LAST_SAMPLE_DURATION_BEHAVIOR_DUPLICATE_PREVIOUS;
|
||||||
import static androidx.media3.muxer.Mp4Muxer.LAST_SAMPLE_DURATION_BEHAVIOR_INSERT_SHORT_SAMPLE;
|
import static androidx.media3.muxer.Mp4Muxer.LAST_SAMPLE_DURATION_BEHAVIOR_SET_FROM_END_OF_STREAM_BUFFER;
|
||||||
|
import static androidx.media3.muxer.Mp4Muxer.LAST_SAMPLE_DURATION_BEHAVIOR_SET_TO_ZERO;
|
||||||
import static androidx.media3.muxer.MuxerTestUtil.FAKE_AUDIO_FORMAT;
|
import static androidx.media3.muxer.MuxerTestUtil.FAKE_AUDIO_FORMAT;
|
||||||
import static androidx.media3.muxer.MuxerTestUtil.FAKE_CSD_0;
|
import static androidx.media3.muxer.MuxerTestUtil.FAKE_CSD_0;
|
||||||
import static androidx.media3.muxer.MuxerTestUtil.FAKE_VIDEO_FORMAT;
|
import static androidx.media3.muxer.MuxerTestUtil.FAKE_VIDEO_FORMAT;
|
||||||
@ -477,7 +478,7 @@ public class BoxesTest {
|
|||||||
sampleBufferInfos,
|
sampleBufferInfos,
|
||||||
/* firstSamplePresentationTimeUs= */ 0L,
|
/* firstSamplePresentationTimeUs= */ 0L,
|
||||||
VU_TIMEBASE,
|
VU_TIMEBASE,
|
||||||
LAST_SAMPLE_DURATION_BEHAVIOR_INSERT_SHORT_SAMPLE,
|
LAST_SAMPLE_DURATION_BEHAVIOR_SET_TO_ZERO,
|
||||||
C.TIME_UNSET);
|
C.TIME_UNSET);
|
||||||
|
|
||||||
assertThat(durationsVu).containsExactly(0);
|
assertThat(durationsVu).containsExactly(0);
|
||||||
@ -494,7 +495,7 @@ public class BoxesTest {
|
|||||||
sampleBufferInfos,
|
sampleBufferInfos,
|
||||||
/* firstSamplePresentationTimeUs= */ 0L,
|
/* firstSamplePresentationTimeUs= */ 0L,
|
||||||
VU_TIMEBASE,
|
VU_TIMEBASE,
|
||||||
LAST_SAMPLE_DURATION_BEHAVIOR_INSERT_SHORT_SAMPLE,
|
LAST_SAMPLE_DURATION_BEHAVIOR_SET_TO_ZERO,
|
||||||
C.TIME_UNSET);
|
C.TIME_UNSET);
|
||||||
|
|
||||||
assertThat(durationsVu).containsExactly(0);
|
assertThat(durationsVu).containsExactly(0);
|
||||||
@ -511,7 +512,7 @@ public class BoxesTest {
|
|||||||
sampleBufferInfos,
|
sampleBufferInfos,
|
||||||
/* firstSamplePresentationTimeUs= */ 0L,
|
/* firstSamplePresentationTimeUs= */ 0L,
|
||||||
VU_TIMEBASE,
|
VU_TIMEBASE,
|
||||||
LAST_SAMPLE_DURATION_BEHAVIOR_INSERT_SHORT_SAMPLE,
|
LAST_SAMPLE_DURATION_BEHAVIOR_SET_TO_ZERO,
|
||||||
C.TIME_UNSET);
|
C.TIME_UNSET);
|
||||||
|
|
||||||
assertThat(durationsVu).containsExactly(3_000, 5_000, 0);
|
assertThat(durationsVu).containsExactly(3_000, 5_000, 0);
|
||||||
@ -528,7 +529,7 @@ public class BoxesTest {
|
|||||||
sampleBufferInfos,
|
sampleBufferInfos,
|
||||||
/* firstSamplePresentationTimeUs= */ 0L,
|
/* firstSamplePresentationTimeUs= */ 0L,
|
||||||
VU_TIMEBASE,
|
VU_TIMEBASE,
|
||||||
LAST_SAMPLE_DURATION_BEHAVIOR_DUPLICATE_PREV_DURATION,
|
LAST_SAMPLE_DURATION_BEHAVIOR_DUPLICATE_PREVIOUS,
|
||||||
C.TIME_UNSET);
|
C.TIME_UNSET);
|
||||||
|
|
||||||
assertThat(durationsVu).containsExactly(3_000, 5_000, 5_000);
|
assertThat(durationsVu).containsExactly(3_000, 5_000, 5_000);
|
||||||
@ -545,7 +546,7 @@ public class BoxesTest {
|
|||||||
sampleBufferInfos,
|
sampleBufferInfos,
|
||||||
/* firstSamplePresentationTimeUs= */ 0L,
|
/* firstSamplePresentationTimeUs= */ 0L,
|
||||||
VU_TIMEBASE,
|
VU_TIMEBASE,
|
||||||
LAST_SAMPLE_DURATION_BEHAVIOR_INSERT_SHORT_SAMPLE,
|
LAST_SAMPLE_DURATION_BEHAVIOR_SET_TO_ZERO,
|
||||||
C.TIME_UNSET);
|
C.TIME_UNSET);
|
||||||
|
|
||||||
assertThat(durationsVu).containsExactly(100, 100, 800, 100, 0);
|
assertThat(durationsVu).containsExactly(100, 100, 800, 100, 0);
|
||||||
@ -562,7 +563,7 @@ public class BoxesTest {
|
|||||||
sampleBufferInfos,
|
sampleBufferInfos,
|
||||||
/* firstSamplePresentationTimeUs= */ 0L,
|
/* firstSamplePresentationTimeUs= */ 0L,
|
||||||
VU_TIMEBASE,
|
VU_TIMEBASE,
|
||||||
Mp4Muxer.LAST_SAMPLE_DURATION_BEHAVIOR_USING_END_OF_STREAM_FLAG,
|
LAST_SAMPLE_DURATION_BEHAVIOR_SET_FROM_END_OF_STREAM_BUFFER,
|
||||||
/* endOfStreamTimestampUs= */ 10_000);
|
/* endOfStreamTimestampUs= */ 10_000);
|
||||||
|
|
||||||
assertThat(durationsVu).containsExactly(100, 100, 100, 100, 600);
|
assertThat(durationsVu).containsExactly(100, 100, 100, 100, 600);
|
||||||
@ -617,7 +618,7 @@ public class BoxesTest {
|
|||||||
sampleBufferInfos,
|
sampleBufferInfos,
|
||||||
/* firstSamplePresentationTimeUs= */ 0L,
|
/* firstSamplePresentationTimeUs= */ 0L,
|
||||||
VU_TIMEBASE,
|
VU_TIMEBASE,
|
||||||
LAST_SAMPLE_DURATION_BEHAVIOR_INSERT_SHORT_SAMPLE,
|
LAST_SAMPLE_DURATION_BEHAVIOR_SET_TO_ZERO,
|
||||||
C.TIME_UNSET);
|
C.TIME_UNSET);
|
||||||
|
|
||||||
ByteBuffer cttsBox = Boxes.ctts(sampleBufferInfos, durationsVu, VU_TIMEBASE);
|
ByteBuffer cttsBox = Boxes.ctts(sampleBufferInfos, durationsVu, VU_TIMEBASE);
|
||||||
@ -635,7 +636,7 @@ public class BoxesTest {
|
|||||||
sampleBufferInfos,
|
sampleBufferInfos,
|
||||||
/* firstSamplePresentationTimeUs= */ 0L,
|
/* firstSamplePresentationTimeUs= */ 0L,
|
||||||
VU_TIMEBASE,
|
VU_TIMEBASE,
|
||||||
LAST_SAMPLE_DURATION_BEHAVIOR_INSERT_SHORT_SAMPLE,
|
LAST_SAMPLE_DURATION_BEHAVIOR_SET_TO_ZERO,
|
||||||
C.TIME_UNSET);
|
C.TIME_UNSET);
|
||||||
|
|
||||||
ByteBuffer cttsBox = Boxes.ctts(sampleBufferInfos, durationsVu, VU_TIMEBASE);
|
ByteBuffer cttsBox = Boxes.ctts(sampleBufferInfos, durationsVu, VU_TIMEBASE);
|
||||||
@ -655,7 +656,7 @@ public class BoxesTest {
|
|||||||
sampleBufferInfos,
|
sampleBufferInfos,
|
||||||
/* firstSamplePresentationTimeUs= */ 0L,
|
/* firstSamplePresentationTimeUs= */ 0L,
|
||||||
VU_TIMEBASE,
|
VU_TIMEBASE,
|
||||||
LAST_SAMPLE_DURATION_BEHAVIOR_INSERT_SHORT_SAMPLE,
|
LAST_SAMPLE_DURATION_BEHAVIOR_SET_TO_ZERO,
|
||||||
C.TIME_UNSET);
|
C.TIME_UNSET);
|
||||||
|
|
||||||
ByteBuffer cttsBox = Boxes.ctts(sampleBufferInfos, durationsVu, VU_TIMEBASE);
|
ByteBuffer cttsBox = Boxes.ctts(sampleBufferInfos, durationsVu, VU_TIMEBASE);
|
||||||
@ -676,7 +677,7 @@ public class BoxesTest {
|
|||||||
sampleBufferInfos,
|
sampleBufferInfos,
|
||||||
/* firstSamplePresentationTimeUs= */ 23698215060L,
|
/* firstSamplePresentationTimeUs= */ 23698215060L,
|
||||||
VU_TIMEBASE,
|
VU_TIMEBASE,
|
||||||
LAST_SAMPLE_DURATION_BEHAVIOR_INSERT_SHORT_SAMPLE,
|
LAST_SAMPLE_DURATION_BEHAVIOR_SET_TO_ZERO,
|
||||||
C.TIME_UNSET);
|
C.TIME_UNSET);
|
||||||
|
|
||||||
ByteBuffer cttsBox = Boxes.ctts(sampleBufferInfos, durationsVu, VU_TIMEBASE);
|
ByteBuffer cttsBox = Boxes.ctts(sampleBufferInfos, durationsVu, VU_TIMEBASE);
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package androidx.media3.muxer;
|
package androidx.media3.muxer;
|
||||||
|
|
||||||
|
import static androidx.media3.muxer.Mp4Muxer.LAST_SAMPLE_DURATION_BEHAVIOR_SET_FROM_END_OF_STREAM_BUFFER;
|
||||||
import static androidx.media3.muxer.MuxerTestUtil.FAKE_VIDEO_FORMAT;
|
import static androidx.media3.muxer.MuxerTestUtil.FAKE_VIDEO_FORMAT;
|
||||||
import static androidx.media3.muxer.MuxerTestUtil.XMP_SAMPLE_DATA;
|
import static androidx.media3.muxer.MuxerTestUtil.XMP_SAMPLE_DATA;
|
||||||
import static androidx.media3.muxer.MuxerTestUtil.getFakeSampleAndSampleInfo;
|
import static androidx.media3.muxer.MuxerTestUtil.getFakeSampleAndSampleInfo;
|
||||||
@ -682,7 +683,7 @@ public class Mp4MuxerEndToEndTest {
|
|||||||
Mp4Muxer mp4Muxer =
|
Mp4Muxer mp4Muxer =
|
||||||
new Mp4Muxer.Builder(new FileOutputStream(outputFilePath))
|
new Mp4Muxer.Builder(new FileOutputStream(outputFilePath))
|
||||||
.setLastSampleDurationBehavior(
|
.setLastSampleDurationBehavior(
|
||||||
Mp4Muxer.LAST_SAMPLE_DURATION_BEHAVIOR_USING_END_OF_STREAM_FLAG)
|
LAST_SAMPLE_DURATION_BEHAVIOR_SET_FROM_END_OF_STREAM_BUFFER)
|
||||||
.build();
|
.build();
|
||||||
mp4Muxer.addMetadataEntry(
|
mp4Muxer.addMetadataEntry(
|
||||||
new Mp4TimestampData(
|
new Mp4TimestampData(
|
||||||
@ -730,7 +731,7 @@ public class Mp4MuxerEndToEndTest {
|
|||||||
Mp4Muxer mp4Muxer =
|
Mp4Muxer mp4Muxer =
|
||||||
new Mp4Muxer.Builder(new FileOutputStream(outputFilePath))
|
new Mp4Muxer.Builder(new FileOutputStream(outputFilePath))
|
||||||
.setLastSampleDurationBehavior(
|
.setLastSampleDurationBehavior(
|
||||||
Mp4Muxer.LAST_SAMPLE_DURATION_BEHAVIOR_USING_END_OF_STREAM_FLAG)
|
LAST_SAMPLE_DURATION_BEHAVIOR_SET_FROM_END_OF_STREAM_BUFFER)
|
||||||
.build();
|
.build();
|
||||||
mp4Muxer.addMetadataEntry(
|
mp4Muxer.addMetadataEntry(
|
||||||
new Mp4TimestampData(
|
new Mp4TimestampData(
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
package androidx.media3.transformer;
|
package androidx.media3.transformer;
|
||||||
|
|
||||||
import static androidx.media3.common.util.Assertions.checkNotNull;
|
import static androidx.media3.common.util.Assertions.checkNotNull;
|
||||||
|
import static androidx.media3.muxer.Mp4Muxer.LAST_SAMPLE_DURATION_BEHAVIOR_SET_FROM_END_OF_STREAM_BUFFER;
|
||||||
|
|
||||||
import android.media.MediaCodec;
|
import android.media.MediaCodec;
|
||||||
import android.media.MediaCodec.BufferInfo;
|
import android.media.MediaCodec.BufferInfo;
|
||||||
@ -185,7 +186,7 @@ public final class InAppMuxer implements Muxer {
|
|||||||
Mp4Muxer.Builder builder = new Mp4Muxer.Builder(outputStream);
|
Mp4Muxer.Builder builder = new Mp4Muxer.Builder(outputStream);
|
||||||
if (videoDurationUs != C.TIME_UNSET) {
|
if (videoDurationUs != C.TIME_UNSET) {
|
||||||
builder.setLastSampleDurationBehavior(
|
builder.setLastSampleDurationBehavior(
|
||||||
Mp4Muxer.LAST_SAMPLE_DURATION_BEHAVIOR_USING_END_OF_STREAM_FLAG);
|
LAST_SAMPLE_DURATION_BEHAVIOR_SET_FROM_END_OF_STREAM_BUFFER);
|
||||||
}
|
}
|
||||||
muxer = builder.build();
|
muxer = builder.build();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user