Main Page | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages | Examples

vetDirectXInput Class Reference

Inheritance diagram for vetDirectXInput:

vetInput

Public Member Functions

 vetDirectXInput (int device=-1)
 Default costructor, initialize variables and connect to device if requested.
 vetDirectXInput (int device, float fps)
 ~vetDirectXInput ()
 Default destructor, release objects and buffers and destroy the imVideoCapture object.
void enumerateDevices (void)
 Read (update) windows' connected device list.
int getDeviceCount (void)
 Return current device count, call enumerateDevices(void) first.
const char * getDeviceDescription (int device)
 Returns the device description. Returns NULL in the last device.
int getCurrentDevice ()
 Get current device id.
VETRESULT setDevice (int device)
 Set current device.
VETRESULT openPropertyPage (void *HWND_Owner)
VETRESULT connectTo (int device)
 Connect to device.
VETRESULT connect (void)
 Connect to current device.
VETRESULT disconnect (void)
 Disconnect from current capture device.
VETRESULT doStopLive ()
 Stop stream media control.
VETRESULT doStartLive ()
 Start stream media control.
bool isLive ()
 Return current media control state.
unsigned int getWidth () const
 Get current canvas' width.
unsigned int getHeight () const
 Get current canvas' height.
VETRESULT setImageSize (int width, int height)
 Set capture stream size.
void getImageSize (int *width, int *height)
 Read current image size and store to passed arguments.
int getFormat ()
 Read current format's id.
VETRESULT setFormat (int format)
 Set current format's id.
VETRESULT getFormat (int format, int *width, int *height, char *desc)
 Read format's informations.
int getFormatCount ()
 Read support format's count.
bool EoF ()
 Get the state of current data source.
VETRESULT reset ()
 Disconnect and reset the module.
VETRESULT extractTo (vetFrameYUV420 &img)
 Grab a frame and copy to VETLib standard format.
VETRESULT extractTo (vetFrameRGB24 &img)
 Grab a frame and copy to VETLib standard format.
VETRESULT extractTo (vetFrameT< unsigned char > &img)
 Grab a frame and copy to VETLib standard format.

Protected Member Functions

int vetCheckVideoPort (vetDXCapture *vdx)
int initCaptureGraphBuilder (vetDXCapture *vdx)
int vetUpdateFormatList (vetDXCapture *vdx)
void doReleaseMixer (vetDXCapture *vdx)
 Disconnect filter graph and free objects.

Protected Attributes

vetDXCapturecCap
int deviceCount
 DirectX compatible device count.
char deviceDesc [VETDX_MAXDEVICES][160]
 DirectX compatible devices' description.
int height
int width

Detailed Description

Definition at line 62 of file vetDirectXInput.h.


Constructor & Destructor Documentation

vetDirectXInput::vetDirectXInput int  device = -1  ) 
 

Default costructor, initialize variables and connect to device if requested.

Parameters:
device device id: [0, getDeviceCount()[
fps frame rate value (0 = max possible)

Definition at line 608 of file vetDirectXInput.cpp.

References cCap, connectTo(), vetDXCapture::device, deviceCount, enumerateDevices(), INFO, and vetDXCapture::sample_callback.


Member Function Documentation

VETRESULT vetDirectXInput::connect void   ) 
 

Connect to current device.

Returns:
VET_ILLEGAL_USE if a device is already connected, VETRET_INTERNAL_ERR if any error occured, VETRET_OK else.
See also:
setDevice(int device);

Definition at line 751 of file vetDirectXInput.cpp.

References cCap, connectTo(), vetDXCapture::device, deviceCount, enumerateDevices(), and VETRET_ILLEGAL_USE.

Referenced by setImageSize().

VETRESULT vetDirectXInput::connectTo int  device  ) 
 

Connect to device.

Returns:
VETRET_PARAMS_ERR if device is not valid, VET_ILLEGAL_USE if a device is already connected, VETRET_INTERNAL_ERR if any error occured, VETRET_OK else.

