All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
videoio1394dc.h
Go to the documentation of this file.
/*
* videoio1394dc.h
*
* Copyright:
* Copyright (c) 2002 Ryutaroh Matsumoto <ryutaroh@rmatsumoto.org>
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
*
* Classes to support streaming video input from IEEE 1394 cameras.
* Detailed explanation can be found at src/ptlib/unix/video4dc1394.cxx
*
* $Revision: 24177 $
* $Author: rjongbloed $
* $Date: 2010-04-05 06:52:04 -0500 (Mon, 05 Apr 2010) $
*/
#ifndef PTLIB_VIDEOIO1394DC_H
#define PTLIB_VIDEOIO1394DC_H
#ifdef __GNUC__
#pragma interface
#endif
#include <libraw1394/raw1394.h>
#include <libdc1394/dc1394_control.h>
class PVideoInput1394DcDevice : public PVideoInputDevice
{
PCLASSINFO(PVideoInput1394DcDevice, PVideoInputDevice);
public:
PVideoInput1394DcDevice();
~PVideoInput1394DcDevice();
PBoolean Open(
const PString & deviceName,
PBoolean startImmediate = true
);
PBoolean IsOpen();
PBoolean Close();
PBoolean Start();
PBoolean Stop();
PBoolean IsCapturing();
static PStringList GetInputDeviceNames();
PINDEX GetMaxFrameBytes();
PBoolean GetFrameData(
BYTE * buffer,
PINDEX * bytesReturned = NULL
);
PBoolean GetFrameDataNoDelay(
BYTE * buffer,
PINDEX * bytesReturned = NULL
);
int GetBrightness();
PBoolean SetBrightness(unsigned newBrightness);
int GetWhiteness();
PBoolean SetWhiteness(unsigned newWhiteness);
int GetColour();
PBoolean SetColour(unsigned newColour);
int GetContrast();
PBoolean SetContrast(unsigned newContrast);
int GetHue();
PBoolean SetHue(unsigned newHue);
PBoolean GetParameters (int *whiteness, int *brightness,
int *colour, int *contrast, int *hue);
PBoolean GetFrameSizeLimits(
unsigned & minWidth,
unsigned & minHeight,
unsigned & maxWidth,
unsigned & maxHeight
) ;
void ClearMapping();
int GetNumChannels();
PBoolean SetChannel(
int channelNumber
);
PBoolean SetFrameRate(
unsigned rate
);
PBoolean SetVideoFormat(
VideoFormat videoFormat
);
PBoolean SetFrameSize(
unsigned width,
unsigned height
);
PBoolean SetColourFormat(
const PString & colourFormat // New colour format for device.
);
PBoolean TestAllFormats();
PBoolean SetFrameSizeConverter(
unsigned width,
unsigned height,
PBoolean bScaleNotCrop
);
PBoolean SetColourFormatConverter(
const PString & colourFormat // New colour format for device.
);
protected:
raw1394handle_t handle;
PBoolean is_capturing;
PBoolean UseDMA;
nodeid_t * camera_nodes;
int numCameras;
dc1394_cameracapture camera;
int capturing_duration;
PString desiredColourFormat;
unsigned desiredFrameWidth;
unsigned desiredFrameHeight;
};
#endif // PTLIB_VIDEOIO1394DC_H
// End Of File ///////////////////////////////////////////////////////////////
PVideoInput1394DcDevice::SetFrameSize
PBoolean SetFrameSize(unsigned width, unsigned height)
Set the frame size to be used.
PVideoInput1394DcDevice::SetWhiteness
PBoolean SetWhiteness(unsigned newWhiteness)
Set whiteness of the image.
PVideoDevice::channelNumber
int channelNumber
Definition: videoio.h:685
PVideoInput1394DcDevice::GetContrast
int GetContrast()
Get the contrast of the image.
PVideoInput1394DcDevice::GetInputDeviceNames
static PStringList GetInputDeviceNames()
Get a list of all of the drivers available.
PVideoInput1394DcDevice::SetChannel
PBoolean SetChannel(int channelNumber)
Set the video channel to be used on the device.
PVideoInput1394DcDevice::desiredFrameWidth
unsigned desiredFrameWidth
Definition: videoio1394dc.h:220
PVideoInput1394DcDevice::GetWhiteness
int GetWhiteness()
Get the whiteness of the image.
PVideoInput1394DcDevice::is_capturing
PBoolean is_capturing
Definition: videoio1394dc.h:213
PVideoInput1394DcDevice::ClearMapping
void ClearMapping()
PVideoInput1394DcDevice::IsOpen
PBoolean IsOpen()
Determine of the device is currently open.
PVideoInput1394DcDevice::Close
PBoolean Close()
Close the device.
PVideoInput1394DcDevice::IsCapturing
PBoolean IsCapturing()
Determine if the video device I/O capture is in progress.
PVideoInput1394DcDevice::desiredColourFormat
PString desiredColourFormat
Definition: videoio1394dc.h:219
PVideoFrameInfo::colourFormat
PString colourFormat
Definition: videoio.h:255
PVideoInput1394DcDevice::GetMaxFrameBytes
PINDEX GetMaxFrameBytes()
Get the maximum frame size in bytes.
PVideoInput1394DcDevice::GetColour
int GetColour()
Get the colour of the image.
PVideoInput1394DcDevice::handle
raw1394handle_t handle
Definition: videoio1394dc.h:212
PVideoInput1394DcDevice::SetFrameRate
PBoolean SetFrameRate(unsigned rate)
Set the video frame rate to be used on the device.
PVideoInput1394DcDevice::SetVideoFormat
PBoolean SetVideoFormat(VideoFormat videoFormat)
Set the video format to be used.
PVideoInput1394DcDevice::SetContrast
PBoolean SetContrast(unsigned newContrast)
Set contrast of the image.
PVideoDevice::VideoFormat
VideoFormat
Definition: videoio.h:382
PBoolean
BOOL PBoolean
Definition: object.h:102
PVideoInput1394DcDevice::GetFrameData
PBoolean GetFrameData(BYTE *buffer, PINDEX *bytesReturned=NULL)
Grab a frame, after a delay as specified by the frame rate.
PVideoInput1394DcDevice::SetBrightness
PBoolean SetBrightness(unsigned newBrightness)
Set brightness of the image.
PVideoInput1394DcDevice::GetHue
int GetHue()
Get the hue of the image.
PVideoInput1394DcDevice::SetColour
PBoolean SetColour(unsigned newColour)
Set colour of the image.
PVideoInput1394DcDevice::numCameras
int numCameras
Definition: videoio1394dc.h:216
PVideoInput1394DcDevice::SetHue
PBoolean SetHue(unsigned newHue)
Set hue of the image.
PVideoDevice::deviceName
PString deviceName
Definition: videoio.h:682
PString
The character string class.
Definition: pstring.h:108
PVideoInput1394DcDevice::SetColourFormat
PBoolean SetColourFormat(const PString &colourFormat)
Set the colour format to be used.
PVideoInput1394DcDevice::PVideoInput1394DcDevice
PVideoInput1394DcDevice()
Create a new video input device.
PVideoInput1394DcDevice::camera
dc1394_cameracapture camera
Definition: videoio1394dc.h:217
PVideoInput1394DcDevice::GetNumChannels
int GetNumChannels()
Get the number of video channels available on the device.
PVideoInput1394DcDevice::SetColourFormatConverter
PBoolean SetColourFormatConverter(const PString &colourFormat)
Set the colour format to be used, trying converters if available.
PVideoDevice::videoFormat
VideoFormat videoFormat
Definition: videoio.h:684
PStringList
This is a list collection class of PString objects.
Definition: pstring.h:2184
PVideoInput1394DcDevice::~PVideoInput1394DcDevice
~PVideoInput1394DcDevice()
Close the video input device on destruction.
PVideoInput1394DcDevice::TestAllFormats
PBoolean TestAllFormats()
Try all known video formats & see which ones are accepted by the video driver.
PVideoInputDevice
This class defines a video input device.
Definition: videoio.h:962
PVideoInput1394DcDevice::UseDMA
PBoolean UseDMA
Definition: videoio1394dc.h:214
PVideoInput1394DcDevice
This class defines a video input device that generates fictitous image data.
Definition: videoio1394dc.h:40
PVideoInput1394DcDevice::SetFrameSizeConverter
PBoolean SetFrameSizeConverter(unsigned width, unsigned height, PBoolean bScaleNotCrop)
Set the frame size to be used, trying converters if available.
PVideoInput1394DcDevice::Start
PBoolean Start()
Start the video device I/O.
PVideoInput1394DcDevice::camera_nodes
nodeid_t * camera_nodes
Definition: videoio1394dc.h:215
PVideoInput1394DcDevice::GetFrameSizeLimits
PBoolean GetFrameSizeLimits(unsigned &minWidth, unsigned &minHeight, unsigned &maxWidth, unsigned &maxHeight)
Get the minimum & maximum size of a frame on the device.
PVideoInput1394DcDevice::Open
PBoolean Open(const PString &deviceName, PBoolean startImmediate=true)
Open the device given the device name.
PVideoInput1394DcDevice::desiredFrameHeight
unsigned desiredFrameHeight
Definition: videoio1394dc.h:221
PVideoInput1394DcDevice::GetFrameDataNoDelay
PBoolean GetFrameDataNoDelay(BYTE *buffer, PINDEX *bytesReturned=NULL)
Grab a frame.
PVideoInput1394DcDevice::GetParameters
PBoolean GetParameters(int *whiteness, int *brightness, int *colour, int *contrast, int *hue)
Return whiteness, brightness, colour, contrast and hue in one call.
PVideoInput1394DcDevice::capturing_duration
int capturing_duration
Definition: videoio1394dc.h:218
PVideoInput1394DcDevice::Stop
PBoolean Stop()
Stop the video device I/O capture.
PVideoInput1394DcDevice::GetBrightness
int GetBrightness()
Get the brightness of the image.