Hello,
I'm currently working on two boxes with two signal streams in entry, and one signal stream for the output.
If all the signal processing procedure is working reasonably well, I have a problem to create the new header for the output of the boxes.
After the decoding procedure, I can access for each input to the sampling rate and to an handler for a header, data or an ender.
If working with data is working well, how I can access to information as the channels name, the size of the chunks...
And how can I use the information presented at the two input to create a new header for the output ?
Thanks a lot.
Guillaume.
Access and modification of the stream header.
Re: Access and modification of the stream header.
Dear glio,
what do header is expected to be sent based on the two input headers your box receives ?
In short, what should you box do ?
Yann
what do header is expected to be sent based on the two input headers your box receives ?
In short, what should you box do ?
Yann
Re: Access and modification of the stream header.
Hello,
For example, the simplest box is a Signal Stream Concatenation Box.
If we have two streams with the same sampling rate in input :
Stream 1 - Channel 0 - Channel name : FP1
Stream 1 - Channel 1 - Channel name : FPz
Stream 1 - Channel 2 - Channel name : FP2
Stream 2 - Channel 0 - Channel name : Coord_X
Stream 2 - Channel 1 - Channel name : Coord_Y
I want to concatenate the two streams in one at the output :
Stream 3 - Channel 0 - Channel name : FP1
Stream 3 - Channel 1 - Channel name : FPz
Stream 3 - Channel 2 - Channel name : FP2
Stream 3 - Channel 3 - Channel name : Coord_X
Stream 3 - Channel 4 - Channel name : Coord_Y
So for each chunk at the inputs of the box, after the decoding procedure, I can identify if the
chunk is :
an header
a buffer
or an ender
If chunks are buffers, I can access to the data and launch the concatenation procedure :
But, if chunks are headers I must extract from the headers the channels names, to create then a new header with all the channels names for the output stream.
Do you have any idea to how I can access to this kind of stream parameters ?
Thank you,
Guillaume.
For example, the simplest box is a Signal Stream Concatenation Box.
If we have two streams with the same sampling rate in input :
Stream 1 - Channel 0 - Channel name : FP1
Stream 1 - Channel 1 - Channel name : FPz
Stream 1 - Channel 2 - Channel name : FP2
Stream 2 - Channel 0 - Channel name : Coord_X
Stream 2 - Channel 1 - Channel name : Coord_Y
I want to concatenate the two streams in one at the output :
Stream 3 - Channel 0 - Channel name : FP1
Stream 3 - Channel 1 - Channel name : FPz
Stream 3 - Channel 2 - Channel name : FP2
Stream 3 - Channel 3 - Channel name : Coord_X
Stream 3 - Channel 4 - Channel name : Coord_Y
So for each chunk at the inputs of the box, after the decoding procedure, I can identify if the
chunk is :
an header
Code: Select all
isOutputTriggerActive(OVP_GD_Algorithm_SignalStreamDecoder_OutputTriggerId_ReceivedHeader)
Code: Select all
isOutputTriggerActive(OVP_GD_Algorithm_SignalStreamDecoder_OutputTriggerId_ReceivedBuffer)
Code: Select all
isOutputTriggerActive(OVP_GD_Algorithm_SignalStreamDecoder_OutputTriggerId_ReceivedEnd
Code: Select all
op_pEncodedMemoryBuffer=l_pDynamicBoxContext->getOutputChunk(0);
m_pSignalEncoder->process(OVP_GD_Algorithm_SignalStreamEncoder_InputTriggerId_EncodeBuffer);
Do you have any idea to how I can access to this kind of stream parameters ?
Thank you,
Guillaume.
Re: Access and modification of the stream header.
Dear glio,
this information is available in the OpenViBE::IMatrix itself. After the header has been decoded, you can get the matrix' dimension count, dimension size(s) and dimension name(s).
Hope this helps,
Best regards,
Yann
this information is available in the OpenViBE::IMatrix itself. After the header has been decoded, you can get the matrix' dimension count, dimension size(s) and dimension name(s).
Hope this helps,
Best regards,
Yann
Re: Access and modification of the stream header.
Ok,
and
Thank you ! This is perfect.
Code: Select all
virtual const char * getDimensionLabel (const OpenViBE::uint32 ui32DimensionIndex, const OpenViBE::uint32 ui32DimensionEntryIndex) const =0
Gets the dimension label for a given dimension index / dimension entry index pair.
Code: Select all
virtual OpenViBE::boolean setDimensionLabel (const OpenViBE::uint32 ui32DimensionIndex, const OpenViBE::uint32 ui32DimensionEntryIndex, const char *sDimensionLabel)=0
Sets the dimension label for this matrix on a given dimension index / dimension entry index pair.