summaryrefslogtreecommitdiff
path: root/test/ipc/meson.build
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-07-05 07:19:00 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-07-22 17:13:44 +0300
commit24ca846a27d3b5f3e371dcd039df6ee74dd113c1 (patch)
tree8bd492fe96b28048ce13070547b4d5b2ea0d37db /test/ipc/meson.build
parent4cd0f586fbc7bc8451bd18aaa3b59fbd8d53574e (diff)
cam: camera_session: Use std::unique_ptr<> to manage class members
Store the BufferWriter and FrameBufferAllocator pointers in std::unique_ptr<> instances to simplify memory management and avoid leaks. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'test/ipc/meson.build')
0 files changed, 0 insertions, 0 deletions
t; #include "pipeline_handler.h" namespace libcamera { class PipeHandlerVimc : public PipelineHandler { public: PipeHandlerVimc(); ~PipeHandlerVimc(); bool match(DeviceEnumerator *enumerator); unsigned int count(); Camera *camera(unsigned int id) final; private: MediaDevice *dev_; Camera *camera_; }; PipeHandlerVimc::PipeHandlerVimc() : dev_(nullptr), camera_(nullptr) { } PipeHandlerVimc::~PipeHandlerVimc() { if (camera_) camera_->put(); if (dev_) dev_->release(); } unsigned int PipeHandlerVimc::count() { return 1; } Camera *PipeHandlerVimc::camera(unsigned int id) { if (id != 0) return nullptr; return camera_; } bool PipeHandlerVimc::match(DeviceEnumerator *enumerator) { DeviceMatch dm("vimc"); dm.add("Raw Capture 0"); dm.add("Raw Capture 1"); dm.add("RGB/YUV Capture"); dm.add("Sensor A"); dm.add("Sensor B"); dm.add("Debayer A"); dm.add("Debayer B"); dm.add("RGB/YUV Input"); dm.add("Scaler"); dev_ = enumerator->search(dm); if (!dev_) return false; dev_->acquire(); /* * NOTE: A more complete Camera implementation could * be passed the MediaDevice(s) it controls here or * a reference to the PipelineHandler. Which method * will be chosen depends on how the Camera * object is modeled. */ camera_ = new Camera("Dummy VIMC Camera"); return true; } REGISTER_PIPELINE_HANDLER(PipeHandlerVimc); } /* namespace libcamera */