diff options
author | Rachad <rachad@google.com> | 2015-02-02 15:37:11 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-02-02 15:37:11 +0000 |
commit | 82a4ca039f600569726df0326269b4ac1a78fc6c (patch) | |
tree | e25655727edd3260fca511a3dd6b056408405a29 | |
parent | d7dbf4179aa87a018d4a8a4cd0958a5ed5d7fe5f (diff) | |
parent | a601b86287ab5437a7e9aaf6f09bc171803cdc3d (diff) | |
download | frameworks_av-82a4ca039f600569726df0326269b4ac1a78fc6c.zip frameworks_av-82a4ca039f600569726df0326269b4ac1a78fc6c.tar.gz frameworks_av-82a4ca039f600569726df0326269b4ac1a78fc6c.tar.bz2 |
am a601b862: am c9e11696: am 36dca156: Merge "Acodec: Send framerate information to OMX decoder if available" into lmp-mr1-dev
* commit 'a601b86287ab5437a7e9aaf6f09bc171803cdc3d':
Acodec: Send framerate information to OMX decoder if available
-rw-r--r-- | include/media/stagefright/ACodec.h | 2 | ||||
-rw-r--r-- | media/libstagefright/ACodec.cpp | 17 |
2 files changed, 16 insertions, 3 deletions
diff --git a/include/media/stagefright/ACodec.h b/include/media/stagefright/ACodec.h index 371e2c8..8509d55 100644 --- a/include/media/stagefright/ACodec.h +++ b/include/media/stagefright/ACodec.h @@ -264,7 +264,7 @@ private: status_t setVideoFormatOnPort( OMX_U32 portIndex, int32_t width, int32_t height, - OMX_VIDEO_CODINGTYPE compressionFormat); + OMX_VIDEO_CODINGTYPE compressionFormat, float frameRate = -1.0); typedef struct drcParams { int32_t drcCut; diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index fa31c44..9fc6b23 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -2223,8 +2223,17 @@ status_t ACodec::setupVideoDecoder( return err; } + int32_t frameRateInt; + float frameRateFloat; + if (!msg->findFloat("frame-rate", &frameRateFloat)) { + if (!msg->findInt32("frame-rate", &frameRateInt)) { + frameRateInt = -1; + } + frameRateFloat = (float)frameRateInt; + } + err = setVideoFormatOnPort( - kPortIndexInput, width, height, compressionFormat); + kPortIndexInput, width, height, compressionFormat, frameRateFloat); if (err != OK) { return err; @@ -2988,7 +2997,8 @@ status_t ACodec::setupErrorCorrectionParameters() { status_t ACodec::setVideoFormatOnPort( OMX_U32 portIndex, - int32_t width, int32_t height, OMX_VIDEO_CODINGTYPE compressionFormat) { + int32_t width, int32_t height, OMX_VIDEO_CODINGTYPE compressionFormat, + float frameRate) { OMX_PARAM_PORTDEFINITIONTYPE def; InitOMXParams(&def); def.nPortIndex = portIndex; @@ -3016,6 +3026,9 @@ status_t ACodec::setVideoFormatOnPort( if (portIndex == kPortIndexInput) { video_def->eCompressionFormat = compressionFormat; video_def->eColorFormat = OMX_COLOR_FormatUnused; + if (frameRate >= 0) { + video_def->xFramerate = (OMX_U32)(frameRate * 65536.0f); + } } err = mOMX->setParameter( |