This is a very light wrapper to v4l2 interface. It uses MMAP transfer method only and doesn't do any copying, just passing assigned buffers filled by driver. It's intention was to easily access device without need to prepate all those structures for ioctl's.
To use it, first create FRAMEGRABBER2 object by fg2_createFrameGrabber
Definition in file v4l2capture.h.
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <linux/fs.h>
#include <linux/kernel.h>
#include <asm/types.h>
#include <linux/videodev.h>
Go to the source code of this file.
|
|
Returns number of found controls Definition at line 464 of file v4l2capture.c. References FRAMEGRABBER2::numOfCtls. |
|
|
Create device handler (just fill structure)
Definition at line 90 of file v4l2capture.c. References FRAMEGRABBER2::altField, FRAMEGRABBER2::buffers, FRAMEGRABBER2::controls, FRAMEGRABBER2::cur_frame, FRAMEGRABBER2::device, FRAMEGRABBER2::fd, FRAMEGRABBER2::field, FRAMEGRABBER2::height, FRAMEGRABBER2::isCapturing, FRAMEGRABBER2::n_buffers, FRAMEGRABBER2::numOfCtls, FRAMEGRABBER2::numOfIn, FRAMEGRABBER2::pix_fmt, FRAMEGRABBER2::source, FRAMEGRABBER2::sources, and FRAMEGRABBER2::width. |
|
|
delete completely fg handler (including whatever is needed to close device)
Definition at line 126 of file v4l2capture.c. |
|
|
Name of device Definition at line 409 of file v4l2capture.c. References FRAMEGRABBER2::caps. |
|
||||||||||||
|
Name of given source identified by id Definition at line 395 of file v4l2capture.c. References FRAMEGRABBER2::numOfIn, and FRAMEGRABBER2::sources. |
|
|
Returns number of found inputs Definition at line 364 of file v4l2capture.c. References FRAMEGRABBER2::numOfIn. |
|
|
Current source id Definition at line 372 of file v4l2capture.c. References FRAMEGRABBER2::fd. |
|
|
Current source name Definition at line 387 of file v4l2capture.c. |
|
||||||||||||
|
Gets current control value. <0 means error. Control is identified by its name Definition at line 560 of file v4l2capture.c. References FRAMEGRABBER2::controls, and FRAMEGRABBER2::numOfCtls. |
|
||||||||||||
|
Gets current control value. <0 means error. Control is identified by id in local table Definition at line 531 of file v4l2capture.c. References FRAMEGRABBER2::controls, FRAMEGRABBER2::fd, and FRAMEGRABBER2::numOfCtls. |
|
||||||||||||
|
open device and discover capabilities and inputs. To capture from device You need to use fg2_startCapture first. Earlier You can set source and size.
Definition at line 140 of file v4l2capture.c. References FRAMEGRABBER2::caps, FRAMEGRABBER2::cur_frame, FRAMEGRABBER2::device, FRAMEGRABBER2::fd, FG_DEFAULT_DEVICE, and FRAMEGRABBER2::numOfIn. |
|
||||||||||||||||
|
Select input source. if src<0, then strSrc is used to compare with known sources
Definition at line 419 of file v4l2capture.c. References FRAMEGRABBER2::fd, FRAMEGRABBER2::numOfIn, FRAMEGRABBER2::source, and FRAMEGRABBER2::sources. |
|
||||||||||||
|
pal, ntsc, secam, etc. Definition at line 586 of file v4l2capture.c. References FRAMEGRABBER2::fd. |
|
||||||||||||||||
|
Sets new value to control. Val is in 0.0-1.0 range. Values <0 means use default Control is identified by its name Definition at line 516 of file v4l2capture.c. References FRAMEGRABBER2::controls, and FRAMEGRABBER2::numOfCtls. |
|
||||||||||||||||
|
Sets new value to control. Val is in 0.0-1.0 range. Values <0 means use default Control is identified by id in local table Definition at line 473 of file v4l2capture.c. References FRAMEGRABBER2::controls, FRAMEGRABBER2::fd, and FRAMEGRABBER2::numOfCtls. |
|
||||||||||||||||||||||||||||
|
Tries to apply given frame settings Definition at line 603 of file v4l2capture.c. References FRAMEGRABBER2::depth, FRAMEGRABBER2::field, FRAMEGRABBER2::height, FRAMEGRABBER2::pix_fmt, and FRAMEGRABBER2::width. |
|
|
Turn capture stream on. You need to use it by hand after opening, or stopping
Definition at line 217 of file v4l2capture.c. References FRAMEGRABBER2::fd, and FRAMEGRABBER2::isCapturing. |
|
|
Turn capture stream of. You need to use it by hand when changing format or size of frame. Only controls doesn't need stopping
Definition at line 268 of file v4l2capture.c. References FRAMEGRABBER2::fd, and FRAMEGRABBER2::isCapturing. |
|
|
light capture interface, gives live data without any memcpy (just after dequeueing)
Definition at line 300 of file v4l2capture.c. References FRAMEGRABBER2::altField, my_buffer::buf, FRAMEGRABBER2::buffers, FRAMEGRABBER2::fd, and FRAMEGRABBER2::n_buffers. |
|
||||||||||||
|
This is opposite to getFrameBuffer. It Queues used buffer to the driver.
Definition at line 347 of file v4l2capture.c. References my_buffer::buf, and FRAMEGRABBER2::fd. |
1.4.4