Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

L1394::Device Class Reference

#include <l1394_device.h>

Inheritance diagram for L1394::Device:

L1394::Camera L1394::Vcr L1394::AvcCamera L1394::DccCamera L1394::AvcVcr List of all members.

Public Member Functions

Device constructor
These functions creates the Device objects.

 Device (Node *parent_node)
virtual ~Device ()
Event handling
These methods provide access to the event handling mechanism in this library.

virtual void addEventHandle (L1394::EventHandle *, const EVENT event)
virtual void addEventHandle (L1394::EventHandle *)
 This method adds an EventHandle, to all events of a node.
virtual void removeEventHandle (L1394::EventHandle *, const EVENT event)
virtual void removeEventHandle (L1394::EventHandle *handle)
 This method removes an EventHandle from any event.
Device information
These methods provide specific device information.

void setName (const string &name)
const string & getName () const
virtual u_int getFrameSize () const
 This method returns the frame size.
virtual u_int getFrameWidth () const
 This method returns the frame size. (obsolete).
virtual u_int getFrameHeight () const
 This method returns the width of a frame.
virtual const NodegetParentNode () const
 This method returns the parent node.
virtual DeviceType getDeviceType () const =0
 This abstract method must be implemented by all devices.
virtual bool hasVideoFormat (const Videomode videomode)=0
 This method tests, if a videomode is supported by a Camera.
virtual bool hasFramerate (const Videomode videomode, const Framerate framerate)=0
 This method tests, if a framerate, with a videomode is supported by the camera.
Basic operations
Every device must implement these basic functions.

virtual FramegetFrame ()
 This method returns the actual frame of a camera.
virtual void releaseFrame (Frame *frame)
 This method releases a frame.
virtual void setFrameMode (const bool frame_mode)
 This method enables or disables the autorelease mode for frames.
virtual bool getFrameMode () const
 This method returns the framemode.
virtual int setParameter (const int buffercount, const int channel, const Isomode isomode, const Videomode videomode, const Framerate framerate)=0
 This method sets the device-specific parameter for iso-receive.
virtual void flushIsoQueue ()
virtual bool isSending () const
 This method reports if a camera is sending or not.
virtual int init ()
 This method allocates ressoures for isochronous transmission.
virtual int start ()=0
 This method starts a FireWire device and iso-receive.
virtual int stop ()=0
 This method stops a sending device and the Iso-receive.

Protected Member Functions

void setFrameSize (const int frame_size)
void setFrameWidth (const int frame_width)
void setFrameHeight (const int frame_height)
void setSending (const bool is_sending)

Constructor & Destructor Documentation

L1394::Device::Device Node parent_node  ) 
 

Definition at line 21 of file l1394_device.cpp.

virtual L1394::Device::~Device  )  [inline, virtual]
 

Destructor

Definition at line 117 of file l1394_device.h.


Member Function Documentation

L1394::Device::addEventHandle L1394::EventHandle event_handle  )  [virtual]
 

This method adds an EventHandle, to all events of a node.

Parameters:
event_handle : pointer to the EventHandle object.

Definition at line 31 of file l1394_device.cpp.

void L1394::Device::addEventHandle L1394::EventHandle ,
const EVENT  event
[virtual]
 

Definition at line 26 of file l1394_device.cpp.

void L1394::Device::flushIsoQueue  )  [virtual]
 

Definition at line 65 of file l1394_device.cpp.

L1394::Device::getDeviceType  )  const [pure virtual]
 

This abstract method must be implemented by all devices.

This method is normaly for internal use. You can use it for save down_casting. The following types are defined:

return int : type of the device.

Implemented in L1394::Camera, and L1394::Vcr.

Referenced by L1394::FcpNode::findSubunit().

L1394::Device::getFrame  )  [virtual]
 

This method returns the actual frame of a camera.

At this time this method blocks until it gets a frame.

Returns:
u_char* : pointer to the actual frame.

Reimplemented in L1394::DccCamera.

Definition at line 46 of file l1394_device.cpp.

