PTLib Version 2.12.9

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
videoio1394dc.h
Go to the documentation of this file.
1 /*
2 * videoio1394dc.h
3 *
4 * Copyright:
5 * Copyright (c) 2002 Ryutaroh Matsumoto <ryutaroh@rmatsumoto.org>
6 *
7 * The contents of this file are subject to the Mozilla Public License
8 * Version 1.0 (the "License"); you may not use this file except in
9 * compliance with the License. You may obtain a copy of the License at
10 * http://www.mozilla.org/MPL/
11 *
12 * Software distributed under the License is distributed on an "AS IS"
13 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 * the License for the specific language governing rights and limitations
15 * under the License.
16 *
17 *
18 * Classes to support streaming video input from IEEE 1394 cameras.
19 * Detailed explanation can be found at src/ptlib/unix/video4dc1394.cxx
20 *
21 * $Revision: 24177 $
22 * $Author: rjongbloed $
23 * $Date: 2010-04-05 21:52:04 +1000 (Mon, 05 Apr 2010) $
24 */
25
26
27 #ifndef PTLIB_VIDEOIO1394DC_H
28 #define PTLIB_VIDEOIO1394DC_H
29
30 #ifdef __GNUC__
31 #pragma interface
32 #endif
33
34 #include <libraw1394/raw1394.h>
35 #include <libdc1394/dc1394_control.h>
36
40 class PVideoInput1394DcDevice : public PVideoInputDevice
41 {
42 PCLASSINFO(PVideoInput1394DcDevice, PVideoInputDevice);
43 public:
46 PVideoInput1394DcDevice();
47
50 ~PVideoInput1394DcDevice();
51
54 PBoolean Open(
55 const PString & deviceName,
56 PBoolean startImmediate = true
57 );
58
61 PBoolean IsOpen();
62
65 PBoolean Close();
66
69 PBoolean Start();
70
73 PBoolean Stop();
74
77 PBoolean IsCapturing();
78
81 static PStringList GetInputDeviceNames();
82
88 PINDEX GetMaxFrameBytes();
89
92 PBoolean GetFrameData(
93 BYTE * buffer,
94 PINDEX * bytesReturned = NULL
95 );
96
99 PBoolean GetFrameDataNoDelay(
100 BYTE * buffer,
101 PINDEX * bytesReturned = NULL
102 );
103
104
107 int GetBrightness();
108
111 PBoolean SetBrightness(unsigned newBrightness);
112
113
116 int GetWhiteness();
117
120 PBoolean SetWhiteness(unsigned newWhiteness);
121
122
125 int GetColour();
126
129 PBoolean SetColour(unsigned newColour);
130
131
134 int GetContrast();
135
138 PBoolean SetContrast(unsigned newContrast);
139
140
143 int GetHue();
144
147 PBoolean SetHue(unsigned newHue);
148
149
152 PBoolean GetParameters (int *whiteness, int *brightness,
153 int *colour, int *contrast, int *hue);
154
157 PBoolean GetFrameSizeLimits(
158 unsigned & minWidth,
159 unsigned & minHeight,
160 unsigned & maxWidth,
161 unsigned & maxHeight
162 ) ;
163
164 void ClearMapping();
165
166 int GetNumChannels();
167 PBoolean SetChannel(
168 int channelNumber
169 );
170 PBoolean SetFrameRate(
171 unsigned rate
172 );
173 PBoolean SetVideoFormat(
174 VideoFormat videoFormat
175 );
176 PBoolean SetFrameSize(
177 unsigned width,
178 unsigned height
179 );
180 PBoolean SetColourFormat(
181 const PString & colourFormat // New colour format for device.
182 );
183
184
187 PBoolean TestAllFormats();
188
194 PBoolean SetFrameSizeConverter(
195 unsigned width,
196 unsigned height,
197 PBoolean bScaleNotCrop
198 );
199
206 PBoolean SetColourFormatConverter(
207 const PString & colourFormat // New colour format for device.
208 );
209
210
211 protected:
212 raw1394handle_t handle;
213 PBoolean is_capturing;
214 PBoolean UseDMA;
215 nodeid_t * camera_nodes;
216 int numCameras;
217 dc1394_cameracapture camera;
218 int capturing_duration;
219 PString desiredColourFormat;
220 unsigned desiredFrameWidth;
221 unsigned desiredFrameHeight;
222 };
223
224
225 #endif // PTLIB_VIDEOIO1394DC_H
226
227
228 // End Of File ///////////////////////////////////////////////////////////////