Deprecate NalUnitUtil.isNalUnitSei(String, byte)

The overload that takes a `Format` is preferred, because it can detect
SEI NAL units in Dolby Vision tracks too.

Submitting this in a separate change so we can avoid cherry-picking it
into `1.5.0-rc01`, otherwise it would naturally be part of
27371db225.

Issue: androidx/media#1820
PiperOrigin-RevId: 691408725
This commit is contained in:
ibaker 2024-10-30 07:18:31 -07:00 committed by Copybara-Service
parent df07fa35d8
commit 0462349902

View File

@ -601,14 +601,11 @@ public final class NalUnitUtil {
}
/**
* Returns whether the NAL unit with the specified header contains supplemental enhancement
* information.
*
* @param mimeType The sample MIME type, or {@code null} if unknown.
* @param nalUnitHeaderFirstByte The first byte of 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}.
* @deprecated Use {@link #isNalUnitSei(Format, byte)} in order to support {@link
* MimeTypes#VIDEO_DOLBY_VISION} tracks with backwards compatible {@link MimeTypes#VIDEO_H264}
* or {@link MimeTypes#VIDEO_H265} data.
*/
@Deprecated
public static boolean isNalUnitSei(@Nullable String mimeType, byte nalUnitHeaderFirstByte) {
return (MimeTypes.VIDEO_H264.equals(mimeType)
&& (nalUnitHeaderFirstByte & 0x1F) == H264_NAL_UNIT_TYPE_SEI)