summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice
diff options
context:
space:
mode:
authorNipun Kwatra <nkwatra@google.com>2010-08-04 14:26:45 -0700
committerNipun Kwatra <nkwatra@google.com>2010-08-05 21:30:08 -0700
commit453e92f6e1189f61f1d692c2501029bdb8c12ea2 (patch)
treeabcd6741fb8b9acb4219838ccf62abc584744481 /media/libmediaplayerservice
parentcffebf85be94f326d8bedc496bc734e55cb052ae (diff)
downloadframeworks_base-453e92f6e1189f61f1d692c2501029bdb8c12ea2.zip
frameworks_base-453e92f6e1189f61f1d692c2501029bdb8c12ea2.tar.gz
frameworks_base-453e92f6e1189f61f1d692c2501029bdb8c12ea2.tar.bz2
When using still camera for time lapse capture, don't set preview.
Since HD resolution may not be supported by the video camera, don't set preivew using the HD size. The app should have set the preview already, just use that. Change-Id: I2f8e89bf2c7440f7bc8db7e4a228f4c8250d92b4
Diffstat (limited to 'media/libmediaplayerservice')
-rw-r--r--media/libmediaplayerservice/StagefrightRecorder.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp
index 805f86b..5756e53 100644
--- a/media/libmediaplayerservice/StagefrightRecorder.cpp
+++ b/media/libmediaplayerservice/StagefrightRecorder.cpp
@@ -38,8 +38,8 @@
#include <surfaceflinger/ISurface.h>
#include <utils/Errors.h>
#include <sys/types.h>
-#include <unistd.h>
#include <ctype.h>
+#include <unistd.h>
#include "ARTPWriter.h"
@@ -906,7 +906,7 @@ void StagefrightRecorder::clipVideoFrameWidth() {
}
status_t StagefrightRecorder::setupCameraSource() {
- if(!mCaptureTimeLapse) {
+ if (!mCaptureTimeLapse) {
// Dont clip for time lapse capture as encoder will have enough
// time to encode because of slow capture rate of time lapse.
clipVideoBitRate();
@@ -929,9 +929,10 @@ status_t StagefrightRecorder::setupCameraSource() {
// Set the actual video recording frame size
CameraParameters params(mCamera->getParameters());
- // dont change the preview size for time lapse as mVideoWidth, mVideoHeight
- // may correspond to HD resolution not supported by video camera.
- if (!mCaptureTimeLapse) {
+ // dont change the preview size when using still camera for time lapse
+ // as mVideoWidth, mVideoHeight may correspond to HD resolution not
+ // supported by the video camera.
+ if (!(mCaptureTimeLapse && mUseStillCameraForTimeLapse)) {
params.setPreviewSize(mVideoWidth, mVideoHeight);
}
@@ -947,7 +948,7 @@ status_t StagefrightRecorder::setupCameraSource() {
// Check on video frame size
int frameWidth = 0, frameHeight = 0;
newCameraParams.getPreviewSize(&frameWidth, &frameHeight);
- if (!mCaptureTimeLapse &&
+ if (!(mCaptureTimeLapse && mUseStillCameraForTimeLapse) &&
(frameWidth < 0 || frameWidth != mVideoWidth ||
frameHeight < 0 || frameHeight != mVideoHeight)) {
LOGE("Failed to set the video frame size to %dx%d",