AURobotServers  4
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
UFuncV4lGst Class Reference
Inheritance diagram for UFuncV4lGst:
Inheritance graph

Public Member Functions

void busCall (GstBus *bus, GstMessage *msg, gpointer data)
 
virtual void createResources ()
 
virtual bool handleCommand (UServerInMsg *msg, void *extra)
 
void run ()
 
 UFuncV4lGst ()
 
void useBuffer (GstElement *fakesink, GstBuffer *buffer, GstPad *pad)
 
virtual ~UFuncV4lGst ()
 
- Public Member Functions inherited from UFunctionCamBase
UImagegetImage (UServerInMsg *msg, void *extra)
 
virtual bool setResource (UResBase *ressource, bool remove)
 
 UFunctionCamBase ()
 
virtual ~UFunctionCamBase ()
 
- Public Member Functions inherited from UFunctionImgBase
virtual void setCmdHandler (UCmdExe *cmdExe)
 
void showImagesAsDefault (bool show)
 
 UFunctionImgBase ()
 
virtual ~UFunctionImgBase ()
 
- Public Member Functions inherited from UFunctionBase
bool addResource (UResBase *resource, UFunctionBase *owner)
 
void closeLogfile ()
 
virtual const char * commandList ()
 
const char * getAliasName ()
 
const char * getLoadedFileName ()
 
void * getLoadedModuleRef ()
 
virtual bool gotAllResources (char *missingThese, int missingTheseCnt)
 
bool isMine (const char *cmdName)
 
bool isStatic ()
 is the module loaded as static A module is static if the ldFilename has a length of zero. More...
 
virtual const char * name ()
 
bool newCmd (UServerInMsg *newMsg, UDataBase *extra)
 
bool newCommand (UServerInMsg *newMsg, void *extra)
 
bool openLogfile (const char *name)
 
void print (const char *preString)
 
virtual void resourceUpdated ()
 
bool sendEndTag (UServerInMsg *msg)
 
bool sendEndTag ()
 
bool sendFullTag (const char *attributes)
 
bool sendHelpDone (UServerInMsg *msg)
 
bool sendHelpDone ()
 
bool sendHelpStart (UServerInMsg *msg, const char *subject)
 
bool sendHelpStart (const char *subject)
 
bool sendHelpStart ()
 
bool sendMsg (UServerInMsg *msg, const char *message, int size)
 
bool sendMsg (const char *message)
 
bool sendMsg (UServerInMsg *msg, const char *message)
 
bool sendMsg (int clientIdx, const char *message, int size)
 
bool sendMsgInt (int clientIdx, const char *message)
 
bool sendStartTag (const char *attributes)
 
bool sendText (UServerInMsg *msg, const char *text)
 
bool sendText (const char *text)
 
virtual void setAliasName (const char *name)
 
virtual void setCommand (const char *cmdList, const char *name, const char *note)
 
void setLoadedModuleRef (void *module, const char *moduleFileName)
 
virtual void setLoadTime (UTime)
 
void setName (const char *name)
 
void setVerbose (bool value)
 
 UFunctionBase ()
 
virtual ~UFunctionBase ()
 
- Public Member Functions inherited from UCallBack
bool addOnEvent (UOnEvent *dataObject)
 
virtual bool onEvent (const char *interface, const char *dataType, void *data)
 
 UCallBack ()
 
virtual ~UCallBack ()
 
- Public Member Functions inherited from UResVarPool
int addMethod (const char *formalName, const char *paramTypes, const char *comment)
 
int addMethodV (const char *formalName, const char *paramTypes, const char *comment)
 
UVarPooladdStruct (const char *name, const char *comment, bool copy=false)
 
UVariableaddVar (const char *name, const double initialValue, const char *type, const char *comment)
 
UVariableaddVar (const char *name, const char *initialValue, const char *type, const char *comment)
 
UVariableaddVarA (const char *name, const char *initialValue, const char *type, const char *comment)
 
bool callGlobal (const char *name, const char *paramOrder, char **strings, const double *doubles, double *value, UDataBase **returnStruct, int *returnStructCnt)
 
bool callGlobalV (const char *name, const char *paramOrder, UVariable **params, UDataBase **returnStruct, int *returnStructCnt)
 Call a method from the root var pool scope It may be in the structure direct (no '.') or in any sub-structure that the 'name.subname' indicate. More...
 
bool callLocal (const char *name, const char *paramOrder, char **strings, const double *doubles, double *value, UDataBase **returnStruct, int *returnStructCnt)
 
bool callVS (const char *function, const char *stringParam)
 
int callVSCD (const char *function, const char *strPar, UDataBase *data, int cooSys)
 
void createBaseVar ()
 
virtual bool createVarSpace (const int varCnt, const int structCnt, const int methCnt, const char *note, bool copy=false)
 
