mirror of
https://github.com/androidx/media.git
synced 2025-05-08 08:00:49 +08:00
Throw NPE instead of IAE when sampleMimeType is null.
PiperOrigin-RevId: 422550627
This commit is contained in:
parent
7ba79cfa42
commit
e0aa61681d
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user