MCPcopy Create free account
hub / github.com/OpenNI/OpenNI / xnFrameSyncWith

Function xnFrameSyncWith

Source/OpenNI/XnOpenNI.cpp:4164–4194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4162}
4163
4164XN_C_API XnStatus xnFrameSyncWith(XnNodeHandle hInstance, XnNodeHandle hOther)
4165{
4166 XN_VALIDATE_INPUT_PTR(hInstance);
4167 XN_VALIDATE_INPUT_PTR(hOther);
4168 XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_GENERATOR);
4169 XN_VALIDATE_CHANGES_ALLOWED(hInstance);
4170
4171 // check if this is already the case
4172 if (hInstance->hFrameSyncedWith == hOther)
4173 {
4174 return (XN_STATUS_OK);
4175 }
4176
4177 // TODO: support more than one node. Right now, every node can only be synched to one other node.
4178 if (hInstance->hFrameSyncedWith != NULL || hOther->hFrameSyncedWith != NULL)
4179 {
4180 XN_RETURN_WITH_WARNING_LOG(g_logger, XN_STATUS_NOT_IMPLEMENTED, "Currently, a node can be frame synched to one node only.");
4181 }
4182
4183 XnGeneratorInterfaceContainer* pInterface = (XnGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
4184 XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
4185 XN_VALIDATE_FUNC_PTR(pInterface->FrameSync.FrameSyncWith);
4186 XnStatus nRetVal = pInterface->FrameSync.FrameSyncWith(hModuleNode, hOther);
4187 XN_IS_STATUS_OK(nRetVal);
4188
4189 // store this
4190 hInstance->hFrameSyncedWith = hOther;
4191 hOther->hFrameSyncedWith = hInstance;
4192
4193 return (XN_STATUS_OK);
4194}
4195
4196XN_C_API XnStatus xnStopFrameSyncWith(XnNodeHandle hInstance, XnNodeHandle hOther)
4197{

Callers 3

FrameSyncWithMethod · 0.85
xnConfigureFrameSyncFunction · 0.85

Calls 1

FrameSyncWithMethod · 0.45

Tested by

no test coverage detected