diff options
author | James Dong <jdong@google.com> | 2010-10-20 11:41:33 -0700 |
---|---|---|
committer | James Dong <jdong@google.com> | 2010-10-20 11:44:15 -0700 |
commit | 26e54e258f0331e09c045c7af9b6b8cf11d19257 (patch) | |
tree | 7c4eb1006249143407501802d24409f1c7b008d8 /media/libstagefright/CameraSource.cpp | |
parent | 5ff9980ac510a996927398a803f2bab3b71c7ebf (diff) | |
download | frameworks_base-26e54e258f0331e09c045c7af9b6b8cf11d19257.zip frameworks_base-26e54e258f0331e09c045c7af9b6b8cf11d19257.tar.gz frameworks_base-26e54e258f0331e09c045c7af9b6b8cf11d19257.tar.bz2 |
Fix an issue where the video size was incorrectly retrieved from preview size
bug - 3115814
Change-Id: I6aa59b3182ceee35c6d6ef54ff520f81077873f0
Diffstat (limited to 'media/libstagefright/CameraSource.cpp')
-rw-r--r-- | media/libstagefright/CameraSource.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/media/libstagefright/CameraSource.cpp b/media/libstagefright/CameraSource.cpp index df95cf7..95afb1d8 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); |