Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
rtc
VideoCapture
camera.h
Go to the documentation of this file.
1
2
/* Most of capture.cpp and capture.h are copied from http://jsk-enshu.svn.sourceforge.net/viewvc/jsk-enshu/trunk/keisanki/2009/ */
3
#include <opencv/cv.h>
4
#include <opencv/highgui.h>
5
#include <linux/videodev2.h>
6
#include <fcntl.h>
7
#include <errno.h>
8
#include <sys/ioctl.h>
9
10
/* v4l2 capture class */
11
class
v4l_capture
12
{
13
typedef
struct
_buffer
{
14
void
*
start
;
15
size_t
length
;
16
}
buffer
;
17
cv::Mat
frame
;
18
std::string
dev_name
;
19
int
fd
,
width
,
height
;
20
buffer
*
buffers
;
21
unsigned
int
n_buffers
;
22
bool
open_device
();
23
bool
init_device
();
24
bool
init_mmap
();
25
bool
start_capturing
();
26
bool
stop_capturing
();
27
void
uninit_device
();
28
bool
uninit_mmap
();
29
bool
close_device
();
30
bool
read_frame
(
void
);
31
bool
write_img
(uchar * ret);
32
bool
init_all
(
size_t
_width,
size_t
_height,
unsigned
int
_devId);
33
public
:
34
v4l_capture
();
35
~v4l_capture
();
36
uchar *
capture
();
37
int
getHeight
();
38
int
getWidth
();
39
int
init
(
size_t
_width,
size_t
_height,
unsigned
int
devId);
40
};
v4l_capture::uninit_mmap
bool uninit_mmap()
Definition:
camera.cpp:196
v4l_capture::buffers
buffer * buffers
Definition:
camera.h:20
v4l_capture::_buffer::start
void * start
Definition:
camera.h:14
v4l_capture::getHeight
int getHeight()
Definition:
camera.cpp:45
v4l_capture::close_device
bool close_device()
Definition:
camera.cpp:76
v4l_capture::width
int width
Definition:
camera.h:19
v4l_capture::height
int height
Definition:
camera.h:19
v4l_capture::~v4l_capture
~v4l_capture()
Definition:
camera.cpp:15
v4l_capture::getWidth
int getWidth()
Definition:
camera.cpp:40
v4l_capture::init_mmap
bool init_mmap()
Definition:
camera.cpp:140
v4l_capture::init
int init(size_t _width, size_t _height, unsigned int devId)
Definition:
camera.cpp:23
v4l_capture::write_img
bool write_img(uchar *ret)
Definition:
camera.cpp:86
v4l_capture::buffer
struct v4l_capture::_buffer buffer
v4l_capture::v4l_capture
v4l_capture()
Definition:
camera.cpp:10
v4l_capture::open_device
bool open_device()
Definition:
camera.cpp:63
v4l_capture::init_device
bool init_device()
Definition:
camera.cpp:209
v4l_capture::dev_name
std::string dev_name
Definition:
camera.h:18
v4l_capture
Definition:
camera.h:11
v4l_capture::init_all
bool init_all(size_t _width, size_t _height, unsigned int _devId)
Definition:
camera.cpp:50
v4l_capture::fd
int fd
Definition:
camera.h:19
v4l_capture::_buffer::length
size_t length
Definition:
camera.h:15
v4l_capture::stop_capturing
bool stop_capturing()
Definition:
camera.cpp:323
v4l_capture::frame
cv::Mat frame
Definition:
camera.h:17
v4l_capture::uninit_device
void uninit_device()
Definition:
camera.cpp:288
v4l_capture::_buffer
Definition:
camera.h:13
v4l_capture::n_buffers
unsigned int n_buffers
Definition:
camera.h:21
v4l_capture::read_frame
bool read_frame(void)
Definition:
camera.cpp:117
v4l_capture::capture
uchar * capture()
Definition:
camera.cpp:33
v4l_capture::start_capturing
bool start_capturing()
Definition:
camera.cpp:294
hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Thu May 6 2021 02:41:49