status_t OMX::freeNode(node_id node) { OMXNodeInstance *instance = findInstance(node); { Mutex::Autolock autoLock(mLock); ssize_t index = mLiveNodes.indexOfKey(instance->observer()->asBinder()); if (index < 0) { // This could conceivably happen if the observer dies at roughly the // same time that a client attempts to free the node explicitly. return OK; } mLiveNodes.removeItemsAt(index); } instance->observer()->asBinder()->unlinkToDeath(this); status_t err = instance->freeNode(mMaster); { Mutex::Autolock autoLock(mLock); ssize_t index = mDispatchers.indexOfKey(node); CHECK(index >= 0); mDispatchers.removeItemsAt(index); } return err; }
status_t OMX::freeNode(node_id node) { OMXNodeInstance *instance = findInstance(node); ssize_t index = mLiveNodes.indexOfKey(instance->observer()->asBinder()); CHECK(index >= 0); mLiveNodes.removeItemsAt(index); instance->observer()->asBinder()->unlinkToDeath(this); return instance->freeNode(mMaster); }
status_t OMX::freeNode(node_id node) { OMXNodeInstance *instance = findInstance(node); ssize_t index = mLiveNodes.indexOfKey(instance->observer()->asBinder()); CHECK(index >= 0); mLiveNodes.removeItemsAt(index); instance->observer()->asBinder()->unlinkToDeath(this); status_t err = instance->freeNode(mMaster); { Mutex::Autolock autoLock(mLock); index = mDispatchers.indexOfKey(node); CHECK(index >= 0); mDispatchers.removeItemsAt(index); } return err; }