Use the SDK interface to obtain the camera’s color stream and display it in the window.
config is the configuration of the camera Frameset is a combination of different types of Frames
Configure the output color stream and open the video stream.You must configure this before calling pipe.start().
// Configure which streams to enable or disable for the Pipeline by creating a Config.
std::shared_ptr<ob::Config> config = std::make_shared<ob::Config>();
// Enable color video stream.
config->enableVideoStream(OB_STREAM_COLOR);
After waiting for a while, get the color stream in the frameset and display it in the window
while(win.run()) {
// Wait for up to 100ms for a frameset in blocking mode.
auto frameSet = pipe.waitForFrameset();
if(frameSet == nullptr) {
continue;
}
// get color frame from frameset.
auto colorFrame = frameSet->getFrame(OB_FRAME_COLOR);
// Render colorFrame.
win.pushFramesToView(colorFrame);
}
Press the Esc key in the window to exit the program.