Loading media/java/android/media/MediaRecorder.java +3 −0 Original line number Diff line number Diff line Loading @@ -288,9 +288,12 @@ public class MediaRecorder * @hide */ public void setTimeLapseParameters(boolean enableTimeLapse, boolean useStillCameraForTimeLapse, int timeBetweenTimeLapseFrameCaptureMs, int encoderLevel) { setParameter(String.format("time-lapse-enable=%d", (enableTimeLapse) ? 1 : 0)); setParameter(String.format("use-still-camera-for-time-lapse=%d", (useStillCameraForTimeLapse) ? 1 : 0)); setParameter(String.format("time-between-time-lapse-frame-capture=%d", timeBetweenTimeLapseFrameCaptureMs)); setVideoEncoderLevel(encoderLevel); Loading media/libmediaplayerservice/StagefrightRecorder.cpp +20 −1 Original line number Diff line number Diff line Loading @@ -486,6 +486,19 @@ 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); Loading Loading @@ -587,6 +600,11 @@ 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)) { Loading Loading @@ -930,7 +948,7 @@ status_t StagefrightRecorder::setupVideoEncoder(const sp<MediaWriter>& writer) { if (err != OK) return err; sp<CameraSource> cameraSource = (mCaptureTimeLapse) ? CameraSourceTimeLapse::CreateFromCamera(mCamera, true, CameraSourceTimeLapse::CreateFromCamera(mCamera, mUseStillCameraForTimeLapse, mTimeBetweenTimeLapseFrameCaptureUs, mVideoWidth, mVideoHeight, mFrameRate): CameraSource::CreateFromCamera(mCamera); CHECK(cameraSource != NULL); Loading Loading @@ -1133,6 +1151,7 @@ status_t StagefrightRecorder::reset() { mMaxFileSizeBytes = 0; mTrackEveryTimeDurationUs = 0; mCaptureTimeLapse = false; mUseStillCameraForTimeLapse = true; mTimeBetweenTimeLapseFrameCaptureUs = -1; mEncoderProfiles = MediaProfiles::getInstance(); Loading media/libmediaplayerservice/StagefrightRecorder.h +2 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ private: int64_t mTrackEveryTimeDurationUs; bool mCaptureTimeLapse; bool mUseStillCameraForTimeLapse; int64_t mTimeBetweenTimeLapseFrameCaptureUs; String8 mParams; Loading @@ -116,6 +117,7 @@ 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 setParamVideoEncodingBitRate(int32_t bitRate); status_t setParamVideoIFramesInterval(int32_t seconds); Loading Loading
media/java/android/media/MediaRecorder.java +3 −0 Original line number Diff line number Diff line Loading @@ -288,9 +288,12 @@ public class MediaRecorder * @hide */ public void setTimeLapseParameters(boolean enableTimeLapse, boolean useStillCameraForTimeLapse, int timeBetweenTimeLapseFrameCaptureMs, int encoderLevel) { setParameter(String.format("time-lapse-enable=%d", (enableTimeLapse) ? 1 : 0)); setParameter(String.format("use-still-camera-for-time-lapse=%d", (useStillCameraForTimeLapse) ? 1 : 0)); setParameter(String.format("time-between-time-lapse-frame-capture=%d", timeBetweenTimeLapseFrameCaptureMs)); setVideoEncoderLevel(encoderLevel); Loading
media/libmediaplayerservice/StagefrightRecorder.cpp +20 −1 Original line number Diff line number Diff line Loading @@ -486,6 +486,19 @@ 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); Loading Loading @@ -587,6 +600,11 @@ 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)) { Loading Loading @@ -930,7 +948,7 @@ status_t StagefrightRecorder::setupVideoEncoder(const sp<MediaWriter>& writer) { if (err != OK) return err; sp<CameraSource> cameraSource = (mCaptureTimeLapse) ? CameraSourceTimeLapse::CreateFromCamera(mCamera, true, CameraSourceTimeLapse::CreateFromCamera(mCamera, mUseStillCameraForTimeLapse, mTimeBetweenTimeLapseFrameCaptureUs, mVideoWidth, mVideoHeight, mFrameRate): CameraSource::CreateFromCamera(mCamera); CHECK(cameraSource != NULL); Loading Loading @@ -1133,6 +1151,7 @@ status_t StagefrightRecorder::reset() { mMaxFileSizeBytes = 0; mTrackEveryTimeDurationUs = 0; mCaptureTimeLapse = false; mUseStillCameraForTimeLapse = true; mTimeBetweenTimeLapseFrameCaptureUs = -1; mEncoderProfiles = MediaProfiles::getInstance(); Loading
media/libmediaplayerservice/StagefrightRecorder.h +2 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ private: int64_t mTrackEveryTimeDurationUs; bool mCaptureTimeLapse; bool mUseStillCameraForTimeLapse; int64_t mTimeBetweenTimeLapseFrameCaptureUs; String8 mParams; Loading @@ -116,6 +117,7 @@ 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 setParamVideoEncodingBitRate(int32_t bitRate); status_t setParamVideoIFramesInterval(int32_t seconds); Loading