libcamera: pipeline: vimc: create camera for Sensor B
Create a camera for Sensor B of the vimc pipeline. At this stage only Sensor B is exposed while the are in total two sensors in the graph. Going forward Sensor A should also be exposed as another camera. Sensor B was chosen since the graph is configured correctly for it out of the box. As we lack control over sub devices formats it's not really possible to use Sensor A yet with the library. Once both cameras are registered with the library they should be extended to provide two streams each, one for the raw output and one for the output which uses the shared scaler. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
8400bdd19a
commit
08c31d2a86
1 changed files with 14 additions and 2 deletions
|
@ -12,6 +12,7 @@
|
|||
#include "log.h"
|
||||
#include "media_device.h"
|
||||
#include "pipeline_handler.h"
|
||||
#include "v4l2_device.h"
|
||||
|
||||
namespace libcamera {
|
||||
|
||||
|
@ -33,16 +34,19 @@ public:
|
|||
|
||||
private:
|
||||
std::shared_ptr<MediaDevice> media_;
|
||||
V4L2Device *video_;
|
||||
Stream stream_;
|
||||
};
|
||||
|
||||
PipeHandlerVimc::PipeHandlerVimc(CameraManager *manager)
|
||||
: PipelineHandler(manager), media_(nullptr)
|
||||
: PipelineHandler(manager), media_(nullptr), video_(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
PipeHandlerVimc::~PipeHandlerVimc()
|
||||
{
|
||||
delete video_;
|
||||
|
||||
if (media_)
|
||||
media_->release();
|
||||
}
|
||||
|
@ -93,8 +97,16 @@ bool PipeHandlerVimc::match(DeviceEnumerator *enumerator)
|
|||
|
||||
media_->acquire();
|
||||
|
||||
video_ = new V4L2Device(*media_->getEntityByName("Raw Capture 1"));
|
||||
|
||||
if (video_->open()) {
|
||||
media_->release();
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<Stream *> streams{ &stream_ };
|
||||
std::shared_ptr<Camera> camera = Camera::create(this, "Dummy VIMC Camera", streams);
|
||||
std::shared_ptr<Camera> camera = Camera::create(this, "VIMC Sensor B",
|
||||
streams);
|
||||
registerCamera(std::move(camera));
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue