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

Function xnConfigureAddNodeToRecording

Source/OpenNI/XnXmlScriptNode.cpp:357–390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355}
356
357XnStatus xnConfigureAddNodeToRecording(XnNodeHandle hNode, const TiXmlElement* pOpcode)
358{
359 XnStatus nRetVal = XN_STATUS_OK;
360
361 const XnChar* strName;
362 nRetVal = xnXmlReadStringAttribute(pOpcode, "name", &strName);
363 XN_IS_STATUS_OK(nRetVal);
364
365 const XnChar* strCodec;
366 nRetVal = xnXmlReadStringAttribute(pOpcode, "codec", &strCodec);
367 XN_IS_STATUS_OK(nRetVal);
368
369 // find node
370 XnContext* pContext = hNode->pContext;
371 XnNodeHandle hOther = NULL;
372 nRetVal = xnGetRefNodeHandleByName(pContext, strName, &hOther);
373 XN_IS_STATUS_OK(nRetVal);
374
375 // find codec
376 if (strlen(strCodec) != sizeof(XnCodecID))
377 {
378 xnProductionNodeRelease(hOther);
379 XN_LOG_ERROR_RETURN(XN_STATUS_CORRUPT_FILE, XN_MASK_OPEN_NI, "'%s' is not a valid codec ID!", strCodec);
380 }
381
382 XnCodecID codecID;
383 xnOSMemCopy(&codecID, strCodec, sizeof(codecID));
384
385 nRetVal = xnAddNodeToRecording(hNode, hOther, codecID);
386 xnProductionNodeRelease(hOther);
387 XN_IS_STATUS_OK(nRetVal);
388
389 return (XN_STATUS_OK);
390}
391
392XnStatus xnConfigureSetOpcode(XnNodeHandle hNode, const TiXmlElement* pOpcode)
393{

Callers 1

xnConfigureSetOpcodeFunction · 0.85

Calls 5

xnXmlReadStringAttributeFunction · 0.85
xnGetRefNodeHandleByNameFunction · 0.85
xnProductionNodeReleaseFunction · 0.85
xnAddNodeToRecordingFunction · 0.85
xnOSMemCopyFunction · 0.50

Tested by

no test coverage detected