Throw NPE instead of IAE when sampleMimeType is null.

PiperOrigin-RevId: 422550627
This commit is contained in:
claincly 2022-01-18 15:24:25 +00:00 committed by Ian Baker
parent 7ba79cfa42
commit e0aa61681d

View File

@ -101,14 +101,12 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
@Override
public Codec createForVideoEncoding(Format format) throws TransformationException {
checkArgument(format.sampleMimeType != null);
checkArgument(format.width != Format.NO_VALUE);
checkArgument(format.height != Format.NO_VALUE);
// According to interface Javadoc, format.rotationDegrees should be 0. The video should always
// be in landscape orientation.
checkArgument(format.height < format.width);
checkArgument(format.rotationDegrees == 0);
// Checking again to silence null checker warning.
checkNotNull(format.sampleMimeType);
format = getVideoEncoderSupportedFormat(format);