Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
246f47fe
Commit
246f47fe
authored
May 23, 2017
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8778 from mshabunin:pr6853
parents
7c3577f7
7cefb52f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
cap_libv4l.cpp
modules/videoio/src/cap_libv4l.cpp
+8
-1
cap_v4l.cpp
modules/videoio/src/cap_v4l.cpp
+7
-1
No files found.
modules/videoio/src/cap_libv4l.cpp
View file @
246f47fe
...
@@ -312,6 +312,7 @@ typedef struct CvCaptureCAM_V4L
...
@@ -312,6 +312,7 @@ typedef struct CvCaptureCAM_V4L
int
deviceHandle
;
int
deviceHandle
;
int
bufferIndex
;
int
bufferIndex
;
int
FirstCapture
;
int
FirstCapture
;
bool
returnFrame
;
int
width
;
int
height
;
int
width
;
int
height
;
int
mode
;
int
mode
;
...
@@ -1094,6 +1095,8 @@ static CvCaptureCAM_V4L * icvCaptureFromCAM_V4L (const char* deviceName)
...
@@ -1094,6 +1095,8 @@ static CvCaptureCAM_V4L * icvCaptureFromCAM_V4L (const char* deviceName)
capture
->
is_v4l2_device
=
1
;
capture
->
is_v4l2_device
=
1
;
}
}
capture
->
returnFrame
=
true
;
return
capture
;
return
capture
;
};
/* End icvOpenCAM_V4L */
};
/* End icvOpenCAM_V4L */
...
@@ -1119,6 +1122,7 @@ static int read_frame_v4l2(CvCaptureCAM_V4L* capture) {
...
@@ -1119,6 +1122,7 @@ static int read_frame_v4l2(CvCaptureCAM_V4L* capture) {
default:
default:
/* display the error and stop processing */
/* display the error and stop processing */
capture
->
returnFrame
=
false
;
perror
(
"VIDIOC_DQBUF"
);
perror
(
"VIDIOC_DQBUF"
);
return
-
1
;
return
-
1
;
}
}
...
@@ -1360,7 +1364,10 @@ static IplImage* icvRetrieveFrameCAM_V4L( CvCaptureCAM_V4L* capture, int) {
...
@@ -1360,7 +1364,10 @@ static IplImage* icvRetrieveFrameCAM_V4L( CvCaptureCAM_V4L* capture, int) {
}
}
return
(
&
capture
->
frame
);
if
(
capture
->
returnFrame
)
return
(
&
capture
->
frame
);
else
return
0
;
}
}
static
int
zeroPropertyQuietly
(
CvCaptureCAM_V4L
*
capture
,
int
property_id
,
int
value
)
static
int
zeroPropertyQuietly
(
CvCaptureCAM_V4L
*
capture
,
int
property_id
,
int
value
)
...
...
modules/videoio/src/cap_v4l.cpp
View file @
246f47fe
...
@@ -280,6 +280,7 @@ struct CvCaptureCAM_V4L : public CvCapture
...
@@ -280,6 +280,7 @@ struct CvCaptureCAM_V4L : public CvCapture
__u32
fps
;
__u32
fps
;
bool
convert_rgb
;
bool
convert_rgb
;
bool
frame_allocated
;
bool
frame_allocated
;
bool
returnFrame
;
/* V4L2 variables */
/* V4L2 variables */
buffer
buffers
[
MAX_V4L_BUFFERS
+
1
];
buffer
buffers
[
MAX_V4L_BUFFERS
+
1
];
...
@@ -820,6 +821,7 @@ bool CvCaptureCAM_V4L::open(const char* _deviceName)
...
@@ -820,6 +821,7 @@ bool CvCaptureCAM_V4L::open(const char* _deviceName)
fps
=
DEFAULT_V4L_FPS
;
fps
=
DEFAULT_V4L_FPS
;
convert_rgb
=
true
;
convert_rgb
=
true
;
deviceName
=
_deviceName
;
deviceName
=
_deviceName
;
returnFrame
=
true
;
return
_capture_V4L2
(
this
)
==
1
;
return
_capture_V4L2
(
this
)
==
1
;
}
}
...
@@ -847,6 +849,7 @@ static int read_frame_v4l2(CvCaptureCAM_V4L* capture) {
...
@@ -847,6 +849,7 @@ static int read_frame_v4l2(CvCaptureCAM_V4L* capture) {
default
:
default
:
/* display the error and stop processing */
/* display the error and stop processing */
capture
->
returnFrame
=
false
;
perror
(
"VIDIOC_DQBUF"
);
perror
(
"VIDIOC_DQBUF"
);
return
-
1
;
return
-
1
;
}
}
...
@@ -1581,7 +1584,10 @@ static IplImage* icvRetrieveFrameCAM_V4L( CvCaptureCAM_V4L* capture, int) {
...
@@ -1581,7 +1584,10 @@ static IplImage* icvRetrieveFrameCAM_V4L( CvCaptureCAM_V4L* capture, int) {
break
;
break
;
}
}
return
(
&
capture
->
frame
);
if
(
capture
->
returnFrame
)
return
(
&
capture
->
frame
);
else
return
0
;
}
}
static
inline
__u32
capPropertyToV4L2
(
int
prop
)
{
static
inline
__u32
capPropertyToV4L2
(
int
prop
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment