[libcamera-devel] [PATCH] libcamera: CameraData: Change queuedRequests_ type to std::dequeue

Sebastian Fricke sebastian.fricke at posteo.net
Tue Mar 30 12:35:23 CEST 2021


Hey Jacopo,

On 30.03.2021 12:07, Jacopo Mondi wrote:
>Hi Hiro,
>
>On Tue, Mar 30, 2021 at 03:27:36PM +0900, Hirokazu Honda wrote:
>> A more appropriate type is std::dequeue as requests are reported
>> and removed in the order of queuing.
>>
>> Signed-off-by: Hirokazu Honda <hiroh at chromium.org>
>> Reviewed-by: Sebastian Fricke <sebastian.fricke at posteo.net>
>> ---
>>  include/libcamera/internal/pipeline_handler.h | 4 ++--
>>  src/libcamera/pipeline_handler.cpp            | 8 ++++----
>>  2 files changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h
>> index 9bdda8f3..ff9d88d8 100644
>> --- a/include/libcamera/internal/pipeline_handler.h
>> +++ b/include/libcamera/internal/pipeline_handler.h
>> @@ -7,9 +7,9 @@
>>  #ifndef __LIBCAMERA_INTERNAL_PIPELINE_HANDLER_H__
>>  #define __LIBCAMERA_INTERNAL_PIPELINE_HANDLER_H__
>>
>> -#include <list>
>>  #include <map>
>>  #include <memory>
>> +#include <queue>
>>  #include <set>
>>  #include <string>
>>  #include <sys/types.h>
>> @@ -44,7 +44,7 @@ public:
>>  	virtual ~CameraData() = default;
>>
>>  	PipelineHandler *pipe_;
>> -	std::list<Request *> queuedRequests_;
>> +	std::deque<Request *> queuedRequests_;
>>  	ControlInfoMap controlInfo_;
>>  	ControlList properties_;
>>
>> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
>> index e3d4975d..0fe913e9 100644
>> --- a/src/libcamera/pipeline_handler.cpp
>> +++ b/src/libcamera/pipeline_handler.cpp
>> @@ -72,10 +72,10 @@ LOG_DEFINE_CATEGORY(Pipeline)
>>
>>  /**
>>   * \var CameraData::queuedRequests_
>> - * \brief The list of queued and not yet completed request
>> + * \brief The queue of incomplete requests.
>
>we don't use . at the end

That was my fault, I suggested that change :S
Thank you.

>
>>   *
>> - * The list of queued request is used to track requests queued in order to
>> - * ensure completion of all requests when the pipeline handler is stopped.
>> + * This queue is used to ensure that all requests are completed when the pipeline
>> + * handler is stopped.
>>   *
>>   * \sa PipelineHandler::queueRequest(), PipelineHandler::stop(),
>>   * PipelineHandler::completeRequest()
>> @@ -386,7 +386,7 @@ int PipelineHandler::queueRequest(Request *request)
>>
>>  	int ret = queueRequestDevice(camera, request);
>>  	if (ret)
>> -		data->queuedRequests_.remove(request);
>> +		data->queuedRequests_.pop_back(request);
>
>The nit about the full stop can be fixed when applying
>Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>
>
>Thanks
>  j
>>
>>  	return ret;
>>  }
>> --
>> 2.31.0.291.g576ba9dcdaf-goog
>>
>> _______________________________________________
>> libcamera-devel mailing list
>> libcamera-devel at lists.libcamera.org
>> https://lists.libcamera.org/listinfo/libcamera-devel
>_______________________________________________
>libcamera-devel mailing list
>libcamera-devel at lists.libcamera.org
>https://lists.libcamera.org/listinfo/libcamera-devel


More information about the libcamera-devel mailing list