Public Member Functions | Public Attributes
streamerSource Class Reference

Interacts with LIBAV and other relevant libraries to read video data from USB. More...

#include <video.hpp>

List of all members.

Public Member Functions

void close_device ()
void close_video_capture ()
int close_video_file (std::string filename)
void errno_exit (const char *s)
void init_device (int image_width, int image_height)
int init_mjpeg_decoder (int image_width, int image_height)
void init_mmap ()
void init_read (unsigned int buffer_size)
void init_userp (unsigned int buffer_size)
void initialize_video_source ()
void mjpeg2rgb (char *MJPEG, int len, char *RGB, int NumPixels)
void open_device ()
void process_image (const void *src, int len, usb_cam_camera_image_t *dest)
int read_frame ()
int setup_video_capture (std::string devicename, int &deviceWidth, int &deviceHeight, bool verbose=false)
int setup_video_file (std::string filename)
void start_capturing ()
void stop_capturing ()
void uninit_device ()
void usb_cam_camera_grab_image ()
void usb_cam_camera_shutdown (void)
void usb_cam_camera_start (const char *dev, usb_cam_io_method io, usb_cam_pixel_format pf, int width, int height)
void uyvy2rgb (char *YUV, char *RGB, int NumPixels)
int xioctl (int fd, int request, void *arg)
void YUV2RGB (const unsigned char y, const unsigned char u, const unsigned char v, unsigned char *r, unsigned char *g, unsigned char *b)
void yuyv2rgb (char *YUV, char *RGB, int NumPixels)

Public Attributes

AVCodec * avcodec
AVCodecContext * avcodec_context
AVFrame * avframe_camera
int avframe_camera_size
AVFrame * avframe_rgb
int avframe_rgb_size
int bImgFormat
int bQuality
int bRet
uint8_t * buffer
struct usb_bufferbuffers
char * camera_dev
int fd
FILE * fdJPEG
int fFrame
int frameFinished
int i
usb_cam_camera_image_timage
usb_cam_io_method io
int ix
int ixInputStream
unsigned int n_buffers
int numBytes
AVPacket oPacket
AVPacket packet
AVCodec * pCodec
AVCodecContext * pCodecCtx
AVFrame * pFrame
AVFrame * pFrameRGB
AVCodec * pICodec
AVCodecContext * pICodecCtx
AVInputFormat * pIFormat
AVFormatContext * pIFormatCtx
unsigned int pixelformat
AVCodec * pOCodec
AVCodecContext * pOCodecCtx
int szBuffer
int szBufferActual
struct SwsContext * video_sws
uint8_t * videoBuffer
int videoStream

Detailed Description

Interacts with LIBAV and other relevant libraries to read video data from USB.

Definition at line 50 of file video.hpp.


Member Function Documentation

Definition at line 985 of file video.cpp.

Definition at line 155 of file video.cpp.

int streamerSource::close_video_file ( std::string  filename)

Definition at line 33 of file video.cpp.

void streamerSource::errno_exit ( const char *  s)

Definition at line 309 of file video.cpp.

void streamerSource::init_device ( int  image_width,
int  image_height 
)

Definition at line 874 of file video.cpp.

int streamerSource::init_mjpeg_decoder ( int  image_width,
int  image_height 
)

Definition at line 441 of file video.cpp.

void streamerSource::init_mmap ( void  )

Definition at line 763 of file video.cpp.

void streamerSource::init_read ( unsigned int  buffer_size)

Definition at line 737 of file video.cpp.

void streamerSource::init_userp ( unsigned int  buffer_size)

Definition at line 831 of file video.cpp.

Definition at line 7 of file video.cpp.

void streamerSource::mjpeg2rgb ( char *  MJPEG,
int  len,
char *  RGB,
int  NumPixels 
)

Definition at line 476 of file video.cpp.

Definition at line 993 of file video.cpp.

void streamerSource::process_image ( const void *  src,
int  len,
usb_cam_camera_image_t dest 
)

Definition at line 516 of file video.cpp.

Definition at line 526 of file video.cpp.

int streamerSource::setup_video_capture ( std::string  devicename,
int &  deviceWidth,
int &  deviceHeight,
bool  verbose = false 
)

Definition at line 162 of file video.cpp.

int streamerSource::setup_video_file ( std::string  filename)

