本文整理汇总了C++中XnDeviceStream::GetProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ XnDeviceStream::GetProperty方法的具体用法?C++ XnDeviceStream::GetProperty怎么用?C++ XnDeviceStream::GetProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XnDeviceStream
的用法示例。
在下文中一共展示了XnDeviceStream::GetProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetBufferPool
XnStatus XnSensor::GetBufferPool(const XnChar* strStream, XnBufferPool** ppBufferPool)
{
XnStatus nRetVal = XN_STATUS_OK;
XnDeviceModuleHolder* pHolder;
nRetVal = FindStream(strStream, &pHolder);
XN_IS_STATUS_OK(nRetVal);
XnSensorStreamHolder* pSensorStreamHolder = (XnSensorStreamHolder*)(pHolder);
XnDeviceStream* pStream = pSensorStreamHolder->GetStream();
XnUInt64 nFrameBased;
nRetVal = pStream->GetProperty(XN_STREAM_PROPERTY_IS_FRAME_BASED, &nFrameBased);
XN_IS_STATUS_OK(nRetVal);
if (nFrameBased == 0)
{
return XN_STATUS_BAD_TYPE;
}
XnFrameStream* pFrameStream = (XnFrameStream*)pStream;
*ppBufferPool = pFrameStream->GetBufferPool();
return (XN_STATUS_OK);
}
示例2: getProperty
OniStatus XnOniDevice::getProperty(int propertyId, void* data, int* pDataSize)
{
switch (propertyId)
{
case ONI_DEVICE_PROPERTY_DRIVER_VERSION:
{
if (*pDataSize == sizeof(OniVersion))
{
OniVersion* version = (OniVersion*)data;
version->major = XN_PS_MAJOR_VERSION;
version->minor = XN_PS_MINOR_VERSION;
version->maintenance = XN_PS_MAINTENANCE_VERSION;
version->build = XN_PS_BUILD_VERSION;
}
else
{
m_driverServices.errorLoggerAppend("Unexpected size: %d != %d\n", *pDataSize, sizeof(OniVersion));
return ONI_STATUS_ERROR;
}
}
break;
case ONI_DEVICE_PROPERTY_IMAGE_REGISTRATION:
{
if (*pDataSize == sizeof(OniImageRegistrationMode))
{
OniImageRegistrationMode* mode = (OniImageRegistrationMode*)data;
// Find the depth stream in the sensor.
XnDeviceStream* pDepth = NULL;
XnStatus xnrc = m_sensor.GetStream(XN_STREAM_NAME_DEPTH, &pDepth);
if (xnrc != XN_STATUS_OK)
{
return ONI_STATUS_BAD_PARAMETER;
}
// Set the mode in the depth stream.
XnUInt64 val;
xnrc = pDepth->GetProperty(XN_STREAM_PROPERTY_REGISTRATION, &val);
if (xnrc != XN_STATUS_OK)
{
return ONI_STATUS_ERROR;
}
// Update the return value.
*mode = (val == 1) ? ONI_IMAGE_REGISTRATION_DEPTH_TO_COLOR : ONI_IMAGE_REGISTRATION_OFF;
}
else
{
m_driverServices.errorLoggerAppend("Unexpected size: %d != %d\n", *pDataSize, sizeof(OniImageRegistrationMode));
return ONI_STATUS_ERROR;
}
}
break;
default:
XnStatus nRetVal = m_sensor.DeviceModule()->GetProperty(propertyId, data, pDataSize);
if (nRetVal != XN_STATUS_OK)
{
return ONI_STATUS_BAD_PARAMETER;
}
}
return ONI_STATUS_OK;
}