mirror of
https://github.com/samsonjs/media.git
synced 2026-04-12 12:25:47 +00:00
Remove supportsSampleMimeType from Muxer.Factory
- This method is redundant with getSupportedSampleMimeTypes().
- This is to prepare the Muxer class to become public.
PiperOrigin-RevId: 480840902
(cherry picked from commit 2786db9e73)
This commit is contained in:
parent
3575b68020
commit
7a488a192b
5 changed files with 12 additions and 27 deletions
|
|
@ -26,7 +26,6 @@ import android.media.MediaFormat;
|
|||
import android.media.MediaMuxer;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.util.SparseLongArray;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.media3.common.C;
|
||||
import androidx.media3.common.Format;
|
||||
|
|
@ -97,13 +96,6 @@ import java.nio.ByteBuffer;
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsSampleMimeType(
|
||||
@Nullable String sampleMimeType, String containerMimeType) {
|
||||
return getSupportedSampleMimeTypes(MimeTypes.getTrackType(sampleMimeType), containerMimeType)
|
||||
.contains(sampleMimeType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImmutableList<String> getSupportedSampleMimeTypes(
|
||||
@C.TrackType int trackType, String containerMimeType) {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
package androidx.media3.transformer;
|
||||
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.C;
|
||||
import androidx.media3.common.Format;
|
||||
import androidx.media3.common.MimeTypes;
|
||||
|
|
@ -28,11 +27,12 @@ import java.nio.ByteBuffer;
|
|||
* Abstracts media muxing operations.
|
||||
*
|
||||
* <p>Query whether {@linkplain Factory#supportsOutputMimeType(String) container MIME type} and
|
||||
* {@linkplain Factory#supportsSampleMimeType(String, String) sample MIME types} are supported and
|
||||
* {@linkplain #addTrack(Format) add all tracks}, then {@linkplain #writeSampleData(int, ByteBuffer,
|
||||
* boolean, long) write sample data} to mux samples. Once any sample data has been written, it is
|
||||
* not possible to add tracks. After writing all sample data, {@linkplain #release(boolean) release}
|
||||
* the instance to finish writing to the output and return any resources to the system.
|
||||
* {@linkplain Factory#getSupportedSampleMimeTypes(int, String)} sample MIME types} are supported
|
||||
* and {@linkplain #addTrack(Format) add all tracks}, then {@linkplain #writeSampleData(int,
|
||||
* ByteBuffer, boolean, long) write sample data} to mux samples. Once any sample data has been
|
||||
* written, it is not possible to add tracks. After writing all sample data, {@linkplain
|
||||
* #release(boolean) release} the instance to finish writing to the output and return any resources
|
||||
* to the system.
|
||||
*/
|
||||
/* package */ interface Muxer {
|
||||
|
||||
|
|
@ -81,12 +81,6 @@ import java.nio.ByteBuffer;
|
|||
*/
|
||||
boolean supportsOutputMimeType(String mimeType);
|
||||
|
||||
/**
|
||||
* Returns whether the sample {@linkplain MimeTypes MIME type} is supported with the given
|
||||
* container {@linkplain MimeTypes MIME type}.
|
||||
*/
|
||||
boolean supportsSampleMimeType(@Nullable String sampleMimeType, String containerMimeType);
|
||||
|
||||
/**
|
||||
* Returns the supported sample {@linkplain MimeTypes MIME types} for the given {@link
|
||||
* C.TrackType} and container {@linkplain MimeTypes MIME type}.
|
||||
|
|
|
|||
|
|
@ -88,7 +88,8 @@ import java.nio.ByteBuffer;
|
|||
|
||||
/** Returns whether the sample {@linkplain MimeTypes MIME type} is supported. */
|
||||
public boolean supportsSampleMimeType(@Nullable String mimeType) {
|
||||
return muxerFactory.supportsSampleMimeType(mimeType, containerMimeType);
|
||||
@C.TrackType int trackType = MimeTypes.getTrackType(mimeType);
|
||||
return getSupportedSampleMimeTypes(trackType).contains(mimeType);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -485,7 +485,10 @@ public final class Transformer {
|
|||
|
||||
private void checkSampleMimeType(String sampleMimeType) {
|
||||
checkState(
|
||||
muxerFactory.supportsSampleMimeType(sampleMimeType, containerMimeType),
|
||||
muxerFactory
|
||||
.getSupportedSampleMimeTypes(
|
||||
MimeTypes.getTrackType(sampleMimeType), containerMimeType)
|
||||
.contains(sampleMimeType),
|
||||
"Unsupported sample MIME type "
|
||||
+ sampleMimeType
|
||||
+ " for container MIME type "
|
||||
|
|
|
|||
|
|
@ -882,11 +882,6 @@ public final class TransformerEndToEndTest {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsSampleMimeType(String sampleMimeType, String outputMimeType) {
|
||||
return frameworkMuxerFactory.supportsSampleMimeType(sampleMimeType, outputMimeType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImmutableList<String> getSupportedSampleMimeTypes(
|
||||
@C.TrackType int trackType, String containerMimeType) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue