Hi,
I'm trying to use depthai library on C++ with VS 2015. However, when I try to build the project RawImgFrame.hpp, and encoding.h have the next error.
a constexpr function must contain exactly one return statement
statement may not appear in a constexpr function
I can't figure it out how to fix this problem. The code that I'm testing is the next:
#include <iostream>
// Includes common necessary includes for development using depthai library
#include "depthai/depthai.hpp"
int main() {
// Create pipeline
dai::Pipeline pipeline;
// Define source and output
auto camRgb = pipeline.create<dai::node::ColorCamera>();
auto xoutVideo = pipeline.create<dai::node::XLinkOut>();
xoutVideo->setStreamName("video");
// Properties
camRgb->setBoardSocket(dai::CameraBoardSocket::RGB);
camRgb->setResolution(dai::ColorCameraProperties::SensorResolution::THE_1080_P);
camRgb->setVideoSize(1920, 1080);
xoutVideo->input.setBlocking(false);
xoutVideo->input.setQueueSize(1);
// Linking
camRgb->video.link(xoutVideo->input);
// Connect to device and start pipeline
dai::Device device(pipeline);
auto video = device.getOutputQueue("video");
while (true) {
auto videoIn = video->get<dai::ImgFrame>();
// Get BGR frame from NV12 encoded video frame to show with opencv
// Visualizing the frame on slower hosts might have overhead
cv::imshow("video", videoIn->getCvFrame());
int key = cv::waitKey(1);
if (key == 'q' || key == 'Q') {
return 0;
}
}
return 0;
}
Hope somebody can help me.