本文整理汇总了C++中XnDeviceStream::IsOpen方法的典型用法代码示例。如果您正苦于以下问题:C++ XnDeviceStream::IsOpen方法的具体用法?C++ XnDeviceStream::IsOpen怎么用?C++ XnDeviceStream::IsOpen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XnDeviceStream
的用法示例。
在下文中一共展示了XnDeviceStream::IsOpen方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WriteStream
XnStatus XnDeviceBase::WriteStream(XnStreamData* pStreamData)
{
XnStatus nRetVal = XN_STATUS_OK;
XN_VALIDATE_INPUT_PTR(pStreamData);
if (m_ReadWriteMode.GetValue() != XN_DEVICE_MODE_WRITE)
{
return XN_STATUS_IO_DEVICE_WRONG_MODE;
}
// take the stream to write
XnDeviceStream* pStream;
nRetVal = FindStream(pStreamData->StreamName, &pStream);
XN_IS_STATUS_OK(nRetVal);
// make sure it is open
if (!pStream->IsOpen())
{
return XN_STATUS_STREAM_NOT_OPEN;
}
// and write
nRetVal = pStream->Write(pStreamData);
XN_IS_STATUS_OK(nRetVal);
return (XN_STATUS_OK);
}
示例2: CloseAllStreams
XnStatus XnDeviceBase::CloseAllStreams()
{
XnStatus nRetVal = XN_STATUS_OK;
xnLogVerbose(XN_MASK_DDK, "Closing all streams...");
// go over modules list, and look for closed streams
for (XnStringsHash::Iterator it = m_Modules.begin(); it != m_Modules.end(); ++it)
{
XnDeviceModuleHolder* pModuleHolder = (XnDeviceModuleHolder*)it.Value();
if (IsStream(pModuleHolder->GetModule()))
{
XnDeviceStream* pStream = (XnDeviceStream*)pModuleHolder->GetModule();
if (pStream->IsOpen())
{
nRetVal = pStream->Close();
XN_IS_STATUS_OK(nRetVal);
}
}
}
xnLogInfo(XN_MASK_DDK, "All streams are closed.");
return XN_STATUS_OK;
}
示例3: ReadStream
XnStatus XnDeviceBase::ReadStream(XnStreamData* pStreamOutput)
{
XnStatus nRetVal = XN_STATUS_OK;
XN_VALIDATE_INPUT_PTR(pStreamOutput);
if (m_ReadWriteMode.GetValue() == XN_DEVICE_MODE_WRITE)
{
return XN_STATUS_IO_DEVICE_WRONG_MODE;
}
// take the stream to read
XnDeviceStream* pStream;
nRetVal = FindStream(pStreamOutput->StreamName, &pStream);
XN_IS_STATUS_OK(nRetVal);
// make sure it is open
if (!pStream->IsNewDataAvailable() && !pStream->IsOpen())
{
return XN_STATUS_STREAM_NOT_OPEN;
}
// wait for it to advance
nRetVal = WaitForStream(m_hNewDataEvent, pStream);
XN_IS_STATUS_OK(nRetVal);
// and read
nRetVal = ReadFromStreamImpl(pStream, pStreamOutput);
XN_IS_STATUS_OK(nRetVal);
return (XN_STATUS_OK);
}
示例4: OpenAllStreams
XnStatus XnDeviceBase::OpenAllStreams()
{
XnStatus nRetVal = XN_STATUS_OK;
xnLogVerbose(XN_MASK_DDK, "Opening all streams...");
// go over modules list, and look for closed streams
for (ModuleHoldersHash::Iterator it = m_Modules.Begin(); it != m_Modules.End(); ++it)
{
XnDeviceModuleHolder* pModuleHolder = it->Value();
if (IsStream(pModuleHolder->GetModule()))
{
XnDeviceStream* pStream = (XnDeviceStream*)pModuleHolder->GetModule();
if (!pStream->IsOpen())
{
nRetVal = pStream->Open();
XN_IS_STATUS_OK(nRetVal);
}
}
}
xnLogInfo(XN_MASK_DDK, "All streams are open.");
return XN_STATUS_OK;
}