MFSM || Philips webcam input module
Alexandre R.J. François
Module version: 0.2
FSF code version: 0.8
ARJF © 2005-2007
contents
Description
Reference guide
Index
The PWC Input module regroups components for live video input from Philips
webcams (using the PWC driver).
The module implements the push version of the interface i/o model: an
interface node communicates with the dice, which triggers the creation of
pulses that are put on the active stream via an input cell.
Images are captured in YUV 4:2:0 Planar format and converted to 24 bits
Yuv or RGB.
PwcInput module elements are defined in the pwc
namespace. This section lists all the elements defined in the module, in
alphabetical order.
CCloseDevice (fsf::CCell) "PWC_CLOSE_DEVICE"
| Active filter | [FSF_ACTIVE_FILTER "Root"] |
| Passive filter | [PWC_INTERFACE "Pwc input interface"] |
| Output | (x (FSF_BOOL_NODE "Status")) |
Close device action cell: deactivate interface and close device.
Member functions
Constructors, destructor and other functions that are part of any derived cell class
- CCloseDevice() : default constructor
- virtual void GetTypeID(std::string &str) : factory mapping key; must be overloaded in any derived cell
Active stream processing
- virtual void Process(fsf::CPassiveHandle *pPassiveHandle, fsf::CActiveHandle *pActiveHandle, fsf::CActivePulse *pActivePulse): specialized processing function
CInput (fsf::CCell) "PWC_INPUT"
| Active filter | [FSF_ACTIVE_FILTER "Root"] |
| Passive filter | [FSF_PASSIVE_PULSE "Root"] |
| Output | (x (IMAGE_IMAGE "Input"+interface name)) |
Input cell. Passive element: all actions are triggered by the interface. The output name is the concatenation fo the cell's output name and the name of the interface node that pushed the frame. This allows to distinguish between frames generated by multiple interface nodes.
Member functions
Constructors, destructor and other functions that are part of any derived cell class
- CInput() : default constructor
- virtual void GetTypeID(std::string &str) : factory mapping key; must be overloaded in any derived cell
Member functions
- void MakePulse(image::CImage *pFrame) : creates an active pulse containing the image node passed as parameter, and puts it on the stream
CInterface (fsf::CNode) "PWC_INTERFACE"
Interface node. Communicates with the device and generates the stream of frames through an input cell.
Data members
- fsf::CMutex m_csInterface : mutex for interface access
- bool m_bCapture : capture flag
- int m_nDevice : device handle
- struct video_mbuf m_mbuf : buffer info structure
- struct video_mmap m_mmap : map info structure
- char *m_pData : pointer to mapped memory
- long m_nOutputFormat : format (color model) of output images
- CInput *m_pCell : pointer to input cell
- pthread_t m_thread : interface activity thread
Member functions
Constructors, destructor and other functions that are part of any derived node class
- CInterface() : default constructor
- CInterface(CNode *pParent, fsf::Time tTime=0) : initialization constructor
- CInterface(const std::string &strName, CNode *pParent=NULL, fsf::Time tTime=0) : initialization constructor
- CInterface(const CInterface&) : copy constructor
- CInterface& operator=(const CInterface&) : assignment operator
- virtual CNode* Clone() : virtual cloning member function (necessary for run-time polymorphism)
- virtual void GetTypeID(std::string &str) : factory mapping key
Member functions
- static inline unsigned char clip(int x) : private static utility member used in conversion from YUV 4:2:0 to RGB
- bool Close() : deactivate interface and close device
- static void* InterfaceThreadProc(void* pParam) : static function for interface thread
- bool Open(std::string &strDevice, unsigned long nFrameRate=15, unsigned long nWidth=320, unsigned long nHeight=240, long nOutputFormat) : initialize device with passed parameters and activate interface
- void SetInputCell(CInput *pCell) : set pointer to input cell
- void StartInterfaceThread() : start interface thread
CloseDevice(fsf::CSource *pCaptureSource, std::string &strInterfaceName)
Utility scripting functions for CCloseDevice action cell.
COpenDevice (fsf::CCell) "PWC_OPEN_DEVICE"
| Active filter | [FSF_ACTIVE_FILTER "Root"
[FSF_STRING_NODE "Device" OPEN_DEVICE]
[FSF_INT32_NODE "Frame rate" OPEN_FRAME_RATE]*
[FSF_INT32_NODE "Width" OPEN_WIDTH]*
[FSF_INT32_NODE "Height" OPEN_HEIGHT]*
[FSF_INT32_NODE "Output format" OPEN_OUTPUT_FORMAT]*
] |
| Passive filter | [PWC_INTERFACE "Pwc input interface"] |
| Output | (x (FSF_BOOL_NODE "Status")) |
Open device action cell: initialize device with passed parameters and activate interface
Member functions
Constructors, destructor and other functions that are part of any derived cell class
- COpenDevice() : default constructor
- virtual void GetTypeID(std::string &str) : factory mapping key; must be overloaded in any derived cell
Active stream processing
- virtual void Process(fsf::CPassiveHandle *pPassiveHandle, fsf::CActiveHandle *pActiveHandle, fsf::CActivePulse *pActivePulse): specialized processing function
OpenDevice(fsf::CSource *pCaptureSource, std::string &strInterfaceName, std::string &strDevice, unsigned long nFrameRate, unsigned long nWidth, unsigned long nHeight)
Utility scripting functions for COpenDevice action cell.
Registers the factories for the nodes and cells defined in the module, with the unique system instance.
C
O
R