Definition at line 775 of file vetDirectXInput.cpp.

References vetDXCapture::camera_prop, vetDXCapture::capture_filter, vetDXCapture::capture_graph_builder, cCap, vetDXCapture::device, disconnect(), vetDXCapture::filter_builder, getImageSize(), vetDXCapture::grabber_filter, height, initCaptureGraphBuilder(), vetDXCapture::live, vetDXCapture::null_filter, SafeRelease, vetDXCapture::sample_callback, vetDXCapture::sample_grabber, setDevice(), imTrackingGrabberCB::SetImageSize(), vetCheckVideoPort(), vetConnectFilters(), vetGetDevice(), VETRET_INTERNAL_ERR, VETRET_OK, VETRET_PARAM_ERR, vetUpdateFormatList(), vetDXCapture::video_prop, vetDXCapture::videoctrl_prop, and width.

Referenced by connect(), and vetDirectXInput().

VETRESULT vetDirectXInput::disconnect void   ) 
 

Disconnect from current capture device.

Returns:
VETRET_ILLEGAL_USE if no device is connected, VETRET_OK else.

Definition at line 844 of file vetDirectXInput.cpp.

References vetDXCapture::camera_prop, vetDXCapture::capture_filter, cCap, vetDXCapture::device, doReleaseMixer(), doStopLive(), vetDXCapture::filter_builder, vetDXCapture::grabber_filter, height, vetDXCapture::live, vetDXCapture::null_filter, vetDXCapture::overlay_mixer, SafeRelease, vetDXCapture::sample_grabber, vetDisconnectFilterPin(), vetDisconnectFilters(), vetNukeDownstream(), VETRET_ILLEGAL_USE, VETRET_INTERNAL_ERR, VETRET_OK, vetDXCapture::video_prop, vetDXCapture::videoctrl_prop, and width.

Referenced by connectTo(), reset(), setFormat(), setImageSize(), and ~vetDirectXInput().

void vetDirectXInput::doReleaseMixer vetDXCapture vdx  )  [protected]
 

Disconnect filter graph and free objects.

Parameters:
[in] vdx vetDXCapture object to release.

Definition at line 1483 of file vetDirectXInput.cpp.

References vetDXCapture::filter_builder, vetDXCapture::overlay_mixer, vetDXCapture::overlay_renderer, SafeRelease, vetDisconnectFilters(), and vetGetPin().

Referenced by disconnect().

VETRESULT vetDirectXInput::doStartLive  ) 
 

Start stream media control.

Returns:
VETRET_ILLEGAL_USE if stream is already playing, VETRET_INTERNAL_ERR if an error occured, VETRET_OK else.

Definition at line 1261 of file vetDirectXInput.cpp.

References cCap, vetDXCapture::live, vetDXCapture::media_control, VETRET_ILLEGAL_USE, VETRET_INTERNAL_ERR, and VETRET_OK.

Referenced by extractTo(), and setImageSize().

VETRESULT vetDirectXInput::doStopLive  ) 
 

Stop stream media control.

Returns:
VETRET_ILLEGAL_USE if stream is already stopped, VETRET_OK else.

Definition at line 1286 of file vetDirectXInput.cpp.

References cCap, vetDXCapture::live, vetDXCapture::media_control, VETRET_ILLEGAL_USE, and VETRET_OK.

Referenced by disconnect(), extractTo(), setFormat(), and setImageSize().

void vetDirectXInput::enumerateDevices void   ) 
 

Read (update) windows' connected device list.

See also:
getDeviceCount(void);

getDeviceDescription(int device);

Definition at line 1589 of file vetDirectXInput.cpp.

References CATEGORY_FLAG, deviceCount, and deviceDesc.

Referenced by connect(), getDeviceDescription(), setDevice(), and vetDirectXInput().

