MediaX v1.0.0rc7 [7e6cb74]
Video streaming for military vehicles
Loading...
Searching...
No Matches
V4L2Capture Class Reference

Class for Video 4 Linux 2 (V4L2) capture. More...

#include <v4l2_source.h>

Collaboration diagram for V4L2Capture:
Collaboration graph

Public Member Functions

 V4L2Capture (std::string_view device, int width, int height)
 Construct a new V4L2Capture object.
 
V4L2Captureoperator= (const V4L2Capture &)=delete
 Delete the assignment operator.
 
 ~V4L2Capture ()
 Destroy the V4L2Capture::V4L2Capture object.
 
int Initalise ()
 Initalise the V4L2 device.
 
bool CaptureFrame (uint8_t *buffer) const
 Capture a frame from the V4L2 device.
 
 V4L2Capture (const V4L2Capture &)=delete
 Delete the copy constructor.
 

Private Member Functions

void PrintCaps (const v4l2_capability *cap) const
 Print the capabilities of the V4L2 device.
 

Private Attributes

int fd_ = -1
 The file descriptor for the V4L2 device.
 
std::string device_
 The video capture device.
 
int width_
 The width of the frame.
 
int height_
 The height of the frame.
 
uint8_t * buffer_ = nullptr
 The buffer to store the frame in.
 

Detailed Description

Class for Video 4 Linux 2 (V4L2) capture.

Constructor & Destructor Documentation

◆ V4L2Capture()

V4L2Capture::V4L2Capture ( std::string_view  device,
int  width,
int  height 
)

Construct a new V4L2Capture object.

Parameters
deviceThe device to capture from
widthThe width of the frame
heightThe height of the frame

Member Function Documentation

◆ CaptureFrame()

bool V4L2Capture::CaptureFrame ( uint8_t *  buffer) const

Capture a frame from the V4L2 device.

Parameters
bufferThe buffer to store the frame in
Returns
true
false

◆ Initalise()

int V4L2Capture::Initalise ( )

Initalise the V4L2 device.

Returns
int

◆ operator=()

V4L2Capture & V4L2Capture::operator= ( const V4L2Capture )
delete

Delete the assignment operator.

Returns
V4L2Capture&

◆ PrintCaps()

void V4L2Capture::PrintCaps ( const v4l2_capability *  cap) const
private

Print the capabilities of the V4L2 device.

Parameters
cap

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