summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/omx/OMXNodeInstance.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2009-12-04 12:52:40 -0800
committerAndreas Huber <andih@google.com>2009-12-04 12:52:40 -0800
commitf0fb96c352f30b812a4903a1d783a715e1e817bd (patch)
treebf0573cd7eb7789a512c51f21c854c4e8b7fa017 /media/libstagefright/omx/OMXNodeInstance.cpp
parentadf7d77752b3dbd47badc8819aa2674860d6ccba (diff)
downloadframeworks_av-f0fb96c352f30b812a4903a1d783a715e1e817bd.zip
frameworks_av-f0fb96c352f30b812a4903a1d783a715e1e817bd.tar.gz
frameworks_av-f0fb96c352f30b812a4903a1d783a715e1e817bd.tar.bz2
Enable proper cleanup of OMX nodes managed through stagefright.
Diffstat (limited to 'media/libstagefright/omx/OMXNodeInstance.cpp')
-rw-r--r--media/libstagefright/omx/OMXNodeInstance.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/media/libstagefright/omx/OMXNodeInstance.cpp b/media/libstagefright/omx/OMXNodeInstance.cpp
index 099139a..288710e 100644
--- a/media/libstagefright/omx/OMXNodeInstance.cpp
+++ b/media/libstagefright/omx/OMXNodeInstance.cpp
@@ -19,6 +19,7 @@
#include <utils/Log.h>
#include "../include/OMXNodeInstance.h"
+#include "OMXMaster.h"
#include <OMX_Component.h>
@@ -106,7 +107,7 @@ static status_t StatusFromOMXError(OMX_ERRORTYPE err) {
return (err == OMX_ErrorNone) ? OK : UNKNOWN_ERROR;
}
-status_t OMXNodeInstance::freeNode() {
+status_t OMXNodeInstance::freeNode(OMXMaster *master) {
// Transition the node from its current state all the way down
// to "Loaded".
// This ensures that all active buffers are properly freed even
@@ -157,8 +158,9 @@ status_t OMXNodeInstance::freeNode() {
break;
}
- OMX_ERRORTYPE err =
- (*static_cast<OMX_COMPONENTTYPE *>(mHandle)->ComponentDeInit)(mHandle);
+ OMX_ERRORTYPE err = master->destroyComponentInstance(
+ static_cast<OMX_COMPONENTTYPE *>(mHandle));
+
mHandle = NULL;
if (err != OMX_ErrorNone) {
@@ -384,11 +386,11 @@ void OMXNodeInstance::onMessage(const omx_message &msg) {
mObserver->onMessage(msg);
}
-void OMXNodeInstance::onObserverDied() {
+void OMXNodeInstance::onObserverDied(OMXMaster *master) {
LOGE("!!! Observer died. Quickly, do something, ... anything...");
// Try to force shutdown of the node and hope for the best.
- freeNode();
+ freeNode(master);
}
void OMXNodeInstance::onGetHandleFailed() {