
How to get rid of the window shown in the picture?
I developed my C++ code based on rpicam-apps/apps/rpicam_hello.cpp from https://github.com/raspberrypi/rpicam-apps. On top of that, I will show the camera image using OpenGL.
I got everything working i.e. Camera image is displayed correctly on both the OpenGL and Preview pane simultaneously. However if I commented out the code for preview window, and just wanting to display camera image on OpenGL, this rpicam-app window appears.
Also note that my code for OpenGL creates its' own Window using GLFW, so there are currently 2 windows shown even when the preview window code is commented out.
Code:
static void event_loop(RPiCamApp &app){Options const *options = app.GetOptions();app.OpenCamera();app.ConfigureViewfinder();app.StartCamera();auto start_time = std::chrono::high_resolution_clock::now();for (unsigned int count = 0; ; count++){RPiCamApp::Msg msg = app.Wait();if (msg.type == RPiCamApp::MsgType::Timeout){LOG_ERROR("ERROR: Device timeout detected, attempting a restart!!!");app.StopCamera();app.StartCamera();continue;}if (msg.type == RPiCamApp::MsgType::Quit)return;else if (msg.type != RPiCamApp::MsgType::RequestComplete)throw std::runtime_error("unrecognised message!");LOG(2, "Viewfinder frame " << count);auto now = std::chrono::high_resolution_clock::now();if (options->timeout && (now - start_time) > options->timeout.value)return;CompletedRequestPtr &completed_request = std::get<CompletedRequestPtr>(msg.payload);//app.ShowPreview(completed_request, app.ViewfinderStream());}}
Code:
void myCam::_myCamThread(){Options *options = app.GetOptions();char argv0[] = "--nopreview";char *argv[] = {argv0, NULL};options->Parse(1, argv);event_loop(app);}
Statistics: Posted by SavageGreed — Sun Mar 24, 2024 3:58 am — Replies 0 — Views 15