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  * $Revision: 21788 $
00022  * $Author: rjongbloed $
00023  * $Date: 2008-12-11 23:42:13 -0600 (Thu, 11 Dec 2008) $
00024  */
00025 
00026 
00027 #ifndef PTLIB_VIDEOIO1394DC_H
00028 #define PTLIB_VIDEOIO1394DC_H
00029 
00030 #ifdef __GNUC__
00031 #pragma interface
00032 #endif
00033 
00034 #include <libraw1394/raw1394.h>
00035 #include <libdc1394/dc1394_control.h>
00036 
00040 class PVideoInput1394DcDevice : public PVideoInputDevice
00041 {
00042     PCLASSINFO(PVideoInput1394DcDevice, PVideoInputDevice);
00043  public:
00046     PVideoInput1394DcDevice();
00047 
00050     ~PVideoInput1394DcDevice();
00051 
00054     PBoolean Open(
00055       const PString & deviceName,   
00056       PBoolean startImmediate = PTrue    
00057     );
00058 
00061     PBoolean IsOpen();
00062 
00065     PBoolean Close();
00066 
00069     PBoolean Start();
00070 
00073     PBoolean Stop();
00074 
00077     PBoolean IsCapturing();
00078 
00081     static PStringList GetInputDeviceNames();
00082 
00088     PINDEX GetMaxFrameBytes();
00089 
00092     PBoolean GetFrameData(
00093       BYTE * buffer,                 
00094       PINDEX * bytesReturned = NULL  
00095     );
00096 
00099     PBoolean GetFrameDataNoDelay(
00100       BYTE * buffer,                 
00101       PINDEX * bytesReturned = NULL  
00102     );
00103 
00104 
00107     int GetBrightness();
00108 
00111     PBoolean SetBrightness(unsigned newBrightness);
00112 
00113 
00116     int GetWhiteness();
00117 
00120     PBoolean SetWhiteness(unsigned newWhiteness);
00121 
00122 
00125     int GetColour();
00126 
00129     PBoolean SetColour(unsigned newColour);
00130 
00131 
00134     int GetContrast();
00135 
00138     PBoolean SetContrast(unsigned newContrast);
00139 
00140 
00143     int GetHue();
00144 
00147     PBoolean SetHue(unsigned newHue);
00148     
00149     
00152     PBoolean GetParameters (int *whiteness, int *brightness, 
00153                         int *colour, int *contrast, int *hue);
00154 
00157     PBoolean GetFrameSizeLimits(
00158       unsigned & minWidth,   
00159       unsigned & minHeight,  
00160       unsigned & maxWidth,   
00161       unsigned & maxHeight   
00162     ) ;
00163 
00164     void ClearMapping();
00165 
00166     int GetNumChannels();
00167     PBoolean SetChannel(
00168          int channelNumber  
00169     );
00170     PBoolean SetFrameRate(
00171       unsigned rate  
00172     );
00173     PBoolean SetVideoFormat(
00174       VideoFormat videoFormat   
00175     );
00176     PBoolean SetFrameSize(
00177       unsigned width,   
00178       unsigned height   
00179     );
00180     PBoolean SetColourFormat(
00181       const PString & colourFormat   // New colour format for device.
00182     );
00183 
00184 
00187     PBoolean TestAllFormats();
00188 
00194     PBoolean SetFrameSizeConverter(
00195       unsigned width,        
00196       unsigned height,       
00197       PBoolean     bScaleNotCrop 
00198     );
00199 
00206     PBoolean SetColourFormatConverter(
00207       const PString & colourFormat // New colour format for device.
00208     );
00209 
00210 
00211  protected:
00212     raw1394handle_t handle;
00213     PBoolean is_capturing;
00214     PBoolean UseDMA;
00215     nodeid_t * camera_nodes;
00216     int numCameras;
00217     dc1394_cameracapture camera;
00218     int capturing_duration;
00219     PString      desiredColourFormat;
00220     unsigned     desiredFrameWidth;
00221     unsigned     desiredFrameHeight;
00222 };
00223 
00224 
00225 #endif // PTLIB_VIDEOIO1394DC_H
00226 
00227 
00228 // End Of File ///////////////////////////////////////////////////////////////

Generated on Thu May 27 01:36:48 2010 for PTLib by  doxygen 1.4.7