Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbc0c46c

Browse files
committed
move iotype in V4L2DeviceParameters
1 parent2d16227 commitbc0c46c

File tree

6 files changed

+18
-17
lines changed

6 files changed

+18
-17
lines changed

‎inc/V4l2Access.h‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,7 @@
1717

1818
classV4l2Access
1919
{
20-
public:
21-
enum IoType
22-
{
23-
IOTYPE_READWRITE,
24-
IOTYPE_MMAP
25-
};
26-
20+
public:
2721
V4l2Access(V4l2Device* device);
2822
virtual~V4l2Access();
2923

‎inc/V4l2Capture.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class V4l2Capture : public V4l2Access
2424
V4l2Capture(V4l2Device* device);
2525

2626
public:
27-
static V4l2Capture*create(const V4L2DeviceParameters & param, IoType iotype = V4l2Access::IOTYPE_MMAP);
27+
static V4l2Capture*create(const V4L2DeviceParameters & param);
2828
virtual~V4l2Capture();
2929

3030
size_tread(char* buffer,size_t bufferSize);

‎inc/V4l2Device.h‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,22 @@
2828
#defineV4L2_PIX_FMT_HEVCv4l2_fourcc('H','E','V','C')
2929
#endif
3030

31+
enum V4l2IoType
32+
{
33+
IOTYPE_READWRITE,
34+
IOTYPE_MMAP
35+
};
36+
3137
// ---------------------------------
3238
// V4L2 Device parameters
3339
// ---------------------------------
3440
structV4L2DeviceParameters
3541
{
36-
V4L2DeviceParameters(constchar* devname,const std::list<unsignedint> & formatList,unsignedint width,unsignedint height,int fps,int verbose =0,int openFlags = O_RDWR | O_NONBLOCK) :
37-
m_devName(devname), m_formatList(formatList), m_width(width), m_height(height), m_fps(fps), m_verbose(verbose), m_openFlags(openFlags) {}
42+
V4L2DeviceParameters(constchar* devname,const std::list<unsignedint> & formatList,unsignedint width,unsignedint height,int fps,V4l2IoType ioType = IOTYPE_MMAP,int verbose =0,int openFlags = O_RDWR | O_NONBLOCK) :
43+
m_devName(devname), m_formatList(formatList), m_width(width), m_height(height), m_fps(fps),m_iotype(ioType),m_verbose(verbose), m_openFlags(openFlags) {}
3844

39-
V4L2DeviceParameters(constchar* devname,unsignedint format,unsignedint width,unsignedint height,int fps,int verbose =0,int openFlags = O_RDWR | O_NONBLOCK) :
40-
m_devName(devname), m_width(width), m_height(height), m_fps(fps), m_verbose(verbose), m_openFlags(openFlags) {
45+
V4L2DeviceParameters(constchar* devname,unsignedint format,unsignedint width,unsignedint height,int fps,V4l2IoType ioType = IOTYPE_MMAP,int verbose =0,int openFlags = O_RDWR | O_NONBLOCK) :
46+
m_devName(devname), m_width(width), m_height(height), m_fps(fps),m_iotype(ioType),m_verbose(verbose), m_openFlags(openFlags) {
4147
if (format) {
4248
m_formatList.push_back(format);
4349
}
@@ -50,6 +56,7 @@ struct V4L2DeviceParameters
5056
int m_fps;
5157
int m_verbose;
5258
int m_openFlags;
59+
V4l2IoType m_iotype;
5360
};
5461

5562
// ---------------------------------

‎inc/V4l2Output.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class V4l2Output : public V4l2Access
2424
V4l2Output(V4l2Device* device);
2525

2626
public:
27-
static V4l2Output*create(const V4L2DeviceParameters & param, IoType iotype = V4l2Access::IOTYPE_MMAP);
27+
static V4l2Output*create(const V4L2DeviceParameters & param);
2828
virtual~V4l2Output();
2929

3030
size_twrite(char* buffer,size_t bufferSize);

‎src/V4l2Capture.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
// -----------------------------------------
2424
// create video capture interface
2525
// -----------------------------------------
26-
V4l2Capture*V4l2Capture::create(const V4L2DeviceParameters & param, IoType iotype)
26+
V4l2Capture*V4l2Capture::create(const V4L2DeviceParameters & param)
2727
{
2828
V4l2Capture* videoCapture =NULL;
2929
V4l2Device* videoDevice =NULL;
3030
int caps = V4L2_CAP_VIDEO_CAPTURE;
31-
switch (iotype)
31+
switch (param.m_iotype)
3232
{
3333
case IOTYPE_MMAP:
3434
videoDevice =newV4l2MmapDevice(param, V4L2_BUF_TYPE_VIDEO_CAPTURE);

‎src/V4l2Output.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
// -----------------------------------------
2525
// create video output interface
2626
// -----------------------------------------
27-
V4l2Output*V4l2Output::create(const V4L2DeviceParameters & param, IoType iotype)
27+
V4l2Output*V4l2Output::create(const V4L2DeviceParameters & param)
2828
{
2929
V4l2Output* videoOutput =NULL;
3030
V4l2Device* videoDevice =NULL;
3131
int caps = V4L2_CAP_VIDEO_OUTPUT;
32-
switch (iotype)
32+
switch (param.m_iotype)
3333
{
3434
case IOTYPE_MMAP:
3535
videoDevice =newV4l2MmapDevice(param, V4L2_BUF_TYPE_VIDEO_OUTPUT);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp