v3
This commit is contained in:
14
my_ndi.cpp
14
my_ndi.cpp
@@ -93,6 +93,7 @@ int main(int argc, char* argv[]) {
|
||||
// Run for one minute
|
||||
using namespace std::chrono;
|
||||
int counter = 0;
|
||||
cv::namedWindow("test2");
|
||||
while (!is_terminated) {
|
||||
counter += 1;
|
||||
// The descriptors
|
||||
@@ -124,18 +125,17 @@ int main(int argc, char* argv[]) {
|
||||
std::cout << "metadata len = " << len << " "
|
||||
<< std::string(video_frame.p_metadata)
|
||||
<< std::endl;
|
||||
cv::Mat frame(video_frame.yres, video_frame.xres, CV_8UC4, (char*)video_frame.p_data);
|
||||
// cv::namedWindow("test");
|
||||
std::cout << "The frame dimensions: " << frame.cols << " " << frame.rows << std::endl;
|
||||
// cv::imshow("test2", frame);
|
||||
// cv::waitKey(0);
|
||||
} else {
|
||||
std::cout << "video_frame.p_metadata is nullptr" << std::endl;
|
||||
std::cout << "metadata len = " << len << std::endl;
|
||||
}
|
||||
if (!video_frame.p_metadata) {
|
||||
auto p_data = video_frame.p_data;
|
||||
std::cout << "The frame format type is: " << video_frame.frame_format_type << std::endl;
|
||||
cv::Mat frame(video_frame.yres, video_frame.xres, CV_8UC4, p_data);
|
||||
std::cout << "The frame dimensions: " << frame.cols << " " << frame.rows << std::endl;
|
||||
cv::imshow("test2", frame);
|
||||
cv::waitKey(0);
|
||||
|
||||
}
|
||||
std::cout << "space (video frame)" << std::endl;
|
||||
NDIlib_recv_free_video_v2(pNDI_recv, &video_frame);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user