summaryrefslogtreecommitdiff
path: root/test/stream
AgeCommit message (Collapse)Author
2020-05-13licenses: License all meson files under CC0-1.0Laurent Pinchart
In an attempt to clarify the license terms of all files in the libcamera project, the build system files deserve particular attention. While they describe how the binaries are created, they are not themselves transformed into any part of binary distributions of the software, and thus don't influence the copyright on the binary packages. They are however subject to copyright, and thus influence the distribution terms of the source packages. Most of the meson.build files would not meet the threshold of originality criteria required for copyright protection. Some of the more complex meson.build files may be eligible for copyright protection. To avoid any ambiguity and uncertainty, state our intent to not assert copyrights on the build system files by putting them in the public domain with the CC0-1.0 license. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Acked-by: Giulio Benetti <giulio.benetti@micronovasrl.com> Acked-by: Jacopo Mondi <jacopo@jmondi.org> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Acked-by: Naushir Patuck <naush@raspberrypi.com> Acked-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Acked-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Acked-by: Paul Elder <paul.elder@ideasonboard.com> Acked-by: Show Liu <show.liu@linaro.org>
2020-03-19libcamera: geometry: Construct SizeRange from SizeLaurent Pinchart
The SizeRange constructors take minimum and maximum width and height values as separate arguments. We have a Size class to convey size information, use it in the constructors, and update the callers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-03-18libcamera: PixelFormat: Make constructor explicitLaurent Pinchart
To achieve the goal of preventing unwanted conversion between a DRM and a V4L2 FourCC, make the PixelFormat constructor that takes an integer value explicit. All users of pixel formats flagged by the compiler are fixed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-07-04test: Allow self-contained tests to run in parallelNiklas Söderlund
The IPA, IPC and Stream tests are self-contained so they can run in parallel. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-06-19test: stream: Add test for StreamFormatNiklas Söderlund
Test that both discrete and range based stream format descriptions result in good discrete frame sizes. The range based stream formats needs to be fitted with a table of resolutions inside libcamera so if that table is updated this test might need to be updated. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
span class="hl kwd">open(V4L2CameraFile *file); void close(V4L2CameraFile *file); void *mmap(void *addr, size_t length, int prot, int flags, off64_t offset); int munmap(void *addr, size_t length); int ioctl(V4L2CameraFile *file, unsigned long request, void *arg); private: bool validateBufferType(uint32_t type); bool validateMemoryType(uint32_t memory); void setFmtFromConfig(const libcamera::StreamConfiguration &streamConfig); void querycap(std::shared_ptr<libcamera::Camera> camera); int tryFormat(struct v4l2_format *arg); enum v4l2_priority maxPriority(); void updateBuffers(); void freeBuffers(); int vidioc_querycap(struct v4l2_capability *arg); int vidioc_enum_framesizes(V4L2CameraFile *file, struct v4l2_frmsizeenum *arg); int vidioc_enum_fmt(V4L2CameraFile *file, struct v4l2_fmtdesc *arg); int vidioc_g_fmt(V4L2CameraFile *file, struct v4l2_format *arg); int vidioc_s_fmt(V4L2CameraFile *file, struct v4l2_format *arg); int vidioc_try_fmt(V4L2CameraFile *file, struct v4l2_format *arg); int vidioc_g_priority(V4L2CameraFile *file, enum v4l2_priority *arg); int vidioc_s_priority(V4L2CameraFile *file, enum v4l2_priority *arg); int vidioc_enuminput(V4L2CameraFile *file, struct v4l2_input *arg); int vidioc_g_input(V4L2CameraFile *file, int *arg); int vidioc_s_input(V4L2CameraFile *file, int *arg); int vidioc_reqbufs(V4L2CameraFile *file, struct v4l2_requestbuffers *arg); int vidioc_querybuf(V4L2CameraFile *file, struct v4l2_buffer *arg); int vidioc_qbuf(V4L2CameraFile *file, struct v4l2_buffer *arg); int vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg, libcamera::Mutex *lock) LIBCAMERA_TSA_REQUIRES(*lock); int vidioc_streamon(V4L2CameraFile *file, int *arg); int vidioc_streamoff(V4L2CameraFile *file, int *arg); bool hasOwnership(V4L2CameraFile *file); int acquire(V4L2CameraFile *file); void release(V4L2CameraFile *file); static const std::set<unsigned long> supportedIoctls_; unsigned int refcount_; unsigned int index_; libcamera::StreamConfiguration streamConfig_; unsigned int bufferCount_; unsigned int currentBuf_; unsigned int sizeimage_; struct v4l2_capability capabilities_; struct v4l2_pix_format v4l2PixFormat_; std::vector<struct v4l2_buffer> buffers_; std::map<void *, unsigned int> mmaps_; std::set<V4L2CameraFile *> files_; std::unique_ptr<V4L2Camera> vcam_; /* * This is the exclusive owner of this V4L2CameraProxy instance. * When there is no owner, anybody can call any ioctl before reqbufs. * The first file to call reqbufs with count > 0 or s_fmt will become * the owner, and when the owner calls reqbufs with count = 0 it will * release ownership. Any buffer-related ioctl (except querybuf) or * s_fmt that is called by a non-owner while there exists an owner * will return -EBUSY. */ V4L2CameraFile *owner_; /* This mutex is to serialize access to the proxy. */ libcamera::Mutex proxyMutex_; };