bool getGlobalString (const char *name, const char **value)
 
bool getGlobalValue (const char *name, double *value)
 
bool getGlobalValue (const char *name, const char **value)
 
bool getGlobalValue (const char *name, bool *value)
 
bool getGlobalValue (const char *name, UTime *value)
 
bool getLocalValue (const char *name, double *value)
 get a value in this variable tree More...
 
bool getLocalValue (const char *name, bool *value)
 
bool getLocalValue (const char *name, UTime *value)
 
double getLocalValue (int idx)
 
UPosition getLocalValue3D (int idx)
 
UPosRot getLocalValue6D (int idx)
 
bool getLocalValueBool (int idx)
 
int getLocalValueInt (int idx)
 
UTime getLocalValueTime (int idx)
 
const char * getLogFileName ()
 
const char * getVarDescription (int idx)
 
UVarCalcgetVarPool ()
 
bool isLogFileOpen ()
 
bool isLogFileOpen (const char *structName)
 
bool isVarPoolUpdated (int lastCnt, int *newCnt)
 
void logFileClose ()
 
bool logFileOpen ()
 
void logFileStart (const char *structName, bool open)
 
virtual bool methodCall (const char *name, const char *paramOrder, char **strings, const double *doubles, double *value, UDataBase **returnStruct=NULL, int *returnStructCnt=NULL)
 
virtual const char * print (const char *preString, char *buff, int buffCnt)
 
bool setGlobalVar (const char *name, const double value, bool mayAdd)
 Assigns a value to a variable. The variable may be a part of a structure. More...
 
bool setLocalVar (int idx, double value, const int element)
 
bool setLocalVar (const char *name, const double value, bool mayAdd)
 Assigns a value to a variable. The variable may be a part of a structure. More...
 
bool setLocalVar3D (int idx, UPosition *value)
 
bool setLocalVar6D (int idx, UPosRot *value)
 
bool setLocalVarAdd (int idx, double value, const int element)
 
bool setLocalVarPose (int idx, UPose *value)
 
void setVarPool (UVarCalc *sharedVarPool)
 
int updateQTvars (int structIdx)
 
 UResVarPool ()
 
virtual ~UResVarPool ()
 
- Public Member Functions inherited from UResBase
void createReplayVar (UVarPool *pool)
 
UCmdExegetCorePointer ()
 
char * getLogFileName (char *fn, const int fnCnt)
 
int getResFuncIdx ()
 
const char * getResID ()
 
int getResVersion ()
 
bool isA (const char *idStr)
 
bool isAlsoA (const char *id)
 
virtual void saveSettings ()
 
void setCorePointer (UCmdExe *serverCore)
 
void setResFuncIdx (int idx)
 
virtual void setResID (const char *id, const int version)
 
virtual void updateReplayStatus ()
 
 UResBase ()
 
virtual ~UResBase ()
 
- Public Member Functions inherited from UReplay
void addChild (UReplay *child)
 
virtual bool decodeReplayLine (char *)
 
char * getLogFileName (char *fn, const int fnCnt)
 
char * getReplayFileName (char *fn, const int fnCnt)
 
int getReplayLogLine ()
 
bool isReplay ()
 
bool isReplayFileOpen ()
 
void removeChild (UReplay *child)
 
virtual void replayAdvanceTime (UTime untilTime)
 
void replaySetBaseFileName (const char *name, const char *preName="")
 
void replaySetFileName (const char *name)
 
virtual bool replayStep ()
 
int replayStep (int steps)
 
virtual bool replayToTime (UTime untilTime)
 
void setParent (UReplay *parent)
 
bool setReplay (bool value)
 
 UReplay ()
 
virtual ~UReplay ()
 
- Public Member Functions inherited from ULock
bool lock ()
 
void lockInit ()
 
void post ()
 
bool tryLock ()
 
bool tryWait ()
 
 ULock ()
 
void unlock ()
 
bool wait ()
 
 ~ULock ()
 
- Public Member Functions inherited from UVarMethodImplement
virtual bool methodCallV (const char *name, const char *paramOrder, UVariable *params[], UDataBase **returnStruct, int *returnStructCnt)
 
virtual ~UVarMethodImplement ()
 

Protected Member Functions

void createBaseVar ()
 
- Protected Member Functions inherited from UFunctionCamBase
UCamPushgetCam (int imgDevice, const char *posName)
 
UCamPushgetCam (int camDevNum)
 
bool getCamAndRawImage (UCamPush **cam, UImage **imgRaw, int *imgDevice, void *imgBase, const char *posName, int rectfiedImg)
 
int getDefaultCamDevice ()
 
- Protected Member Functions inherited from UFunctionImgBase
bool sendImage (UServerInMsg *msg, const char *tagName, UImage *imgRgb, int imgLeft=0, int imgTop=0, int imgWidth=640, int imgHeight=480, int imgSource=-1, bool isCodecBin=true, bool imgIsBW=false, bool imgGetNum=true, bool imgGetTod=true, bool imgGetTime=false, const char *posName=NULL, bool imgGetName=true, bool silent=false)
 
