aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuanjun Huang <yuanjun.huang@intel.com>2015-07-01 02:41:11 +0800
committerPatrick Tjin <pattjin@google.com>2015-07-01 08:34:37 -0700
commit11c1c17fed35585f9256031ee70db1c6c18d0219 (patch)
tree03775ce24bfe08f6aad7a476f9e1efa6e6271228
parent94dc18063f6f0f60d99feaa0ffb1fc103d49c2c8 (diff)
downloadandroid_hardware_intel_common_omx-components-11c1c17fed35585f9256031ee70db1c6c18d0219.tar.gz
android_hardware_intel_common_omx-components-11c1c17fed35585f9256031ee70db1c6c18d0219.tar.bz2
android_hardware_intel_common_omx-components-11c1c17fed35585f9256031ee70db1c6c18d0219.zip
Revert "omx-component: Adding media resource management support"
Bug: 20165724 A more comprehensive codec level resource manager is implemented. This reverts commit f832fbe64172f3dcde2bf8d7f960375efd8a30d9. Change-Id: Ia45655873c9b7e9d57bed6c8d5dad29e219a2e3c
-rw-r--r--videocodec/OMXVideoDecoderAVC.cpp26
-rw-r--r--videocodec/OMXVideoDecoderVP8.cpp27
-rw-r--r--videocodec/OMXVideoDecoderVP9Hybrid.cpp27
-rw-r--r--videocodec/OMXVideoEncoderAVC.cpp28
-rw-r--r--videocodec/OMXVideoEncoderVP8.cpp28
5 files changed, 5 insertions, 131 deletions
diff --git a/videocodec/OMXVideoDecoderAVC.cpp b/videocodec/OMXVideoDecoderAVC.cpp
index df3b4d2..87b74a4 100644
--- a/videocodec/OMXVideoDecoderAVC.cpp
+++ b/videocodec/OMXVideoDecoderAVC.cpp
@@ -25,9 +25,6 @@
static const char* AVC_MIME_TYPE = "video/h264";
#define INVALID_PTS (OMX_S64)-1
-// codec number limitation
-#define INSTANCE_LIMITATION 4
-static int gInstanceNumber = 0;
OMXVideoDecoderAVC::OMXVideoDecoderAVC()
: mAccumulateBuffer(NULL),
@@ -45,7 +42,6 @@ OMXVideoDecoderAVC::OMXVideoDecoderAVC()
}
OMXVideoDecoderAVC::~OMXVideoDecoderAVC() {
- gInstanceNumber --;
LOGV("OMXVideoDecoderAVC is destructed.");
}
@@ -333,24 +329,4 @@ OMX_ERRORTYPE OMXVideoDecoderAVC::SetMaxOutputBufferCount(OMX_PARAM_PORTDEFINITI
return OMXVideoDecoderBase::SetMaxOutputBufferCount(p);
}
-#define DECLARE_OMX_COMPONENT_AVC(NAME, ROLE, CLASS) \
- static const char *gName = (const char *)(NAME);\
- static const char *gRole = (const char *)(ROLE);\
- OMX_ERRORTYPE CreateInstance(OMX_PTR *instance) {\
- *instance = NULL;\
- if (gInstanceNumber + 1 > INSTANCE_LIMITATION) {\
- return OMX_ErrorInsufficientResources;\
- } else {\
- gInstanceNumber ++;\
- }\
- ComponentBase *inst = new CLASS;\
- if (!inst) {\
- return OMX_ErrorInsufficientResources;\
- }\
- *instance = inst;\
- return OMX_ErrorNone;\
- }\
- struct wrs_omxil_cmodule_ops_s gOps = {CreateInstance};\
- struct wrs_omxil_cmodule_s WRS_OMXIL_CMODULE_SYMBOL = {gName, &gRole, 1, &gOps};
-
-DECLARE_OMX_COMPONENT_AVC("OMX.Intel.VideoDecoder.AVC", "video_decoder.avc", OMXVideoDecoderAVC);
+DECLARE_OMX_COMPONENT("OMX.Intel.VideoDecoder.AVC", "video_decoder.avc", OMXVideoDecoderAVC);
diff --git a/videocodec/OMXVideoDecoderVP8.cpp b/videocodec/OMXVideoDecoderVP8.cpp
index 1dad3ae..013bf8b 100644
--- a/videocodec/OMXVideoDecoderVP8.cpp
+++ b/videocodec/OMXVideoDecoderVP8.cpp
@@ -22,10 +22,6 @@
// Be sure to have an equal string in VideoDecoderHost.cpp (libmix)
static const char* VP8_MIME_TYPE = "video/x-vnd.on2.vp8";
-// codec number limitation
-#define INSTANCE_LIMITATION 4
-static int gInstanceNumber = 0;
-
OMXVideoDecoderVP8::OMXVideoDecoderVP8() {
LOGV("OMXVideoDecoderVP8 is constructed.");
mVideoDecoder = createVideoDecoder(VP8_MIME_TYPE);
@@ -38,7 +34,6 @@ OMXVideoDecoderVP8::OMXVideoDecoderVP8() {
}
OMXVideoDecoderVP8::~OMXVideoDecoderVP8() {
- gInstanceNumber --;
LOGV("OMXVideoDecoderVP8 is destructed.");
}
@@ -133,26 +128,6 @@ OMX_ERRORTYPE OMXVideoDecoderVP8::SetMaxOutputBufferCount(OMX_PARAM_PORTDEFINITI
p->nBufferCountActual = OUTPORT_NATIVE_BUFFER_COUNT;
return OMXVideoDecoderBase::SetMaxOutputBufferCount(p);
}
+DECLARE_OMX_COMPONENT("OMX.Intel.VideoDecoder.VP8", "video_decoder.vp8", OMXVideoDecoderVP8);
-#define DECLARE_OMX_COMPONENT_VP8(NAME, ROLE, CLASS) \
- static const char *gName = (const char *)(NAME);\
- static const char *gRole = (const char *)(ROLE);\
- OMX_ERRORTYPE CreateInstance(OMX_PTR *instance) {\
- *instance = NULL;\
- if (gInstanceNumber + 1 > INSTANCE_LIMITATION) {\
- return OMX_ErrorInsufficientResources;\
- } else {\
- gInstanceNumber ++;\
- }\
- ComponentBase *inst = new CLASS;\
- if (!inst) {\
- return OMX_ErrorInsufficientResources;\
- }\
- *instance = inst;\
- return OMX_ErrorNone;\
- }\
- struct wrs_omxil_cmodule_ops_s gOps = {CreateInstance};\
- struct wrs_omxil_cmodule_s WRS_OMXIL_CMODULE_SYMBOL = {gName, &gRole, 1, &gOps};
-
-DECLARE_OMX_COMPONENT_VP8("OMX.Intel.VideoDecoder.VP8", "video_decoder.vp8", OMXVideoDecoderVP8);
diff --git a/videocodec/OMXVideoDecoderVP9Hybrid.cpp b/videocodec/OMXVideoDecoderVP9Hybrid.cpp
index b717e66..81e4f3f 100644
--- a/videocodec/OMXVideoDecoderVP9Hybrid.cpp
+++ b/videocodec/OMXVideoDecoderVP9Hybrid.cpp
@@ -25,10 +25,6 @@
#include <hardware/gralloc.h>
#include <system/graphics.h>
-// codec number limitation
-#define INSTANCE_LIMITATION 4
-static int gInstanceNumber = 0;
-
static const char* VP9_MIME_TYPE = "video/x-vnd.on2.vp9";
OMXVideoDecoderVP9Hybrid::OMXVideoDecoderVP9Hybrid() {
@@ -55,7 +51,6 @@ OMXVideoDecoderVP9Hybrid::OMXVideoDecoderVP9Hybrid() {
}
OMXVideoDecoderVP9Hybrid::~OMXVideoDecoderVP9Hybrid() {
- gInstanceNumber --;
LOGV("OMXVideoDecoderVP9Hybrid is destructed.");
}
@@ -659,24 +654,4 @@ bool OMXVideoDecoderVP9Hybrid::IsAllBufferAvailable(void) {
return mCheckBufferAvailable(mHybridCtx);
}
-#define DECLARE_OMX_COMPONENT_VP9(NAME, ROLE, CLASS) \
- static const char *gName = (const char *)(NAME);\
- static const char *gRole = (const char *)(ROLE);\
- OMX_ERRORTYPE CreateInstance(OMX_PTR *instance) {\
- *instance = NULL;\
- if (gInstanceNumber + 1 > INSTANCE_LIMITATION) {\
- return OMX_ErrorInsufficientResources;\
- } else {\
- gInstanceNumber ++;\
- }\
- ComponentBase *inst = new CLASS;\
- if (!inst) {\
- return OMX_ErrorInsufficientResources;\
- }\
- *instance = inst;\
- return OMX_ErrorNone;\
- }\
- struct wrs_omxil_cmodule_ops_s gOps = {CreateInstance};\
- struct wrs_omxil_cmodule_s WRS_OMXIL_CMODULE_SYMBOL = {gName, &gRole, 1, &gOps};
-
-DECLARE_OMX_COMPONENT_VP9("OMX.Intel.VideoDecoder.VP9.hybrid", "video_decoder.vp9", OMXVideoDecoderVP9Hybrid);
+DECLARE_OMX_COMPONENT("OMX.Intel.VideoDecoder.VP9.hybrid", "video_decoder.vp9", OMXVideoDecoderVP9Hybrid);
diff --git a/videocodec/OMXVideoEncoderAVC.cpp b/videocodec/OMXVideoEncoderAVC.cpp
index 220ca26..36390e2 100644
--- a/videocodec/OMXVideoEncoderAVC.cpp
+++ b/videocodec/OMXVideoEncoderAVC.cpp
@@ -20,10 +20,6 @@
static const char *AVC_MIME_TYPE = "video/h264";
-// AVC encoder instance limitation
-#define INSTANCE_LIMITATION 3
-static int gInstanceNumber = 0;
-
struct ProfileMap {
OMX_VIDEO_AVCPROFILETYPE key;
VAProfile value;
@@ -123,7 +119,6 @@ OMXVideoEncoderAVC::~OMXVideoEncoderAVC() {
delete mAVCParams;
mAVCParams = NULL;
}
- gInstanceNumber --;
}
OMX_ERRORTYPE OMXVideoEncoderAVC::InitOutputPortFormatSpecific(OMX_PARAM_PORTDEFINITIONTYPE *paramPortDefinitionOutput) {
@@ -1065,25 +1060,4 @@ OMX_ERRORTYPE OMXVideoEncoderAVC::SetParamVideoBytestream(OMX_PTR pStructure) {
}
-#define DECLARE_OMX_COMPONENT_AVC(NAME, ROLE, CLASS) \
- static const char *gName = (const char *)(NAME);\
- static const char *gRole = (const char *)(ROLE);\
- OMX_ERRORTYPE CreateInstance(OMX_PTR *instance) {\
- *instance = NULL;\
- if (gInstanceNumber + 1 > INSTANCE_LIMITATION) {\
- return OMX_ErrorInsufficientResources;\
- } else {\
- gInstanceNumber ++;\
- }\
- ComponentBase *inst = new CLASS;\
- if (!inst) {\
- return OMX_ErrorInsufficientResources;\
- }\
- *instance = inst;\
- return OMX_ErrorNone;\
- }\
- struct wrs_omxil_cmodule_ops_s gOps = {CreateInstance};\
- struct wrs_omxil_cmodule_s WRS_OMXIL_CMODULE_SYMBOL = {gName, &gRole, 1, &gOps};
-
-
-DECLARE_OMX_COMPONENT_AVC("OMX.Intel.VideoEncoder.AVC", "video_encoder.avc", OMXVideoEncoderAVC);
+DECLARE_OMX_COMPONENT("OMX.Intel.VideoEncoder.AVC", "video_encoder.avc", OMXVideoEncoderAVC);
diff --git a/videocodec/OMXVideoEncoderVP8.cpp b/videocodec/OMXVideoEncoderVP8.cpp
index c78a0ad..ec1062d 100644
--- a/videocodec/OMXVideoEncoderVP8.cpp
+++ b/videocodec/OMXVideoEncoderVP8.cpp
@@ -4,10 +4,6 @@
static const char *VP8_MIME_TYPE = "video/x-vnd.on2.vp8";
-// VP8 encoder instance limitation
-#define INSTANCE_LIMITATION 3
-static int gInstanceNumber = 0;
-
OMXVideoEncoderVP8::OMXVideoEncoderVP8() {
LOGV("OMXVideoEncoderVP8 is constructed.");
mLastTimestamp = 0x7FFFFFFFFFFFFFFFLL;
@@ -18,7 +14,6 @@ OMXVideoEncoderVP8::OMXVideoEncoderVP8() {
OMXVideoEncoderVP8::~OMXVideoEncoderVP8() {
LOGV("OMXVideoEncoderVP8 is destructed.");
- gInstanceNumber --;
}
OMX_ERRORTYPE OMXVideoEncoderVP8::InitOutputPortFormatSpecific(OMX_PARAM_PORTDEFINITIONTYPE *paramPortDefinitionOutput) {
@@ -326,25 +321,4 @@ OMX_ERRORTYPE OMXVideoEncoderVP8::SetConfigVp8MaxFrameSizeRatio(OMX_PTR pStructu
return OMX_ErrorNone;
}
-#define DECLARE_OMX_COMPONENT_VP8(NAME, ROLE, CLASS) \
- static const char *gName = (const char *)(NAME);\
- static const char *gRole = (const char *)(ROLE);\
- OMX_ERRORTYPE CreateInstance(OMX_PTR *instance) {\
- *instance = NULL;\
- if (gInstanceNumber + 1 > INSTANCE_LIMITATION) {\
- return OMX_ErrorInsufficientResources;\
- } else {\
- gInstanceNumber ++;\
- }\
- ComponentBase *inst = new CLASS;\
- if (!inst) {\
- return OMX_ErrorInsufficientResources;\
- }\
- *instance = inst;\
- return OMX_ErrorNone;\
- }\
- struct wrs_omxil_cmodule_ops_s gOps = {CreateInstance};\
- struct wrs_omxil_cmodule_s WRS_OMXIL_CMODULE_SYMBOL = {gName, &gRole, 1, &gOps};
-
-
-DECLARE_OMX_COMPONENT_VP8("OMX.Intel.VideoEncoder.VP8", "video_encoder.vp8", OMXVideoEncoderVP8);
+DECLARE_OMX_COMPONENT("OMX.Intel.VideoEncoder.VP8", "video_encoder.vp8", OMXVideoEncoderVP8);