Interacts with LIBAV and other relevant libraries to read video data from USB.
More...
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_buffer * | buffers |
char * | camera_dev |
int | fd |
FILE * | fdJPEG |
int | fFrame |
int | frameFinished |
int | i |
usb_cam_camera_image_t * | image |
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 |
Interacts with LIBAV and other relevant libraries to read video data from USB.
Definition at line 50 of file video.hpp.
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.