summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/codecs/avc
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2011-07-14 09:59:24 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-07-14 09:59:24 -0700
commit15825c7b6f6b19092a5949b4e46aea4fa229932c (patch)
treed9f7ac9876c2dde68c6cc962109a28d1c24231a6 /media/libstagefright/codecs/avc
parent2864c9a3a29311beb5ef96d8fc3c7745df2dd2cd (diff)
parent457116d3a01618acf9a875020ca5860551ba03a6 (diff)
downloadframeworks_av-15825c7b6f6b19092a5949b4e46aea4fa229932c.zip
frameworks_av-15825c7b6f6b19092a5949b4e46aea4fa229932c.tar.gz
frameworks_av-15825c7b6f6b19092a5949b4e46aea4fa229932c.tar.bz2
Merge "Support profile and level query for SW video decoders"
Diffstat (limited to 'media/libstagefright/codecs/avc')
-rw-r--r--media/libstagefright/codecs/avc/dec/SoftAVC.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/media/libstagefright/codecs/avc/dec/SoftAVC.cpp b/media/libstagefright/codecs/avc/dec/SoftAVC.cpp
index 9f141ac..6a476f6 100644
--- a/media/libstagefright/codecs/avc/dec/SoftAVC.cpp
+++ b/media/libstagefright/codecs/avc/dec/SoftAVC.cpp
@@ -23,6 +23,7 @@
#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/MediaDefs.h>
#include <media/stagefright/MediaErrors.h>
+#include <media/IOMX.h>
#include "avcdec_api.h"
#include "avcdec_int.h"
@@ -31,6 +32,13 @@ namespace android {
static const char kStartCode[4] = { 0x00, 0x00, 0x00, 0x01 };
+static const CodecProfileLevel kProfileLevels[] = {
+ { OMX_VIDEO_AVCProfileBaseline, OMX_VIDEO_AVCLevel1 },
+ { OMX_VIDEO_AVCProfileBaseline, OMX_VIDEO_AVCLevel1b },
+ { OMX_VIDEO_AVCProfileBaseline, OMX_VIDEO_AVCLevel11 },
+ { OMX_VIDEO_AVCProfileBaseline, OMX_VIDEO_AVCLevel12 },
+};
+
template<class T>
static void InitOMXParams(T *params) {
params->nSize = sizeof(T);
@@ -181,6 +189,28 @@ OMX_ERRORTYPE SoftAVC::internalGetParameter(
return OMX_ErrorNone;
}
+ case OMX_IndexParamVideoProfileLevelQuerySupported:
+ {
+ OMX_VIDEO_PARAM_PROFILELEVELTYPE *profileLevel =
+ (OMX_VIDEO_PARAM_PROFILELEVELTYPE *) params;
+
+ if (profileLevel->nPortIndex != 0) { // Input port only
+ LOGE("Invalid port index: %ld", profileLevel->nPortIndex);
+ return OMX_ErrorUnsupportedIndex;
+ }
+
+ size_t index = profileLevel->nProfileIndex;
+ size_t nProfileLevels =
+ sizeof(kProfileLevels) / sizeof(kProfileLevels[0]);
+ if (index >= nProfileLevels) {
+ return OMX_ErrorNoMore;
+ }
+
+ profileLevel->eProfile = kProfileLevels[index].mProfile;
+ profileLevel->eLevel = kProfileLevels[index].mLevel;
+ return OMX_ErrorNone;
+ }
+
default:
return SimpleSoftOMXComponent::internalGetParameter(index, params);
}