OpenViBE forum

The OpenViBE community
It is currently Fri Dec 15, 2017 9:44 pm

All times are UTC

Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Sep 30, 2015 2:44 pm 

Joined: Wed Sep 30, 2015 1:02 pm
Posts: 1

I am a total newbie to OpenViBE.
I am trying to develop C++ plugin, more precisely a (Box)Algorithm that takes a Streamed Matrix as input, and produce a Streamed Matrix as output.
I have read the box plugins implementation algorithms, and looked at the code of the CBoxAlgorithmConfusionMatrix plugin as an example.
I am not sure I get (yet) all the plumbing necessary to pass around the data chunks between the BoxAlgorithm and the(s) Algorithm(s), and also between the BoxAlgorithm and the rest of the scenario.

For example, in CBoxAlgorithmConfusionMatrix::process(), there is the following code [openvibe 1.0.1 or git] :

      TParameterHandler < IMemoryBuffer* > l_oOutputMemoryBufferHandle(m_pConfusionMatrixEncoder->getOutputParameter(OVP_GD_Algorithm_StreamedMatrixStreamEncoder_OutputParameterId_EncodedMemoryBuffer));

I don't understand why the l_oOutputMemoryBufferHandler local variable is necessary. It is not used anywhere else.
However, if this code is commented out, the BoxAlgorithm does not send anything to the following box (the MatrixDisplay linked to it in my scenario does not display anything).

Could you explain why this code is necessary ? Or refer me to the appropriate documentation ...

[I on linux (Ubuntu 14.04.3), I compile git head in RelWithDebInfo mode]

Reply with quote  
PostPosted: Thu Oct 01, 2015 1:47 pm 

Joined: Tue Dec 04, 2012 3:53 pm
Posts: 601
Location: INRIA Rennes, FRANCE
Hi Boris, welcome aboard!

Over the years, there have been evolving set of conventions of how to handle the data passing between boxes. Some boxes, like the confusion matrix box, still use old, quite complicated conventions. We haven't had the time to refactor these boxes. The currently recommended practice is described in this tutorial, ... ssing-box/

If you prefer instead to work by customizing an existing box -- which is my preferred approach -- one of the simplest boxes which follow the new codec conventions is the Signal Average box. Try taking a look at that.

ps. to answer your question, assigning to the local variable actually changes m_pConfusionMatrixEncoder by some C++ overloading magic. But with the new conventions this knowledge should not needed (but you might need to pay attention that sometimes code seems to assign to a getter function -- this works if the getter returns a reference).

Hope this helps,

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Americanized by Maƫl Soucaze.