This release brings in some new support and features for UVC Gadget to operate with libcamera based cameras. - libcamera sources are now supported - Support for encoded streams - Software based MJPEG encoding is managed by the libcamera source only. Please be aware, that as part of this release, the existing V4L2 source option '-c' is renamed to '-d'. The new libcamera source is now supported by the option '-c' and can be selected by camera index, or explictly choosing the camera based on it's libcamera id. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
MJPEG is an extremely useful format given its compression allows high framerates even over limited bandwith USB connections. Add an MJPEG encoder class that converts YUV420 data into MJPEG data. Where a libcamera-source does not support MJPEG natively, convert YUV420 into MJPEG if the user tries to set MJPEG format. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
Add functions to handle a new entry into video_source_type, representing data with an encoding step between the source and sink. When running through this route, buffers are allocated and mmaped on both the source and the sink, then imported to the source to be filled before being queued to the sink. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
We need to be able to place encoded data into the sink device's bufs. To facilitate that add a video_source operation that allows the source to import buffers from the sink. Add a .import_buffers() callback so that the libcamera-source can access a sink's buffers. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
Add an enum to struct video_source that details the type of source we're dealing with. This will be used to make decisions about buffer allocation and handling in a more explicit way. Use the video_source_type associated with a video_source to decide on the appropriate allocation function and buffer handler at stream on time. This is a more explicit method than relying on the presence of the .alloc_buffers op and allows more flexibility. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
Allow callers to create a libcamera source when available. libcamera support is optional, so conditionally compile the new options depending on whether libcamera is available. Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
Provide the integration of a libcamera source within uvc-gadget. This adds C++ support to the project and adds libcamera as an optional external dependency. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
Use the option 'd' to specify a v4l2 capture device. This will free up the use of option 'c' for 'camera' identifiers based on libcamera. Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This release extends UVC Gadget with the ability to provide a 'slideshow' source. This can assist in the testing of performance and capabilities of a UVC Gadget based device, by providing a known set of data frames and configurations to stream to the host. Further more this release contains: - lib/timer: Add timer infrastructure - lib/jpg-source: Constrain fps These allow sources with out a controlling device to be configured to deliver at the rate requested by the host. Finally, the Makefile 'helper' is fixed to correctly call the install target in ninja. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Add facilities in main() to allow selection and usage of slideshow_source. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>