diff options
author | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2020-08-11 01:07:37 +0200 |
---|---|---|
committer | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2020-08-14 13:19:15 +0200 |
commit | 27869c5f649c4b524e142014be073b40230ecbc4 (patch) | |
tree | ce805806bd6c9166e6892887b292109616073b06 /src/libcamera/request.cpp | |
parent | dac8e9552ccdff137e717270468e584c2a9895b9 (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/libcamera/request.cpp')
-rw-r--r-- | src/libcamera/request.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp index d5f11e8c..60b30692 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -127,7 +127,7 @@ Request::~Request() * \retval -EEXIST The request already contains a buffer for the stream * \retval -EINVAL The buffer does not reference a valid Stream */ -int Request::addBuffer(Stream *stream, FrameBuffer *buffer) +int Request::addBuffer(const Stream *stream, FrameBuffer *buffer) { if (!stream) { LOG(Request, Error) << "Invalid stream reference"; @@ -162,9 +162,9 @@ int Request::addBuffer(Stream *stream, FrameBuffer *buffer) * \return The buffer associated with the stream, or nullptr if the stream is * not part of this request */ -FrameBuffer *Request::findBuffer(Stream *stream) const +FrameBuffer *Request::findBuffer(const Stream *stream) const { - auto it = bufferMap_.find(stream); + const auto it = bufferMap_.find(stream); if (it == bufferMap_.end()) return nullptr; |