- Protected Member Functions inherited from UFunctionBase
int getCmdIndex ()
 
UResBasegetStaticResource (const char *resName, bool mayCreate, bool staticOnly=true)
 get a pointer to a static resource. More...
 
bool isClientAlive (int clientIdx, double holdOffTime)
 
bool sendDebug (UServerInMsg *msg, const char *debugText)
 
bool sendDebug (const char *debugText)
 
bool sendError (UServerInMsg *msg, const char *errorText)
 
bool sendError (const char *errorText)
 
bool sendHelp (UServerInMsg *msg, const char *infoText)
 
bool sendHelp (const char *infoText)
 
bool sendInfo (UServerInMsg *msg, const char *infoText)
 
bool sendInfo (const char *infoText)
 
bool sendWarning (UServerInMsg *msg, const char *warningText)
 
bool sendWarning (const char *warningText)
 
UResBasesetThisResource (const char *ID, UResBase *resource, bool remove, bool *changed, UResBase *currentResPtr, bool *isLocal)
 
- Protected Member Functions inherited from UResVarPool
void setDescription (const char *note, bool copy=false)
 
- Protected Member Functions inherited from UResBase
UResBasegetStaticResource (const char *resName, bool mayCreate, bool staticOnly=true)
 get a pointer to a static resource. More...
 

Private Member Functions

bool start ()
 
void stop (bool andWait)
 

Private Attributes

GMainContext * context
 main context got this plugin More...
 
GMainLoop * gloop
 streamer variables: More...
 
uint32_t imageNumber
 last image number More...
 
int imgSizeH
 size of source image in pixels More...
 
int imgSizeW
 size of source image in pixels More...
 
UImagepoolimg
 image pool buffer More...
 
pthread_t threadHandle
 
bool threadRunning
 is thread running - set by thread More...
 
bool threadStop
 is thread to stop - set by main function More...
 
UTime tPush
 timestamp More...
 
UVariablevarBusCnt
 streamer bus call count More...
 
UVariablevarBusErr
 streamer bus error message More...
 
UVariablevarCamNum
 camera index number More...
 
UVariablevarDevice
 device string variable More...
 
UVariablevarFormat
 video format string - limited support More...
 
UVariablevarFramerate
 camera framerate (num denom), used framerate (num, denom) More...
 
UVariablevarImgNum
 destination image number More...
 
UVariablevarSize
 Image size (height x width) More...
 
UVariablevarStream
 is port open More...
 

Additional Inherited Members

- Static Public Member Functions inherited from UResVarPool
static const char * getResClassID ()
 
- Public Attributes inherited from UFunctionBase
bool silent
 is reply to client and console to be limited More...
 
- Public Attributes inherited from UReplay
bool replayTimeAdvancePending
 
UTime replayTimeNow
 
- Static Public Attributes inherited from UFunctionBase
static const int MAX_ID_LENGTH = 30
 
static const int MAX_RESOURCE_LIST_SIZE = 250
 
- Protected Attributes inherited from UFunctionCamBase
UCamPoolcamPool
 
- Protected Attributes inherited from UFunctionImgBase
UImagePoolimgPool
 
- Protected Attributes inherited from UFunctionBase
char aliasName [MAX_ID_LENGTH]
 
UCmdExecmdHandler
 
char * cmdToks [20]
 
int cmdToksCnt
 
char commandsHandled [MAX_RESOURCE_LIST_SIZE]
 
UServerInMsgmsg
 
char pluginName [MAX_RESOURCE_LIST_SIZE]
 
bool verboseMessages
 
- Protected Attributes inherited from UResBase
int resFuncIdx
 
char resID [MAX_RESOURCE_ID_LENGTH]
 
char resIsAlso [MAX_RESOURCE_ISALSO_LENGTH]
 
int resVersion
 
- Protected Attributes inherited from UReplay
bool replay
 
FILE * replayFile
 
char replayFileName [REPLAY_FILE_NAME_LENGTH]
 replay filename More...
 
char replayLine [MAX_LOG_LINE_LENGTH]
 
int replayLogLine
 
UReplayreplayParent
 
UTime replayTimeNext
 
- Static Protected Attributes inherited from UReplay
static const int MAX_LOG_LINE_LENGTH = 10000
 
static const int REPLAY_FILE_NAME_LENGTH = 264
 max length of replay filename More...
 

Detailed Description

Experimental plugin to use gstreamer to import/export image series.

Constructor & Destructor Documentation

UFuncV4lGst::UFuncV4lGst ( )
inline
virtual UFuncV4lGst::~UFuncV4lGst ( )
inlinevirtual

