Video4Linux 2 camera access implementation. More...
#include <>>

Classes | |
| struct | ControlParameterInt |
| struct | FrameBuffer |
Public Member Functions | |
| V4L2Camera (const char *device_name="/dev/video0") | |
| Constructor. | |
| V4L2Camera (const CameraArgumentParser *cap) | |
| Constructor. | |
| virtual | ~V4L2Camera () |
| Destructor. | |
| virtual void | open () |
| virtual void | start () |
| virtual void | stop () |
| virtual void | close () |
| virtual void | flush () |
| virtual void | capture () |
| virtual void | print_info () |
| virtual bool | ready () |
| virtual unsigned char * | buffer () |
| virtual unsigned int | buffer_size () |
| virtual void | dispose_buffer () |
| virtual unsigned int | pixel_width () |
| virtual unsigned int | pixel_height () |
| virtual colorspace_t | colorspace () |
| virtual fawkes::Time * | capture_time () |
| virtual void | set_image_number (unsigned int n) |
| virtual bool | auto_gain () |
| virtual void | set_auto_gain (bool enabled) |
| virtual bool | auto_white_balance () |
| virtual void | set_auto_white_balance (bool enabled) |
| virtual bool | auto_exposure () |
| virtual void | set_auto_exposure (bool enabled) |
| virtual int | red_balance () |
| virtual void | set_red_balance (int red_balance) |
| virtual int | blue_balance () |
| virtual void | set_blue_balance (int blue_balance) |
| virtual int | u_balance () |
| virtual void | set_u_balance (int u_balance) |
| virtual int | v_balance () |
| virtual void | set_v_balance (int v_balance) |
| virtual unsigned int | brightness () |
| virtual void | set_brightness (unsigned int brightness) |
| virtual unsigned int | contrast () |
| virtual void | set_contrast (unsigned int contrast) |
| virtual unsigned int | saturation () |
| virtual void | set_saturation (unsigned int saturation) |
| virtual int | hue () |
| virtual void | set_hue (int hue) |
| virtual unsigned int | exposure () |
| virtual void | set_exposure (unsigned int exposure) |
| virtual unsigned int | gain () |
| virtual void | set_gain (unsigned int gain) |
| virtual const char * | format () |
| Get the image format the camera currently uses. | |
| virtual void | set_format (const char *format) |
| Set the image format the camera should use. | |
| virtual unsigned int | width () |
| Get the current width of the image. | |
| virtual unsigned int | height () |
| Get the current height of the image. | |
| virtual void | set_size (unsigned int width, unsigned int height) |
| Set the image size the camera should use. | |
| virtual bool | horiz_mirror () |
| Return whether the camera image is horizontally mirrored. | |
| virtual bool | vert_mirror () |
| Return whether the camera image is vertically mirrored. | |
| virtual void | set_horiz_mirror (bool enabled) |
| Set whether the camera should mirror images horizontally. | |
| virtual void | set_vert_mirror (bool enabled) |
| Set whether the camera should mirror images vertically. | |
| virtual unsigned int | fps () |
| Get the number of frames per second that have been requested from the camera. | |
| virtual void | set_fps (unsigned int fps) |
| Set the number of frames per second the camera tries to deliver. | |
| virtual unsigned int | lens_x_corr () |
| Get current lens x correction. | |
| virtual unsigned int | lens_y_corr () |
| Get current lens y correction. | |
| virtual void | set_lens_x_corr (unsigned int x_corr) |
| Set lens x correction. | |
| virtual void | set_lens_y_corr (unsigned int y_corr) |
| Set lens y correction. | |
Protected Member Functions | |
| V4L2Camera (const char *device_name, int dev) | |
| Protected Constructor. | |
| virtual void | set_one_control (const char *ctrl, unsigned int id, int value) |
| Set one Camera control value. | |
| virtual int | get_one_control (const char *ctrl, unsigned int id) |
| Get one Camera control value. | |
Protected Attributes | |
| char * | _device_name |
| Device name. | |
Friends | |
| class | V4LCamera |
Video4Linux 2 camera access implementation.
UPTR method
Standards queries (VIDIOC_ENUMSTD)
v4l2_pix_format.field
Definition at line 46 of file v4l2.h.
| firevision::V4L2Camera::V4L2Camera | ( | const char * | device_name = "/dev/video0" |
) |
Constructor.
| device_name | device file name (e.g. /dev/video0) |
Definition at line 89 of file v4l2.cpp.
References _device_name.
| firevision::V4L2Camera::V4L2Camera | ( | const CameraArgumentParser * | cap | ) |
Constructor.
Initialize camera with parameters from camera argument parser. Supported arguments: *Required:
| cap | camera argument parser |
Definition at line 139 of file v4l2.cpp.
References _device_name, firevision::CameraArgumentParser::get(), firevision::CameraArgumentParser::has(), and firevision::CameraControlImage::size().
| firevision::V4L2Camera::~V4L2Camera | ( | ) | [virtual] |
| firevision::V4L2Camera::V4L2Camera | ( | const char * | device_name, | |
| int | dev | |||
| ) | [protected] |
Protected Constructor.
Gets called from V4LCamera, when the device has already been opened and determined to be a V4L2 device.
| device_name | device file name (e.g. /dev/video0) | |
| dev | file descriptor of the opened device |
Definition at line 390 of file v4l2.cpp.
References _device_name.
| const char * firevision::V4L2Camera::format | ( | ) | [virtual] |
Get the image format the camera currently uses.
Check implementation documentation for details on the format.
| NotImplementedException | Not implemented by this control |
Reimplemented from firevision::CameraControlImage.
| unsigned int firevision::V4L2Camera::fps | ( | ) | [virtual] |
Get the number of frames per second that have been requested from the camera.
A return value of 0 means that fps haven't been set yet through the camera.
Reimplemented from firevision::CameraControlImage.
| int firevision::V4L2Camera::get_one_control | ( | const char * | ctrl, | |
| unsigned int | id | |||
| ) | [protected, virtual] |
Get one Camera control value.
| ctrl | name of the value | |
| id | ID of the value |
Definition at line 860 of file v4l2.cpp.
Referenced by firevision::NaoCamera::auto_exposure(), horiz_mirror(), lens_x_corr(), lens_y_corr(), and vert_mirror().
| unsigned int firevision::V4L2Camera::height | ( | ) | [virtual] |
Get the current height of the image.
Implements firevision::CameraControlImage.
| bool firevision::V4L2Camera::horiz_mirror | ( | ) | [virtual] |
Return whether the camera image is horizontally mirrored.
| NotImplementedException | Not implemented by this control |
Reimplemented from firevision::CameraControlImage.
Definition at line 1507 of file v4l2.cpp.
References get_one_control().
| unsigned int firevision::V4L2Camera::lens_x_corr | ( | ) | [virtual] |
Get current lens x correction.
| NotImplementedException | Not implemented by this control |
Reimplemented from firevision::CameraControlImage.
Definition at line 1550 of file v4l2.cpp.
References get_one_control().
| unsigned int firevision::V4L2Camera::lens_y_corr | ( | ) | [virtual] |
Get current lens y correction.
| NotImplementedException | Not implemented by this control |
Reimplemented from firevision::CameraControlImage.
Definition at line 1556 of file v4l2.cpp.
References get_one_control().
| void firevision::V4L2Camera::set_format | ( | const char * | format | ) | [virtual] |
Set the image format the camera should use.
Check implementation documentation for details on the format.
| format | the new image format |
| NotImplementedException | Not implemented by this control |
Reimplemented from firevision::CameraControlImage.
| void firevision::V4L2Camera::set_fps | ( | unsigned int | fps | ) | [virtual] |
Set the number of frames per second the camera tries to deliver.
| fps | the new fps |
| NotImplementedException | Not implemented by this control |
Reimplemented from firevision::CameraControlImage.
Definition at line 1543 of file v4l2.cpp.
References set_fps().
Referenced by set_fps().
| void firevision::V4L2Camera::set_horiz_mirror | ( | bool | enabled | ) | [virtual] |
Set whether the camera should mirror images horizontally.
| enabled | if true, images should be mirrored horizontally |
| NotImplementedException | Not implemented by this control |
Reimplemented from firevision::CameraControlImage.
Definition at line 1519 of file v4l2.cpp.
References set_one_control().
| void firevision::V4L2Camera::set_lens_x_corr | ( | unsigned int | x_corr | ) | [virtual] |
Set lens x correction.
| x_corr | new lens x correction |
| NotImplementedException | Not implemented by this control |
Reimplemented from firevision::CameraControlImage.
Definition at line 1562 of file v4l2.cpp.
References set_one_control().
| void firevision::V4L2Camera::set_lens_y_corr | ( | unsigned int | y_corr | ) | [virtual] |
Set lens y correction.
| y_corr | new lens y correction |
| NotImplementedException | Not implemented by this control |
Reimplemented from firevision::CameraControlImage.
Definition at line 1569 of file v4l2.cpp.
References set_one_control().
| void firevision::V4L2Camera::set_one_control | ( | const char * | ctrl, | |
| unsigned int | id, | |||
| int | value | |||
| ) | [protected, virtual] |
Set one Camera control value.
| ctrl | name of the value | |
| id | ID of the value | |
| value | value to set |
Definition at line 817 of file v4l2.cpp.
Referenced by firevision::NaoCamera::set_auto_exposure(), set_horiz_mirror(), set_lens_x_corr(), set_lens_y_corr(), and set_vert_mirror().
| void firevision::V4L2Camera::set_size | ( | unsigned int | width, | |
| unsigned int | height | |||
| ) | [virtual] |
Set the image size the camera should use.
| width | new width of the image | |
| height | new height of the image |
| Exception | thrown for instance if size setting at run-time is not supported |
Implements firevision::CameraControlImage.
| void firevision::V4L2Camera::set_vert_mirror | ( | bool | enabled | ) | [virtual] |
Set whether the camera should mirror images vertically.
| enabled | if true, images should be mirrored vertically |
| NotImplementedException | Not implemented by this control |
Reimplemented from firevision::CameraControlImage.
Definition at line 1526 of file v4l2.cpp.
References set_one_control().
| bool firevision::V4L2Camera::vert_mirror | ( | ) | [virtual] |
Return whether the camera image is vertically mirrored.
| NotImplementedException | Not implemented by this control |
Reimplemented from firevision::CameraControlImage.
Definition at line 1513 of file v4l2.cpp.
References get_one_control().
| unsigned int firevision::V4L2Camera::width | ( | ) | [virtual] |
Get the current width of the image.
Implements firevision::CameraControlImage.
char* firevision::V4L2Camera::_device_name [protected] |
Device name.
Definition at line 138 of file v4l2.h.
Referenced by firevision::NaoCamera::NaoCamera(), firevision::NaoCamera::set_source(), V4L2Camera(), and ~V4L2Camera().
1.7.1