diff options
author | Chong Zhang <chz@google.com> | 2014-02-22 04:42:25 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-02-22 04:42:25 +0000 |
commit | dc6ac201032d0f6ad0c8149ae2f009ec38693025 (patch) | |
tree | 66b04298c58f76a0c9723dcd6c6dbb2ebfa6ee63 /media/libmediaplayerservice | |
parent | 323da1015a758243c2c43017b026a01c6cf0c6f2 (diff) | |
parent | 2c9c8cba8562cc3a27532e4cd348912cc78d8d98 (diff) | |
download | frameworks_av-dc6ac201032d0f6ad0c8149ae2f009ec38693025.zip frameworks_av-dc6ac201032d0f6ad0c8149ae2f009ec38693025.tar.gz frameworks_av-dc6ac201032d0f6ad0c8149ae2f009ec38693025.tar.bz2 |
Merge "support for time lapse/slow motion when using SURFACE source"
Diffstat (limited to 'media/libmediaplayerservice')
-rw-r--r-- | media/libmediaplayerservice/StagefrightRecorder.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp index d377acd..845a589 100644 --- a/media/libmediaplayerservice/StagefrightRecorder.cpp +++ b/media/libmediaplayerservice/StagefrightRecorder.cpp @@ -690,10 +690,10 @@ status_t StagefrightRecorder::setParameter( return setParamTimeLapseEnable(timeLapseEnable); } } else if (key == "time-between-time-lapse-frame-capture") { - int64_t timeBetweenTimeLapseFrameCaptureMs; - if (safe_strtoi64(value.string(), &timeBetweenTimeLapseFrameCaptureMs)) { + int64_t timeBetweenTimeLapseFrameCaptureUs; + if (safe_strtoi64(value.string(), &timeBetweenTimeLapseFrameCaptureUs)) { return setParamTimeBetweenTimeLapseFrameCapture( - 1000LL * timeBetweenTimeLapseFrameCaptureMs); + timeBetweenTimeLapseFrameCaptureUs); } } else { ALOGE("setParameter: failed to find key %s", key.string()); @@ -1436,6 +1436,17 @@ status_t StagefrightRecorder::setupVideoEncoder( format->setInt32("stride", mVideoWidth); format->setInt32("slice-height", mVideoWidth); format->setInt32("color-format", OMX_COLOR_FormatAndroidOpaque); + + // set up time lapse/slow motion for surface source + if (mCaptureTimeLapse) { + if (mTimeBetweenTimeLapseFrameCaptureUs <= 0) { + ALOGE("Invalid mTimeBetweenTimeLapseFrameCaptureUs value: %lld", + mTimeBetweenTimeLapseFrameCaptureUs); + return BAD_VALUE; + } + format->setInt64("time-lapse", + mTimeBetweenTimeLapseFrameCaptureUs); + } } format->setInt32("bitrate", mVideoBitRate); |