References L1394::Singleton< T, CreationPolicy, LifetimePolicy, ThreadingModel >::getInstance().

L1394::Device::getFrameHeight  )  const [inline, virtual]
 

This method returns the width of a frame.

Devices supporting more than one resolution provides normaly an init method. Before you call init, this method returns the default setting of the device.

Returns:
u_int : size of a frame in bytes.

Definition at line 197 of file l1394_device.h.

L1394::Device::getFrameMode  )  const [virtual]
 

This method returns the framemode.

Returns:
bool : true if the autorelease mode is enabled else false

Definition at line 78 of file l1394_device.cpp.

References L1394::Singleton< T, CreationPolicy, LifetimePolicy, ThreadingModel >::getInstance().

L1394::Device::getFrameSize  )  const [inline, virtual]
 

This method returns the frame size.

Returns:
u_int : returns the frame size

Definition at line 174 of file l1394_device.h.

Referenced by L1394::DccCamera::init().

L1394::Device::getFrameWidth  )  const [inline, virtual]
 

This method returns the frame size. (obsolete).

Devices supporting more than one resolution, provides normaly an init method. Before you call init, this method returns the default settings of the device.

Returns:
u_int : size of a frame in bytes.

Definition at line 186 of file l1394_device.h.

const string& L1394::Device::getName  )  const [inline]
 

returns the device name

Definition at line 168 of file l1394_device.h.

L1394::Device::getParentNode  )  const [inline, virtual]
 

This method returns the parent node.

Returns:
Node* : pointer to the parent node.

Definition at line 205 of file l1394_device.h.

Referenced by L1394::AvcVcr::setParameter(), L1394::AvcCamera::setParameter(), L1394::AvcVcr::start(), L1394::AvcCamera::start(), L1394::AvcVcr::stop(), and L1394::AvcCamera::stop().

L1394::Device::hasFramerate const Videomode  videomode,
const Framerate  framerate
[pure virtual]
 

This method tests, if a framerate, with a videomode is supported by the camera.

Parameters:
videomode : the videomode for the framerate.
framerate : the framerate that should be tested.
Returns:
bool : true, if a framerate is supported, false if not

Implemented in L1394::AvcCamera, L1394::AvcVcr, and L1394::DccCamera.

Referenced by main().

L1394::Device::hasVideoFormat const Videomode  videomode  )  [pure virtual]
 

This method tests, if a videomode is supported by a Camera.

Returns:
bool : true if the videomode is supported, false if not

Implemented in L1394::AvcCamera, L1394::AvcVcr, and L1394::DccCamera.

L1394::Device::init  )  [inline, virtual]
 

This method allocates ressoures for isochronous transmission.

If you write your own device you can use this method to allocate iso- resources.

Returns:
int : L1394_SUCCESS if allocating success, else L1394_Failed.

Reimplemented in L1394::DccCamera.

Definition at line 313 of file l1394_device.h.

References L1394_SUCCESS.

Referenced by main().

L1394::Device::isSending  )  const [inline, virtual]
 

This method reports if a camera is sending or not.

Returns:
bool : true, if a camera is sending, false if not.

Definition at line 303 of file l1394_device.h.

Referenced by L1394::DccCamera::getFrame(), L1394::AvcCamera::start(), and L1394::AvcVcr::stop().

void L1394::Device::releaseFrame Frame frame  )  [virtual]
 

This method releases a frame.

You must only call this function, if the autorelease mode is disabled. See also frameMode() param frame : pointer to the frame.

Definition at line 57 of file l1394_device.cpp.

References L1394::Singleton< T, CreationPolicy, LifetimePolicy, ThreadingModel >::getInstance().

L1394::Device::removeEventHandle L1394::EventHandle event_handle  )  [virtual]
 

This method removes an EventHandle from any event.

If an EventHandle object is destroyed it must be removed from all Node objects

Parameters:
event_handle : pointer to the EventHandle object.

Definition at line 36 of file l1394_device.cpp.

void L1394::Device::removeEventHandle L1394::EventHandle ,
const EVENT  event
[virtual]
 

