[libcamera-devel] [PATCH 3/3] libcamera: camera: Mark controls() and properties() as const operations

Kieran Bingham kieran.bingham at ideasonboard.com
Fri Aug 14 11:35:32 CEST 2020


On 14/08/2020 10:34, Kieran Bingham wrote:
> Hi Niklas,
> 
> On 06/08/2020 13:53, Niklas Söderlund wrote:
>> Reading the controls and properties do not modify the camera's state
> 
> 'does not'
> 
>> and can be marked as const operations.
>>
>> Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>

Oooops forgot to add the <ctrl-v>

Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

>> ---
>>  include/libcamera/camera.h | 4 ++--
>>  src/libcamera/camera.cpp   | 4 ++--
>>  2 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h
>> index 48d88d64a0a94050..272c12c3c47392fc 100644
>> --- a/include/libcamera/camera.h
>> +++ b/include/libcamera/camera.h
>> @@ -86,8 +86,8 @@ public:
>>  	int acquire();
>>  	int release();
>>  
>> -	const ControlInfoMap &controls();
>> -	const ControlList &properties();
>> +	const ControlInfoMap &controls() const;
>> +	const ControlList &properties() const;
>>  
>>  	const std::set<Stream *> &streams() const;
>>  	std::unique_ptr<CameraConfiguration> generateConfiguration(const StreamRoles &roles = {});
>> diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp
>> index 820fa1e3065e5f88..1685697b8ebbebcb 100644
>> --- a/src/libcamera/camera.cpp
>> +++ b/src/libcamera/camera.cpp
>> @@ -658,7 +658,7 @@ int Camera::release()
>>   *
>>   * \return A ControlInfoMap listing the controls supported by the camera
>>   */
>> -const ControlInfoMap &Camera::controls()
>> +const ControlInfoMap &Camera::controls() const
>>  {
>>  	return p_->pipe_->controls(this);
>>  }
>> @@ -671,7 +671,7 @@ const ControlInfoMap &Camera::controls()
>>   *
>>   * \return A ControlList of properties supported by the camera
>>   */
>> -const ControlList &Camera::properties()
>> +const ControlList &Camera::properties() const
>>  {
>>  	return p_->pipe_->properties(this);
>>  }
>>
> 

-- 
Regards
--
Kieran


More information about the libcamera-devel mailing list