[libcamera-devel] [PATCH v2 02/11] qcam: main_window: Explicitly name raw buffer
Kieran Bingham
kieran.bingham at ideasonboard.com
Fri Oct 16 00:37:41 CEST 2020
The buffer obtained for queuing to a raw stream aliases the buffer
passed in for the main view finder stream.
Prevent aliasing, and explicitly name the buffer as a separate variable.
Suggested-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
---
src/qcam/main_window.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp
index 0cbdab9a6bce..f140313ede8d 100644
--- a/src/qcam/main_window.cpp
+++ b/src/qcam/main_window.cpp
@@ -769,16 +769,16 @@ void MainWindow::queueRequest(FrameBuffer *buffer)
request->addBuffer(vfStream_, buffer);
if (captureRaw_) {
- FrameBuffer *buffer = nullptr;
+ FrameBuffer *rawBuffer = nullptr;
{
QMutexLocker locker(&mutex_);
if (!freeBuffers_[rawStream_].isEmpty())
- buffer = freeBuffers_[rawStream_].dequeue();
+ rawBuffer = freeBuffers_[rawStream_].dequeue();
}
- if (buffer) {
- request->addBuffer(rawStream_, buffer);
+ if (rawBuffer) {
+ request->addBuffer(rawStream_, rawBuffer);
captureRaw_ = false;
} else {
qWarning() << "No free buffer available for RAW capture";
--
2.25.1
More information about the libcamera-devel
mailing list