本文整理汇总了C++中xnLogWarning函数的典型用法代码示例。如果您正苦于以下问题:C++ xnLogWarning函数的具体用法?C++ xnLogWarning怎么用?C++ xnLogWarning使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xnLogWarning函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetOSName
static XnStatus GetOSName(xnOSInfo* pOSInfo)
{
// Get OS Info
OSVERSIONINFOEX osVersionInfo;
osVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
#pragma warning(push)
#pragma warning(disable:4996)
if (0 == GetVersionEx((LPOSVERSIONINFO)&osVersionInfo))
#pragma warning(pop)
{
DWORD nErr = GetLastError();
xnLogWarning(XN_MASK_OS, "Failed getting OS version information. Error code: %d", nErr);
return XN_STATUS_ERROR;
}
sprintf(pOSInfo->csOSName, "%s", GetOSName(osVersionInfo));
if (osVersionInfo.szCSDVersion[0] != '\0')
{
strcat(pOSInfo->csOSName, " ");
strcat(pOSInfo->csOSName, osVersionInfo.szCSDVersion);
}
return XN_STATUS_OK;
}
示例2: xnLogWarning
void XnFrameStreamProcessor::FrameIsCorrupted()
{
if (!m_bFrameCorrupted)
{
xnLogWarning(XN_MASK_SENSOR_PROTOCOL, "%s frame is corrupt!", m_csName);
m_bFrameCorrupted = TRUE;
}
}
示例3: xnLogWarning
void XN_CALLBACK_TYPE PlayerImpl::CloseFile(void* pCookie)
{
PlayerImpl* pThis = (PlayerImpl*)pCookie;
if (pThis == NULL)
{
xnLogWarning(XN_MASK_OPEN_NI, "Got NULL cookie");
return;
}
pThis->CloseFileImpl();
}
示例4: XnDeviceManagerLoadAllDevices
XnStatus XnDeviceManagerLoadAllDevices()
{
XnStatus nRetVal = XN_STATUS_OK;
#define XN_DEVICE_INTERFACE_FUNCTION(name, sig) pDescriptor->Interface.name = XN_DEVICE_PROTO_NAME(name);
XnDeviceDescriptor* pDescriptor = g_pDeviceManager->aDevices[g_pDeviceManager->nDevicesCount];
#define XN_DEVICE_EXPORT_PREFIX SensorV2_
#include <XnDeviceProto.inl>
#undef XN_DEVICE_EXPORT_PREFIX
nRetVal = XnDeviceManagerUpdateDefinition(pDescriptor);
if (nRetVal != XN_STATUS_OK)
{
xnLogWarning(XN_MASK_DEVICE_MANAGER, "'SensorV2' is not a valid device: %s", xnGetStatusString(nRetVal));
}
else
{
g_pDeviceManager->nDevicesCount++;
}
XnDeviceDescriptor* pDescriptor = g_pDeviceManager->aDevices[g_pDeviceManager->nDevicesCount];
#define XN_DEVICE_EXPORT_PREFIX File_
#include <XnDeviceProto.inl>
#undef XN_DEVICE_EXPORT_PREFIX
nRetVal = XnDeviceManagerUpdateDefinition(pDescriptor);
if (nRetVal != XN_STATUS_OK)
{
xnLogWarning(XN_MASK_DEVICE_MANAGER, "'SensorV2' is not a valid device: %s", xnGetStatusString(nRetVal));
}
else
{
g_pDeviceManager->nDevicesCount++;
}
#undef XN_DEVICE_INTERFACE_FUNCTION
return (XN_STATUS_OK)
}
示例5: xnLogWarning
XnStatus RecorderImpl::RemoveRawNode(const XnChar* strNodeName)
{
if (!IsRawNode(strNodeName))
{
xnLogWarning(XN_MASK_OPEN_NI, "Tried to remove non-existing raw node by the name of '%s'", strNodeName);
XN_ASSERT(FALSE);
return XN_STATUS_NO_MATCH;
}
return Notifications().OnNodeRemoved(ModuleHandle(), strNodeName);
}
示例6: xnLogError
XnStatus LinkContInputStream::Init(LinkControlEndpoint* pLinkControlEndpoint,
XnStreamType streamType,
XnUInt16 nStreamID,
IConnection* pConnection)
{
XnStatus nRetVal = XN_STATUS_OK;
if (m_hCriticalSection == NULL)
{
xnLogError(XN_MASK_INPUT_STREAM, "Cannot initialize - critical section was not created successfully");
XN_ASSERT(FALSE);
return XN_STATUS_ERROR;
}
xnl::AutoCSLocker csLock(m_hCriticalSection);
if (m_bInitialized)
{
//We shutdown first so we can re-initialize.
Shutdown();
}
nRetVal = LinkInputStream::Init(pLinkControlEndpoint, streamType, nStreamID, pConnection);
XN_IS_STATUS_OK_LOG_ERROR("Init base input stream", nRetVal);
m_nStreamID = nStreamID;
m_nUserBufferMaxSize = CONT_STREAM_PREDEFINED_BUFFER_SIZE;
m_nUserBufferCurrentSize = m_nWorkingBufferCurrentSize = 0;
//Allocate buffers
m_pUserBuffer = reinterpret_cast<XnUInt8*>(xnOSCallocAligned(1, m_nUserBufferMaxSize, XN_DEFAULT_MEM_ALIGN));
if (m_pUserBuffer == NULL)
{
Shutdown();
xnLogError(XN_MASK_INPUT_STREAM, "Failed to allocate buffer of size %u", m_nUserBufferMaxSize);
XN_ASSERT(FALSE);
return XN_STATUS_ALLOC_FAILED;
}
m_pWorkingBuffer = reinterpret_cast<XnUInt8*>(xnOSCallocAligned(1, CONT_STREAM_PREDEFINED_BUFFER_SIZE, XN_DEFAULT_MEM_ALIGN));
if (m_pWorkingBuffer == NULL)
{
Shutdown();
xnLogError(XN_MASK_INPUT_STREAM, "Failed to allocate buffer of size %u", m_nUserBufferMaxSize);
XN_ASSERT(FALSE);
return XN_STATUS_ALLOC_FAILED;
}
nRetVal = xnLinkGetStreamDumpName(m_nStreamID, m_strDumpName, sizeof(m_strDumpName));
if (nRetVal != XN_STATUS_OK)
{
xnLogWarning(XN_MASK_INPUT_STREAM, "Failed to get stream dump name: %s", xnGetStatusString(nRetVal));
XN_ASSERT(FALSE);
}
m_bInitialized = TRUE;
return XN_STATUS_OK;
}
示例7: xnOSStrCopy
void LinkContInputStream::SetDumpName(const XnChar* strDumpName)
{
XnStatus nRetVal = XN_STATUS_OK;
(void)nRetVal;
nRetVal = xnOSStrCopy(m_strDumpName, strDumpName, sizeof(m_strDumpName));
if (nRetVal != XN_STATUS_OK)
{
xnLogWarning(XN_MASK_INPUT_STREAM, "Failed to set dump name: %s", xnGetStatusString(nRetVal));
XN_ASSERT(FALSE);
}
}
示例8: xnLogWarning
PlayerNode::PlayerNodeInfo* PlayerNode::GetPlayerNodeInfo(XnUInt32 nNodeID)
{
if (nNodeID >= m_nMaxNodes)
{
xnLogWarning(XN_MASK_OPEN_NI, "Got node ID %u, bigger than said max of %u", nNodeID, m_nMaxNodes);
XN_ASSERT(FALSE);
return NULL;
}
return &m_pNodeInfoMap[nNodeID];
}
示例9: xnOSGetModulePathForProcAddress
XN_C_API XnStatus xnOSGetModulePathForProcAddress(void* procAddr, XnChar *strModulePath)
{
Dl_info info;
if (!dladdr(procAddr, &info))
{
xnLogWarning(XN_MASK_OS, "Failed to get the dl info: %s\n", dlerror());
return XN_STATUS_ERROR;
}
return xnOSStrCopy(strModulePath, info.dli_fname, XN_FILE_MAX_PATH);
}
示例10: xnDumpSetMaskState
void LinkContInputStream::SetDumpOn(XnBool bDumpOn)
{
XnStatus nRetVal = XN_STATUS_OK;
(void)nRetVal;
nRetVal = xnDumpSetMaskState(m_strDumpName, bDumpOn);
if (nRetVal != XN_STATUS_OK)
{
xnLogWarning(XN_MASK_INPUT_STREAM, "Failed to set dump state: %s", xnGetStatusString(nRetVal));
XN_ASSERT(FALSE);
}
}
示例11: CalculateExpectedSize
void XnImageProcessor::OnEndOfFrame(const XnSensorProtocolResponseHeader* pHeader)
{
XnUInt32 nExpectedSize = CalculateExpectedSize();
if (GetWriteBuffer()->GetSize() != nExpectedSize)
{
xnLogWarning(XN_MASK_SENSOR_READ, "Read: Image buffer is corrupt. Size is %u (!= %u)", GetWriteBuffer()->GetSize(), nExpectedSize);
FrameIsCorrupted();
}
// call base
XnFrameStreamProcessor::OnEndOfFrame(pHeader);
}
示例12: xnIsNodeMatch
static XnBool xnIsNodeMatch(XnContext* pContext, const XnNodeQuery* pQuery, XnNodeInfo* pNodeInfo)
{
// check existing node
XnNodeHandle hNode = xnNodeInfoGetRefHandle(pNodeInfo);
if (pQuery->bExistingNodeOnly && (hNode == NULL))
{
return (FALSE);
}
if (pQuery->bNonExistingNodeOnly && (hNode != NULL))
{
return (FALSE);
}
if (!xnIsInfoQueryMatch(pQuery, pNodeInfo))
{
if (hNode != NULL)
{
xnProductionNodeRelease(hNode);
}
return (FALSE);
}
// check if we need to create an instance, to check capabilities
if (pQuery->nSupportedCapabilities > 0 ||
pQuery->nSupportedMapOutputModes > 0 ||
pQuery->nMinUserPositions > 0)
{
if (hNode == NULL)
{
const XnProductionNodeDescription* pDescription = xnNodeInfoGetDescription(pNodeInfo);
xnLogVerbose(XN_MASK_OPEN_NI, "Creating node '%s' of type '%s' for querying...", pDescription->strName, xnProductionNodeTypeToString(pDescription->Type));
XnStatus nRetVal = xnCreateProductionTree(pContext, pNodeInfo, &hNode);
if (nRetVal != XN_STATUS_OK)
{
xnLogWarning(XN_MASK_OPEN_NI, "Failed to create node of type '%s' for querying: %s", xnProductionNodeTypeToString(pDescription->Type), xnGetStatusString(nRetVal));
return (FALSE);
}
}
}
XnBool bResult = xnIsNodeInstanceMatch(pQuery, hNode);
// in any case, we need to release the node. if we created it, this will cause it to be destroyed. If we just took
// a reference to it, we need to release it.
if (hNode != NULL)
{
xnProductionNodeRelease(hNode);
}
return (bResult);
}
示例13: serverRunningLock
void XnSensorServer::ShutdownServer()
{
XnStatus nRetVal = XN_STATUS_OK;
XnAutoMutexLocker serverRunningLock(m_hServerRunningMutex, XN_SENSOR_SERVER_RUNNING_MUTEX_TIMEOUT);
nRetVal = serverRunningLock.GetStatus();
if (nRetVal != XN_STATUS_OK)
{
//This could mean there's another server/client that's frozen and they're jamming the mutex...
xnLogWarning(XN_MASK_SENSOR_SERVER, "Failed to lock server mutex: %s - proceeding with shutdown.", xnGetStatusString(nRetVal));
XN_ASSERT(FALSE);
}
if (m_hServerRunningEvent != NULL)
{
nRetVal = xnOSResetEvent(m_hServerRunningEvent);
if (nRetVal != XN_STATUS_OK)
{
xnLogWarning(XN_MASK_SENSOR_SERVER, "Failed to reset sensor server event: %s - proceeding with shutdown.", xnGetStatusString(nRetVal));
XN_ASSERT(FALSE);
}
xnOSCloseEvent(&m_hServerRunningEvent);
m_hServerRunningEvent = NULL;
}
XN_ASSERT(m_sessions.IsEmpty());
if (m_hListenSocket != NULL)
{
xnOSCloseSocket(m_hListenSocket);
m_hListenSocket = NULL;
}
if (m_hSessionsLock != NULL)
{
xnOSCloseCriticalSection(&m_hSessionsLock);
m_hSessionsLock = NULL;
}
}
示例14: xnSchedulerAddTask
XN_C_API XnStatus xnSchedulerAddTask(XnScheduler* pScheduler, XnUInt64 nInterval, XnTaskCallbackFuncPtr pCallback, void* pCallbackArg, XnScheduledTask** ppTask)
{
XnStatus nRetVal = XN_STATUS_OK;
XN_VALIDATE_INPUT_PTR(pScheduler);
XN_VALIDATE_INPUT_PTR(pCallback);
XN_VALIDATE_OUTPUT_PTR(ppTask);
// create node
XnScheduledTask* pTask;
XN_VALIDATE_ALLOC(pTask, XnScheduledTask);
pTask->nInterval = nInterval;
pTask->pCallback = pCallback;
pTask->pCallbackArg = pCallbackArg;
// calculate next execution
XnUInt64 nNow;
xnOSGetTimeStamp(&nNow);
pTask->nNextTime = nNow + nInterval;
pTask->pNextTask = NULL;
// enter critical section
nRetVal = xnOSEnterCriticalSection(&pScheduler->hCriticalSection);
if (nRetVal != XN_STATUS_OK)
{
xnOSFree(pTask);
return (nRetVal);
}
xnSchedulerAddTaskInternal(pScheduler, pTask);
// leave critical section
nRetVal = xnOSLeaveCriticalSection(&pScheduler->hCriticalSection);
if (nRetVal != XN_STATUS_OK)
{
xnOSFree(pTask);
return (nRetVal);
}
// notify that the list has changed
nRetVal = xnOSSetEvent(pScheduler->hWakeThreadEvent);
if (nRetVal != XN_STATUS_OK)
{
xnLogWarning(XN_MASK_SCHEDULER, "Failed setting event when adding task: %s", xnGetStatusString(nRetVal));
}
*ppTask = pTask;
return (XN_STATUS_OK);
}
示例15: CSource
//---------------------------------------------------------------------------
// Code
//---------------------------------------------------------------------------
XnVideoSource::XnVideoSource(LPUNKNOWN lpunk, HRESULT *phr) :
CSource(g_videoName, lpunk, CLSID_OpenNIVideo),
m_pVideoProcAmp(NULL),
m_pCameraControl(NULL),
m_Dump(xnDumpFileOpen(XN_MASK_FILTER, "FilterFlow.log"))
{
ASSERT(phr != NULL);
xnLogVerbose(XN_MASK_FILTER, "Creating video source filter");
CAutoLock cAutoLock(&m_cStateLock);
// initialize OpenNI
XnStatus nRetVal = m_context.Init();
if (nRetVal != XN_STATUS_OK)
{
xnLogWarning(XN_MASK_FILTER, "Can't init context");
*phr = E_UNEXPECTED;
}
// try to create an image generator
nRetVal = m_image.Create(m_context);
if (nRetVal != XN_STATUS_OK)
{
xnLogWarning(XN_MASK_FILTER, "Can't create image generator");
*phr = VFW_E_NO_CAPTURE_HARDWARE;
return;
}
// create output pins. Every pin registers itself with the source object
XnVideoStream* pStream = new XnVideoStream(phr, this, m_image, L"VideoOut");
if (pStream == NULL)
{
*phr = E_OUTOFMEMORY;
}
*phr = NOERROR;
}