Image Component Library (ICL)
Public Member Functions | Private Attributes | List of all members
icl::io::V4L2LoopBackOutput Class Reference

ImageOutput implementation for V4L2-Looback devices. More...

#include <V4L2LoopBackOutput.h>

Inheritance diagram for icl::io::V4L2LoopBackOutput:
icl::io::ImageOutput icl::io::ImageCompressor icl::utils::Uncopyable

Public Member Functions

 V4L2LoopBackOutput ()
 creates an unintialized instance More...
 
 ~V4L2LoopBackOutput ()
 Destructor ... More...
 
 V4L2LoopBackOutput (const std::string &device)
 creates V4L2LoopBackImageOutput from given device string More...
 
void init (const std::string &deviceString)
 initializes a the deivce More...
 
virtual void send (const core::ImgBase *image)
 actual publishing function More...
 
- Public Member Functions inherited from icl::io::ImageOutput
virtual ~ImageOutput ()
 virtual destructor More...
 
virtual CompressionSpec getCompression () const
 provide the protectedly inherited image compressor options here More...
 
virtual void setCompression (const CompressionSpec &spec)
 provide the protectedly inherited image compressor options here More...
 

Private Attributes

Data * m_data
 internal data structure More...
 

Additional Inherited Members

- Protected Member Functions inherited from icl::io::ImageCompressor
Header uncompressHeader (const icl8u *compressedData, int len)
 only decodes an image header More...
 
Header createHeader (const core::ImgBase *image, bool skipMetaData)
 creates a header for a given image (not data will be null) More...
 
 ImageCompressor (const CompressionSpec &spec=CompressionSpec("none"))
 Creates an image Compressor with given compression mode. More...
 
 ~ImageCompressor ()
 Destructor. More...
 
virtual void setCompression (const CompressionSpec &spec)
 string based interface for setting the compression mode More...
 
virtual CompressionSpec getCompression () const
 can be implemented for returning the current compression mode More...
 
utils::Time pickTimeStamp (const icl8u *compressedData)
 this can help to find out wheter the data is new and must be encoded More...
 
const CompressedData compress (const core::ImgBase *image, bool skipMetaData=false)
 encodes a given image into the compressed code More...
 
const core::ImgBaseuncompress (const icl8u *compressedData, int len, core::ImgBase **dst=0)
 decodes the given byte segment More...
 
- Protected Member Functions inherited from icl::utils::Uncopyable
 Uncopyable ()
 Empty base constructor. More...
 

Detailed Description

ImageOutput implementation for V4L2-Looback devices.

The V4L2LoopBackOutput allows you to send images through a V4L2 loopback device. Please don't mix these up with common web-cam devices. You must install the v4l2looback kernel module fisrt. Once this is installed, you can load the kernel module and instantiate a number of loopback devices using

sudo modprobe v4l2loopback devices=1

Please note that the next free devices are used. I.e. if you alread have a webcam or built-in can in your PC/Laptop, which uses /dev/video0, the command above will automatically create /dev/video1 as a loopback-device

Once the device is created it must be initalized using

v4l2loopback-ctl set-caps 'any' /dev/video1

If the device is somehow broken or it can't be accessed anymore, you can re-initialize it using

sudo modprobe -r v4l2loopback && sleep 1 && sudo modprobe v4l2loopback devices=1 && sleep 1 && v4l2loopback-ctl set-caps 'any' /dev/video1

Please don't use the V4L2LoopBackOutput directly, but the GenericImageOutput with the output-specifier 'v4l'

More information can be found at https://github.com/umlaeute/v4l2loopback

Constructor & Destructor Documentation

◆ V4L2LoopBackOutput() [1/2]

icl::io::V4L2LoopBackOutput::V4L2LoopBackOutput ( )

creates an unintialized instance

◆ ~V4L2LoopBackOutput()

icl::io::V4L2LoopBackOutput::~V4L2LoopBackOutput ( )

Destructor ...

◆ V4L2LoopBackOutput() [2/2]

icl::io::V4L2LoopBackOutput::V4L2LoopBackOutput ( const std::string &  device)

creates V4L2LoopBackImageOutput from given device string

The device string can either be the full device-name, such as /dev/video1 or just an integer that specifies the device id (1 for /dev/video1 etc.)

Member Function Documentation

◆ init()

void icl::io::V4L2LoopBackOutput::init ( const std::string &  deviceString)

initializes a the deivce

◆ send()

virtual void icl::io::V4L2LoopBackOutput::send ( const core::ImgBase image)
virtual

actual publishing function

Implements icl::io::ImageOutput.

Member Data Documentation

◆ m_data

Data* icl::io::V4L2LoopBackOutput::m_data
private

internal data structure

internal data pointer


The documentation for this class was generated from the following file: