PTLib  Version 2.18.8
 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  */
22 
23 
24 #ifndef PTLIB_VIDEOIO1394DC_H
25 #define PTLIB_VIDEOIO1394DC_H
26 
27 #ifdef __GNUC__
28 #pragma interface
29 #endif
30 
31 #include <libraw1394/raw1394.h>
32 #include <libdc1394/dc1394_control.h>
33 
38 {
40  public:
44 
48 
51  PBoolean Open(
52  const PString & deviceName,
53  PBoolean startImmediate = true
54  );
55 
58  PBoolean IsOpen();
59 
62  PBoolean Close();
63 
66  PBoolean Start();
67 
70  PBoolean Stop();
71 
75 
79 
85  PINDEX GetMaxFrameBytes();
86 
89  int GetBrightness();
90 
93  PBoolean SetBrightness(unsigned newBrightness);
94 
95 
98  int GetWhiteness();
99 
102  PBoolean SetWhiteness(unsigned newWhiteness);
103 
104 
107  int GetColour();
108 
111  PBoolean SetColour(unsigned newColour);
112 
113 
116  int GetContrast();
117 
120  PBoolean SetContrast(unsigned newContrast);
121 
122 
125  int GetHue();
126 
129  PBoolean SetHue(unsigned newHue);
130 
131 
134  PBoolean GetParameters (int *whiteness, int *brightness,
135  int *colour, int *contrast, int *hue);
136 
140  unsigned & minWidth,
141  unsigned & minHeight,
142  unsigned & maxWidth,
143  unsigned & maxHeight
144  ) ;
145 
146  void ClearMapping();
147 
148  int GetNumChannels();
150  int channelNumber
151  );
153  unsigned rate
154  );
156  VideoFormat videoFormat
157  );
159  unsigned width,
160  unsigned height
161  );
163  const PString & colourFormat // New colour format for device.
164  );
165 
166 
170 
177  unsigned width,
178  unsigned height,
179  PBoolean bScaleNotCrop
180  );
181 
189  const PString & colourFormat // New colour format for device.
190  );
191 
192 
193  protected:
194  virtual bool InternalGetFrameData(BYTE * buffer, PINDEX & bytesReturned, bool & keyFrame, bool wait);
195 
196  raw1394handle_t handle;
199  nodeid_t * camera_nodes;
201  dc1394_cameracapture camera;
206 };
207 
208 
209 #endif // PTLIB_VIDEOIO1394DC_H
210 
211 
212 // 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 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:204
int GetWhiteness()
Get the whiteness of the image.
PBoolean is_capturing
Definition: videoio1394dc.h:197
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:203
PINDEX GetMaxFrameBytes()
Get the maximum frame size in bytes.
int GetColour()
Get the colour of the image.
raw1394handle_t handle
Definition: videoio1394dc.h:196
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.
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:200
virtual bool InternalGetFrameData(BYTE *buffer, PINDEX &bytesReturned, bool &keyFrame, bool wait)
PBoolean SetHue(unsigned newHue)
Set hue of the image.
bool PBoolean
Definition: object.h:174
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:201
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.
This is a list collection class of PString objects.
Definition: pstring.h:2562
~PVideoInput1394DcDevice()
Close the video input device on destruction.
PBoolean TestAllFormats()
Try all known video formats &amp; see which ones are accepted by the video driver.
This class defines a video input device.
Definition: videoio.h:940
PBoolean UseDMA
Definition: videoio1394dc.h:198
This class defines a video input device that generates fictitous image data.
Definition: videoio1394dc.h:37
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:199
PBoolean GetFrameSizeLimits(unsigned &minWidth, unsigned &minHeight, unsigned &maxWidth, unsigned &maxHeight)
Get the minimum &amp; 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:205
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:202
PBoolean Stop()
Stop the video device I/O capture.
int GetBrightness()
Get the brightness of the image.