Namespaces | Functions
usb_cam::util Namespace Reference

Namespaces

 converters
 

Functions

timespec calc_img_timestamp (const timeval &buffer_time, const time_t &epoch_time_shift_us)
 Calculate image timestamp from buffer time and epoch time shift. In this, the buffer time is first converted into microseconds before the epoch time shift, which is to be given in microseconds is added to it. Afterwards it is split into seconds and nanoseconds for the image timestamp. More...
 
unsigned char CLIPVALUE (const int &val)
 
time_t get_epoch_time_shift_us ()
 Get epoch time shift. More...
 
int xioctl (int fd, int request, void *arg)
 

Function Documentation

◆ calc_img_timestamp()

timespec usb_cam::util::calc_img_timestamp ( const timeval &  buffer_time,
const time_t &  epoch_time_shift_us 
)

Calculate image timestamp from buffer time and epoch time shift. In this, the buffer time is first converted into microseconds before the epoch time shift, which is to be given in microseconds is added to it. Afterwards it is split into seconds and nanoseconds for the image timestamp.

Definition at line 23 of file util.cpp.

◆ CLIPVALUE()

unsigned char usb_cam::util::CLIPVALUE ( const int &  val)

Clip a value to the range 0<val<255. For speed this is done using an array, so can only cope with numbers in the range -128<=val<=383.

Definition at line 48 of file util.cpp.

◆ get_epoch_time_shift_us()

time_t usb_cam::util::get_epoch_time_shift_us ( )

Get epoch time shift.

Run this at start of process to calculate epoch time shift https://stackoverflow.com/questions/10266451/where-does-v4l2-buffer-timestamp-value-starts-counting

Definition at line 5 of file util.cpp.

◆ xioctl()

int usb_cam::util::xioctl ( int  fd,
int  request,
void *  arg 
)

Definition at line 36 of file util.cpp.



usb_cam
Author(s): Benjamin Pitzer
autogenerated on Sun Sep 3 2023 02:44:54