mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +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.media.MediaMuxer;
|
||||||
import android.os.ParcelFileDescriptor;
|
import android.os.ParcelFileDescriptor;
|
||||||
import android.util.SparseLongArray;
|
import android.util.SparseLongArray;
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.annotation.RequiresApi;
|
import androidx.annotation.RequiresApi;
|
||||||
import androidx.media3.common.C;
|
import androidx.media3.common.C;
|
||||||
import androidx.media3.common.Format;
|
import androidx.media3.common.Format;
|
||||||
|
|
@ -97,13 +96,6 @@ import java.nio.ByteBuffer;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSampleMimeType(
|
|
||||||
@Nullable String sampleMimeType, String containerMimeType) {
|
|
||||||
return getSupportedSampleMimeTypes(MimeTypes.getTrackType(sampleMimeType), containerMimeType)
|
|
||||||
.contains(sampleMimeType);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ImmutableList<String> getSupportedSampleMimeTypes(
|
public ImmutableList<String> getSupportedSampleMimeTypes(
|
||||||
@C.TrackType int trackType, String containerMimeType) {
|
@C.TrackType int trackType, String containerMimeType) {
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
package androidx.media3.transformer;
|
package androidx.media3.transformer;
|
||||||
|
|
||||||
import android.os.ParcelFileDescriptor;
|
import android.os.ParcelFileDescriptor;
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.media3.common.C;
|
import androidx.media3.common.C;
|
||||||
import androidx.media3.common.Format;
|
import androidx.media3.common.Format;
|
||||||
import androidx.media3.common.MimeTypes;
|
import androidx.media3.common.MimeTypes;
|
||||||
|
|
@ -28,11 +27,12 @@ import java.nio.ByteBuffer;
|
||||||
* Abstracts media muxing operations.
|
* Abstracts media muxing operations.
|
||||||
*
|
*
|
||||||
* <p>Query whether {@linkplain Factory#supportsOutputMimeType(String) container MIME type} and
|
* <p>Query whether {@linkplain Factory#supportsOutputMimeType(String) container MIME type} and
|
||||||
* {@linkplain Factory#supportsSampleMimeType(String, String) sample MIME types} are supported and
|
* {@linkplain Factory#getSupportedSampleMimeTypes(int, String)} sample MIME types} are supported
|
||||||
* {@linkplain #addTrack(Format) add all tracks}, then {@linkplain #writeSampleData(int, ByteBuffer,
|
* and {@linkplain #addTrack(Format) add all tracks}, then {@linkplain #writeSampleData(int,
|
||||||
* boolean, long) write sample data} to mux samples. Once any sample data has been written, it is
|
* ByteBuffer, boolean, long) write sample data} to mux samples. Once any sample data has been
|
||||||
* not possible to add tracks. After writing all sample data, {@linkplain #release(boolean) release}
|
* written, it is not possible to add tracks. After writing all sample data, {@linkplain
|
||||||
* the instance to finish writing to the output and return any resources to the system.
|
* #release(boolean) release} the instance to finish writing to the output and return any resources
|
||||||
|
* to the system.
|
||||||
*/
|
*/
|
||||||
/* package */ interface Muxer {
|
/* package */ interface Muxer {
|
||||||
|
|
||||||
|
|
@ -81,12 +81,6 @@ import java.nio.ByteBuffer;
|
||||||
*/
|
*/
|
||||||
boolean supportsOutputMimeType(String mimeType);
|
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
|
* Returns the supported sample {@linkplain MimeTypes MIME types} for the given {@link
|
||||||
* C.TrackType} and container {@linkplain MimeTypes MIME type}.
|
* 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. */
|
/** Returns whether the sample {@linkplain MimeTypes MIME type} is supported. */
|
||||||
public boolean supportsSampleMimeType(@Nullable String mimeType) {
|
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) {
|
private void checkSampleMimeType(String sampleMimeType) {
|
||||||
checkState(
|
checkState(
|
||||||
muxerFactory.supportsSampleMimeType(sampleMimeType, containerMimeType),
|
muxerFactory
|
||||||
|
.getSupportedSampleMimeTypes(
|
||||||
|
MimeTypes.getTrackType(sampleMimeType), containerMimeType)
|
||||||
|
.contains(sampleMimeType),
|
||||||
"Unsupported sample MIME type "
|
"Unsupported sample MIME type "
|
||||||
+ sampleMimeType
|
+ sampleMimeType
|
||||||
+ " for container MIME type "
|
+ " for container MIME type "
|
||||||
|
|
|
||||||
|
|
@ -882,11 +882,6 @@ public final class TransformerEndToEndTest {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSampleMimeType(String sampleMimeType, String outputMimeType) {
|
|
||||||
return frameworkMuxerFactory.supportsSampleMimeType(sampleMimeType, outputMimeType);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ImmutableList<String> getSupportedSampleMimeTypes(
|
public ImmutableList<String> getSupportedSampleMimeTypes(
|
||||||
@C.TrackType int trackType, String containerMimeType) {
|
@C.TrackType int trackType, String containerMimeType) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue