Loading include/media/IOMX.h +1 −0 Original line number Diff line number Diff line Loading @@ -144,6 +144,7 @@ public: INTERNAL_OPTION_REPEAT_PREVIOUS_FRAME_DELAY, // data is an int64_t INTERNAL_OPTION_MAX_TIMESTAMP_GAP, // data is int64_t INTERNAL_OPTION_START_TIME, // data is an int64_t INTERNAL_OPTION_TIME_LAPSE, // data is an int64_t[2] }; virtual status_t setInternalOption( node_id node, Loading include/media/stagefright/ACodec.h +3 −0 Original line number Diff line number Diff line Loading @@ -207,6 +207,9 @@ private: int64_t mRepeatFrameDelayUs; int64_t mMaxPtsGapUs; int64_t mTimePerFrameUs; int64_t mTimePerCaptureUs; bool mCreateInputBuffersSuspended; status_t setCyclicIntraMacroblockRefresh(const sp<AMessage> &msg, int32_t mode); Loading media/libmediaplayerservice/StagefrightRecorder.cpp +14 −3 Original line number Diff line number Diff line Loading @@ -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()); Loading Loading @@ -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); Loading media/libstagefright/ACodec.cpp +31 −5 Original line number Diff line number Diff line Loading @@ -374,7 +374,9 @@ ACodec::ACodec() mStoreMetaDataInOutputBuffers(false), mMetaDataBuffersToSubmit(0), mRepeatFrameDelayUs(-1ll), mMaxPtsGapUs(-1l), mMaxPtsGapUs(-1ll), mTimePerCaptureUs(-1ll), mTimePerFrameUs(-1ll), mCreateInputBuffersSuspended(false) { mUninitializedState = new UninitializedState(this); mLoadedState = new LoadedState(this); Loading Loading @@ -1119,7 +1121,11 @@ status_t ACodec::configureCodec( } if (!msg->findInt64("max-pts-gap-to-encoder", &mMaxPtsGapUs)) { mMaxPtsGapUs = -1l; mMaxPtsGapUs = -1ll; } if (!msg->findInt64("time-lapse", &mTimePerCaptureUs)) { mTimePerCaptureUs = -1ll; } if (!msg->findInt32( Loading Loading @@ -1916,6 +1922,7 @@ status_t ACodec::setupVideoEncoder(const char *mime, const sp<AMessage> &msg) { return INVALID_OPERATION; } frameRate = (float)tmp; mTimePerFrameUs = (int64_t) (1000000.0f / frameRate); } video_def->xFramerate = (OMX_U32)(frameRate * 65536.0f); Loading Loading @@ -3938,7 +3945,7 @@ void ACodec::LoadedState::onCreateInputSurface( } } if (err == OK && mCodec->mMaxPtsGapUs > 0l) { if (err == OK && mCodec->mMaxPtsGapUs > 0ll) { err = mCodec->mOMX->setInternalOption( mCodec->mNode, kPortIndexInput, Loading @@ -3953,6 +3960,25 @@ void ACodec::LoadedState::onCreateInputSurface( } } if (err == OK && mCodec->mTimePerCaptureUs > 0ll && mCodec->mTimePerFrameUs > 0ll) { int64_t timeLapse[2]; timeLapse[0] = mCodec->mTimePerFrameUs; timeLapse[1] = mCodec->mTimePerCaptureUs; err = mCodec->mOMX->setInternalOption( mCodec->mNode, kPortIndexInput, IOMX::INTERNAL_OPTION_TIME_LAPSE, &timeLapse[0], sizeof(timeLapse)); if (err != OK) { ALOGE("[%s] Unable to configure time lapse (err %d)", mCodec->mComponentName.c_str(), err); } } if (err == OK && mCodec->mCreateInputBuffersSuspended) { bool suspend = true; err = mCodec->mOMX->setInternalOption( Loading media/libstagefright/Utils.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -452,6 +452,11 @@ void convertMessageToMetaData(const sp<AMessage> &msg, sp<MetaData> &meta) { } } int32_t timeScale; if (msg->findInt32("time-scale", &timeScale)) { meta->setInt32(kKeyTimeScale, timeScale); } // XXX TODO add whatever other keys there are #if 0 Loading Loading
include/media/IOMX.h +1 −0 Original line number Diff line number Diff line Loading @@ -144,6 +144,7 @@ public: INTERNAL_OPTION_REPEAT_PREVIOUS_FRAME_DELAY, // data is an int64_t INTERNAL_OPTION_MAX_TIMESTAMP_GAP, // data is int64_t INTERNAL_OPTION_START_TIME, // data is an int64_t INTERNAL_OPTION_TIME_LAPSE, // data is an int64_t[2] }; virtual status_t setInternalOption( node_id node, Loading
include/media/stagefright/ACodec.h +3 −0 Original line number Diff line number Diff line Loading @@ -207,6 +207,9 @@ private: int64_t mRepeatFrameDelayUs; int64_t mMaxPtsGapUs; int64_t mTimePerFrameUs; int64_t mTimePerCaptureUs; bool mCreateInputBuffersSuspended; status_t setCyclicIntraMacroblockRefresh(const sp<AMessage> &msg, int32_t mode); Loading
media/libmediaplayerservice/StagefrightRecorder.cpp +14 −3 Original line number Diff line number Diff line Loading @@ -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()); Loading Loading @@ -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); Loading
media/libstagefright/ACodec.cpp +31 −5 Original line number Diff line number Diff line Loading @@ -374,7 +374,9 @@ ACodec::ACodec() mStoreMetaDataInOutputBuffers(false), mMetaDataBuffersToSubmit(0), mRepeatFrameDelayUs(-1ll), mMaxPtsGapUs(-1l), mMaxPtsGapUs(-1ll), mTimePerCaptureUs(-1ll), mTimePerFrameUs(-1ll), mCreateInputBuffersSuspended(false) { mUninitializedState = new UninitializedState(this); mLoadedState = new LoadedState(this); Loading Loading @@ -1119,7 +1121,11 @@ status_t ACodec::configureCodec( } if (!msg->findInt64("max-pts-gap-to-encoder", &mMaxPtsGapUs)) { mMaxPtsGapUs = -1l; mMaxPtsGapUs = -1ll; } if (!msg->findInt64("time-lapse", &mTimePerCaptureUs)) { mTimePerCaptureUs = -1ll; } if (!msg->findInt32( Loading Loading @@ -1916,6 +1922,7 @@ status_t ACodec::setupVideoEncoder(const char *mime, const sp<AMessage> &msg) { return INVALID_OPERATION; } frameRate = (float)tmp; mTimePerFrameUs = (int64_t) (1000000.0f / frameRate); } video_def->xFramerate = (OMX_U32)(frameRate * 65536.0f); Loading Loading @@ -3938,7 +3945,7 @@ void ACodec::LoadedState::onCreateInputSurface( } } if (err == OK && mCodec->mMaxPtsGapUs > 0l) { if (err == OK && mCodec->mMaxPtsGapUs > 0ll) { err = mCodec->mOMX->setInternalOption( mCodec->mNode, kPortIndexInput, Loading @@ -3953,6 +3960,25 @@ void ACodec::LoadedState::onCreateInputSurface( } } if (err == OK && mCodec->mTimePerCaptureUs > 0ll && mCodec->mTimePerFrameUs > 0ll) { int64_t timeLapse[2]; timeLapse[0] = mCodec->mTimePerFrameUs; timeLapse[1] = mCodec->mTimePerCaptureUs; err = mCodec->mOMX->setInternalOption( mCodec->mNode, kPortIndexInput, IOMX::INTERNAL_OPTION_TIME_LAPSE, &timeLapse[0], sizeof(timeLapse)); if (err != OK) { ALOGE("[%s] Unable to configure time lapse (err %d)", mCodec->mComponentName.c_str(), err); } } if (err == OK && mCodec->mCreateInputBuffersSuspended) { bool suspend = true; err = mCodec->mOMX->setInternalOption( Loading
media/libstagefright/Utils.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -452,6 +452,11 @@ void convertMessageToMetaData(const sp<AMessage> &msg, sp<MetaData> &meta) { } } int32_t timeScale; if (msg->findInt32("time-scale", &timeScale)) { meta->setInt32(kKeyTimeScale, timeScale); } // XXX TODO add whatever other keys there are #if 0 Loading