diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2014-03-03 04:34:50 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2014-03-03 04:34:50 -0800 |
commit | 45cdd51ac9100f221b114c9c89648781afe7482e (patch) | |
tree | 1fffe730be0fc50d91e817e6891f8325107a3ecf /src/com/android/camera/VideoModule.java | |
parent | 40aad1d5fb7ad8828b25c502165eaa557327edc2 (diff) | |
parent | 6758cbfaee369c5577c7440849fa9e8f0d9537fc (diff) | |
download | android_packages_apps_Snap-45cdd51ac9100f221b114c9c89648781afe7482e.tar.gz android_packages_apps_Snap-45cdd51ac9100f221b114c9c89648781afe7482e.tar.bz2 android_packages_apps_Snap-45cdd51ac9100f221b114c9c89648781afe7482e.zip |
Merge "Camera: Check if codec supports HFR resolution/fps."
Diffstat (limited to 'src/com/android/camera/VideoModule.java')
-rw-r--r-- | src/com/android/camera/VideoModule.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index f8db15bec..0339ac9c2 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -1831,6 +1831,30 @@ public class VideoModule implements CameraModule, Log.e(TAG, "supported hfr sizes is null"); } + int hfrFps = Integer.parseInt(HighFrameRate); + int inputBitrate = videoWidth*videoHeight*hfrFps; + + //check if codec supports the resolution, otherwise throw toast + List<VideoEncoderCap> videoEncoders = EncoderCapabilities.getVideoEncoders(); + for (VideoEncoderCap videoEncoder: videoEncoders) { + if (videoEncoder.mCodec == mVideoEncoder){ + int maxBitrate = (videoEncoder.mMaxHFRFrameWidth * + videoEncoder.mMaxHFRFrameHeight * + videoEncoder.mMaxHFRMode); + if (inputBitrate > maxBitrate ){ + Log.e(TAG,"Selected codec "+mVideoEncoder+ + " does not support HFR " + HighFrameRate + " with "+ videoWidth + + "x" + videoHeight +" resolution"); + Log.e(TAG, "Codec capabilities: " + + "mMaxHFRFrameWidth = " + videoEncoder.mMaxHFRFrameWidth + " , "+ + "mMaxHFRFrameHeight = " + videoEncoder.mMaxHFRFrameHeight + " , "+ + "mMaxHFRMode = " + videoEncoder.mMaxHFRMode); + mUnsupportedHFRVideoSize = true; + } + break; + } + } + if(mUnsupportedHFRVideoSize) Log.v(TAG,"Unsupported hfr resolution"); |