@@ -704,7 +704,7 @@ int Camera::allocateBuffers()
return -EINVAL;
}
- int ret = pipe_->allocateBuffers(this, activeStreams_);
+ int ret = pipe_->setupBuffers(this, activeStreams_);
if (ret) {
LOG(Camera, Error) << "Failed to allocate buffers";
return ret;
@@ -64,8 +64,8 @@ public:
const StreamRoles &roles) = 0;
virtual int configure(Camera *camera, CameraConfiguration *config) = 0;
- virtual int allocateBuffers(Camera *camera,
- const std::set<Stream *> &streams) = 0;
+ virtual int setupBuffers(Camera *camera,
+ const std::set<Stream *> &streams) = 0;
virtual int freeBuffers(Camera *camera,
const std::set<Stream *> &streams) = 0;
@@ -207,8 +207,8 @@ public:
const StreamRoles &roles) override;
int configure(Camera *camera, CameraConfiguration *config) override;
- int allocateBuffers(Camera *camera,
- const std::set<Stream *> &streams) override;
+ int setupBuffers(Camera *camera,
+ const std::set<Stream *> &streams) override;
int freeBuffers(Camera *camera,
const std::set<Stream *> &streams) override;
@@ -588,8 +588,8 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)
* In order to be able to start the 'viewfinder' and 'stat' nodes, we need
* memory to be reserved.
*/
-int PipelineHandlerIPU3::allocateBuffers(Camera *camera,
- const std::set<Stream *> &streams)
+int PipelineHandlerIPU3::setupBuffers(Camera *camera,
+ const std::set<Stream *> &streams)
{
IPU3CameraData *data = cameraData(camera);
IPU3Stream *outStream = &data->outStream_;
@@ -80,7 +80,7 @@ public:
const StreamRoles &roles) override;
int configure(Camera *camera, CameraConfiguration *config) override;
- int allocateBuffers(Camera *camera,
+ int setupBuffers(Camera *camera,
const std::set<Stream *> &streams) override;
int freeBuffers(Camera *camera,
const std::set<Stream *> &streams) override;
@@ -315,8 +315,8 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)
return 0;
}
-int PipelineHandlerRkISP1::allocateBuffers(Camera *camera,
- const std::set<Stream *> &streams)
+int PipelineHandlerRkISP1::setupBuffers(Camera *camera,
+ const std::set<Stream *> &streams)
{
Stream *stream = *streams.begin();
return video_->exportBuffers(&stream->bufferPool());
@@ -58,8 +58,8 @@ public:
const StreamRoles &roles) override;
int configure(Camera *camera, CameraConfiguration *config) override;
- int allocateBuffers(Camera *camera,
- const std::set<Stream *> &streams) override;
+ int setupBuffers(Camera *camera,
+ const std::set<Stream *> &streams) override;
int freeBuffers(Camera *camera,
const std::set<Stream *> &streams) override;
@@ -184,8 +184,8 @@ int PipelineHandlerUVC::configure(Camera *camera, CameraConfiguration *config)
return 0;
}
-int PipelineHandlerUVC::allocateBuffers(Camera *camera,
- const std::set<Stream *> &streams)
+int PipelineHandlerUVC::setupBuffers(Camera *camera,
+ const std::set<Stream *> &streams)
{
UVCCameraData *data = cameraData(camera);
Stream *stream = *streams.begin();
@@ -62,8 +62,8 @@ public:
const StreamRoles &roles) override;
int configure(Camera *camera, CameraConfiguration *config) override;
- int allocateBuffers(Camera *camera,
- const std::set<Stream *> &streams) override;
+ int setupBuffers(Camera *camera,
+ const std::set<Stream *> &streams) override;
int freeBuffers(Camera *camera,
const std::set<Stream *> &streams) override;
@@ -183,8 +183,8 @@ int PipelineHandlerVimc::configure(Camera *camera, CameraConfiguration *config)
return 0;
}
-int PipelineHandlerVimc::allocateBuffers(Camera *camera,
- const std::set<Stream *> &streams)
+int PipelineHandlerVimc::setupBuffers(Camera *camera,
+ const std::set<Stream *> &streams)
{
VimcCameraData *data = cameraData(camera);
Stream *stream = *streams.begin();
@@ -261,11 +261,13 @@ void PipelineHandler::unlock()
*/
/**
- * \fn PipelineHandler::allocateBuffers()
- * \brief Allocate buffers for a stream
+ * \fn PipelineHandler::setupBuffers()
+ * \brief Setup buffer for a stream
* \param[in] camera The camera the \a stream belongs to
* \param[in] streams The set of streams to allocate buffers for
*
+ * \todo Change this to describe both allocation and importing
+ *
* This method allocates buffers internally in the pipeline handler for each
* stream in the \a streams buffer set, and associates them with the stream's
* buffer pool.
Now that the pipeline handlers can inspect the Stream's memory type flag the allocateBuffers() operation name does not match the actual operation purpose, which is to setup buffers to export memory to application or either prepare to use externally allocated buffers. Todo: rename the camera operation as well? Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> --- src/libcamera/camera.cpp | 2 +- src/libcamera/include/pipeline_handler.h | 4 ++-- src/libcamera/pipeline/ipu3/ipu3.cpp | 8 ++++---- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 6 +++--- src/libcamera/pipeline/uvcvideo.cpp | 8 ++++---- src/libcamera/pipeline/vimc.cpp | 8 ++++---- src/libcamera/pipeline_handler.cpp | 6 ++++-- 7 files changed, 22 insertions(+), 20 deletions(-)