26 uint32_t target_width { 1920 };
27 uint32_t target_height { 1080 };
28 double target_fps { 30.0 };
30 int pixel_format { -1 };
89 [[nodiscard]]
virtual std::vector<CameraMode>
preset_modes()
const = 0;
102 [[nodiscard]]
virtual bool is_open()
const = 0;
108 [[nodiscard]]
virtual std::shared_ptr<Kakshya::CameraContainer>
create_container()
const = 0;
120 virtual bool pull_frame(
const std::shared_ptr<Kakshya::CameraContainer>& container) = 0;
123 [[nodiscard]]
virtual uint32_t
width()
const = 0;
126 [[nodiscard]]
virtual uint32_t
height()
const = 0;
135 virtual void set_container(
const std::shared_ptr<Kakshya::CameraContainer>& container) = 0;
147 [[nodiscard]]
virtual const std::string&
last_error()
const = 0;
virtual std::vector< CameraConfig > enumerate_configs() const =0
Discover ready-to-open camera configurations without starting capture.
virtual bool pull_frame(const std::shared_ptr< Kakshya::CameraContainer > &container)=0
Produce one frame into the container.
virtual void set_container(const std::shared_ptr< Kakshya::CameraContainer > &container)=0
Store a weak reference to the container for IOService dispatch.
virtual void pull_frame_all()=0
Signal the source to pull one frame.
virtual bool is_open() const =0
True if the device is open and ready to deliver frames.
virtual double frame_rate() const =0
Negotiated frame rate in fps.
virtual bool open(const CameraConfig &config)=0
Open a configuration returned by enumerate_configs().
virtual uint32_t width() const =0
Negotiated output width in pixels.
virtual void setup_io_service(uint64_t reader_id)=0
Wire this source into an IOService under the given reader_id.
virtual void close()=0
Release device, decode, and scratch resources.
virtual std::shared_ptr< Kakshya::CameraContainer > create_container() const =0
Create a CameraContainer sized to the negotiated device resolution.
virtual uint32_t height() const =0
Negotiated output height in pixels.
virtual std::vector< CameraMode > preset_modes() const =0
Capture modes this source offers as defaults, ordered from safest to most demanding.
virtual const std::string & last_error() const =0
Last error string, empty if no error.
virtual ~CameraSource()=default
Abstract interface for a live camera backend hosted by IOManager.
std::string device_name
Platform device string.
std::string display_name
Human-readable device name for a chooser.
std::string format_override
Leave empty to use CAMERA_FORMAT for current platform.
std::string input_format
Capture format or codec (e.g. "mjpeg"); empty selects mjpeg where the platform supports it.
uint32_t target_width
Requested width in pixels.
uint32_t target_height
Requested height in pixels.
double target_fps
Hint only; device may ignore.
Configuration for opening a camera device via FFmpeg.
void apply(CameraConfig &config) const
Write this mode's size and frame rate into config.
std::string label
Caption for a chooser.
A requested capture mode offered by a source, for a chooser.