diff options
author | Nipun Kwatra <nkwatra@google.com> | 2010-09-02 11:43:15 -0700 |
---|---|---|
committer | Nipun Kwatra <nkwatra@google.com> | 2010-09-03 17:09:36 -0700 |
commit | 155e833a7a5fc3e193691324cf9326da1bc3289a (patch) | |
tree | bf8997c55b22617004836014389664dcb56ebf05 /media/libmediaplayerservice | |
parent | cfe88a20345dad981842b2c8092e4c704d3f98b4 (diff) | |
download | frameworks_av-155e833a7a5fc3e193691324cf9326da1bc3289a.zip frameworks_av-155e833a7a5fc3e193691324cf9326da1bc3289a.tar.gz frameworks_av-155e833a7a5fc3e193691324cf9326da1bc3289a.tar.bz2 |
Moving decision to use still camera to CameraSourceTimeLapse
CameraSourceTimeLapse now decides whether to use still or video
camera automatically. It checks if the passed in size is a valid
preview size and if it is, then uses the video camera else uses
the still camera.
Removed from StagefrightRecorder the support to set parameter
useStillCameraForTimeLapse.
Change-Id: I71f5b0fc7080ca524792381efe918d22e41a7f36
Diffstat (limited to 'media/libmediaplayerservice')
-rw-r--r-- | media/libmediaplayerservice/StagefrightRecorder.cpp | 27 | ||||
-rw-r--r-- | media/libmediaplayerservice/StagefrightRecorder.h | 2 |
2 files changed, 4 insertions, 25 deletions
diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp index f1b8334..77a9cca 100644 --- a/media/libmediaplayerservice/StagefrightRecorder.cpp +++ b/media/libmediaplayerservice/StagefrightRecorder.cpp @@ -507,19 +507,6 @@ status_t StagefrightRecorder::setParamTimeLapseEnable(int32_t timeLapseEnable) { return OK; } -status_t StagefrightRecorder::setParamUseStillCameraForTimeLapse(int32_t useStillCamera) { - LOGV("setParamUseStillCameraForTimeLapse: %d", useStillCamera); - - if(useStillCamera == 0) { - mUseStillCameraForTimeLapse= false; - } else if (useStillCamera == 1) { - mUseStillCameraForTimeLapse= true; - } else { - return BAD_VALUE; - } - return OK; -} - status_t StagefrightRecorder::setParamTimeBetweenTimeLapseFrameCapture(int64_t timeUs) { LOGV("setParamTimeBetweenTimeLapseFrameCapture: %lld us", timeUs); @@ -657,11 +644,6 @@ status_t StagefrightRecorder::setParameter( if (safe_strtoi32(value.string(), &timeLapseEnable)) { return setParamTimeLapseEnable(timeLapseEnable); } - } else if (key == "use-still-camera-for-time-lapse") { - int32_t useStillCamera; - if (safe_strtoi32(value.string(), &useStillCamera)) { - return setParamUseStillCameraForTimeLapse(useStillCamera); - } } else if (key == "time-between-time-lapse-frame-capture") { int64_t timeBetweenTimeLapseFrameCaptureMs; if (safe_strtoi64(value.string(), &timeBetweenTimeLapseFrameCaptureMs)) { @@ -1008,10 +990,10 @@ status_t StagefrightRecorder::setupCamera() { // Set the actual video recording frame size CameraParameters params(mCamera->getParameters()); - // dont change the preview size when using still camera for time lapse + // dont change the preview size because time lapse may be using still camera // as mVideoWidth, mVideoHeight may correspond to HD resolution not // supported by the video camera. - if (!(mCaptureTimeLapse && mUseStillCameraForTimeLapse)) { + if (!mCaptureTimeLapse) { params.setPreviewSize(mVideoWidth, mVideoHeight); } @@ -1027,7 +1009,7 @@ status_t StagefrightRecorder::setupCamera() { // Check on video frame size int frameWidth = 0, frameHeight = 0; newCameraParams.getPreviewSize(&frameWidth, &frameHeight); - if (!(mCaptureTimeLapse && mUseStillCameraForTimeLapse) && + if (!mCaptureTimeLapse && (frameWidth < 0 || frameWidth != mVideoWidth || frameHeight < 0 || frameHeight != mVideoHeight)) { LOGE("Failed to set the video frame size to %dx%d", @@ -1072,7 +1054,7 @@ status_t StagefrightRecorder::setupCameraSource(sp<CameraSource> *cameraSource) if (err != OK) return err; *cameraSource = (mCaptureTimeLapse) ? - CameraSourceTimeLapse::CreateFromCamera(mCamera, mUseStillCameraForTimeLapse, + CameraSourceTimeLapse::CreateFromCamera(mCamera, mTimeBetweenTimeLapseFrameCaptureUs, mVideoWidth, mVideoHeight, mFrameRate): CameraSource::CreateFromCamera(mCamera); CHECK(*cameraSource != NULL); @@ -1418,7 +1400,6 @@ status_t StagefrightRecorder::reset() { mMaxFileSizeBytes = 0; mTrackEveryTimeDurationUs = 0; mCaptureTimeLapse = false; - mUseStillCameraForTimeLapse = true; mTimeBetweenTimeLapseFrameCaptureUs = -1; mCaptureAuxVideo = false; mCameraSourceSplitter = NULL; diff --git a/media/libmediaplayerservice/StagefrightRecorder.h b/media/libmediaplayerservice/StagefrightRecorder.h index d50a393..f1dc9e6 100644 --- a/media/libmediaplayerservice/StagefrightRecorder.h +++ b/media/libmediaplayerservice/StagefrightRecorder.h @@ -98,7 +98,6 @@ private: int64_t mTrackEveryTimeDurationUs; bool mCaptureTimeLapse; - bool mUseStillCameraForTimeLapse; int64_t mTimeBetweenTimeLapseFrameCaptureUs; bool mCaptureAuxVideo; sp<MediaSourceSplitter> mCameraSourceSplitter; @@ -138,7 +137,6 @@ private: status_t setParamAudioSamplingRate(int32_t sampleRate); status_t setParamAudioTimeScale(int32_t timeScale); status_t setParamTimeLapseEnable(int32_t timeLapseEnable); - status_t setParamUseStillCameraForTimeLapse(int32_t useStillCamera); status_t setParamTimeBetweenTimeLapseFrameCapture(int64_t timeUs); status_t setParamAuxVideoHeight(int32_t height); status_t setParamAuxVideoWidth(int32_t width); |