summaryrefslogtreecommitdiff
path: root/src/cam
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-08-11 01:07:37 +0200
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-08-14 13:19:15 +0200
commit27869c5f649c4b524e142014be073b40230ecbc4 (patch)
treece805806bd6c9166e6892887b292109616073b06 /src/cam
parentdac8e9552ccdff137e717270468e584c2a9895b9 (diff)
libcamera: request: Make Stream pointer const
The Stream pointer just acts as a key in the Request object. There is no good use-case to modify a stream from a pointer retrieved from the Request, make it const. This allows pipeline handlers to better express that the Stream pointer is retrieved in a Request should just be treated as a key. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/cam')
-rw-r--r--src/cam/capture.cpp4
-rw-r--r--src/cam/capture.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/cam/capture.cpp b/src/cam/capture.cpp
index 07203769..af9029b7 100644
--- a/src/cam/capture.cpp
+++ b/src/cam/capture.cpp
@@ -169,7 +169,7 @@ void Capture::requestComplete(Request *request)
info << "fps: " << std::fixed << std::setprecision(2) << fps;
for (auto it = buffers.begin(); it != buffers.end(); ++it) {
- Stream *stream = it->first;
+ const Stream *stream = it->first;
FrameBuffer *buffer = it->second;
const std::string &name = streamName_[stream];
@@ -209,7 +209,7 @@ void Capture::requestComplete(Request *request)
}
for (auto it = buffers.begin(); it != buffers.end(); ++it) {
- Stream *stream = it->first;
+ const Stream *stream = it->first;
FrameBuffer *buffer = it->second;
request->addBuffer(stream, buffer);
diff --git a/src/cam/capture.h b/src/cam/capture.h
index 32940a2a..b4e39d51 100644
--- a/src/cam/capture.h
+++ b/src/cam/capture.h
@@ -36,7 +36,7 @@ private:
std::shared_ptr<libcamera::Camera> camera_;
libcamera::CameraConfiguration *config_;
- std::map<libcamera::Stream *, std::string> streamName_;
+ std::map<const libcamera::Stream *, std::string> streamName_;
BufferWriter *writer_;
std::chrono::steady_clock::time_point last_;