25 #ifndef __BIASVIDEOSOURCE_V4L_HH__
26 #define __BIASVIDEOSOURCE_V4L_HH__
28 #include <bias_config.h>
31 # error Please recompile BIAS with BUILD_V4L to use VideoSource V4L.
33 #ifndef BIAS_HAVE_PTHREADS
34 # error BIAS_HAVE_PTHREADS not defined. But BIAS::VideoSource_V4L needs pthreads (on Unix and Win32). Please enable USE_PTHREADS in CMake configure step.
37 #include <VideoSource/VideoSource_Base.hh>
39 #ifdef BIAS_HAVE_LIBJPEG
40 # include <Base/Image/CompressJpeg.hh>
41 # include <Base/Image/ImageConvert.hh>
42 # include <Image/Camera.hh>
45 #include <linux/videodev2.h>
128 #ifdef BIAS_HAVE_LIBJPEG
131 #endif //BIAS_HAVE_LIBJPEG
162 std::vector<BIAS::Camera<unsigned char> >
Frame_;
178 int xioctl_(
int fd,
int request,
void *arg);
184 int StartCapturing_();
186 int StopCapturing_();
Wrapper for fast libjpeg methods.
float GetBrightness()
Get brightness as value in interval [0, 100]. */.
float GetContrast()
Get contrast as value in interval [0, 100]. */.
bool HasControlBrightness()
pthread_mutex_t ActiveFrameMutex_
Defines a common interface to different devices.
void GetDeviceChannelNames(std::vector< std::string > &names)
if more than one channel is present names can are returned here.
struct v4l2_buffer buffer_
struct v4l2_requestbuffers reqBuf
bool HasControlWhiteBalance()
v4l2_field interlaceMode_
int SetShutter(float g)
Set shutter (exposure time) in seconds.
std::vector< BIAS::Camera< unsigned char > > Frame_
struct v4l2_format formatRGB_
void FixIdentifierString_()
struct v4l2_queryctrl ControlTiltReset_
void ResetPanTiltZoom()
Reset digital zoom, pan and tilt to defaults to ensure compliance with calibration.
float GetShutter()
Get shutter (exposure time) in seconds.
virtual int OpenDevice()
selects the first available device to open (e.g.
float GetGain()
Get gain in dB.
void SetAutoBrightness(bool b)
struct v4l2_queryctrl ControlContrast_
struct v4l2_queryctrl ControlShutter_
int PreGrab()
Do last preparations before grabbing (e.g. start ISO transfer)
struct v4l2_queryctrl ControlAutoGain_
virtual int GrabSingle(BIAS::Camera< unsigned char > &image)
blocks until a new frame arrives from the cam, if dont want blocking set waitForNew() to false ...
int SetBrightness(float g)
Set brightness as value in interval [0, 100]. */.
int SetGain(float g)
Set gain in dB.
struct v4l2_format format2_
int GetAllDevices(std::vector< std::string > &devices)
BIAS::JpegHandler Decompressor_
std::map< std::string, std::string > ModelNameToDevice_
struct v4l2_queryctrl ControlZoom_
struct v4l2_queryctrl ControlBrightness_
pthread_t ContinousThread_
struct v4l2_queryctrl ControlGain_
int SetContrast(float g)
Set contrast as value in interval [0, 100]. */.
BIAS::Camera< unsigned char > jpegImg_
virtual ~VideoSource_V4L()
std::vector< std::string > deviceChannelNames_
Checks for VideoSource capabilities.
struct v4l2_queryctrl ControlPanReset_
bool HasControlContrast()
struct v4l2_capability capability2
This class extends VideoSource for the use of Video4Linux supported devices like framegrabber, USB cameras.
int PostGrab()
Stop anything started in PreGrab()
virtual int CloseDevice()
int GetCapabilities(VideoSourceCapabilities &caps)
Use this method to learn something about the capabilities of the source (only useful for V4L sources...
std::vector< struct buffer > Buffers_
static void * GrabContThread_(void *arg)
void SetAutoShutter(bool b)