aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--videocodec/OMXVideoDecoderAVC.cpp19
-rw-r--r--videocodec/OMXVideoDecoderH263.cpp15
-rw-r--r--videocodec/OMXVideoDecoderMPEG4.cpp16
3 files changed, 40 insertions, 10 deletions
diff --git a/videocodec/OMXVideoDecoderAVC.cpp b/videocodec/OMXVideoDecoderAVC.cpp
index 054c6bb..d54ce99 100644
--- a/videocodec/OMXVideoDecoderAVC.cpp
+++ b/videocodec/OMXVideoDecoderAVC.cpp
@@ -15,7 +15,7 @@
*/
-#define LOG_NDEBUG 0
+// #define LOG_NDEBUG 0
#define LOG_TAG "OMXVideoDecoder"
#include <utils/Log.h>
#include "OMXVideoDecoderAVC.h"
@@ -283,10 +283,21 @@ OMX_ERRORTYPE OMXVideoDecoderAVC::GetParamVideoAVCProfileLevel(OMX_PTR pStructur
OMX_VIDEO_PARAM_PROFILELEVELTYPE *p = (OMX_VIDEO_PARAM_PROFILELEVELTYPE *)pStructure;
CHECK_TYPE_HEADER(p);
CHECK_PORT_INDEX(p, INPORT_INDEX);
- CHECK_ENUMERATION_RANGE(p->nProfileIndex,1);
- p->eProfile = mParamAvc.eProfile;
- p->eLevel = mParamAvc.eLevel;
+ struct ProfileLevelTable {
+ OMX_U32 profile;
+ OMX_U32 level;
+ } plTable[] = {
+ {OMX_VIDEO_AVCProfileBaseline, OMX_VIDEO_AVCLevel41},
+ {OMX_VIDEO_AVCProfileMain, OMX_VIDEO_AVCLevel41},
+ {OMX_VIDEO_AVCProfileHigh, OMX_VIDEO_AVCLevel41}
+ };
+
+ OMX_U32 count = sizeof(plTable)/sizeof(ProfileLevelTable);
+ CHECK_ENUMERATION_RANGE(p->nProfileIndex,count);
+
+ p->eProfile = plTable[p->nProfileIndex].profile;
+ p->eLevel = plTable[p->nProfileIndex].level;
return OMX_ErrorNone;
}
diff --git a/videocodec/OMXVideoDecoderH263.cpp b/videocodec/OMXVideoDecoderH263.cpp
index 35697db..424ab54 100644
--- a/videocodec/OMXVideoDecoderH263.cpp
+++ b/videocodec/OMXVideoDecoderH263.cpp
@@ -113,10 +113,19 @@ OMX_ERRORTYPE OMXVideoDecoderH263::GetParamVideoH263ProfileLevel(OMX_PTR pStruct
OMX_ERRORTYPE ret;
OMX_VIDEO_PARAM_PROFILELEVELTYPE *p = (OMX_VIDEO_PARAM_PROFILELEVELTYPE *)pStructure;
CHECK_TYPE_HEADER(p);
- CHECK_ENUMERATION_RANGE(p->nProfileIndex,1);
- p->eProfile = mParamH263.eProfile;
- p->eLevel = mParamH263.eLevel;
+ struct ProfileLevelTable {
+ OMX_U32 profile;
+ OMX_U32 level;
+ } plTable[] = {
+ {OMX_VIDEO_H263ProfileBaseline, OMX_VIDEO_H263Level70}
+ };
+
+ OMX_U32 count = sizeof(plTable)/sizeof(ProfileLevelTable);
+ CHECK_ENUMERATION_RANGE(p->nProfileIndex,count);
+
+ p->eProfile = plTable[p->nProfileIndex].profile;
+ p->eLevel = plTable[p->nProfileIndex].level;
return OMX_ErrorNone;
}
diff --git a/videocodec/OMXVideoDecoderMPEG4.cpp b/videocodec/OMXVideoDecoderMPEG4.cpp
index d6e6757..0be7571 100644
--- a/videocodec/OMXVideoDecoderMPEG4.cpp
+++ b/videocodec/OMXVideoDecoderMPEG4.cpp
@@ -113,10 +113,20 @@ OMX_ERRORTYPE OMXVideoDecoderMPEG4::GetParamVideoMpeg4ProfileLevel(OMX_PTR pStru
OMX_ERRORTYPE ret;
OMX_VIDEO_PARAM_PROFILELEVELTYPE *p = (OMX_VIDEO_PARAM_PROFILELEVELTYPE *)pStructure;
CHECK_TYPE_HEADER(p);
- CHECK_ENUMERATION_RANGE(p->nProfileIndex,1);
- p->eProfile = mParamMpeg4.eProfile;
- p->eLevel = mParamMpeg4.eLevel;
+ struct ProfileLevelTable {
+ OMX_U32 profile;
+ OMX_U32 level;
+ } plTable[] = {
+ {OMX_VIDEO_MPEG4ProfileSimple, OMX_VIDEO_MPEG4Level3},
+ {OMX_VIDEO_MPEG4ProfileAdvancedSimple, OMX_VIDEO_MPEG4Level5}
+ };
+
+ OMX_U32 count = sizeof(plTable)/sizeof(ProfileLevelTable);
+ CHECK_ENUMERATION_RANGE(p->nProfileIndex,count);
+
+ p->eProfile = plTable[p->nProfileIndex].profile;
+ p->eLevel = plTable[p->nProfileIndex].level;
return OMX_ErrorNone;
}