cam: Store camera as shared pointer everywhere
Do not store the camera raw pointer in the capture class, this will prevent forwarding the shared pointer in the future. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
bcf4299453
commit
1d32f21136
3 changed files with 4 additions and 4 deletions
|
@ -16,7 +16,7 @@
|
|||
|
||||
using namespace libcamera;
|
||||
|
||||
Capture::Capture(Camera *camera, CameraConfiguration *config)
|
||||
Capture::Capture(std::shared_ptr<Camera> camera, CameraConfiguration *config)
|
||||
: camera_(camera), config_(config), writer_(nullptr)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
class Capture
|
||||
{
|
||||
public:
|
||||
Capture(libcamera::Camera *camera,
|
||||
Capture(std::shared_ptr<libcamera::Camera> camera,
|
||||
libcamera::CameraConfiguration *config);
|
||||
|
||||
int run(EventLoop *loop, const OptionsParser::Options &options);
|
||||
|
@ -30,7 +30,7 @@ private:
|
|||
|
||||
void requestComplete(libcamera::Request *request);
|
||||
|
||||
libcamera::Camera *camera_;
|
||||
std::shared_ptr<libcamera::Camera> camera_;
|
||||
libcamera::CameraConfiguration *config_;
|
||||
|
||||
std::map<libcamera::Stream *, std::string> streamName_;
|
||||
|
|
|
@ -319,7 +319,7 @@ int CamApp::run()
|
|||
}
|
||||
|
||||
if (options_.isSet(OptCapture)) {
|
||||
Capture capture(camera_.get(), config_.get());
|
||||
Capture capture(camera_, config_.get());
|
||||
return capture.run(loop_, options_);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue