summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/StagefrightRecorder.cpp
diff options
context:
space:
mode:
authorNipun Kwatra <nkwatra@google.com>2010-09-13 18:52:55 -0700
committerNipun Kwatra <nkwatra@google.com>2010-09-14 18:23:57 -0700
commit59d9e31c503e5c2f49448362a0d3a8f1150fb6c2 (patch)
tree89dad46179877bd15bd92127a36717c45d07cbcb /media/libmediaplayerservice/StagefrightRecorder.cpp
parent7bb20172891fdd27cc13208ac9e36b80309ab0e5 (diff)
downloadframeworks_av-59d9e31c503e5c2f49448362a0d3a8f1150fb6c2.zip
frameworks_av-59d9e31c503e5c2f49448362a0d3a8f1150fb6c2.tar.gz
frameworks_av-59d9e31c503e5c2f49448362a0d3a8f1150fb6c2.tar.bz2
Checks for auxiliary video recording.
- Check that time lapse mode is on when using auxiliary video recording. - Check that auxiliary video size is strictly less than the main video size. Change-Id: Ic49d25e6ac30f6f885ce4f5fb38dbe0cc7bc1be1
Diffstat (limited to 'media/libmediaplayerservice/StagefrightRecorder.cpp')
-rw-r--r--media/libmediaplayerservice/StagefrightRecorder.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp
index 77a9cca..fe5074b 100644
--- a/media/libmediaplayerservice/StagefrightRecorder.cpp
+++ b/media/libmediaplayerservice/StagefrightRecorder.cpp
@@ -1193,8 +1193,6 @@ status_t StagefrightRecorder::setupMPEG4Recording(
}
if ((videoWidth != mVideoWidth) || (videoHeight != mVideoHeight)) {
// Use downsampling from the original source.
- CHECK(videoWidth <= mVideoWidth);
- CHECK(videoHeight <= mVideoHeight);
cameraMediaSource =
new VideoSourceDownSampler(cameraMediaSource, videoWidth, videoHeight);
}
@@ -1244,6 +1242,10 @@ void StagefrightRecorder::setupMPEG4MetaData(int64_t startTimeUs, int32_t totalB
status_t StagefrightRecorder::startMPEG4Recording() {
if (mCaptureAuxVideo) {
+ if (!mCaptureTimeLapse) {
+ LOGE("Auxiliary video can be captured only in time lapse mode");
+ return UNKNOWN_ERROR;
+ }
LOGV("Creating MediaSourceSplitter");
sp<CameraSource> cameraSource;
status_t err = setupCameraSource(&cameraSource);
@@ -1278,6 +1280,12 @@ status_t StagefrightRecorder::startMPEG4Recording() {
LOGE("Auxiliary File writer is not avaialble");
return UNKNOWN_ERROR;
}
+ if ((mAuxVideoWidth > mVideoWidth) || (mAuxVideoHeight > mVideoHeight) ||
+ ((mAuxVideoWidth == mVideoWidth) && mAuxVideoHeight == mVideoHeight)) {
+ LOGE("Auxiliary video size (%d x %d) same or larger than the main video size (%d x %d)",
+ mAuxVideoWidth, mAuxVideoHeight, mVideoWidth, mVideoHeight);
+ return UNKNOWN_ERROR;
+ }
int32_t totalBitrateAux;
err = setupMPEG4Recording(mCaptureAuxVideo,