videoio1394dc.h

Go to the documentation of this file.
00001 /*
00002  * videoio1394dc.h
00003  *
00004  * Copyright:
00005  * Copyright (c) 2002 Ryutaroh Matsumoto <ryutaroh@rmatsumoto.org>
00006  *
00007  * The contents of this file are subject to the Mozilla Public License
00008  * Version 1.0 (the "License"); you may not use this file except in
00009  * compliance with the License. You may obtain a copy of the License at
00010  * http://www.mozilla.org/MPL/
00011  *
00012  * Software distributed under the License is distributed on an "AS IS"
00013  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00014  * the License for the specific language governing rights and limitations
00015  * under the License.
00016  *
00017  *
00018  * Classes to support streaming video input from IEEE 1394 cameras.
00019  * Detailed explanation can be found at src/ptlib/unix/video4dc1394.cxx
00020  *
00021  * $Log: videoio1394dc.h,v $
00022  * Revision 1.3  2005/11/30 12:47:38  csoutheren
00023  * Removed tabs, reformatted some code, and changed tags for Doxygen
00024  *
00025  * Revision 1.2  2002/05/30 22:49:35  dereks
00026  * correct implementation of GetInputDeviceNames().
00027  *
00028  * Revision 1.1  2002/02/20 02:37:26  dereks
00029  * Initial release of Firewire camera support for linux.
00030  * Many thanks to Ryutaroh Matsumoto <ryutaroh@rmatsumoto.org>.
00031  *
00032  *
00033  */
00034 
00035 
00036 #ifndef _PVIDEOIO1394DC
00037 
00038 #define _PVIDEOIO1394DC
00039 
00040 #ifdef __GNUC__
00041 #pragma interface
00042 #endif
00043 
00044 #include <libraw1394/raw1394.h>
00045 #include <libdc1394/dc1394_control.h>
00046 
00050 class PVideoInput1394DcDevice : public PVideoInputDevice
00051 {
00052     PCLASSINFO(PVideoInput1394DcDevice, PVideoInputDevice);
00053  public:
00056     PVideoInput1394DcDevice();
00057 
00060     ~PVideoInput1394DcDevice();
00061 
00064     BOOL Open(
00065       const PString & deviceName,   
00066       BOOL startImmediate = TRUE    
00067     );
00068 
00071     BOOL IsOpen();
00072 
00075     BOOL Close();
00076 
00079     BOOL Start();
00080 
00083     BOOL Stop();
00084 
00087     BOOL IsCapturing();
00088 
00091     static PStringList GetInputDeviceNames();
00092 
00098     PINDEX GetMaxFrameBytes();
00099 
00102     BOOL GetFrameData(
00103       BYTE * buffer,                 
00104       PINDEX * bytesReturned = NULL  
00105     );
00106 
00109     BOOL GetFrameDataNoDelay(
00110       BYTE * buffer,                 
00111       PINDEX * bytesReturned = NULL  
00112     );
00113 
00114 
00117     int GetBrightness();
00118 
00121     BOOL SetBrightness(unsigned newBrightness);
00122 
00123 
00126     int GetWhiteness();
00127 
00130     BOOL SetWhiteness(unsigned newWhiteness);
00131 
00132 
00135     int GetColour();
00136 
00139     BOOL SetColour(unsigned newColour);
00140 
00141 
00144     int GetContrast();
00145 
00148     BOOL SetContrast(unsigned newContrast);
00149 
00150 
00153     int GetHue();
00154 
00157     BOOL SetHue(unsigned newHue);
00158     
00159     
00162     BOOL GetParameters (int *whiteness, int *brightness, 
00163                         int *colour, int *contrast, int *hue);
00164 
00167     BOOL GetFrameSizeLimits(
00168       unsigned & minWidth,   
00169       unsigned & minHeight,  
00170       unsigned & maxWidth,   
00171       unsigned & maxHeight   
00172     ) ;
00173 
00174     void ClearMapping();
00175 
00176     int GetNumChannels();
00177     BOOL SetChannel(
00178          int channelNumber  
00179     );
00180     BOOL SetFrameRate(
00181       unsigned rate  
00182     );
00183     BOOL SetVideoFormat(
00184       VideoFormat videoFormat   
00185     );
00186     BOOL SetFrameSize(
00187       unsigned width,   
00188       unsigned height   
00189     );
00190     BOOL SetColourFormat(
00191       const PString & colourFormat   // New colour format for device.
00192     );
00193 
00194 
00197     BOOL TestAllFormats();
00198 
00204     BOOL SetFrameSizeConverter(
00205       unsigned width,        
00206       unsigned height,       
00207       BOOL     bScaleNotCrop 
00208     );
00209 
00216     BOOL SetColourFormatConverter(
00217       const PString & colourFormat // New colour format for device.
00218     );
00219 
00220 
00221  protected:
00222     raw1394handle_t handle;
00223     BOOL is_capturing;
00224     BOOL UseDMA;
00225     nodeid_t * camera_nodes;
00226     int numCameras;
00227     dc1394_cameracapture camera;
00228     int capturing_duration;
00229     PString      desiredColourFormat;
00230     unsigned     desiredFrameWidth;
00231     unsigned     desiredFrameHeight;
00232 };
00233 
00234 #endif
00235 
00236 
00237 // End Of File ///////////////////////////////////////////////////////////////

Generated on Fri Mar 7 06:25:03 2008 for PTLib by  doxygen 1.5.1