XnStatus PlayerNode::RemovePlayerNodeInfo(XnUInt32 nNodeID) { XnStatus nRetVal = XN_STATUS_OK; xn::Player playerNode; nRetVal = m_context.GetProductionNodeByName(m_strName, playerNode); XN_IS_STATUS_OK(nRetVal); PlayerNodeInfo* pPlayerNodeInfo = GetPlayerNodeInfo(nNodeID); XN_VALIDATE_PTR(pPlayerNodeInfo, XN_STATUS_CORRUPT_FILE); if (pPlayerNodeInfo->bValid) { if (m_pNodeNotifications != NULL) { nRetVal = m_pNodeNotifications->OnNodeRemoved(m_pNotificationsCookie, pPlayerNodeInfo->strName); if (nRetVal != XN_STATUS_OK) { return nRetVal; } } playerNode.RemoveNeededNode(pPlayerNodeInfo->codec); pPlayerNodeInfo->codec = NULL; pPlayerNodeInfo->Reset(); //Now it's not valid anymore } return XN_STATUS_OK; }
XnStatus PlayerNode::RemovePlayerNodeInfo(XnUInt32 nNodeID) { XnStatus nRetVal = XN_STATUS_OK; PlayerNodeInfo* pPlayerNodeInfo = GetPlayerNodeInfo(nNodeID); XN_VALIDATE_PTR(pPlayerNodeInfo, XN_STATUS_CORRUPT_FILE); if (pPlayerNodeInfo->bValid) { if (m_pNodeNotifications != NULL) { nRetVal = m_pNodeNotifications->OnNodeRemoved(m_pNotificationsCookie, pPlayerNodeInfo->strName); if (nRetVal != XN_STATUS_OK) { return nRetVal; } } if (pPlayerNodeInfo->codec.IsValid()) { xnRemoveNeededNode(GetSelfNodeHandle(), pPlayerNodeInfo->codec); pPlayerNodeInfo->codec.Release(); } pPlayerNodeInfo->Reset(); //Now it's not valid anymore } return XN_STATUS_OK; }