diff --git a/api/current.txt b/api/current.txt index 51b67eb89cb7f..9750d77c6b7d8 100644 --- a/api/current.txt +++ b/api/current.txt @@ -22999,6 +22999,7 @@ package android.media { method public void setProfile(android.media.CamcorderProfile); method public void setVideoEncoder(int) throws java.lang.IllegalStateException; method public void setVideoEncodingBitRate(int); + method public void setVideoEncodingProfileLevel(int, int); method public void setVideoFrameRate(int) throws java.lang.IllegalStateException; method public void setVideoSize(int, int) throws java.lang.IllegalStateException; method public void setVideoSource(int) throws java.lang.IllegalStateException; diff --git a/api/system-current.txt b/api/system-current.txt index 4784a42197f6c..6e8dde9af3f59 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -24792,6 +24792,7 @@ package android.media { method public void setProfile(android.media.CamcorderProfile); method public void setVideoEncoder(int) throws java.lang.IllegalStateException; method public void setVideoEncodingBitRate(int); + method public void setVideoEncodingProfileLevel(int, int); method public void setVideoFrameRate(int) throws java.lang.IllegalStateException; method public void setVideoSize(int, int) throws java.lang.IllegalStateException; method public void setVideoSource(int) throws java.lang.IllegalStateException; diff --git a/api/test-current.txt b/api/test-current.txt index 25f776b0a157a..2b2c3d3767b82 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -23112,6 +23112,7 @@ package android.media { method public void setProfile(android.media.CamcorderProfile); method public void setVideoEncoder(int) throws java.lang.IllegalStateException; method public void setVideoEncodingBitRate(int); + method public void setVideoEncodingProfileLevel(int, int); method public void setVideoFrameRate(int) throws java.lang.IllegalStateException; method public void setVideoSize(int, int) throws java.lang.IllegalStateException; method public void setVideoSource(int) throws java.lang.IllegalStateException; diff --git a/media/java/android/media/MediaRecorder.java b/media/java/android/media/MediaRecorder.java index cdc1d60fa7895..4675e327ce25c 100644 --- a/media/java/android/media/MediaRecorder.java +++ b/media/java/android/media/MediaRecorder.java @@ -746,14 +746,19 @@ public class MediaRecorder } /** - * Sets the video encoding profile for recording. Call this method before prepare(). - * Prepare() may perform additional checks on the parameter to make sure whether the - * specified profile and level are applicable, and sometimes the passed profile or - * level will be discarded due to codec capablity or to ensure the video recording - * can proceed smoothly based on the capabilities of the platform. - * @hide + * Sets the desired video encoding profile and level for recording. The profile and level + * must be valid for the video encoder set by {@link #setVideoEncoder}. This method can + * called before or after {@link #setVideoEncoder} but it must be called before {@link #prepare}. + * {@code prepare()} may perform additional checks on the parameter to make sure that the specified + * profile and level are applicable, and sometimes the passed profile or level will be + * discarded due to codec capablity or to ensure the video recording can proceed smoothly + * based on the capabilities of the platform.
Application can also use the + * {@link MediaCodecInfo.CodecCapabilities#profileLevels} to query applicable combination of profile + * and level for the corresponding format. Note that the requested profile/level may not be supported by + * the codec that is actually being used by this MediaRecorder instance. * @param profile declared in {@link MediaCodecInfo.CodecProfileLevel}. * @param level declared in {@link MediaCodecInfo.CodecProfileLevel}. + * @throws IllegalArgumentException when an invalid profile or level value is used. */ public void setVideoEncodingProfileLevel(int profile, int level) { if (profile <= 0) { @@ -1281,3 +1286,4 @@ public class MediaRecorder @Override protected void finalize() { native_finalize(); } } +