mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-19 18:35:07 +03:00
qcam: viewfinder: Avoid memory copy when conversion isn't needed
If the frame buffer format is identical to the display format, the viewfinder still invokes the converter to perform what is essentially a slow memcpy(). Make it possible to skip that operation by creating a QImage referencing the buffer memory instead. A reference to the frame buffer is kept internally, and released when the next buffer is queued, pushing the current one out. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
ac828f937e
commit
5816c0c38e
3 changed files with 60 additions and 16 deletions
|
@ -416,6 +416,8 @@ void MainWindow::stopCapture()
|
|||
if (!isCapturing_)
|
||||
return;
|
||||
|
||||
viewfinder_->stop();
|
||||
|
||||
int ret = camera_->stop();
|
||||
if (ret)
|
||||
qInfo() << "Failed to stop capture";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue