summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/OMXCodec.cpp
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-09-15 21:07:52 -0700
committerJames Dong <jdong@google.com>2010-09-16 11:34:20 -0700
commitf01691f44dcbe38a0ab3914e7c709ddc009d95dc (patch)
tree7b9fc42501757edfed4677c4260907f770de1e3d /media/libstagefright/OMXCodec.cpp
parentaae3516293e58c0b015d4109bde58c11d503433c (diff)
downloadframeworks_av-f01691f44dcbe38a0ab3914e7c709ddc009d95dc.zip
frameworks_av-f01691f44dcbe38a0ab3914e7c709ddc009d95dc.tar.gz
frameworks_av-f01691f44dcbe38a0ab3914e7c709ddc009d95dc.tar.bz2
Fixed a bug in the query to the supported profiles and levels
According to OMX spec, the levels returned is the max level settings. In fact, we could not enum all the levels. Change-Id: Ib1cba74100512800a5761c7567894c7ea5b5a452
Diffstat (limited to 'media/libstagefright/OMXCodec.cpp')
-rw-r--r--media/libstagefright/OMXCodec.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 3d25a4b..cd70a3d 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -1035,7 +1035,7 @@ status_t OMXCodec::getVideoProfileLevel(
mNode, OMX_IndexParamVideoProfileLevelQuerySupported,
&param, sizeof(param));
- if (err != OK) return err;
+ if (err != OK) break;
int32_t supportedProfile = static_cast<int32_t>(param.eProfile);
int32_t supportedLevel = static_cast<int32_t>(param.eLevel);
@@ -1043,7 +1043,10 @@ status_t OMXCodec::getVideoProfileLevel(
supportedProfile, supportedLevel);
if (profile == supportedProfile &&
- level == supportedLevel) {
+ level <= supportedLevel) {
+ // We can further check whether the level is a valid
+ // value; but we will leave that to the omx encoder component
+ // via OMX_SetParameter call.
profileLevel.mProfile = profile;
profileLevel.mLevel = level;
return OK;