v4l2uvc.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 #               luvcview: Sdl video Usb Video Class grabber          .         #
00003 #This package work with the Logitech UVC based webcams with the mjpeg feature. #
00004 #All the decoding is in user space with the embedded jpeg decoder              #
00005 #.                                                                             #
00006 #               Copyright (C) 2005 2006 Laurent Pinchart &&  Michel Xhaard     #
00007 #                                                                              #
00008 # This program is free software; you can redistribute it and/or modify         #
00009 # it under the terms of the GNU General Public License as published by         #
00010 # the Free Software Foundation; either version 2 of the License, or            #
00011 # (at your option) any later version.                                          #
00012 #                                                                              #
00013 # This program is distributed in the hope that it will be useful,              #
00014 # but WITHOUT ANY WARRANTY; without even the implied warranty of               #
00015 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
00016 # GNU General Public License for more details.                                 #
00017 #                                                                              #
00018 # You should have received a copy of the GNU General Public License            #
00019 # along with this program; if not, write to the Free Software                  #
00020 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA    #
00021 #                                                                              #
00022 *******************************************************************************/
00023 
00024 #include <stdio.h>
00025 #include <string.h>
00026 #include <fcntl.h>
00027 #include <unistd.h>
00028 #include <errno.h>
00029 #include <sys/ioctl.h>
00030 #include <sys/mman.h>
00031 #include <sys/select.h>
00032 #include <linux/videodev2.h>
00033 
00034 #include "uvcvideo.h"
00035 #include "dynctrl-logitech.h"
00036 
00037 
00038 #define NB_BUFFER 4
00039 #define DHT_SIZE 432
00040 
00041 
00042 
00043 struct vdIn {
00044     int fd;
00045     char *videodevice;
00046     char *status;
00047     char *pictName;
00048     struct v4l2_capability cap;
00049     struct v4l2_format fmt;
00050     struct v4l2_buffer buf;
00051     struct v4l2_requestbuffers rb;
00052     void *mem[NB_BUFFER];
00053     unsigned char *tmpbuffer;
00054     unsigned char *framebuffer;
00055     int isstreaming;
00056     int grabmethod;
00057     int width;
00058     int height;
00059     float fps;
00060     int formatIn;
00061     int formatOut;
00062     int framesizeIn;
00063     int signalquit;
00064     int toggleAvi;
00065     int getPict;
00066     int rawFrameCapture;
00067     /* raw frame capture */
00068     unsigned int fileCounter;
00069     /* raw frame stream capture */
00070     unsigned int rfsFramesWritten;
00071     unsigned int rfsBytesWritten;
00072     /* raw stream capture */
00073     FILE *captureFile;
00074     unsigned int framesWritten;
00075     unsigned int bytesWritten;
00076     int framecount;
00077     int recordstart;
00078     int recordtime;
00079 };
00080 int
00081 init_videoIn(struct vdIn *vd, char *device, int width, int height, float fps,
00082              int format, int grabmethod, char *avifilename);
00083 int enum_controls(int vd);
00084 int save_controls(int vd, const char* filename);
00085 int load_controls(int vd, const char* filename);
00086              
00087 int uvcGrab(struct vdIn *vd);
00088 int close_v4l2(struct vdIn *vd);
00089 
00090 int v4l2GetControl(struct vdIn *vd, int control);
00091 int v4l2SetControl(struct vdIn *vd, int control, int value);
00092 int v4l2UpControl(struct vdIn *vd, int control);
00093 int v4l2DownControl(struct vdIn *vd, int control);
00094 int v4l2ToggleControl(struct vdIn *vd, int control);
00095 int v4l2ResetControl(struct vdIn *vd, int control);
00096 int v4l2ResetPanTilt(struct vdIn *vd);
00097 int v4L2UpDownPan(struct vdIn *vd, short inc);
00098 int v4L2UpDownTilt(struct vdIn *vd,short inc);
00099 int v4L2UpDownPanTilt(struct vdIn *vd, short inc_p, short inc_t);
00100 int v4l2SetLightFrequencyFilter(struct vdIn *vd,int flt);
00101 int enum_frame_intervals(int dev, __u32 pixfmt, __u32 width, __u32 height);
00102 int enum_frame_sizes(int dev, __u32 pixfmt);
00103 int enum_frame_formats(int dev, unsigned int *supported_formats, unsigned int max_formats);
00104 
00105 //Added by Markus Bader
00106 int check_videoIn(struct vdIn *vd, char *device);
00107 int v4l2ResetPan(struct vdIn *vd);
00108 int v4l2ResetTilt(struct vdIn *vd);


v4r_uvc
Author(s):
autogenerated on Wed Aug 26 2015 16:41:35