PTLib  Version 2.10.10
 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 06:52:04 -0500 (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 
41 {
43  public:
47 
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 
78 
82 
88  PINDEX GetMaxFrameBytes();
89 
93  BYTE * buffer,
94  PINDEX * bytesReturned = NULL
95  );
96 
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 
158  unsigned & minWidth,
159  unsigned & minHeight,
160  unsigned & maxWidth,
161  unsigned & maxHeight
162  ) ;
163 
164  void ClearMapping();
165 
166  int GetNumChannels();
168  int channelNumber
169  );
171  unsigned rate
172  );
175  );
177  unsigned width,
178  unsigned height
179  );
181  const PString & colourFormat // New colour format for device.
182  );
183 
184 
188 
195  unsigned width,
196  unsigned height,
197  PBoolean bScaleNotCrop
198  );
199 
207  const PString & colourFormat // New colour format for device.
208  );
209 
210 
211  protected:
212  raw1394handle_t handle;
215  nodeid_t * camera_nodes;
217  dc1394_cameracapture camera;
222 };
223 
224 
225 #endif // PTLIB_VIDEOIO1394DC_H
226 
227 
228 // End Of File ///////////////////////////////////////////////////////////////
PBoolean SetFrameSize(unsigned width, unsigned height)
Set the frame size to be used.
PBoolean SetWhiteness(unsigned newWhiteness)
Set whiteness of the image.
int channelNumber
Definition: videoio.h:685
int GetContrast()
Get the contrast of the image.
static PStringList GetInputDeviceNames()
Get a list of all of the drivers available.
PBoolean SetChannel(int channelNumber)
Set the video channel to be used on the device.
unsigned desiredFrameWidth
Definition: videoio1394dc.h:220
int GetWhiteness()
Get the whiteness of the image.
PBoolean is_capturing
Definition: videoio1394dc.h:213
PBoolean IsOpen()
Determine of the device is currently open.
PBoolean Close()
Close the device.
PBoolean IsCapturing()
Determine if the video device I/O capture is in progress.
PString desiredColourFormat
Definition: videoio1394dc.h:219
PString colourFormat
Definition: videoio.h:255
PINDEX GetMaxFrameBytes()
Get the maximum frame size in bytes.
int GetColour()
Get the colour of the image.
raw1394handle_t handle
Definition: videoio1394dc.h:212
PBoolean SetFrameRate(unsigned rate)
Set the video frame rate to be used on the device.
PBoolean SetVideoFormat(VideoFormat videoFormat)
Set the video format to be used.
PBoolean SetContrast(unsigned newContrast)
Set contrast of the image.
VideoFormat
Definition: videoio.h:382
BOOL PBoolean
Definition: object.h:102
PBoolean GetFrameData(BYTE *buffer, PINDEX *bytesReturned=NULL)
Grab a frame, after a delay as specified by the frame rate.
PBoolean SetBrightness(unsigned newBrightness)
Set brightness of the image.
int GetHue()
Get the hue of the image.
PBoolean SetColour(unsigned newColour)
Set colour of the image.
int numCameras
Definition: videoio1394dc.h:216
PBoolean SetHue(unsigned newHue)
Set hue of the image.
PString deviceName
Definition: videoio.h:682
The character string class.
Definition: pstring.h:108
PBoolean SetColourFormat(const PString &colourFormat)
Set the colour format to be used.
PVideoInput1394DcDevice()
Create a new video input device.
dc1394_cameracapture camera
Definition: videoio1394dc.h:217
int GetNumChannels()
Get the number of video channels available on the device.
PBoolean SetColourFormatConverter(const PString &colourFormat)
Set the colour format to be used, trying converters if available.
VideoFormat videoFormat
Definition: videoio.h:684
This is a list collection class of PString objects.
Definition: pstring.h:2184
~PVideoInput1394DcDevice()
Close the video input device on destruction.
PBoolean TestAllFormats()
Try all known video formats & see which ones are accepted by the video driver.
This class defines a video input device.
Definition: videoio.h:962
PBoolean UseDMA
Definition: videoio1394dc.h:214
This class defines a video input device that generates fictitous image data.
Definition: videoio1394dc.h:40
PBoolean SetFrameSizeConverter(unsigned width, unsigned height, PBoolean bScaleNotCrop)
Set the frame size to be used, trying converters if available.
PBoolean Start()
Start the video device I/O.
nodeid_t * camera_nodes
Definition: videoio1394dc.h:215
PBoolean GetFrameSizeLimits(unsigned &minWidth, unsigned &minHeight, unsigned &maxWidth, unsigned &maxHeight)
Get the minimum & maximum size of a frame on the device.
PBoolean Open(const PString &deviceName, PBoolean startImmediate=true)
Open the device given the device name.
unsigned desiredFrameHeight
Definition: videoio1394dc.h:221
PBoolean GetFrameDataNoDelay(BYTE *buffer, PINDEX *bytesReturned=NULL)
Grab a frame.
PBoolean GetParameters(int *whiteness, int *brightness, int *colour, int *contrast, int *hue)
Return whiteness, brightness, colour, contrast and hue in one call.
int capturing_duration
Definition: videoio1394dc.h:218
PBoolean Stop()
Stop the video device I/O capture.
int GetBrightness()
Get the brightness of the image.