Destructor - to delete the resource (etc) when finished

Member Function Documentation

void UFuncV4lGst::busCall ( GstBus *  bus,
GstMessage *  msg,
gpointer  data 
)
inline
void UFuncV4lGst::createBaseVar ( )
inlineprotected

Make the variables that will be available to other plugins

References UResVarPool::addVar(), UResVarPool::addVarA(), varBusCnt, varBusErr, varCamNum, varDevice, varFormat, varFramerate, varImgNum, varSize, and varStream.

Referenced by createResources().

virtual void UFuncV4lGst::createResources ( )
inlinevirtual

Called by server after this module is integrated into the server core structure, i.e. all core services are in place, but no commands are serviced for this module yet. Create any resources that this modules needs.

Reimplemented from UFunctionCamBase.

References createBaseVar().

virtual bool UFuncV4lGst::handleCommand ( UServerInMsg msg,
void *  extra 
)
inlinevirtual
void UFuncV4lGst::run ( )
inline

stream thread assembles processing and starts gstreamer main thread, This part works, use client script to test.

Returns
when main loop is stopped, or an error occured.

framerate from camera

framerate in communication

framerate in encoder

References UFunctionBase::aliasName, bus_call(), cb_handoff(), context, FALSE, UImage::getChannels(), UImage::getDepth(), UImagePool::getImage(), UVariable::getInt(), UVariable::getString(), gloop, UImage::height(), UFunctionImgBase::imgPool, UFunctionBase::msg, poolimg, UImage::resize(), s_argc, s_argv, UVariable::setBool(), UImage::setName(), threadRunning, threadStop, ULock::tryLock(), ULock::unlock(), varDevice, varFormat, varFramerate, varImgNum, varSize, varStream, and UImage::width().

Referenced by startGstThread().

bool UFuncV4lGst::start ( )
inlineprivate

Start stream processing thread

References startGstThread(), threadHandle, threadRunning, and threadStop.

Referenced by handleCommand().

void UFuncV4lGst::stop ( bool  andWait)
inlineprivatevirtual

stop read thread

Parameters
andWaitwaits until thread is terminated, when false, then the call returns when the stop flag is set (i.e. immidiately).

Reimplemented from UResBase.

References gloop, threadHandle, threadRunning, and threadStop.

Referenced by handleCommand(), and useBuffer().

void UFuncV4lGst::useBuffer ( GstElement *  fakesink,
GstBuffer *  buffer,
GstPad *  pad 
)
inline

Member Data Documentation

GMainContext* UFuncV4lGst::context
private

main context got this plugin

Referenced by run().

GMainLoop* UFuncV4lGst::gloop
private

streamer variables:

Referenced by handleCommand(), run(), stop(), and UFuncV4lGst().

uint32_t UFuncV4lGst::imageNumber
private

last image number

int UFuncV4lGst::imgSizeH
private

size of source image in pixels

int UFuncV4lGst::imgSizeW
private

size of source image in pixels

UImage* UFuncV4lGst::poolimg
private

image pool buffer

Referenced by run(), UFuncV4lGst(), and useBuffer().

pthread_t UFuncV4lGst::threadHandle
private

Thread handle for processing thread.

Referenced by start(), stop(), and UFuncV4lGst().

bool UFuncV4lGst::threadRunning
private

is thread running - set by thread

Referenced by handleCommand(), run(), start(), stop(), and UFuncV4lGst().

bool UFuncV4lGst::threadStop
private

is thread to stop - set by main function

Referenced by run(), start(), stop(), and UFuncV4lGst().

UTime UFuncV4lGst::tPush
private

timestamp

UVariable* UFuncV4lGst::varBusCnt
private

streamer bus call count

Referenced by busCall(), and createBaseVar().

UVariable* UFuncV4lGst::varBusErr
private

streamer bus error message

Referenced by busCall(), and createBaseVar().

UVariable* UFuncV4lGst::varCamNum
private

camera index number

Referenced by createBaseVar(), and useBuffer().

UVariable* UFuncV4lGst::varDevice
private

device string variable

Referenced by createBaseVar(), handleCommand(), and run().

UVariable* UFuncV4lGst::varFormat
private

video format string - limited support

Referenced by createBaseVar(), and run().

UVariable* UFuncV4lGst::varFramerate
private

camera framerate (num denom), used framerate (num, denom)

Referenced by createBaseVar(), and run().

UVariable* UFuncV4lGst::varImgNum
private

destination image number

Referenced by createBaseVar(), handleCommand(), and run().

UVariable* UFuncV4lGst::varSize
private

Image size (height x width)

Referenced by createBaseVar(), run(), and useBuffer().

UVariable* UFuncV4lGst::varStream
private

is port open

Referenced by createBaseVar(), handleCommand(), run(), and useBuffer().


The documentation for this class was generated from the following file: