summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/omx/OMX.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2009-12-03 11:39:54 -0800
committerAndreas Huber <andih@google.com>2009-12-03 12:49:09 -0800
commite3ec3cec3a2e27033249ff82964d2cbd441d9873 (patch)
tree46e3b22fc02c1f20b8a8403818395ba4ba51ddb2 /media/libstagefright/omx/OMX.cpp
parentc297fccffc4ab1cb3b9f5c6a5b0802be057f3e0f (diff)
downloadframeworks_av-e3ec3cec3a2e27033249ff82964d2cbd441d9873.zip
frameworks_av-e3ec3cec3a2e27033249ff82964d2cbd441d9873.tar.gz
frameworks_av-e3ec3cec3a2e27033249ff82964d2cbd441d9873.tar.bz2
Squashed commit of the following:
commit 543e192bf2ae13f573dc4c4e53b239ed4ea00e81 Author: Andreas Huber <andih@google.com> Date: Thu Dec 3 11:33:57 2009 -0800 stagefright now acts as the OMX Master, vendors supply their own plugins through libstagefrighthw. In OpenCore-enabled builds we now sit on top of PVMaster... commit 3cbfdbd9cecadbb77b63125c62883bf1065884fe Author: Andreas Huber <andih@google.com> Date: Wed Dec 2 12:39:07 2009 -0800 More OMX infrastructure, stagefright is now taking over the OMX Master, multiplexing all contributing OMX implementations under a common interface.
Diffstat (limited to 'media/libstagefright/omx/OMX.cpp')
-rw-r--r--media/libstagefright/omx/OMX.cpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/media/libstagefright/omx/OMX.cpp b/media/libstagefright/omx/OMX.cpp
index 5b3cc1b..9f93c31 100644
--- a/media/libstagefright/omx/OMX.cpp
+++ b/media/libstagefright/omx/OMX.cpp
@@ -18,11 +18,11 @@
#define LOG_TAG "OMX"
#include <utils/Log.h>
+#include <dlfcn.h>
+
#include "../include/OMX.h"
#include "OMXRenderer.h"
-#include "pv_omxcore.h"
-
#include "../include/OMXNodeInstance.h"
#include "../include/SoftwareRenderer.h"
@@ -30,6 +30,8 @@
#include <media/stagefright/MediaDebug.h>
#include <media/stagefright/VideoRenderer.h>
+#include "OMXMaster.h"
+
#include <OMX_Component.h>
namespace android {
@@ -178,10 +180,16 @@ private:
};
OMX::OMX()
- : mDispatcher(new CallbackDispatcher(this)),
+ : mMaster(new OMXMaster),
+ mDispatcher(new CallbackDispatcher(this)),
mNodeCounter(0) {
}
+OMX::~OMX() {
+ delete mMaster;
+ mMaster = NULL;
+}
+
void OMX::binderDied(const wp<IBinder> &the_late_who) {
OMXNodeInstance *instance;
@@ -201,14 +209,12 @@ void OMX::binderDied(const wp<IBinder> &the_late_who) {
}
status_t OMX::listNodes(List<String8> *list) {
- OMX_MasterInit(); // XXX Put this somewhere else.
-
list->clear();
OMX_U32 index = 0;
char componentName[256];
- while (OMX_MasterComponentNameEnum(componentName, sizeof(componentName), index)
- == OMX_ErrorNone) {
+ while (mMaster->enumerateComponents(
+ componentName, sizeof(componentName), index) == OMX_ErrorNone) {
list->push_back(String8(componentName));
++index;
@@ -223,14 +229,12 @@ status_t OMX::allocateNode(
*node = 0;
- OMX_MasterInit(); // XXX Put this somewhere else.
-
OMXNodeInstance *instance = new OMXNodeInstance(this, observer);
- OMX_HANDLETYPE handle;
- OMX_ERRORTYPE err = OMX_MasterGetHandle(
- &handle, const_cast<char *>(name), instance,
- &OMXNodeInstance::kCallbacks);
+ OMX_COMPONENTTYPE *handle;
+ OMX_ERRORTYPE err = mMaster->makeComponentInstance(
+ name, &OMXNodeInstance::kCallbacks,
+ instance, &handle);
if (err != OMX_ErrorNone) {
LOGV("FAILED to allocate omx component '%s'", name);