Commit 6960dde8 by kimvde Committed by kim-vde

Add nullness annotations to FragmentedMp4Extractor

PiperOrigin-RevId: 327797428
parent d881a675
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
*/ */
package com.google.android.exoplayer2.util; package com.google.android.exoplayer2.util;
import androidx.annotation.Nullable;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.util.Arrays; import java.util.Arrays;
...@@ -219,11 +220,12 @@ public final class NalUnitUtil { ...@@ -219,11 +220,12 @@ public final class NalUnitUtil {
* Returns whether the NAL unit with the specified header contains supplemental enhancement * Returns whether the NAL unit with the specified header contains supplemental enhancement
* information. * information.
* *
* @param mimeType The sample MIME type. * @param mimeType The sample MIME type, or {@code null} if unknown.
* @param nalUnitHeaderFirstByte The first byte of nal_unit(). * @param nalUnitHeaderFirstByte The first byte of nal_unit().
* @return Whether the NAL unit with the specified header is an SEI NAL unit. * @return Whether the NAL unit with the specified header is an SEI NAL unit. False is returned if
* the {@code MimeType} is {@code null}.
*/ */
public static boolean isNalUnitSei(String mimeType, byte nalUnitHeaderFirstByte) { public static boolean isNalUnitSei(@Nullable String mimeType, byte nalUnitHeaderFirstByte) {
return (MimeTypes.VIDEO_H264.equals(mimeType) return (MimeTypes.VIDEO_H264.equals(mimeType)
&& (nalUnitHeaderFirstByte & 0x1F) == H264_NAL_UNIT_TYPE_SEI) && (nalUnitHeaderFirstByte & 0x1F) == H264_NAL_UNIT_TYPE_SEI)
|| (MimeTypes.VIDEO_H265.equals(mimeType) || (MimeTypes.VIDEO_H265.equals(mimeType)
......
...@@ -21,9 +21,33 @@ package com.google.android.exoplayer2.extractor; ...@@ -21,9 +21,33 @@ package com.google.android.exoplayer2.extractor;
public interface ExtractorOutput { public interface ExtractorOutput {
/** /**
* Placeholder {@link ExtractorOutput} implementation throwing an {@link
* UnsupportedOperationException} in each method.
*/
ExtractorOutput PLACEHOLDER =
new ExtractorOutput() {
@Override
public TrackOutput track(int id, int type) {
throw new UnsupportedOperationException();
}
@Override
public void endTracks() {
throw new UnsupportedOperationException();
}
@Override
public void seekMap(SeekMap seekMap) {
throw new UnsupportedOperationException();
}
};
/**
* Called by the {@link Extractor} to get the {@link TrackOutput} for a specific track. * Called by the {@link Extractor} to get the {@link TrackOutput} for a specific track.
* <p> *
* The same {@link TrackOutput} is returned if multiple calls are made with the same {@code id}. * <p>The same {@link TrackOutput} is returned if multiple calls are made with the same {@code
* id}.
* *
* @param id A track identifier. * @param id A track identifier.
* @param type The type of the track. Typically one of the {@link com.google.android.exoplayer2.C} * @param type The type of the track. Typically one of the {@link com.google.android.exoplayer2.C}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment