mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Add Lint.IfChange/ThenChange for muxer codec support logic
Updating the list of supported codec in Mp4Muxer and FragmenetdMp4Muxer is often missed when a new codec is added in Boxes.java. PiperOrigin-RevId: 726397337
This commit is contained in:
parent
38cfd7dc36
commit
56bd32da96
@ -688,6 +688,7 @@ import org.checkerframework.checker.nullness.qual.PolyNull;
|
||||
@SuppressWarnings("MergeCases")
|
||||
public static ByteBuffer codecSpecificBox(Format format) {
|
||||
String mimeType = checkNotNull(format.sampleMimeType);
|
||||
// LINT.IfChange(codec_specific_boxes)
|
||||
switch (mimeType) {
|
||||
case MimeTypes.AUDIO_AAC:
|
||||
case MimeTypes.AUDIO_VORBIS:
|
||||
@ -717,6 +718,8 @@ import org.checkerframework.checker.nullness.qual.PolyNull;
|
||||
default:
|
||||
throw new IllegalArgumentException("Unsupported format: " + mimeType);
|
||||
}
|
||||
// LINT.ThenChange(Mp4Muxer.java:supported_mime_types,
|
||||
// FragmentedMp4Muxer.java:supported_mime_types)
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -143,6 +143,7 @@ public final class FragmentedMp4Muxer implements AutoCloseable {
|
||||
}
|
||||
}
|
||||
|
||||
// LINT.IfChange(supported_mime_types)
|
||||
/** A list of supported video {@linkplain MimeTypes sample MIME types}. */
|
||||
public static final ImmutableList<String> SUPPORTED_VIDEO_SAMPLE_MIME_TYPES =
|
||||
ImmutableList.of(
|
||||
@ -162,6 +163,8 @@ public final class FragmentedMp4Muxer implements AutoCloseable {
|
||||
MimeTypes.AUDIO_VORBIS,
|
||||
MimeTypes.AUDIO_RAW);
|
||||
|
||||
// LINT.ThenChange(Boxes.java:codec_specific_boxes)
|
||||
|
||||
private final FragmentedMp4Writer fragmentedMp4Writer;
|
||||
private final MetadataCollector metadataCollector;
|
||||
private final SparseArray<Track> trackIdToTrack;
|
||||
|
@ -346,6 +346,7 @@ public final class Mp4Muxer implements AutoCloseable {
|
||||
}
|
||||
}
|
||||
|
||||
// LINT.IfChange(supported_mime_types)
|
||||
/** A list of supported video {@linkplain MimeTypes sample MIME types}. */
|
||||
public static final ImmutableList<String> SUPPORTED_VIDEO_SAMPLE_MIME_TYPES =
|
||||
ImmutableList.of(
|
||||
@ -365,6 +366,8 @@ public final class Mp4Muxer implements AutoCloseable {
|
||||
MimeTypes.AUDIO_VORBIS,
|
||||
MimeTypes.AUDIO_RAW);
|
||||
|
||||
// LINT.ThenChange(Boxes.java:codec_specific_boxes)
|
||||
|
||||
private static final String TAG = "Mp4Muxer";
|
||||
|
||||
private final FileOutputStream outputStream;
|
||||
|
Loading…
x
Reference in New Issue
Block a user