bool vetDirectXInput::EoF  )  [virtual]
 

Get the state of current data source.

Returns:
true is there are no more frames to load, false else.

Implements vetInput.

Definition at line 889 of file vetDirectXInput.cpp.

References getCurrentDevice(), and isLive().

VETRESULT vetDirectXInput::extractTo vetFrameT< unsigned char > &  img  )  [virtual]
 

Grab a frame and copy to VETLib standard format.

Parameters:
[out] img Greyscale VETLib Frame to store data.
Returns:
VETRET_OK if everything is fine, VETRET_INTERNAL_ERR if any device reading error occurs, VETRET_NOT_IMPLEMENTED if color format is not support.
Note:
Ouput operator (>>) call directly this function.
See also:
operator >> (vetFrameT&)

Implements vetInput.

Definition at line 1388 of file vetDirectXInput.cpp.

References INFO, VETRET_NOT_IMPLEMENTED, and VETRET_PARAM_ERR.

VETRESULT vetDirectXInput::extractTo vetFrameRGB24 img  )  [virtual]
 

Grab a frame and copy to VETLib standard format.

Parameters:
[out] img VETLib Cache24 Frame to store data.
Returns:
VETRET_OK if everything is fine, VETRET_INTERNAL_ERR if any device reading error occurs, VETRET_NOT_IMPLEMENTED if color format is not support.
Note:
Ouput operator (>>) call directly this function.
See also:
operator >> (vetFrameRGB24&)

Implements vetInput.

Definition at line 1342 of file vetDirectXInput.cpp.

References cCap, vetFrameRGB24::data, doStartLive(), doStopLive(), imTrackingGrabberCB::GetImage(), vetFrame::height, height, INFO, vetDXCapture::sample_callback, vetDXCapture::sample_grabber, VETRET_INTERNAL_ERR, VETRET_PARAM_ERR, vetFrame::width, and width.

VETRESULT vetDirectXInput::extractTo vetFrameYUV420 img  )  [virtual]
 

Grab a frame and copy to VETLib standard format.

Parameters:
[out] img VETLib Cache Frame to store data.
Returns:
VETRET_OK if everything is fine, VETRET_INTERNAL_ERR if any device reading error occurs, VETRET_NOT_IMPLEMENTED if color format is not support.
Note:
Ouput operator (>>) call directly this function.
See also:
operator >> (vetFrameYUV420&)

Implements vetInput.

Definition at line 1321 of file vetDirectXInput.cpp.

References INFO, and VETRET_NOT_IMPLEMENTED.

int vetDirectXInput::getCurrentDevice  ) 
 

Get current device id.

Returns:
current device id, if disconnected return -1
See also:
enumerateDevices(void);

getDeviceCount(void);

Definition at line 1226 of file vetDirectXInput.cpp.

References cCap, and vetDXCapture::device.

Referenced by EoF().

int vetDirectXInput::getDeviceCount void   )  [inline]
 

Return current device count, call enumerateDevices(void) first.

See also:
enumerateDevices(void);

Definition at line 135 of file vetDirectXInput.h.

References deviceCount.

const char * vetDirectXInput::getDeviceDescription int  device  ) 
 

Returns the device description. Returns NULL in the last device.

See also:
enumerateDevices(void);

getDeviceCount(void);

Definition at line 1651 of file vetDirectXInput.cpp.

References deviceCount, deviceDesc, and enumerateDevices().

int vetDirectXInput::getFormat int  format,
int *  width,
int *  height,
char *  desc
 

Read format's informations.

Parameters:
[in] format's id
[out] width selected format's width
[out] height selected format's height
[out] desc selected format's description
Returns:
VETRET_PARAM_ERR if format id is not valid, VETRET_INTERNAL_ERR if an error occured, VETRET_OK else.

Definition at line 1121 of file vetDirectXInput.cpp.

