APM:Libraries
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
Linux::VideoIn Class Reference

#include <VideoIn.h>

Collaboration diagram for Linux::VideoIn:
[legend]

Classes

class  Frame
 

Public Member Functions

bool get_frame (Frame &frame)
 
void put_frame (Frame &frame)
 
void set_device_path (const char *path)
 
void init ()
 
bool open_device (const char *device_path, uint32_t memtype)
 
bool allocate_buffers (uint32_t nbufs)
 
void get_pixel_formats (std::vector< uint32_t > *formats)
 
bool set_format (uint32_t *width, uint32_t *height, uint32_t *format, uint32_t *bytesperline, uint32_t *sizeimage)
 
bool set_crop (uint32_t left, uint32_t top, uint32_t width, uint32_t height)
 
void prepare_capture ()
 

Static Public Member Functions

static void shrink_8bpp (uint8_t *buffer, uint8_t *new_buffer, uint32_t width, uint32_t height, uint32_t left, uint32_t selection_width, uint32_t top, uint32_t selection_height, uint32_t fx, uint32_t fy)
 
static void crop_8bpp (uint8_t *buffer, uint8_t *new_buffer, uint32_t width, uint32_t left, uint32_t crop_width, uint32_t top, uint32_t crop_height)
 
static void yuyv_to_grey (uint8_t *buffer, uint32_t buffer_size, uint8_t *new_buffer)
 

Private Member Functions

void _queue_buffer (int index)
 
bool _set_streaming (bool enable)
 
bool _dequeue_frame (Frame &frame)
 
uint32_t _timeval_to_us (struct timeval &tv)
 

Private Attributes

int _fd = -1
 
struct buffer_buffers
 
unsigned int _nbufs
 
bool _streaming
 
uint32_t _width
 
uint32_t _height
 
uint32_t _format
 
uint32_t _bytesperline
 
uint32_t _sizeimage
 
uint32_t _memtype = V4L2_MEMORY_MMAP
 

Detailed Description

Definition at line 28 of file VideoIn.h.

Member Function Documentation

◆ _dequeue_frame()

bool VideoIn::_dequeue_frame ( Frame frame)
private

Definition at line 362 of file VideoIn.cpp.

Referenced by get_frame().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _queue_buffer()

void VideoIn::_queue_buffer ( int  index)
private

Definition at line 326 of file VideoIn.cpp.

Referenced by prepare_capture(), and put_frame().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _set_streaming()

bool VideoIn::_set_streaming ( bool  enable)
private

Definition at line 347 of file VideoIn.cpp.

Referenced by get_frame().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _timeval_to_us()

uint32_t VideoIn::_timeval_to_us ( struct timeval &  tv)
private

Definition at line 321 of file VideoIn.cpp.

Referenced by _dequeue_frame().

Here is the caller graph for this function:

◆ allocate_buffers()

bool VideoIn::allocate_buffers ( uint32_t  nbufs)

Definition at line 97 of file VideoIn.cpp.

Referenced by Linux::OpticalFlow_Onboard::init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ crop_8bpp()

void VideoIn::crop_8bpp ( uint8_t *  buffer,
uint8_t *  new_buffer,
uint32_t  width,
uint32_t  left,
uint32_t  crop_width,
uint32_t  top,
uint32_t  crop_height 
)
static

Definition at line 292 of file VideoIn.cpp.

Referenced by Linux::OpticalFlow_Onboard::_run_optflow(), and BM_Crop8bpp().

Here is the caller graph for this function:

◆ get_frame()

bool VideoIn::get_frame ( Frame frame)

Definition at line 45 of file VideoIn.cpp.

Referenced by Linux::OpticalFlow_Onboard::_run_optflow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_pixel_formats()

void VideoIn::get_pixel_formats ( std::vector< uint32_t > *  formats)

Definition at line 163 of file VideoIn.cpp.

Referenced by Linux::OpticalFlow_Onboard::init().

Here is the caller graph for this function:

◆ init()

void Linux::VideoIn::init ( )

◆ open_device()

bool VideoIn::open_device ( const char *  device_path,
uint32_t  memtype 
)

Definition at line 63 of file VideoIn.cpp.

Referenced by Linux::OpticalFlow_Onboard::init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ prepare_capture()

void VideoIn::prepare_capture ( )

Definition at line 243 of file VideoIn.cpp.

Referenced by Linux::OpticalFlow_Onboard::init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ put_frame()

void VideoIn::put_frame ( Frame frame)

Definition at line 58 of file VideoIn.cpp.

Referenced by Linux::OpticalFlow_Onboard::_run_optflow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_crop()

bool VideoIn::set_crop ( uint32_t  left,
uint32_t  top,
uint32_t  width,
uint32_t  height 
)

Definition at line 219 of file VideoIn.cpp.

Referenced by Linux::OpticalFlow_Onboard::init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_device_path()

void Linux::VideoIn::set_device_path ( const char *  path)

◆ set_format()

bool VideoIn::set_format ( uint32_t *  width,
uint32_t *  height,
uint32_t *  format,
uint32_t *  bytesperline,
uint32_t *  sizeimage 
)

Definition at line 177 of file VideoIn.cpp.

Referenced by Linux::OpticalFlow_Onboard::init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shrink_8bpp()

void VideoIn::shrink_8bpp ( uint8_t *  buffer,
uint8_t *  new_buffer,
uint32_t  width,
uint32_t  height,
uint32_t  left,
uint32_t  selection_width,
uint32_t  top,
uint32_t  selection_height,
uint32_t  fx,
uint32_t  fy 
)
static

Definition at line 253 of file VideoIn.cpp.

Referenced by Linux::OpticalFlow_Onboard::_run_optflow().

Here is the caller graph for this function:

◆ yuyv_to_grey()

void VideoIn::yuyv_to_grey ( uint8_t *  buffer,
uint32_t  buffer_size,
uint8_t *  new_buffer 
)
static

Definition at line 310 of file VideoIn.cpp.

Referenced by Linux::OpticalFlow_Onboard::_run_optflow(), and BM_YuyvToGrey().

Here is the caller graph for this function:

Member Data Documentation

◆ _buffers

struct buffer* Linux::VideoIn::_buffers
private

Definition at line 75 of file VideoIn.h.

Referenced by _dequeue_frame(), _queue_buffer(), allocate_buffers(), and open_device().

◆ _bytesperline

uint32_t Linux::VideoIn::_bytesperline
private

Definition at line 81 of file VideoIn.h.

◆ _fd

int Linux::VideoIn::_fd = -1
private

◆ _format

uint32_t Linux::VideoIn::_format
private

Definition at line 80 of file VideoIn.h.

◆ _height

uint32_t Linux::VideoIn::_height
private

Definition at line 79 of file VideoIn.h.

◆ _memtype

uint32_t Linux::VideoIn::_memtype = V4L2_MEMORY_MMAP
private

Definition at line 83 of file VideoIn.h.

Referenced by _dequeue_frame(), _queue_buffer(), allocate_buffers(), and open_device().

◆ _nbufs

unsigned int Linux::VideoIn::_nbufs
private

Definition at line 76 of file VideoIn.h.

Referenced by allocate_buffers(), and prepare_capture().

◆ _sizeimage

uint32_t Linux::VideoIn::_sizeimage
private

Definition at line 82 of file VideoIn.h.

◆ _streaming

bool Linux::VideoIn::_streaming
private

Definition at line 77 of file VideoIn.h.

Referenced by get_frame().

◆ _width

uint32_t Linux::VideoIn::_width
private

Definition at line 78 of file VideoIn.h.


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