Definition at line 51 of file video.cpp.

Definition at line 652 of file video.cpp.

Definition at line 630 of file video.cpp.

Definition at line 713 of file video.cpp.

Definition at line 1069 of file video.cpp.

Definition at line 1050 of file video.cpp.

void streamerSource::usb_cam_camera_start ( const char *  dev,
usb_cam_io_method  io,
usb_cam_pixel_format  pf,
int  width,
int  height 
)

Definition at line 1015 of file video.cpp.

void streamerSource::uyvy2rgb ( char *  YUV,
char *  RGB,
int  NumPixels 
)

Definition at line 398 of file video.cpp.

int streamerSource::xioctl ( int  fd,
int  request,
void *  arg 
)

Definition at line 319 of file video.cpp.

void streamerSource::YUV2RGB ( const unsigned char  y,
const unsigned char  u,
const unsigned char  v,
unsigned char *  r,
unsigned char *  g,
unsigned char *  b 
)

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. Conversion from YUV to RGB. The normal conversion matrix is due to Julien (surname unknown):

[ R ] [ 1.0 0.0 1.403 ] [ Y ] [ G ] = [ 1.0 -0.344 -0.714 ] [ U ] [ B ] [ 1.0 1.770 0.0 ] [ V ]

and the firewire one is similar:

[ R ] [ 1.0 0.0 0.700 ] [ Y ] [ G ] = [ 1.0 -0.198 -0.291 ] [ U ] [ B ] [ 1.0 1.015 0.0 ] [ V ]

Corrected by BJT (coriander's transforms RGB->YUV and YUV->RGB do not get you back to the same RGB!) [ R ] [ 1.0 0.0 1.136 ] [ Y ] [ G ] = [ 1.0 -0.396 -0.578 ] [ U ] [ B ] [ 1.0 2.041 0.002 ] [ V ]

Definition at line 365 of file video.cpp.

void streamerSource::yuyv2rgb ( char *  YUV,
char *  RGB,
int  NumPixels 
)

Definition at line 419 of file video.cpp.


Member Data Documentation

Definition at line 76 of file video.hpp.

Definition at line 77 of file video.hpp.

Definition at line 74 of file video.hpp.

Definition at line 78 of file video.hpp.

Definition at line 75 of file video.hpp.

Definition at line 79 of file video.hpp.

Definition at line 100 of file video.hpp.

Definition at line 101 of file video.hpp.

Definition at line 83 of file video.hpp.

Definition at line 64 of file video.hpp.

Definition at line 72 of file video.hpp.

Definition at line 67 of file video.hpp.

Definition at line 71 of file video.hpp.

Definition at line 102 of file video.hpp.

Definition at line 93 of file video.hpp.

Definition at line 62 of file video.hpp.

Definition at line 56 of file video.hpp.

Definition at line 80 of file video.hpp.

Definition at line 70 of file video.hpp.

Definition at line 83 of file video.hpp.

Definition at line 90 of file video.hpp.

Definition at line 73 of file video.hpp.

Definition at line 63 of file video.hpp.

Definition at line 92 of file video.hpp.

Definition at line 61 of file video.hpp.

Definition at line 58 of file video.hpp.

AVCodecContext* streamerSource::pCodecCtx

Definition at line 57 of file video.hpp.

Definition at line 59 of file video.hpp.

Definition at line 60 of file video.hpp.

Definition at line 88 of file video.hpp.

AVCodecContext* streamerSource::pICodecCtx

Definition at line 87 of file video.hpp.

AVInputFormat* streamerSource::pIFormat

Definition at line 91 of file video.hpp.

AVFormatContext* streamerSource::pIFormatCtx

Definition at line 86 of file video.hpp.

Definition at line 68 of file video.hpp.

Definition at line 96 of file video.hpp.

AVCodecContext* streamerSource::pOCodecCtx

Definition at line 95 of file video.hpp.

Definition at line 98 of file video.hpp.

Definition at line 99 of file video.hpp.

struct SwsContext* streamerSource::video_sws

Definition at line 53 of file video.hpp.

Definition at line 65 of file video.hpp.

Definition at line 56 of file video.hpp.


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


thermalvis
Author(s): Stephen Vidas
autogenerated on Sun Jan 5 2014 11:38:45