References cCap, vetDXCapture::format_count, vetDXCapture::format_map, vetDeleteMediaType(), vetGetStreamConfig(), VETRET_INTERNAL_ERR, VETRET_OK, and VETRET_PARAM_ERR.

int vetDirectXInput::getFormat  ) 
 

Read current format's id.

Returns:
format's id

Definition at line 1246 of file vetDirectXInput.cpp.

References cCap, and vetDXCapture::format_current.

int vetDirectXInput::getFormatCount  ) 
 

Read support format's count.

Returns:
valid format's count

Definition at line 1236 of file vetDirectXInput.cpp.

References cCap, and vetDXCapture::format_count.

unsigned int vetDirectXInput::getHeight  )  const [inline, virtual]
 

Get current canvas' height.

Returns:
height in pixel.

Implements vetInput.

Definition at line 229 of file vetDirectXInput.h.

References height.

void vetDirectXInput::getImageSize int *  width,
int *  height
 

Read current image size and store to passed arguments.

Parameters:
[out] width image's width in pixel
[out] height image's height in pixel

Definition at line 984 of file vetDirectXInput.cpp.

References cCap, and vetDXCapture::sample_grabber.

Referenced by connectTo().

unsigned int vetDirectXInput::getWidth  )  const [inline, virtual]
 

Get current canvas' width.

Returns:
width in pixel.

Implements vetInput.

Definition at line 222 of file vetDirectXInput.h.

References width.

bool vetDirectXInput::isLive  ) 
 

Return current media control state.

Returns:
true is stream is playing live.

Definition at line 1212 of file vetDirectXInput.cpp.

References cCap, and vetDXCapture::live.

Referenced by EoF().

VETRESULT vetDirectXInput::reset  )  [virtual]
 

Disconnect and reset the module.

Returns:
VETRET_INTERNAL_ERR if any error occur, VETRET_OK else.

Implements vetInput.

Definition at line 903 of file vetDirectXInput.cpp.

References disconnect().

VETRESULT vetDirectXInput::setDevice int  device  ) 
 

Set current device.

Parameters:
[in] device device id: [0, getDeviceCount()[
Returns:
VETRET_ILLEGAL_USE if stream is playing, VETRET_PARAM_ERR if device id is not valid, VETRET_OK else.

Definition at line 953 of file vetDirectXInput.cpp.

References cCap, vetDXCapture::device, deviceCount, enumerateDevices(), vetDXCapture::live, VETRET_ILLEGAL_USE, VETRET_OK, and VETRET_PARAM_ERR.

Referenced by connectTo().

VETRESULT vetDirectXInput::setFormat int  format  ) 
 

Set current format's id.

Parameters:
[in] format format's id
Returns:
VETRET_PARAM_ERR if format id is not valid, VETRET_INTERNAL_ERR if an error occured, VETRET_OK else.

Definition at line 1159 of file vetDirectXInput.cpp.

References cCap, disconnect(), doStopLive(), vetDXCapture::format_count, vetDXCapture::format_current, vetDXCapture::format_map, vetDXCapture::sample_callback, imTrackingGrabberCB::SetImageSize(), vetDeleteMediaType(), vetGetStreamConfig(), VETRET_INTERNAL_ERR, VETRET_OK, and VETRET_PARAM_ERR.

VETRESULT vetDirectXInput::setImageSize int  width,
int  height
 

Set capture stream size.

Returns:
VETRET_INTERNAL_ERR if any error occured, VETRET_OK else.

Definition at line 1017 of file vetDirectXInput.cpp.

References cCap, connect(), disconnect(), doStartLive(), doStopLive(), vetDXCapture::live, vetDXCapture::sample_callback, imTrackingGrabberCB::SetImageSize(), vetDeleteMediaType(), vetGetStreamConfig(), VETRET_INTERNAL_ERR, and VETRET_OK.


The documentation for this class was generated from the following files:
Generated on Tue Jan 24 11:59:29 2006 for VETLib by  doxygen 1.4.4