summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRachad <rachad@google.com>2015-01-29 19:24:08 -0800
committerRachad <rachad@google.com>2015-01-29 19:24:08 -0800
commit78b01639c08fe5e7e9c1be5e9dc5de560f1383f9 (patch)
tree0187106f6f7e64716a6cc66a57450559fc61d400
parent64c496c8d51c71605cd34a510da2ecd8180656ec (diff)
downloadframeworks_av-78b01639c08fe5e7e9c1be5e9dc5de560f1383f9.zip
frameworks_av-78b01639c08fe5e7e9c1be5e9dc5de560f1383f9.tar.gz
frameworks_av-78b01639c08fe5e7e9c1be5e9dc5de560f1383f9.tar.bz2
Acodec: Send framerate information to OMX decoder if available
Bug: 19110889 Change-Id: Ia8dbe1b77aaac421ec9415884e1248b9b68168dc
-rw-r--r--include/media/stagefright/ACodec.h2
-rw-r--r--media/libstagefright/ACodec.cpp17
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 87606a5..9b9153b 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -2224,8 +2224,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;
@@ -2989,7 +2998,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;
@@ -3017,6 +3027,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(