Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

V4LCapture.h

Go to the documentation of this file.
00001 /* ---------------------------------------------------------------------------
00002     Phission : 
00003         Realtime Vision Processing System
00004     
00005     Copyright (C) 2003-2006 Philip D.S. Thoren (pthoren@cs.uml.edu)
00006     University of Massachusetts at Lowell,
00007     Laboratory for Artificial Intelligence and Robotics
00008     
00009     This file is part of Phission.
00010 
00011     Phission is free software; you can redistribute it and/or modify
00012     it under the terms of the GNU Lesser General Public License as published by
00013     the Free Software Foundation; either version 2 of the License, or
00014     (at your option) any later version.
00015 
00016     Phission is distributed in the hope that it will be useful,
00017     but WITHOUT ANY WARRANTY; without even the implied warranty of
00018     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019     GNU Lesser General Public License for more details.
00020 
00021     You should have received a copy of the GNU Lesser General Public License
00022     along with Phission; if not, write to the Free Software
00023     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00024 
00025  ---------------------------------------------------------------------------*/
00026 #ifndef _V4LCAPTURE_H
00027 #define _V4LCAPTURE_H
00028 
00029 /* ---------------------------------------------------------------------- */
00030 #include <phImageCapture.h>
00031 
00032 /* ---------------------------------------------------------------------- */
00039 /* ---------------------------------------------------------------------- */
00040 typedef struct phV4LCaptureInfo_t *phV4LCaptureInfo;
00041  /* end \addtogroup Capture */
00043 
00044 /* ---------------------------------------------------------------------- */
00045 /* The Video4Linux API is documented in the kernel:
00046  * /usr/src/linux-2.x.xx/Documentation/video4linux/ */
00047 /* ---------------------------------------------------------------------- */
00053 PHAPI(class) V4LCapture : public phImageCapture
00054 {
00055 private:
00056     /* x: 1 to print info, 0 to retreive it using ioctl */
00057     void print          ( int copy = 1 );
00058     void print_caps     ( int copy = 1 );
00059     void print_channel  ( int copy = 1 );
00060     void print_picture  ( int copy = 1 );
00061     void print_mmap     ( int copy = 1 );
00062     void print_mbuf     ( int copy = 1 );
00063     void print_window   ( int copy = 1 );
00064     void print_tuner    ( int copy = 1 );
00065 
00066     int ioctl_get_capability();
00067     int ioctl_get_mbuf      ();
00068     int ioctl_get_tuner     ();
00069     int ioctl_set_channel   ();
00070     int ioctl_set_picture   ();
00071     int ioctl_set_window    ();
00072     int ioctl_set_tuner     ();
00073 
00074 protected:
00075     phV4LCaptureInfo    m_info;
00076 
00077     int                 m_device_fd;
00078     int                 m_deviceOpen;
00079 
00080     /* hardware buffer stuff */
00081     short               m_hw_mmapped;
00082     uint8_t             *m_hw_buffer;
00083     uint32_t            m_hw_bufferSize;
00084     uint32_t            m_hw_bufferCount;
00085 
00086     int32_t             m_current_format;
00087     uint32_t            m_image_size;
00088     
00089     int m_changed_settings;
00090     int m_changed_channel;
00091     virtual int onApplySettings();
00092 
00093     /* on close, the class retains all previous knowledge
00094      * except the device capabilities. */
00095     virtual int open(char *deviceName);
00096     virtual int close();
00097 
00098     int mapHWBuffer  ();
00099     int unmapHWBuffer();
00100     int remapHWBuffer();
00101 
00102     /* phThread overloaded methods */
00103     virtual int run    ();
00104     virtual int cleanup();
00105     
00106 public:
00107     V4LCapture(char *deviceName = NULL);
00108     ~V4LCapture();
00109     
00110     /* Set the # of internal buffers to use */
00111     int         setBufferCount( uint32_t nBuffers );
00112     uint32_t    getBufferCount();
00113     
00114     virtual int         isOpen();
00115     
00116     virtual int         getWidth    ();
00117     virtual int         getHeight   ();
00118     virtual int32_t     getFormat   ();
00119     virtual uint32_t    getImageSize();
00120    
00121 };
00122 
00123 #endif /* _V4LCAPTURE_H */




Copyright (C) 2002 - 2007 Philip D.S. Thoren ( pthoren@users.sourceforge.net )
University Of Massachusetts at Lowell
Robotics Lab
SourceForge.net Logo

Generated on Sat Jun 16 02:44:03 2007 for phission by  doxygen 1.4.4