diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2019-05-29 01:30:40 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-05-29 01:30:41 -0700 |
commit | 3bfd94586d35760af48588aa82a4549984ec1fcf (patch) | |
tree | 8ee21fd947be1f90b24528009b3b7bee615d660b | |
parent | e3a3255bfbce3bfeed4ee28a6298ddcaa9991614 (diff) | |
parent | 0e4a20d9be972e7ffd093096510b1fd6d2ee1644 (diff) | |
download | android_packages_apps_Snap-3bfd94586d35760af48588aa82a4549984ec1fcf.tar.gz android_packages_apps_Snap-3bfd94586d35760af48588aa82a4549984ec1fcf.tar.bz2 android_packages_apps_Snap-3bfd94586d35760af48588aa82a4549984ec1fcf.zip |
Merge "Update bitrate only for software codecs" into camera-SnapdragonCamera.lnx.2.0
-rw-r--r--[-rwxr-xr-x] | src/com/android/camera/CaptureModule.java | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index ceb7fbf5c..9e340a022 100755..100644 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -5446,23 +5446,16 @@ public class CaptureModule implements CameraModule, PhotoController, if (!info.isEncoder() || info.getName().contains("google")) continue; for (String type : info.getSupportedTypes()) { if ((videoEncoder == MediaRecorder.VideoEncoder.MPEG_4_SP && type.equalsIgnoreCase(MediaFormat.MIMETYPE_VIDEO_MPEG4)) - || (videoEncoder == MediaRecorder.VideoEncoder.H263 && type.equalsIgnoreCase(MediaFormat.MIMETYPE_VIDEO_H263)) - || (videoEncoder == MediaRecorder.VideoEncoder.H264 && type.equalsIgnoreCase(MediaFormat.MIMETYPE_VIDEO_AVC)) - || (videoEncoder == MediaRecorder.VideoEncoder.HEVC && type.equalsIgnoreCase(MediaFormat.MIMETYPE_VIDEO_HEVC))) + || (videoEncoder == MediaRecorder.VideoEncoder.H263 && type.equalsIgnoreCase(MediaFormat.MIMETYPE_VIDEO_H263))) { CodecCapabilities codecCapabilities = info.getCapabilitiesForType(type); VideoCapabilities videoCapabilities = codecCapabilities.getVideoCapabilities(); try { if (videoCapabilities != null) { Log.d(TAG, "updateBitrate type is " + type + " " + info.getName()); - long maxBitRate = videoCapabilities.getBitrateRange().getUpper().intValue(); - int maxWidth = videoCapabilities.getSupportedWidths().getUpper().intValue(); - int maxHeight = videoCapabilities.getSupportedHeights().getUpper().intValue(); - Log.d(TAG, "updateBitrate size is " + width + "x" + height); - int adjustedBitRate = (int) (maxBitRate * width * height / (maxWidth * maxHeight)); - Log.d(TAG, "updateBitrate maxBitRate is " + maxBitRate + ", profileBitRate is " + bitRate - + ", adjustedBitRate is " + adjustedBitRate); - mMediaRecorder.setVideoEncodingBitRate(Math.min(bitRate, adjustedBitRate)); + int maxBitRate = videoCapabilities.getBitrateRange().getUpper().intValue(); + Log.d(TAG, "maxBitRate is " + maxBitRate + ", profileBitRate is " + bitRate); + mMediaRecorder.setVideoEncodingBitRate(Math.min(bitRate, maxBitRate)); return; } } catch (IllegalArgumentException e) { |