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

Function xnProfilingInit

Source/OpenNI/XnProfiling.cpp:130–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130XN_C_API XnStatus xnProfilingInit(XnUInt32 nProfilingInterval)
131{
132 XnStatus nRetVal = XN_STATUS_OK;
133
134 if (nProfilingInterval == 0)
135 {
136 xnProfilingShutdown();
137 }
138 else if (!g_ProfilingData.bInitialized)
139 {
140 g_ProfilingData.nMaxSectionName = 0;
141 g_ProfilingData.nSectionCount = 0;
142 g_ProfilingData.nProfilingInterval = nProfilingInterval;
143 g_ProfilingData.bKillThread = FALSE;
144
145 XN_VALIDATE_CALLOC(g_ProfilingData.aSections, XnProfiledSection, MAX_PROFILED_SECTIONS);
146 g_ProfilingData.nSectionCount = 0;
147
148 nRetVal = xnOSCreateThread(xnProfilingThread, (XN_THREAD_PARAM)NULL, &g_ProfilingData.hThread);
149 XN_IS_STATUS_OK(nRetVal);
150
151 nRetVal = xnOSCreateCriticalSection(&g_ProfilingData.hCriticalSection);
152 XN_IS_STATUS_OK(nRetVal);
153
154 g_ProfilingData.bInitialized = TRUE;
155 }
156
157 return XN_STATUS_OK;
158}
159
160XN_C_API XnStatus xnProfilingInitFromINI(const XnChar* cpINIFileName, const XnChar* cpSectionName)
161{

Callers 1

xnProfilingInitFromINIFunction · 0.85

Calls 3

xnProfilingShutdownFunction · 0.85
xnOSCreateThreadFunction · 0.50

Tested by

no test coverage detected