summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/vimc.cpp
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2019-11-22 16:22:56 +0100
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-01-12 16:10:38 +0100
commit9217f274f64f690b768d332663e1731a3ee5ef15 (patch)
treeee152928be1eaea656c929e56e27e97b175de435 /src/libcamera/pipeline/vimc.cpp
parenteb4030f6c07174a520be1ebd73628e9ae4789569 (diff)
libcamera: Switch to FrameBuffer interface
Switch to the FrameBuffer interface where all buffers are treated as external buffers and are allocated outside the camera. Applications allocating buffers using libcamera are switched to use the FrameBufferAllocator helper. Follow-up changes to this one will finalize the transition to the new FrameBuffer interface by removing code that is left unused after this change. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/libcamera/pipeline/vimc.cpp')
-rw-r--r--src/libcamera/pipeline/vimc.cpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp
index 3fb5cacd..5e0f5c63 100644
--- a/src/libcamera/pipeline/vimc.cpp
+++ b/src/libcamera/pipeline/vimc.cpp
@@ -55,7 +55,7 @@ public:
}
int init(MediaDevice *media);
- void bufferReady(Buffer *buffer);
+ void bufferReady(FrameBuffer *buffer);
CameraSensor *sensor_;
V4L2Subdevice *debayer_;
@@ -291,23 +291,13 @@ void PipelineHandlerVimc::freeFrameBuffers(Camera *camera, Stream *stream)
int PipelineHandlerVimc::allocateBuffers(Camera *camera,
const std::set<Stream *> &streams)
{
- VimcCameraData *data = cameraData(camera);
- Stream *stream = *streams.begin();
- const StreamConfiguration &cfg = stream->configuration();
-
- LOG(VIMC, Debug) << "Requesting " << cfg.bufferCount << " buffers";
-
- if (stream->memoryType() == InternalMemory)
- return data->video_->exportBuffers(&stream->bufferPool());
- else
- return data->video_->importBuffers(&stream->bufferPool());
+ return 0;
}
int PipelineHandlerVimc::freeBuffers(Camera *camera,
const std::set<Stream *> &streams)
{
- VimcCameraData *data = cameraData(camera);
- return data->video_->releaseBuffers();
+ return 0;
}
int PipelineHandlerVimc::start(Camera *camera)
@@ -355,7 +345,7 @@ int PipelineHandlerVimc::processControls(VimcCameraData *data, Request *request)
int PipelineHandlerVimc::queueRequestDevice(Camera *camera, Request *request)
{
VimcCameraData *data = cameraData(camera);
- Buffer *buffer = request->findBuffer(&data->stream_);
+ FrameBuffer *buffer = request->findBuffer(&data->stream_);
if (!buffer) {
LOG(VIMC, Error)
<< "Attempt to queue request with invalid stream";
@@ -447,7 +437,7 @@ int VimcCameraData::init(MediaDevice *media)
if (video_->open())
return -ENODEV;
- video_->bufferReady.connect(this, &VimcCameraData::bufferReady);
+ video_->frameBufferReady.connect(this, &VimcCameraData::bufferReady);
raw_ = new V4L2VideoDevice(media->getEntityByName("Raw Capture 1"));
if (raw_->open())
@@ -484,7 +474,7 @@ int VimcCameraData::init(MediaDevice *media)
return 0;
}
-void VimcCameraData::bufferReady(Buffer *buffer)
+void VimcCameraData::bufferReady(FrameBuffer *buffer)
{
Request *request = buffer->request();