Definition at line 41 of file l1394_device.cpp.

Referenced by L1394_MM::Window::~Window().

void L1394::Device::setFrameHeight const int  frame_height  )  [inline, protected]
 

Definition at line 333 of file l1394_device.h.

Referenced by L1394::AvcCamera::AvcCamera(), L1394::AvcVcr::AvcVcr(), L1394::DccCamera::DccCamera(), and L1394::DccCamera::setVideoMode().

L1394::Device::setFrameMode const bool  mode  )  [virtual]
 

This method enables or disables the autorelease mode for frames.

By default the autorelease mode is enabled. So if you call the function getFrame() the last frame is released and the actual frame is returned You can disable the automode but you MUST call the method releaseFrame(u_char*) for every frame you get.

Parameters:
mode : true enables the automode, false disables the automode.

Definition at line 70 of file l1394_device.cpp.

References L1394::Singleton< T, CreationPolicy, LifetimePolicy, ThreadingModel >::getInstance().

void L1394::Device::setFrameSize const int  frame_size  )  [inline, protected]
 

Definition at line 331 of file l1394_device.h.

Referenced by L1394::DccCamera::DccCamera(), and L1394::DccCamera::setVideoMode().

void L1394::Device::setFrameWidth const int  frame_width  )  [inline, protected]
 

Definition at line 332 of file l1394_device.h.

Referenced by L1394::AvcCamera::AvcCamera(), L1394::AvcVcr::AvcVcr(), L1394::DccCamera::DccCamera(), and L1394::DccCamera::setVideoMode().

void L1394::Device::setName const string &  name  )  [inline]
 

assign a name with this device

Definition at line 164 of file l1394_device.h.

Referenced by L1394::AvcCamera::AvcCamera(), L1394::AvcVcr::AvcVcr(), and L1394::DccCamera::DccCamera().

L1394::Device::setParameter const int  buffercount,
const int  channel,
const Isomode  isomode,
const Videomode  videomode,
const Framerate  framerate
[pure virtual]
 

This method sets the device-specific parameter for iso-receive.

Some parameter are fixed for some devices (like DV-devices) and they take no effect, if you change it.

Parameters:
buffercount : set how many Frame buffer are reserved
isomode : set the isomode
channel : set the iso-channel. A value of -1 (or FREE_ISO_CHANNEL) searches for a for iso channel. Be carefull using this feature, because the used channel are stored in local member variables. So if you run more programms using this library at the same time, this feature can cause serious problems(if two devices uses the same iso-channel).
The current Iso-Master don't store the used channels (or the devices don't allocate a channel) so the register values for used channels are invalid.

Parameters:
videomode : set the video-mode
framerate : set the framerate

Implemented in L1394::AvcCamera, L1394::AvcVcr, and L1394::DccCamera.

Referenced by main().

void L1394::Device::setSending const bool  is_sending  )  [inline, protected]
 

Definition at line 334 of file l1394_device.h.

Referenced by L1394::DccCamera::start(), L1394::AvcVcr::start(), L1394::AvcCamera::start(), L1394::DccCamera::stop(), and L1394::AvcCamera::stop().

L1394::Device::start  )  [pure virtual]
 

This method starts a FireWire device and iso-receive.

Returns:
int : returns L1394_FAILED if an error occur, else L1394_SUCCESS

Implemented in L1394::AvcCamera, L1394::AvcVcr, and L1394::DccCamera.

Referenced by main().

L1394::Device::stop  )  [pure virtual]
 

This method stops a sending device and the Iso-receive.

Returns:
int : returns L1394_FAILED if an error occur, else L1394_SUCCESS

Implemented in L1394::AvcCamera, L1394::AvcVcr, and L1394::DccCamera.

Referenced by main().


The documentation for this class was generated from the following files:
Generated on Wed Aug 24 00:36:44 2005 for L1394 by doxygen 1.4.2
L1394 library (NMM) grahics.cs.uni-sb.de/~repplix/l1394_home/