本文整理汇总了C++中openni::VideoStream::stop方法的典型用法代码示例。如果您正苦于以下问题:C++ VideoStream::stop方法的具体用法?C++ VideoStream::stop怎么用?C++ VideoStream::stop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openni::VideoStream
的用法示例。
在下文中一共展示了VideoStream::stop方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: closeDevice
void closeDevice()
{
g_depthStream.stop();
g_colorStream.stop();
g_irStream.stop();
g_depthStream.destroy();
g_colorStream.destroy();
g_irStream.destroy();
g_device.close();
openni::OpenNI::shutdown();
}
示例2: toggleStreamState
void toggleStreamState(openni::VideoStream& stream, openni::VideoFrameRef& frame, bool& isOn, openni::SensorType type, const char* name)
{
openni::Status nRetVal = openni::STATUS_OK;
if (!stream.isValid())
{
nRetVal = stream.create(g_device, type);
if (nRetVal != openni::STATUS_OK)
{
displayError("Failed to create %s stream:\n%s", name, openni::OpenNI::getExtendedError());
return;
}
}
if (isOn)
{
stream.stop();
frame.release();
}
else
{
nRetVal = stream.start();
if (nRetVal != openni::STATUS_OK)
{
displayError("Failed to start %s stream:\n%s", name, openni::OpenNI::getExtendedError());
return;
}
}
isOn = !isOn;
}
示例3: record_oni
bool record_oni(char *tmpfile, int bufsize, openni::VideoStream &depth, openni::VideoStream &color, Config &conf) {
openni::Recorder recorder;
time_t t = time(NULL);
strftime(tmpfile, bufsize, "rgbd_%Y%m%d_%H-%M-%S_", localtime(&t));
strncat(tmpfile, getenv("HOSTNAME"), bufsize);
strncat(tmpfile, ".oni", bufsize);
printf("Starting ONI Capture.\n");
depth.start();
color.start();
openni::Status rc = recorder.create(tmpfile);
if(rc != openni::STATUS_OK) {
printf("Error: Failed to open '%s' for writing!\n%s", tmpfile, openni::OpenNI::getExtendedError());
return false;
}
recorder.attach(color);
recorder.attach(depth);
recorder.start();
struct timespec start, tp;
clock_gettime(CLOCK_MONOTONIC, &start);
long tt;
do {
usleep(100);
clock_gettime(CLOCK_MONOTONIC, &tp);
tt = (tp.tv_sec-start.tv_sec)*1000+(tp.tv_nsec-start.tv_nsec)/1000000;
} while(tt < conf.capture_time);
recorder.stop();
color.stop();
depth.stop();
recorder.destroy();
printf("Captured ONI to '%s'\n", tmpfile);
return true;
}
示例4: setDepthVideoMode
void setDepthVideoMode(int mode)
{
bool bIsStreamOn = g_bIsDepthOn;
if (bIsStreamOn)
{
g_bIsDepthOn = false;
g_depthStream.stop();
}
g_depthStream.setVideoMode(g_depthSensorInfo->getSupportedVideoModes()[mode]);
if (bIsStreamOn)
{
g_depthStream.start();
g_bIsDepthOn = true;
}
}
示例5: setIRVideoMode
void setIRVideoMode(int mode)
{
bool bIsStreamOn = g_bIsIROn;
if (bIsStreamOn)
{
g_bIsIROn = false;
g_irStream.stop();
}
g_irFrame.release();
g_irStream.setVideoMode(g_irSensorInfo->getSupportedVideoModes()[mode]);
if (bIsStreamOn)
{
g_irStream.start();
g_bIsIROn = true;
}
}
示例6: toggleIRState
void toggleIRState(int )
{
if (g_irStream.isValid())
{
if(g_bIsIROn)
{
g_irStream.stop();
g_irFrame.release();
}
else
{
openni::Status nRetVal = g_irStream.start();
if (nRetVal != openni::STATUS_OK)
{
displayError("Failed to start IR stream:\n%s", openni::OpenNI::getExtendedError());
return;
}
}
g_bIsIROn = !g_bIsIROn;
}
}
示例7:
~Impl() {
color_stream.stop();
color_stream.destroy();
device.close();
openni::OpenNI::shutdown();
}
示例8:
// Stop recording
void Oni2Grabber::stopAndDestroyStream_(openni::VideoStream &stream)
{
stream.stop();
stream.destroy();
}
示例9:
bool OpenNI2Driver::stop()
{
rgbStream.stop() ;
depthStream.stop() ;
return true ;
}