summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-10-20 13:48:14 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-10-20 13:48:14 -0700
commitdc99cd65fac3964637f2674db07323c07f720279 (patch)
tree7135198c97bba021114d6e8883706cf8b2b17946
parent6a9da9fc558263548ebfbae2cbf177eb7454a41b (diff)
parentf96c9d193c70c7216b34e6c65f046a09a2a81f14 (diff)
downloadframeworks_av-dc99cd65fac3964637f2674db07323c07f720279.zip
frameworks_av-dc99cd65fac3964637f2674db07323c07f720279.tar.gz
frameworks_av-dc99cd65fac3964637f2674db07323c07f720279.tar.bz2
Merge "Fix an issue where the video size was incorrectly retrieved from preview size"
-rw-r--r--media/libstagefright/CameraSource.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/media/libstagefright/CameraSource.cpp b/media/libstagefright/CameraSource.cpp
index df95cf7..95afb1d 100644
--- a/media/libstagefright/CameraSource.cpp
+++ b/media/libstagefright/CameraSource.cpp
@@ -347,9 +347,21 @@ status_t CameraSource::checkVideoSize(
const CameraParameters& params,
int32_t width, int32_t height) {
+ // The actual video size is the same as the preview size
+ // if the camera hal does not support separate video and
+ // preview output. In this case, we retrieve the video
+ // size from preview.
int32_t frameWidthActual = -1;
int32_t frameHeightActual = -1;
- params.getPreviewSize(&frameWidthActual, &frameHeightActual);
+ Vector<Size> sizes;
+ params.getSupportedVideoSizes(sizes);
+ if (sizes.size() == 0) {
+ // video size is the same as preview size
+ params.getPreviewSize(&frameWidthActual, &frameHeightActual);
+ } else {
+ // video size may not be the same as preview
+ params.getVideoSize(&frameWidthActual, &frameHeightActual);
+ }
if (frameWidthActual < 0 || frameHeightActual < 0) {
LOGE("Failed to retrieve video frame size (%dx%d)",
frameWidthActual, frameHeightActual);