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: 20385 $
00022  * $Author: rjongbloed $
00023  * $Date: 2008-06-04 10:40:38 +0000 (Wed, 04 Jun 2008) $
00024  */
00025 
00026 
00027 #ifndef _PVIDEOIO1394DC
00028 
00029 #define _PVIDEOIO1394DC
00030 
00031 #ifdef __GNUC__
00032 #pragma interface
00033 #endif
00034 
00035 #include <libraw1394/raw1394.h>
00036 #include <libdc1394/dc1394_control.h>
00037 
00041 class PVideoInput1394DcDevice : public PVideoInputDevice
00042 {
00043     PCLASSINFO(PVideoInput1394DcDevice, PVideoInputDevice);
00044  public:
00047     PVideoInput1394DcDevice();
00048 
00051     ~PVideoInput1394DcDevice();
00052 
00055     PBoolean Open(
00056       const PString & deviceName,   
00057       PBoolean startImmediate = PTrue    
00058     );
00059 
00062     PBoolean IsOpen();
00063 
00066     PBoolean Close();
00067 
00070     PBoolean Start();
00071 
00074     PBoolean Stop();
00075 
00078     PBoolean IsCapturing();
00079 
00082     static PStringList GetInputDeviceNames();
00083 
00089     PINDEX GetMaxFrameBytes();
00090 
00093     PBoolean GetFrameData(
00094       BYTE * buffer,                 
00095       PINDEX * bytesReturned = NULL  
00096     );
00097 
00100     PBoolean GetFrameDataNoDelay(
00101       BYTE * buffer,                 
00102       PINDEX * bytesReturned = NULL  
00103     );
00104 
00105 
00108     int GetBrightness();
00109 
00112     PBoolean SetBrightness(unsigned newBrightness);
00113 
00114 
00117     int GetWhiteness();
00118 
00121     PBoolean SetWhiteness(unsigned newWhiteness);
00122 
00123 
00126     int GetColour();
00127 
00130     PBoolean SetColour(unsigned newColour);
00131 
00132 
00135     int GetContrast();
00136 
00139     PBoolean SetContrast(unsigned newContrast);
00140 
00141 
00144     int GetHue();
00145 
00148     PBoolean SetHue(unsigned newHue);
00149     
00150     
00153     PBoolean GetParameters (int *whiteness, int *brightness, 
00154                         int *colour, int *contrast, int *hue);
00155 
00158     PBoolean GetFrameSizeLimits(
00159       unsigned & minWidth,   
00160       unsigned & minHeight,  
00161       unsigned & maxWidth,   
00162       unsigned & maxHeight   
00163     ) ;
00164 
00165     void ClearMapping();
00166 
00167     int GetNumChannels();
00168     PBoolean SetChannel(
00169          int channelNumber  
00170     );
00171     PBoolean SetFrameRate(
00172       unsigned rate  
00173     );
00174     PBoolean SetVideoFormat(
00175       VideoFormat videoFormat   
00176     );
00177     PBoolean SetFrameSize(
00178       unsigned width,   
00179       unsigned height   
00180     );
00181     PBoolean SetColourFormat(
00182       const PString & colourFormat   // New colour format for device.
00183     );
00184 
00185 
00188     PBoolean TestAllFormats();
00189 
00195     PBoolean SetFrameSizeConverter(
00196       unsigned width,        
00197       unsigned height,       
00198       PBoolean     bScaleNotCrop 
00199     );
00200 
00207     PBoolean SetColourFormatConverter(
00208       const PString & colourFormat // New colour format for device.
00209     );
00210 
00211 
00212  protected:
00213     raw1394handle_t handle;
00214     PBoolean is_capturing;
00215     PBoolean UseDMA;
00216     nodeid_t * camera_nodes;
00217     int numCameras;
00218     dc1394_cameracapture camera;
00219     int capturing_duration;
00220     PString      desiredColourFormat;
00221     unsigned     desiredFrameWidth;
00222     unsigned     desiredFrameHeight;
00223 };
00224 
00225 #endif
00226 
00227 
00228 // End Of File ///////////////////////////////////////////////////////////////

Generated on Mon Sep 15 01:21:35 2008 for PTLib by  doxygen 1.5.1