media3: Capitalize "MIME" for MIME types.

Find and replace "mime" to "MIME", where appropriate, throughout media3.

PiperOrigin-RevId: 531122121
This commit is contained in:
huangdarwin 2023-05-11 07:32:18 +00:00 committed by Tofunmi Adigun-Hameed
parent 925aa34e13
commit 82ede47398
19 changed files with 33 additions and 33 deletions

View File

@ -134,7 +134,7 @@ public final class FileTypes {
/** /**
* Returns the {@link Type} corresponding to the MIME type provided. * Returns the {@link Type} corresponding to the MIME type provided.
* *
* <p>Returns {@link #UNKNOWN} if the mime type is {@code null}. * <p>Returns {@link #UNKNOWN} if the MIME type is {@code null}.
*/ */
public static @FileTypes.Type int inferFileTypeFromMimeType(@Nullable String mimeType) { public static @FileTypes.Type int inferFileTypeFromMimeType(@Nullable String mimeType) {
if (mimeType == null) { if (mimeType == null) {

View File

@ -748,12 +748,12 @@ public final class Format implements Bundleable {
// Container specific. // Container specific.
/** The mime type of the container, or null if unknown or not applicable. */ /** The MIME type of the container, or null if unknown or not applicable. */
@Nullable public final String containerMimeType; @Nullable public final String containerMimeType;
// Sample specific. // Sample specific.
/** The sample mime type, or null if unknown or not applicable. */ /** The sample MIME type, or null if unknown or not applicable. */
@Nullable public final String sampleMimeType; @Nullable public final String sampleMimeType;
/** /**
* The maximum size of a buffer of data (typically one sample), or {@link #NO_VALUE} if unknown or * The maximum size of a buffer of data (typically one sample), or {@link #NO_VALUE} if unknown or

View File

@ -184,7 +184,7 @@ public interface RendererCapabilities {
* C#FORMAT_UNSUPPORTED_DRM}, {@link C#FORMAT_UNSUPPORTED_SUBTYPE} and {@link * C#FORMAT_UNSUPPORTED_DRM}, {@link C#FORMAT_UNSUPPORTED_SUBTYPE} and {@link
* C#FORMAT_UNSUPPORTED_TYPE}. * C#FORMAT_UNSUPPORTED_TYPE}.
* <li>{@link AdaptiveSupport}: The level of support for adapting from the format to another * <li>{@link AdaptiveSupport}: The level of support for adapting from the format to another
* format of the same mime type. One of {@link #ADAPTIVE_SEAMLESS}, {@link * format of the same MIME type. One of {@link #ADAPTIVE_SEAMLESS}, {@link
* #ADAPTIVE_NOT_SEAMLESS} and {@link #ADAPTIVE_NOT_SUPPORTED}. Only set if the level of * #ADAPTIVE_NOT_SEAMLESS} and {@link #ADAPTIVE_NOT_SUPPORTED}. Only set if the level of
* support for the format itself is {@link C#FORMAT_HANDLED} or {@link * support for the format itself is {@link C#FORMAT_HANDLED} or {@link
* C#FORMAT_EXCEEDS_CAPABILITIES}. * C#FORMAT_EXCEEDS_CAPABILITIES}.

View File

@ -530,7 +530,7 @@ public final class MediaMetricsListener
builder.setTrackState(TrackChangeEvent.TRACK_STATE_ON); builder.setTrackState(TrackChangeEvent.TRACK_STATE_ON);
builder.setTrackChangeReason(getTrackChangeReason(trackSelectionReason)); builder.setTrackChangeReason(getTrackChangeReason(trackSelectionReason));
if (format.containerMimeType != null) { if (format.containerMimeType != null) {
// TODO(b/181121074): Progressive container mime type is not filled in by MediaSource. // TODO(b/181121074): Progressive container MIME type is not filled in by MediaSource.
builder.setContainerMimeType(format.containerMimeType); builder.setContainerMimeType(format.containerMimeType);
} }
if (format.sampleMimeType != null) { if (format.sampleMimeType != null) {

View File

@ -58,7 +58,7 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
import java.util.List; import java.util.List;
/** Information about a {@link MediaCodec} for a given mime type. */ /** Information about a {@link MediaCodec} for a given MIME type. */
@SuppressWarnings("InlinedApi") @SuppressWarnings("InlinedApi")
@UnstableApi @UnstableApi
public final class MediaCodecInfo { public final class MediaCodecInfo {
@ -151,10 +151,10 @@ public final class MediaCodecInfo {
* Creates an instance. * Creates an instance.
* *
* @param name The name of the {@link MediaCodec}. * @param name The name of the {@link MediaCodec}.
* @param mimeType A mime type supported by the {@link MediaCodec}. * @param mimeType A MIME type supported by the {@link MediaCodec}.
* @param codecMimeType The MIME type that the codec uses for media of type {@code #mimeType}. * @param codecMimeType The MIME type that the codec uses for media of type {@code #mimeType}.
* Equal to {@code mimeType} unless the codec is known to use a non-standard MIME type alias. * Equal to {@code mimeType} unless the codec is known to use a non-standard MIME type alias.
* @param capabilities The capabilities of the {@link MediaCodec} for the specified mime type, or * @param capabilities The capabilities of the {@link MediaCodec} for the specified MIME type, or
* {@code null} if not known. * {@code null} if not known.
* @param hardwareAccelerated Whether the {@link MediaCodec} is hardware accelerated. * @param hardwareAccelerated Whether the {@link MediaCodec} is hardware accelerated.
* @param softwareOnly Whether the {@link MediaCodec} is software only. * @param softwareOnly Whether the {@link MediaCodec} is software only.

View File

@ -98,7 +98,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
private static final int NO_SUITABLE_DECODER_ERROR = CUSTOM_ERROR_CODE_BASE + 1; private static final int NO_SUITABLE_DECODER_ERROR = CUSTOM_ERROR_CODE_BASE + 1;
private static final int DECODER_QUERY_ERROR = CUSTOM_ERROR_CODE_BASE + 2; private static final int DECODER_QUERY_ERROR = CUSTOM_ERROR_CODE_BASE + 2;
/** The mime type for which a decoder was being initialized. */ /** The MIME type for which a decoder was being initialized. */
public final String mimeType; public final String mimeType;
/** Whether it was required that the decoder support a secure output path. */ /** Whether it was required that the decoder support a secure output path. */

View File

@ -90,12 +90,12 @@ public final class MediaCodecUtil {
private MediaCodecUtil() {} private MediaCodecUtil() {}
/** /**
* Optional call to warm the codec cache for a given mime type. * Optional call to warm the codec cache for a given MIME type.
* *
* <p>Calling this method may speed up subsequent calls to {@link #getDecoderInfo(String, boolean, * <p>Calling this method may speed up subsequent calls to {@link #getDecoderInfo(String, boolean,
* boolean)} and {@link #getDecoderInfos(String, boolean, boolean)}. * boolean)} and {@link #getDecoderInfos(String, boolean, boolean)}.
* *
* @param mimeType The mime type. * @param mimeType The MIME type.
* @param secure Whether the decoder is required to support secure decryption. Always pass false * @param secure Whether the decoder is required to support secure decryption. Always pass false
* unless secure decryption really is required. * unless secure decryption really is required.
* @param tunneling Whether the decoder is required to support tunneling. Always pass false unless * @param tunneling Whether the decoder is required to support tunneling. Always pass false unless
@ -128,7 +128,7 @@ public final class MediaCodecUtil {
} }
/** /**
* Returns information about the preferred decoder for a given mime type. * Returns information about the preferred decoder for a given MIME type.
* *
* @param mimeType The MIME type. * @param mimeType The MIME type.
* @param secure Whether the decoder is required to support secure decryption. Always pass false * @param secure Whether the decoder is required to support secure decryption. Always pass false
@ -146,7 +146,7 @@ public final class MediaCodecUtil {
} }
/** /**
* Returns all {@link MediaCodecInfo}s for the given mime type, in the order given by {@link * Returns all {@link MediaCodecInfo}s for the given MIME type, in the order given by {@link
* MediaCodecList}. * MediaCodecList}.
* *
* @param mimeType The MIME type. * @param mimeType The MIME type.
@ -154,7 +154,7 @@ public final class MediaCodecUtil {
* unless secure decryption really is required. * unless secure decryption really is required.
* @param tunneling Whether the decoder is required to support tunneling. Always pass false unless * @param tunneling Whether the decoder is required to support tunneling. Always pass false unless
* tunneling really is required. * tunneling really is required.
* @return An unmodifiable list of all {@link MediaCodecInfo}s for the given mime type, in the * @return An unmodifiable list of all {@link MediaCodecInfo}s for the given MIME type, in the
* order given by {@link MediaCodecList}. * order given by {@link MediaCodecList}.
* @throws DecoderQueryException If there was an error querying the available decoders. * @throws DecoderQueryException If there was an error querying the available decoders.
*/ */

View File

@ -219,7 +219,7 @@ public final class OutputConsumerAdapterV30 implements MediaParser.OutputConsume
} }
/** /**
* Defines the container mime type to propagate through {@link TrackOutput#format}. * Defines the container MIME type to propagate through {@link TrackOutput#format}.
* *
* @param parserName The name of the selected parser. * @param parserName The name of the selected parser.
*/ */

View File

@ -1626,7 +1626,7 @@ public final class DefaultTrackSelectorTest {
Format aacAudioFormat = formatBuilder.setSampleMimeType(MimeTypes.AUDIO_AAC).build(); Format aacAudioFormat = formatBuilder.setSampleMimeType(MimeTypes.AUDIO_AAC).build();
Format opusAudioFormat = formatBuilder.setSampleMimeType(MimeTypes.AUDIO_OPUS).build(); Format opusAudioFormat = formatBuilder.setSampleMimeType(MimeTypes.AUDIO_OPUS).build();
// Should not adapt between mixed mime types by default, so we expect a fixed selection // Should not adapt between mixed MIME types by default, so we expect a fixed selection
// containing the first stream. // containing the first stream.
TrackGroupArray trackGroups = singleTrackGroup(aacAudioFormat, opusAudioFormat); TrackGroupArray trackGroups = singleTrackGroup(aacAudioFormat, opusAudioFormat);
TrackSelectorResult result = TrackSelectorResult result =
@ -1643,7 +1643,7 @@ public final class DefaultTrackSelectorTest {
assertThat(result.length).isEqualTo(1); assertThat(result.length).isEqualTo(1);
assertFixedSelection(result.selections[0], trackGroups, opusAudioFormat); assertFixedSelection(result.selections[0], trackGroups, opusAudioFormat);
// If we explicitly enable mixed mime type adaptiveness, expect an adaptive selection. // If we explicitly enable mixed MIME type adaptiveness, expect an adaptive selection.
trackSelector.setParameters( trackSelector.setParameters(
defaultParameters.buildUpon().setAllowAudioMixedMimeTypeAdaptiveness(true)); defaultParameters.buildUpon().setAllowAudioMixedMimeTypeAdaptiveness(true));
result = result =
@ -1975,7 +1975,7 @@ public final class DefaultTrackSelectorTest {
Format h264VideoFormat = formatBuilder.setSampleMimeType(MimeTypes.VIDEO_H264).build(); Format h264VideoFormat = formatBuilder.setSampleMimeType(MimeTypes.VIDEO_H264).build();
Format h265VideoFormat = formatBuilder.setSampleMimeType(MimeTypes.VIDEO_H265).build(); Format h265VideoFormat = formatBuilder.setSampleMimeType(MimeTypes.VIDEO_H265).build();
// Should not adapt between mixed mime types by default, so we expect a fixed selection // Should not adapt between mixed MIME types by default, so we expect a fixed selection
// containing the first stream. // containing the first stream.
TrackGroupArray trackGroups = singleTrackGroup(h264VideoFormat, h265VideoFormat); TrackGroupArray trackGroups = singleTrackGroup(h264VideoFormat, h265VideoFormat);
TrackSelectorResult result = TrackSelectorResult result =
@ -1992,7 +1992,7 @@ public final class DefaultTrackSelectorTest {
assertThat(result.length).isEqualTo(1); assertThat(result.length).isEqualTo(1);
assertFixedSelection(result.selections[0], trackGroups, h265VideoFormat); assertFixedSelection(result.selections[0], trackGroups, h265VideoFormat);
// If we explicitly enable mixed mime type adaptiveness, expect an adaptive selection. // If we explicitly enable mixed MIME type adaptiveness, expect an adaptive selection.
trackSelector.setParameters( trackSelector.setParameters(
defaultParameters.buildUpon().setAllowVideoMixedMimeTypeAdaptiveness(true)); defaultParameters.buildUpon().setAllowVideoMixedMimeTypeAdaptiveness(true));
result = result =

View File

@ -1550,7 +1550,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
sampleMimeType = MimeTypes.getMediaMimeType(codecs); sampleMimeType = MimeTypes.getMediaMimeType(codecs);
} else { } else {
// The variant assigns more than one codec string to this track. We choose whichever codec // The variant assigns more than one codec string to this track. We choose whichever codec
// string matches the sample mime type. This can happen when different languages are encoded // string matches the sample MIME type. This can happen when different languages are encoded
// using different codecs. // using different codecs.
codecs = codecs =
MimeTypes.getCodecsCorrespondingToMimeType( MimeTypes.getCodecsCorrespondingToMimeType(

View File

@ -26,9 +26,9 @@ import java.io.IOException;
public final class SampleQueueMappingException extends IOException { public final class SampleQueueMappingException extends IOException {
/** /**
* @param mimeType The mime type of the track group whose mapping failed. * @param mimeType The MIME type of the track group whose mapping failed.
*/ */
public SampleQueueMappingException(@Nullable String mimeType) { public SampleQueueMappingException(@Nullable String mimeType) {
super("Unable to bind a sample queue to TrackGroup with mime type " + mimeType + "."); super("Unable to bind a sample queue to TrackGroup with MIME type " + mimeType + ".");
} }
} }

View File

@ -63,7 +63,7 @@ public final class Ac3Util {
public static final int STREAM_TYPE_TYPE2 = 2; public static final int STREAM_TYPE_TYPE2 = 2;
/** /**
* The sample mime type of the bitstream. One of {@link MimeTypes#AUDIO_AC3} and {@link * The sample MIME type of the bitstream. One of {@link MimeTypes#AUDIO_AC3} and {@link
* MimeTypes#AUDIO_E_AC3}. * MimeTypes#AUDIO_E_AC3}.
*/ */
@Nullable public final String mimeType; @Nullable public final String mimeType;
@ -450,7 +450,7 @@ public final class Ac3Util {
int fscod = data.readBits(2); int fscod = data.readBits(2);
if (fscod == 3) { if (fscod == 3) {
// fscod '11' indicates that the decoder should not attempt to decode audio. We invalidate // fscod '11' indicates that the decoder should not attempt to decode audio. We invalidate
// the mime type to prevent association with a renderer. // the MIME type to prevent association with a renderer.
mimeType = null; mimeType = null;
} }
int frmsizecod = data.readBits(6); int frmsizecod = data.readBits(6);

View File

@ -29,7 +29,7 @@ public final class MpegAudioUtil {
/** MPEG audio header version. */ /** MPEG audio header version. */
public int version; public int version;
/** The mime type. */ /** The MIME type. */
@Nullable public String mimeType; @Nullable public String mimeType;
/** Size of the frame associated with this header, in bytes. */ /** Size of the frame associated with this header, in bytes. */
public int frameSize; public int frameSize;

View File

@ -33,7 +33,7 @@ public final class PictureFrame implements Metadata.Entry {
/** The type of the picture. */ /** The type of the picture. */
public final int pictureType; public final int pictureType;
/** The mime type of the picture. */ /** The MIME type of the picture. */
public final String mimeType; public final String mimeType;
/** A description of the picture. */ /** A description of the picture. */
public final String description; public final String description;

View File

@ -2410,8 +2410,8 @@ public class MatroskaExtractor implements Extractor {
/** /**
* Builds initialization data for a {@link Format} from FourCC codec private data. * Builds initialization data for a {@link Format} from FourCC codec private data.
* *
* @return The codec mime type and initialization data. If the compression type is not supported * @return The codec MIME type and initialization data. If the compression type is not supported
* then the mime type is set to {@link MimeTypes#VIDEO_UNKNOWN} and the initialization data * then the MIME type is set to {@link MimeTypes#VIDEO_UNKNOWN} and the initialization data
* is {@code null}. * is {@code null}.
* @throws ParserException If the initialization data could not be built. * @throws ParserException If the initialization data could not be built.
*/ */

View File

@ -52,7 +52,7 @@ public final class SeiReader {
Assertions.checkArgument( Assertions.checkArgument(
MimeTypes.APPLICATION_CEA608.equals(channelMimeType) MimeTypes.APPLICATION_CEA608.equals(channelMimeType)
|| MimeTypes.APPLICATION_CEA708.equals(channelMimeType), || MimeTypes.APPLICATION_CEA708.equals(channelMimeType),
"Invalid closed caption mime type provided: " + channelMimeType); "Invalid closed caption MIME type provided: " + channelMimeType);
String formatId = channelFormat.id != null ? channelFormat.id : idGenerator.getFormatId(); String formatId = channelFormat.id != null ? channelFormat.id : idGenerator.getFormatId();
output.format( output.format(
new Format.Builder() new Format.Builder()

View File

@ -49,7 +49,7 @@ import java.util.List;
Assertions.checkArgument( Assertions.checkArgument(
MimeTypes.APPLICATION_CEA608.equals(channelMimeType) MimeTypes.APPLICATION_CEA608.equals(channelMimeType)
|| MimeTypes.APPLICATION_CEA708.equals(channelMimeType), || MimeTypes.APPLICATION_CEA708.equals(channelMimeType),
"Invalid closed caption mime type provided: " + channelMimeType); "Invalid closed caption MIME type provided: " + channelMimeType);
output.format( output.format(
new Format.Builder() new Format.Builder()
.setId(idGenerator.getFormatId()) .setId(idGenerator.getFormatId())

View File

@ -88,7 +88,7 @@ public final class MediaPeriodAsserts {
* @param mediaPeriodFactory A factory to create a {@link MediaPeriod} based on a manifest. * @param mediaPeriodFactory A factory to create a {@link MediaPeriod} based on a manifest.
* @param manifest The manifest which is to be tested. * @param manifest The manifest which is to be tested.
* @param periodIndex The index of period in the manifest. * @param periodIndex The index of period in the manifest.
* @param ignoredMimeType Optional mime type whose existence in the filtered track groups is not * @param ignoredMimeType Optional MIME type whose existence in the filtered track groups is not
* asserted. * asserted.
*/ */
public static <T extends FilterableManifest<T>> public static <T extends FilterableManifest<T>>

View File

@ -137,10 +137,10 @@ import java.util.List;
* <p>The {@linkplain Format requestedFormat} determines what support is checked. * <p>The {@linkplain Format requestedFormat} determines what support is checked.
* *
* <ul> * <ul>
* <li>The {@link Format#sampleMimeType} determines whether audio or video mime types are * <li>The {@link Format#sampleMimeType} determines whether audio or video MIME types are
* considered. See {@link MimeTypes#isAudio} and {@link MimeTypes#isVideo} for more details. * considered. See {@link MimeTypes#isAudio} and {@link MimeTypes#isVideo} for more details.
* <li>The {@link Format#sampleMimeType} must be populated with the preferred {@linkplain * <li>The {@link Format#sampleMimeType} must be populated with the preferred {@linkplain
* MimeTypes MIME type}. This mime type will be the first checked. * MimeTypes MIME type}. This MIME type will be the first checked.
* <li>When checking video support, if the HDR {@link Format#colorInfo} is set, only encoders * <li>When checking video support, if the HDR {@link Format#colorInfo} is set, only encoders
* that support that {@link ColorInfo} will be considered. * that support that {@link ColorInfo} will be considered.
* </ul> * </ul>