diff options
author | Jacopo Mondi <jacopo@jmondi.org> | 2019-06-12 13:09:57 +0100 |
---|---|---|
committer | Jacopo Mondi <jacopo@jmondi.org> | 2019-06-19 15:46:44 +0200 |
commit | 3a6c4bd146cc6647daf458bbc048bd861e702f62 (patch) | |
tree | fe44a23f524bd1d82b541985bddf83a275ae725a /src | |
parent | 20807a8c17e629b93d293ef0a0bdbd686ce84823 (diff) |
libcamera: Rename V4L2Device to V4L2VideoDevice
In preparation of creating a new V4L2Device base class, rename
V4L2Device to V4L2VideoDevice.
This is a project wide rename without any intended functional change.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/include/v4l2_videodevice.h (renamed from src/libcamera/include/v4l2_device.h) | 24 | ||||
-rw-r--r-- | src/libcamera/meson.build | 4 | ||||
-rw-r--r-- | src/libcamera/pipeline/ipu3/ipu3.cpp | 24 | ||||
-rw-r--r-- | src/libcamera/pipeline/rkisp1/rkisp1.cpp | 6 | ||||
-rw-r--r-- | src/libcamera/pipeline/uvcvideo.cpp | 6 | ||||
-rw-r--r-- | src/libcamera/pipeline/vimc.cpp | 6 | ||||
-rw-r--r-- | src/libcamera/v4l2_subdevice.cpp | 2 | ||||
-rw-r--r-- | src/libcamera/v4l2_videodevice.cpp (renamed from src/libcamera/v4l2_device.cpp) | 107 |
8 files changed, 90 insertions, 89 deletions
diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_videodevice.h index 1a67850a..89565880 100644 --- a/src/libcamera/include/v4l2_device.h +++ b/src/libcamera/include/v4l2_videodevice.h @@ -2,10 +2,10 @@ /* * Copyright (C) 2019, Google Inc. * - * v4l2_device.h - V4L2 Device + * v4l2_videodevice.h - V4L2 Video Device */ -#ifndef __LIBCAMERA_V4L2_DEVICE_H__ -#define __LIBCAMERA_V4L2_DEVICE_H__ +#ifndef __LIBCAMERA_V4L2_VIDEODEVICE_H__ +#define __LIBCAMERA_V4L2_VIDEODEVICE_H__ #include <atomic> #include <string> @@ -112,15 +112,15 @@ public: const std::string toString() const; }; -class V4L2Device : protected Loggable +class V4L2VideoDevice : protected Loggable { public: - explicit V4L2Device(const std::string &deviceNode); - explicit V4L2Device(const MediaEntity *entity); - V4L2Device(const V4L2Device &) = delete; - ~V4L2Device(); + explicit V4L2VideoDevice(const std::string &deviceNode); + explicit V4L2VideoDevice(const MediaEntity *entity); + V4L2VideoDevice(const V4L2VideoDevice &) = delete; + ~V4L2VideoDevice(); - V4L2Device &operator=(const V4L2Device &) = delete; + V4L2VideoDevice &operator=(const V4L2VideoDevice &) = delete; int open(); bool isOpen() const; @@ -145,8 +145,8 @@ public: int streamOn(); int streamOff(); - static V4L2Device *fromEntityName(const MediaDevice *media, - const std::string &entity); + static V4L2VideoDevice *fromEntityName(const MediaDevice *media, + const std::string &entity); protected: std::string logPrefix() const; @@ -186,4 +186,4 @@ private: } /* namespace libcamera */ -#endif /* __LIBCAMERA_V4L2_DEVICE_H__ */ +#endif /* __LIBCAMERA_V4L2_VIDEODEVICE_H__ */ diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index 1ca1083c..15ab53b1 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -23,8 +23,8 @@ libcamera_sources = files([ 'stream.cpp', 'timer.cpp', 'utils.cpp', - 'v4l2_device.cpp', 'v4l2_subdevice.cpp', + 'v4l2_videodevice.cpp', ]) libcamera_headers = files([ @@ -41,8 +41,8 @@ libcamera_headers = files([ 'include/media_object.h', 'include/pipeline_handler.h', 'include/utils.h', - 'include/v4l2_device.h', 'include/v4l2_subdevice.h', + 'include/v4l2_videodevice.h', ]) libcamera_internal_includes = include_directories('include') diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index f2bdecba..1c0a9825 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -22,8 +22,8 @@ #include "media_device.h" #include "pipeline_handler.h" #include "utils.h" -#include "v4l2_device.h" #include "v4l2_subdevice.h" +#include "v4l2_videodevice.h" namespace libcamera { @@ -39,7 +39,7 @@ public: /* ImgU output descriptor: group data specific to an ImgU output. */ struct ImgUOutput { - V4L2Device *dev; + V4L2VideoDevice *dev; unsigned int pad; std::string name; BufferPool *pool; @@ -85,7 +85,7 @@ public: MediaDevice *media_; V4L2Subdevice *imgu_; - V4L2Device *input_; + V4L2VideoDevice *input_; ImgUOutput output_; ImgUOutput viewfinder_; ImgUOutput stat_; @@ -125,7 +125,7 @@ public: static int mediaBusToFormat(unsigned int code); - V4L2Device *output_; + V4L2VideoDevice *output_; V4L2Subdevice *csi2_; CameraSensor *sensor_; @@ -943,7 +943,7 @@ void IPU3CameraData::cio2BufferReady(Buffer *buffer) * Create and open the V4L2 devices and subdevices of the ImgU instance * with \a index. * - * In case of errors the created V4L2Device and V4L2Subdevice instances + * In case of errors the created V4L2VideoDevice and V4L2Subdevice instances * are destroyed at pipeline handler delete time. * * \return 0 on success or a negative error code otherwise @@ -966,12 +966,12 @@ int ImgUDevice::init(MediaDevice *media, unsigned int index) if (ret) return ret; - input_ = V4L2Device::fromEntityName(media, name_ + " input"); + input_ = V4L2VideoDevice::fromEntityName(media, name_ + " input"); ret = input_->open(); if (ret) return ret; - output_.dev = V4L2Device::fromEntityName(media, name_ + " output"); + output_.dev = V4L2VideoDevice::fromEntityName(media, name_ + " output"); ret = output_.dev->open(); if (ret) return ret; @@ -980,8 +980,8 @@ int ImgUDevice::init(MediaDevice *media, unsigned int index) output_.name = "output"; output_.pool = &outPool_; - viewfinder_.dev = V4L2Device::fromEntityName(media, - name_ + " viewfinder"); + viewfinder_.dev = V4L2VideoDevice::fromEntityName(media, + name_ + " viewfinder"); ret = viewfinder_.dev->open(); if (ret) return ret; @@ -990,7 +990,7 @@ int ImgUDevice::init(MediaDevice *media, unsigned int index) viewfinder_.name = "viewfinder"; viewfinder_.pool = &vfPool_; - stat_.dev = V4L2Device::fromEntityName(media, name_ + " 3a stat"); + stat_.dev = V4L2VideoDevice::fromEntityName(media, name_ + " 3a stat"); ret = stat_.dev->open(); if (ret) return ret; @@ -1067,7 +1067,7 @@ int ImgUDevice::configureInput(const Size &size, int ImgUDevice::configureOutput(ImgUOutput *output, const StreamConfiguration &cfg) { - V4L2Device *dev = output->dev; + V4L2VideoDevice *dev = output->dev; unsigned int pad = output->pad; V4L2SubdeviceFormat imguFormat = {}; @@ -1337,7 +1337,7 @@ int CIO2Device::init(const MediaDevice *media, unsigned int index) return ret; std::string cio2Name = "ipu3-cio2 " + std::to_string(index); - output_ = V4L2Device::fromEntityName(media, cio2Name); + output_ = V4L2VideoDevice::fromEntityName(media, cio2Name); ret = output_->open(); if (ret) return ret; diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 9b3eea2f..4a5898d2 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -23,8 +23,8 @@ #include "media_device.h" #include "pipeline_handler.h" #include "utils.h" -#include "v4l2_device.h" #include "v4l2_subdevice.h" +#include "v4l2_videodevice.h" namespace libcamera { @@ -106,7 +106,7 @@ private: MediaDevice *media_; V4L2Subdevice *dphy_; V4L2Subdevice *isp_; - V4L2Device *video_; + V4L2VideoDevice *video_; Camera *activeCamera_; }; @@ -458,7 +458,7 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator) return false; /* Locate and open the capture video node. */ - video_ = V4L2Device::fromEntityName(media_, "rkisp1_mainpath"); + video_ = V4L2VideoDevice::fromEntityName(media_, "rkisp1_mainpath"); if (video_->open() < 0) return false; diff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp index 7ca9d0ee..2e22523d 100644 --- a/src/libcamera/pipeline/uvcvideo.cpp +++ b/src/libcamera/pipeline/uvcvideo.cpp @@ -16,7 +16,7 @@ #include "media_device.h" #include "pipeline_handler.h" #include "utils.h" -#include "v4l2_device.h" +#include "v4l2_videodevice.h" namespace libcamera { @@ -37,7 +37,7 @@ public: void bufferReady(Buffer *buffer); - V4L2Device *video_; + V4L2VideoDevice *video_; Stream stream_; }; @@ -250,7 +250,7 @@ bool PipelineHandlerUVC::match(DeviceEnumerator *enumerator) /* Locate and open the default video node. */ for (MediaEntity *entity : media->entities()) { if (entity->flags() & MEDIA_ENT_FL_DEFAULT) { - data->video_ = new V4L2Device(entity); + data->video_ = new V4L2VideoDevice(entity); break; } } diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp index ad4577ac..68332136 100644 --- a/src/libcamera/pipeline/vimc.cpp +++ b/src/libcamera/pipeline/vimc.cpp @@ -20,7 +20,7 @@ #include "media_device.h" #include "pipeline_handler.h" #include "utils.h" -#include "v4l2_device.h" +#include "v4l2_videodevice.h" namespace libcamera { @@ -41,7 +41,7 @@ public: void bufferReady(Buffer *buffer); - V4L2Device *video_; + V4L2VideoDevice *video_; Stream stream_; }; @@ -262,7 +262,7 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator) std::unique_ptr<VimcCameraData> data = utils::make_unique<VimcCameraData>(this); /* Locate and open the capture video node. */ - data->video_ = new V4L2Device(media->getEntityByName("Raw Capture 1")); + data->video_ = new V4L2VideoDevice(media->getEntityByName("Raw Capture 1")); if (data->video_->open()) return false; diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp index c38f95a3..48f1fcb3 100644 --- a/src/libcamera/v4l2_subdevice.cpp +++ b/src/libcamera/v4l2_subdevice.cpp @@ -44,7 +44,7 @@ LOG_DEFINE_CATEGORY(V4L2Subdev) * as the "media bus format", and it is identified by a resolution and a pixel * format identification code, known as the "media bus code", not to be confused * with the fourcc code that identify the format of images when stored in memory - * (see V4L2Device::V4L2DeviceFormat). + * (see V4L2VideoDevice::V4L2DeviceFormat). * * Media Bus formats supported by the V4L2 APIs are described in Section * 4.15.3.4.1 of the "Part I - Video for Linux API" chapter of the "Linux Media diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_videodevice.cpp index e14fc610..0e70498c 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -2,10 +2,10 @@ /* * Copyright (C) 2019, Google Inc. * - * v4l2_device.cpp - V4L2 Device + * v4l2_videodevice.cpp - V4L2 Video Device */ -#include "v4l2_device.h" +#include "v4l2_videodevice.h" #include <fcntl.h> #include <iomanip> @@ -25,8 +25,8 @@ #include "media_object.h" /** - * \file v4l2_device.h - * \brief V4L2 Device API + * \file v4l2_videodevice.h + * \brief V4L2 Video Device API */ namespace libcamera { @@ -243,8 +243,8 @@ const std::string V4L2DeviceFormat::toString() const } /** - * \class V4L2Device - * \brief V4L2Device object and API + * \class V4L2VideoDevice + * \brief V4L2VideoDevice object and API * * The V4L2 Device API class models an instance of a V4L2 device node. * It is constructed with the path to a V4L2 video device node. The device node @@ -257,7 +257,7 @@ const std::string V4L2DeviceFormat::toString() const * No API call other than open(), isOpen() and close() shall be called on an * unopened device instance. * - * The V4L2Device class tracks queued buffers and handles buffer events. It + * The V4L2VideoDevice class tracks queued buffers and handles buffer events. It * automatically dequeues completed buffers and emits the \ref bufferReady * signal. * @@ -266,10 +266,10 @@ const std::string V4L2DeviceFormat::toString() const */ /** - * \brief Construct a V4L2Device + * \brief Construct a V4L2VideoDevice * \param[in] deviceNode The file-system path to the video device node */ -V4L2Device::V4L2Device(const std::string &deviceNode) +V4L2VideoDevice::V4L2VideoDevice(const std::string &deviceNode) : deviceNode_(deviceNode), fd_(-1), bufferPool_(nullptr), queuedBuffersCount_(0), fdEvent_(nullptr) { @@ -282,17 +282,17 @@ V4L2Device::V4L2Device(const std::string &deviceNode) } /** - * \brief Construct a V4L2Device from a MediaEntity + * \brief Construct a V4L2VideoDevice from a MediaEntity * \param[in] entity The MediaEntity to build the device from * - * Construct a V4L2Device from a MediaEntity's device node path. + * Construct a V4L2VideoDevice from a MediaEntity's device node path. */ -V4L2Device::V4L2Device(const MediaEntity *entity) - : V4L2Device(entity->deviceNode()) +V4L2VideoDevice::V4L2VideoDevice(const MediaEntity *entity) + : V4L2VideoDevice(entity->deviceNode()) { } -V4L2Device::~V4L2Device() +V4L2VideoDevice::~V4L2VideoDevice() { close(); } @@ -301,7 +301,7 @@ V4L2Device::~V4L2Device() * \brief Open a V4L2 device and query its capabilities * \return 0 on success or a negative error code otherwise */ -int V4L2Device::open() +int V4L2VideoDevice::open() { int ret; @@ -362,7 +362,7 @@ int V4L2Device::open() return -EINVAL; } - fdEvent_->activated.connect(this, &V4L2Device::bufferAvailable); + fdEvent_->activated.connect(this, &V4L2VideoDevice::bufferAvailable); fdEvent_->setEnabled(false); return 0; @@ -372,7 +372,7 @@ int V4L2Device::open() * \brief Check if device is successfully opened * \return True if the device is open, false otherwise */ -bool V4L2Device::isOpen() const +bool V4L2VideoDevice::isOpen() const { return fd_ != -1; } @@ -380,7 +380,7 @@ bool V4L2Device::isOpen() const /** * \brief Close the device, releasing any resources acquired by open() */ -void V4L2Device::close() +void V4L2VideoDevice::close() { if (fd_ < 0) return; @@ -393,30 +393,30 @@ void V4L2Device::close() } /** - * \fn V4L2Device::driverName() + * \fn V4L2VideoDevice::driverName() * \brief Retrieve the name of the V4L2 device driver * \return The string containing the driver name */ /** - * \fn V4L2Device::deviceName() + * \fn V4L2VideoDevice::deviceName() * \brief Retrieve the name of the V4L2 device * \return The string containing the device name */ /** - * \fn V4L2Device::busName() + * \fn V4L2VideoDevice::busName() * \brief Retrieve the location of the device in the system * \return The string containing the device location */ /** - * \fn V4L2Device::deviceNode() + * \fn V4L2VideoDevice::deviceNode() * \brief Retrieve the video device node path * \return The video device device node path */ -std::string V4L2Device::logPrefix() const +std::string V4L2VideoDevice::logPrefix() const { return deviceNode_ + (V4L2_TYPE_IS_OUTPUT(bufferType_) ? "[out]" : "[cap]"); } @@ -426,7 +426,7 @@ std::string V4L2Device::logPrefix() const * \param[out] format The image format applied on the device * \return 0 on success or a negative error code otherwise */ -int V4L2Device::getFormat(V4L2DeviceFormat *format) +int V4L2VideoDevice::getFormat(V4L2DeviceFormat *format) { if (caps_.isMeta()) return getFormatMeta(format); @@ -441,11 +441,11 @@ int V4L2Device::getFormat(V4L2DeviceFormat *format) * \param[inout] format The image format to apply to the device * * Apply the supplied \a format to the device, and return the actually - * applied format parameters, as \ref V4L2Device::getFormat would do. + * applied format parameters, as \ref V4L2VideoDevice::getFormat would do. * * \return 0 on success or a negative error code otherwise */ -int V4L2Device::setFormat(V4L2DeviceFormat *format) +int V4L2VideoDevice::setFormat(V4L2DeviceFormat *format) { if (caps_.isMeta()) return setFormatMeta(format); @@ -455,7 +455,7 @@ int V4L2Device::setFormat(V4L2DeviceFormat *format) return setFormatSingleplane(format); } -int V4L2Device::getFormatMeta(V4L2DeviceFormat *format) +int V4L2VideoDevice::getFormatMeta(V4L2DeviceFormat *format) { struct v4l2_format v4l2Format = {}; struct v4l2_meta_format *pix = &v4l2Format.fmt.meta; @@ -479,7 +479,7 @@ int V4L2Device::getFormatMeta(V4L2DeviceFormat *format) return 0; } -int V4L2Device::setFormatMeta(V4L2DeviceFormat *format) +int V4L2VideoDevice::setFormatMeta(V4L2DeviceFormat *format) { struct v4l2_format v4l2Format = {}; struct v4l2_meta_format *pix = &v4l2Format.fmt.meta; @@ -509,7 +509,7 @@ int V4L2Device::setFormatMeta(V4L2DeviceFormat *format) return 0; } -int V4L2Device::getFormatMultiplane(V4L2DeviceFormat *format) +int V4L2VideoDevice::getFormatMultiplane(V4L2DeviceFormat *format) { struct v4l2_format v4l2Format = {}; struct v4l2_pix_format_mplane *pix = &v4l2Format.fmt.pix_mp; @@ -536,7 +536,7 @@ int V4L2Device::getFormatMultiplane(V4L2DeviceFormat *format) return 0; } -int V4L2Device::setFormatMultiplane(V4L2DeviceFormat *format) +int V4L2VideoDevice::setFormatMultiplane(V4L2DeviceFormat *format) { struct v4l2_format v4l2Format = {}; struct v4l2_pix_format_mplane *pix = &v4l2Format.fmt.pix_mp; @@ -577,7 +577,7 @@ int V4L2Device::setFormatMultiplane(V4L2DeviceFormat *format) return 0; } -int V4L2Device::getFormatSingleplane(V4L2DeviceFormat *format) +int V4L2VideoDevice::getFormatSingleplane(V4L2DeviceFormat *format) { struct v4l2_format v4l2Format = {}; struct v4l2_pix_format *pix = &v4l2Format.fmt.pix; @@ -601,7 +601,7 @@ int V4L2Device::getFormatSingleplane(V4L2DeviceFormat *format) return 0; } -int V4L2Device::setFormatSingleplane(V4L2DeviceFormat *format) +int V4L2VideoDevice::setFormatSingleplane(V4L2DeviceFormat *format) { struct v4l2_format v4l2Format = {}; struct v4l2_pix_format *pix = &v4l2Format.fmt.pix; @@ -641,7 +641,7 @@ int V4L2Device::setFormatSingleplane(V4L2DeviceFormat *format) * * \return A list of the supported device formats */ -ImageFormats V4L2Device::formats() +ImageFormats V4L2VideoDevice::formats() { ImageFormats formats; @@ -661,7 +661,7 @@ ImageFormats V4L2Device::formats() return formats; } -int V4L2Device::requestBuffers(unsigned int count) +int V4L2VideoDevice::requestBuffers(unsigned int count) { struct v4l2_requestbuffers rb = {}; int ret; @@ -690,7 +690,7 @@ int V4L2Device::requestBuffers(unsigned int count) * \param[out] pool BufferPool to populate with buffers * \return 0 on success or a negative error code otherwise */ -int V4L2Device::exportBuffers(BufferPool *pool) +int V4L2VideoDevice::exportBuffers(BufferPool *pool) { unsigned int allocatedBuffers; unsigned int i; @@ -704,7 +704,8 @@ int V4L2Device::exportBuffers(BufferPool *pool) allocatedBuffers = ret; if (allocatedBuffers < pool->count()) { - LOG(V4L2, Error) << "Not enough buffers provided by V4L2Device"; + LOG(V4L2, Error) + << "Not enough buffers provided by V4L2VideoDevice"; requestBuffers(0); return -ENOMEM; } @@ -758,8 +759,8 @@ int V4L2Device::exportBuffers(BufferPool *pool) return 0; } -int V4L2Device::createPlane(Buffer *buffer, unsigned int planeIndex, - unsigned int length) +int V4L2VideoDevice::createPlane(Buffer *buffer, unsigned int planeIndex, + unsigned int length) { struct v4l2_exportbuffer expbuf = {}; int ret; @@ -790,7 +791,7 @@ int V4L2Device::createPlane(Buffer *buffer, unsigned int planeIndex, return 0; } -std::vector<unsigned int> V4L2Device::enumPixelformats() +std::vector<unsigned int> V4L2VideoDevice::enumPixelformats() { std::vector<unsigned int> formats; int ret; @@ -818,7 +819,7 @@ std::vector<unsigned int> V4L2Device::enumPixelformats() return formats; } -std::vector<SizeRange> V4L2Device::enumSizes(unsigned int pixelFormat) +std::vector<SizeRange> V4L2VideoDevice::enumSizes(unsigned int pixelFormat) { std::vector<SizeRange> sizes; int ret; @@ -882,7 +883,7 @@ std::vector<SizeRange> V4L2Device::enumSizes(unsigned int pixelFormat) * \param[in] pool BufferPool of buffers to import * \return 0 on success or a negative error code otherwise */ -int V4L2Device::importBuffers(BufferPool *pool) +int V4L2VideoDevice::importBuffers(BufferPool *pool) { unsigned int allocatedBuffers; int ret; @@ -896,7 +897,7 @@ int V4L2Device::importBuffers(BufferPool *pool) allocatedBuffers = ret; if (allocatedBuffers < pool->count()) { LOG(V4L2, Error) - << "Not enough buffers provided by V4L2Device"; + << "Not enough buffers provided by V4L2VideoDevice"; requestBuffers(0); return -ENOMEM; } @@ -910,7 +911,7 @@ int V4L2Device::importBuffers(BufferPool *pool) /** * \brief Release all internally allocated buffers */ -int V4L2Device::releaseBuffers() +int V4L2VideoDevice::releaseBuffers() { LOG(V4L2, Debug) << "Releasing bufferPool"; @@ -930,7 +931,7 @@ int V4L2Device::releaseBuffers() * * \return 0 on success or a negative error code otherwise */ -int V4L2Device::queueBuffer(Buffer *buffer) +int V4L2VideoDevice::queueBuffer(Buffer *buffer) { struct v4l2_buffer buf = {}; struct v4l2_plane planes[VIDEO_MAX_PLANES] = {}; @@ -991,7 +992,7 @@ int V4L2Device::queueBuffer(Buffer *buffer) * * \return A pointer to the dequeued buffer on success, or nullptr otherwise */ -Buffer *V4L2Device::dequeueBuffer() +Buffer *V4L2VideoDevice::dequeueBuffer() { struct v4l2_buffer buf = {}; struct v4l2_plane planes[VIDEO_MAX_PLANES] = {}; @@ -1040,7 +1041,7 @@ Buffer *V4L2Device::dequeueBuffer() * For Capture devices the Buffer will contain valid data. * For Output devices the Buffer can be considered empty. */ -void V4L2Device::bufferAvailable(EventNotifier *notifier) +void V4L2VideoDevice::bufferAvailable(EventNotifier *notifier) { Buffer *buffer = dequeueBuffer(); if (!buffer) @@ -1053,7 +1054,7 @@ void V4L2Device::bufferAvailable(EventNotifier *notifier) } /** - * \var V4L2Device::bufferReady + * \var V4L2VideoDevice::bufferReady * \brief A Signal emitted when a buffer completes */ @@ -1061,7 +1062,7 @@ void V4L2Device::bufferAvailable(EventNotifier *notifier) * \brief Start the video stream * \return 0 on success or a negative error code otherwise */ -int V4L2Device::streamOn() +int V4L2VideoDevice::streamOn() { int ret; @@ -1084,7 +1085,7 @@ int V4L2Device::streamOn() * * \return 0 on success or a negative error code otherwise */ -int V4L2Device::streamOff() +int V4L2VideoDevice::streamOff() { int ret; @@ -1111,16 +1112,16 @@ int V4L2Device::streamOff() * Releasing memory of the newly created instance is responsibility of the * caller of this function. * - * \return A newly created V4L2Device on success, nullptr otherwise + * \return A newly created V4L2VideoDevice on success, nullptr otherwise */ -V4L2Device *V4L2Device::fromEntityName(const MediaDevice *media, - const std::string &entity) +V4L2VideoDevice *V4L2VideoDevice::fromEntityName(const MediaDevice *media, + const std::string &entity) { MediaEntity *mediaEntity = media->getEntityByName(entity); if (!mediaEntity) return nullptr; - return new V4L2Device(mediaEntity); + return new V4L2VideoDevice(mediaEntity); } } /* namespace libcamera */ |