summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/omx/OMXNodeInstance.cpp
diff options
context:
space:
mode:
authorRonghua Wu <ronghuawu@google.com>2015-01-26 15:47:10 -0800
committerRonghua Wu <ronghuawu@google.com>2015-02-12 22:39:44 +0000
commit37b2b389139ed638831e49708c947863eef631ef (patch)
tree0c0ea0f002452b5108dee8e3b24a9948415f3788 /media/libstagefright/omx/OMXNodeInstance.cpp
parente2cce8139fb5a205170d4e878cc9fea5493755d1 (diff)
downloadframeworks_av-37b2b389139ed638831e49708c947863eef631ef.zip
frameworks_av-37b2b389139ed638831e49708c947863eef631ef.tar.gz
frameworks_av-37b2b389139ed638831e49708c947863eef631ef.tar.bz2
stagefright: add support for limiting framerate in GraphicBufferSource
Bug: 19014096 Change-Id: I6de781e4d140a247dfd8fd8f12c3ddd7baa39ad4
Diffstat (limited to 'media/libstagefright/omx/OMXNodeInstance.cpp')
-rw-r--r--media/libstagefright/omx/OMXNodeInstance.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/media/libstagefright/omx/OMXNodeInstance.cpp b/media/libstagefright/omx/OMXNodeInstance.cpp
index c04d95f..bf59460 100644
--- a/media/libstagefright/omx/OMXNodeInstance.cpp
+++ b/media/libstagefright/omx/OMXNodeInstance.cpp
@@ -1075,6 +1075,7 @@ inline static const char *asString(IOMX::InternalOptionType i, const char *def =
case IOMX::INTERNAL_OPTION_REPEAT_PREVIOUS_FRAME_DELAY:
return "REPEAT_PREVIOUS_FRAME_DELAY";
case IOMX::INTERNAL_OPTION_MAX_TIMESTAMP_GAP: return "MAX_TIMESTAMP_GAP";
+ case IOMX::INTERNAL_OPTION_MAX_FPS: return "MAX_FPS";
case IOMX::INTERNAL_OPTION_START_TIME: return "START_TIME";
case IOMX::INTERNAL_OPTION_TIME_LAPSE: return "TIME_LAPSE";
default: return def;
@@ -1092,6 +1093,7 @@ status_t OMXNodeInstance::setInternalOption(
case IOMX::INTERNAL_OPTION_SUSPEND:
case IOMX::INTERNAL_OPTION_REPEAT_PREVIOUS_FRAME_DELAY:
case IOMX::INTERNAL_OPTION_MAX_TIMESTAMP_GAP:
+ case IOMX::INTERNAL_OPTION_MAX_FPS:
case IOMX::INTERNAL_OPTION_START_TIME:
case IOMX::INTERNAL_OPTION_TIME_LAPSE:
{
@@ -1129,6 +1131,14 @@ status_t OMXNodeInstance::setInternalOption(
int64_t maxGapUs = *(int64_t *)data;
CLOG_CONFIG(setInternalOption, "gapUs=%lld", (long long)maxGapUs);
return bufferSource->setMaxTimestampGapUs(maxGapUs);
+ } else if (type == IOMX::INTERNAL_OPTION_MAX_FPS) {
+ if (size != sizeof(float)) {
+ return INVALID_OPERATION;
+ }
+
+ float maxFps = *(float *)data;
+ CLOG_CONFIG(setInternalOption, "maxFps=%f", maxFps);
+ return bufferSource->setMaxFps(maxFps);
} else if (type == IOMX::INTERNAL_OPTION_START_TIME) {
if (size != sizeof(int64_t)) {
return INVALID_OPERATION;