Merge "media: allow 0 video encoder profiles and levels." into sc-dev

This commit is contained in:
TreeHugger Robot
2021-06-29 20:01:01 +00:00
committed by Android (Google) Code Review

View File

@@ -840,7 +840,7 @@ public class MediaRecorder implements AudioRouting,
setVideoSize(profile.getWidth(), profile.getHeight()); setVideoSize(profile.getWidth(), profile.getHeight());
setVideoEncodingBitRate(profile.getBitrate()); setVideoEncodingBitRate(profile.getBitrate());
setVideoEncoder(profile.getCodec()); setVideoEncoder(profile.getCodec());
if (profile.getProfile() > 0) { if (profile.getProfile() >= 0) {
setVideoEncodingProfileLevel(profile.getProfile(), 0 /* level */); setVideoEncodingProfileLevel(profile.getProfile(), 0 /* level */);
} }
} }
@@ -1121,10 +1121,10 @@ public class MediaRecorder implements AudioRouting,
* @throws IllegalArgumentException when an invalid profile or level value is used. * @throws IllegalArgumentException when an invalid profile or level value is used.
*/ */
public void setVideoEncodingProfileLevel(int profile, int level) { public void setVideoEncodingProfileLevel(int profile, int level) {
if (profile <= 0) { if (profile < 0) {
throw new IllegalArgumentException("Video encoding profile is not positive"); throw new IllegalArgumentException("Video encoding profile is not positive");
} }
if (level <= 0) { if (level < 0) {
throw new IllegalArgumentException("Video encoding level is not positive"); throw new IllegalArgumentException("Video encoding level is not positive");
} }
setParameter("video-param-encoder-profile=" + profile); setParameter("video-param-encoder-profile=" + profile);