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>
This commit is contained in:
+1
-1
@@ -5,8 +5,8 @@ subdir('ipa')
|
||||
subdir('media_device')
|
||||
subdir('pipeline')
|
||||
subdir('stream')
|
||||
subdir('v4l2_device')
|
||||
subdir('v4l2_subdevice')
|
||||
subdir('v4l2_videodevice')
|
||||
|
||||
public_tests = [
|
||||
['event', 'event.cpp'],
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
*
|
||||
* libcamera V4L2 API tests
|
||||
*
|
||||
* Validate the function of exporting buffers from a V4L2Device and
|
||||
* the ability to import them to another V4L2Device instance.
|
||||
* Validate the function of exporting buffers from a V4L2VideoDevice and
|
||||
* the ability to import them to another V4L2VideoDevice instance.
|
||||
* Ensure that the Buffers can successfully be queued and dequeued
|
||||
* between both devices.
|
||||
*/
|
||||
@@ -17,19 +17,19 @@
|
||||
#include <libcamera/event_dispatcher.h>
|
||||
#include <libcamera/timer.h>
|
||||
|
||||
#include "v4l2_device_test.h"
|
||||
#include "v4l2_videodevice_test.h"
|
||||
|
||||
class BufferSharingTest : public V4L2DeviceTest
|
||||
class BufferSharingTest : public V4L2VideoDeviceTest
|
||||
{
|
||||
public:
|
||||
BufferSharingTest()
|
||||
: V4L2DeviceTest("vivid", "vivid-000-vid-cap"),
|
||||
: V4L2VideoDeviceTest("vivid", "vivid-000-vid-cap"),
|
||||
output_(nullptr), framesCaptured_(0), framesOutput_(0) {}
|
||||
|
||||
protected:
|
||||
int init()
|
||||
{
|
||||
int ret = V4L2DeviceTest::init();
|
||||
int ret = V4L2VideoDeviceTest::init();
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -38,7 +38,7 @@ protected:
|
||||
if (!entity)
|
||||
return TestSkip;
|
||||
|
||||
output_ = new V4L2Device(entity);
|
||||
output_ = new V4L2VideoDevice(entity);
|
||||
if (!output_) {
|
||||
std::cout << "Failed to create output device" << std::endl;
|
||||
return TestFail;
|
||||
@@ -171,13 +171,13 @@ protected:
|
||||
|
||||
delete output_;
|
||||
|
||||
V4L2DeviceTest::cleanup();
|
||||
V4L2VideoDeviceTest::cleanup();
|
||||
}
|
||||
|
||||
private:
|
||||
const unsigned int bufferCount = 4;
|
||||
|
||||
V4L2Device *output_;
|
||||
V4L2VideoDevice *output_;
|
||||
|
||||
unsigned int framesCaptured_;
|
||||
unsigned int framesOutput_;
|
||||
@@ -12,13 +12,13 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "v4l2_device_test.h"
|
||||
#include "v4l2_videodevice_test.h"
|
||||
|
||||
class CaptureAsyncTest : public V4L2DeviceTest
|
||||
class CaptureAsyncTest : public V4L2VideoDeviceTest
|
||||
{
|
||||
public:
|
||||
CaptureAsyncTest()
|
||||
: V4L2DeviceTest("vimc", "Raw Capture 0"), frames(0) {}
|
||||
: V4L2VideoDeviceTest("vimc", "Raw Capture 0"), frames(0) {}
|
||||
|
||||
void receiveBuffer(Buffer *buffer)
|
||||
{
|
||||
@@ -7,15 +7,15 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "v4l2_device_test.h"
|
||||
#include "v4l2_videodevice_test.h"
|
||||
|
||||
namespace {
|
||||
|
||||
class DoubleOpen : public V4L2DeviceTest
|
||||
class DoubleOpen : public V4L2VideoDeviceTest
|
||||
{
|
||||
public:
|
||||
DoubleOpen()
|
||||
: V4L2DeviceTest("vimc", "Raw Capture 0") {}
|
||||
: V4L2VideoDeviceTest("vimc", "Raw Capture 0") {}
|
||||
protected:
|
||||
int run()
|
||||
{
|
||||
@@ -23,7 +23,7 @@ protected:
|
||||
|
||||
/*
|
||||
* Expect failure: The device has already been opened by the
|
||||
* V4L2DeviceTest base class
|
||||
* V4L2VideoDeviceTest base class
|
||||
*/
|
||||
ret = capture_->open();
|
||||
if (!ret) {
|
||||
@@ -8,18 +8,18 @@
|
||||
#include <climits>
|
||||
#include <iostream>
|
||||
|
||||
#include "v4l2_device.h"
|
||||
#include "v4l2_videodevice.h"
|
||||
|
||||
#include "v4l2_device_test.h"
|
||||
#include "v4l2_videodevice_test.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace libcamera;
|
||||
|
||||
class Format : public V4L2DeviceTest
|
||||
class Format : public V4L2VideoDeviceTest
|
||||
{
|
||||
public:
|
||||
Format()
|
||||
: V4L2DeviceTest("vimc", "Raw Capture 0") {}
|
||||
: V4L2VideoDeviceTest("vimc", "Raw Capture 0") {}
|
||||
protected:
|
||||
int run()
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
# Tests are listed in order of complexity.
|
||||
# They are not alphabetically sorted.
|
||||
v4l2_device_tests = [
|
||||
v4l2_videodevice_tests = [
|
||||
[ 'double_open', 'double_open.cpp' ],
|
||||
[ 'formats', 'formats.cpp' ],
|
||||
[ 'request_buffers', 'request_buffers.cpp' ],
|
||||
@@ -9,10 +9,10 @@ v4l2_device_tests = [
|
||||
[ 'buffer_sharing', 'buffer_sharing.cpp' ],
|
||||
]
|
||||
|
||||
foreach t : v4l2_device_tests
|
||||
exe = executable(t[0], [t[1], 'v4l2_device_test.cpp'],
|
||||
foreach t : v4l2_videodevice_tests
|
||||
exe = executable(t[0], [t[1], 'v4l2_videodevice_test.cpp'],
|
||||
dependencies : libcamera_dep,
|
||||
link_with : test_libraries,
|
||||
include_directories : test_includes_internal)
|
||||
test(t[0], exe, suite : 'v4l2_device', is_parallel : false)
|
||||
test(t[0], exe, suite : 'v4l2_videodevice', is_parallel : false)
|
||||
endforeach
|
||||
@@ -5,13 +5,13 @@
|
||||
* libcamera V4L2 API tests
|
||||
*/
|
||||
|
||||
#include "v4l2_device_test.h"
|
||||
#include "v4l2_videodevice_test.h"
|
||||
|
||||
class RequestBuffersTest : public V4L2DeviceTest
|
||||
class RequestBuffersTest : public V4L2VideoDeviceTest
|
||||
{
|
||||
public:
|
||||
RequestBuffersTest()
|
||||
: V4L2DeviceTest("vimc", "Raw Capture 0") {}
|
||||
: V4L2VideoDeviceTest("vimc", "Raw Capture 0") {}
|
||||
|
||||
protected:
|
||||
int run()
|
||||
@@ -5,13 +5,13 @@
|
||||
* libcamera V4L2 API tests
|
||||
*/
|
||||
|
||||
#include "v4l2_device_test.h"
|
||||
#include "v4l2_videodevice_test.h"
|
||||
|
||||
class StreamOnStreamOffTest : public V4L2DeviceTest
|
||||
class StreamOnStreamOffTest : public V4L2VideoDeviceTest
|
||||
{
|
||||
public:
|
||||
StreamOnStreamOffTest()
|
||||
: V4L2DeviceTest("vimc", "Raw Capture 0") {}
|
||||
: V4L2VideoDeviceTest("vimc", "Raw Capture 0") {}
|
||||
protected:
|
||||
int run()
|
||||
{
|
||||
+4
-4
@@ -8,7 +8,7 @@
|
||||
#include <iostream>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "v4l2_device_test.h"
|
||||
#include "v4l2_videodevice_test.h"
|
||||
|
||||
#include "device_enumerator.h"
|
||||
#include "media_device.h"
|
||||
@@ -26,7 +26,7 @@ bool exists(const std::string &path)
|
||||
return false;
|
||||
}
|
||||
|
||||
int V4L2DeviceTest::init()
|
||||
int V4L2VideoDeviceTest::init()
|
||||
{
|
||||
enumerator_ = DeviceEnumerator::create();
|
||||
if (!enumerator_) {
|
||||
@@ -50,7 +50,7 @@ int V4L2DeviceTest::init()
|
||||
if (!entity)
|
||||
return TestSkip;
|
||||
|
||||
capture_ = new V4L2Device(entity);
|
||||
capture_ = new V4L2VideoDevice(entity);
|
||||
if (!capture_)
|
||||
return TestFail;
|
||||
|
||||
@@ -77,7 +77,7 @@ int V4L2DeviceTest::init()
|
||||
return TestPass;
|
||||
}
|
||||
|
||||
void V4L2DeviceTest::cleanup()
|
||||
void V4L2VideoDeviceTest::cleanup()
|
||||
{
|
||||
capture_->streamOff();
|
||||
capture_->releaseBuffers();
|
||||
@@ -15,14 +15,14 @@
|
||||
|
||||
#include "device_enumerator.h"
|
||||
#include "media_device.h"
|
||||
#include "v4l2_device.h"
|
||||
#include "v4l2_videodevice.h"
|
||||
|
||||
using namespace libcamera;
|
||||
|
||||
class V4L2DeviceTest : public Test
|
||||
class V4L2VideoDeviceTest : public Test
|
||||
{
|
||||
public:
|
||||
V4L2DeviceTest(const char *driver, const char *entity)
|
||||
V4L2VideoDeviceTest(const char *driver, const char *entity)
|
||||
: driver_(driver), entity_(entity), capture_(nullptr)
|
||||
{
|
||||
}
|
||||
@@ -35,7 +35,7 @@ protected:
|
||||
std::string entity_;
|
||||
std::unique_ptr<DeviceEnumerator> enumerator_;
|
||||
std::shared_ptr<MediaDevice> media_;
|
||||
V4L2Device *capture_;
|
||||
V4L2VideoDevice *capture_;
|
||||
BufferPool pool_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user