00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
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
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
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