aboutsummaryrefslogtreecommitdiffstats
path: root/videocodec/OMXVideoEncoderBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'videocodec/OMXVideoEncoderBase.cpp')
-rw-r--r--videocodec/OMXVideoEncoderBase.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/videocodec/OMXVideoEncoderBase.cpp b/videocodec/OMXVideoEncoderBase.cpp
index 70d6b60..63ab076 100644
--- a/videocodec/OMXVideoEncoderBase.cpp
+++ b/videocodec/OMXVideoEncoderBase.cpp
@@ -28,6 +28,7 @@ OMXVideoEncoderBase::OMXVideoEncoderBase()
,mEncoderParams(NULL)
,mFrameInputCount(0)
,mFrameOutputCount(0)
+ ,mPFrames(0)
,mFrameRetrieved(OMX_TRUE)
,mFirstFrame(OMX_TRUE)
,mStoreMetaDataInBuffers(OMX_FALSE) {
@@ -270,11 +271,11 @@ OMX_ERRORTYPE OMXVideoEncoderBase::SetVideoEncoderParam() {
mConfigFramerate.xEncodeFramerate = paramPortDefinitionInput->format.video.xFramerate >> 16;
}
- if(mEncoderParams->intraPeriod == 0) {
- OMX_U32 intraPeriod = mEncoderParams->frameRate.frameRateNum / 2;
- mEncoderParams->intraPeriod = (intraPeriod < 15) ? 15 : intraPeriod; // Limit intra frame period to ensure video quality for low bitrate application.
+ if(mPFrames == 0) {
+ mPFrames = mEncoderParams->frameRate.frameRateNum / 2;
+ mPFrames = (mPFrames < 15) ? 15 : mPFrames; // Limit intra frame period to ensure video quality for low bitrate application.
}
-
+ mEncoderParams->intraPeriod = mPFrames;
mEncoderParams->rawFormat = RAW_FORMAT_NV12;
LOGV("frameRate.frameRateDenom = %d\n", mEncoderParams->frameRate.frameRateDenom);