IBoxIO Class Reference

Main OpenViBE box interface to communicate with the kernelThis context allows the object which uses it to check inputs states, read them, write outputs while being in a dynamic context (used by player). More...

Inheritance diagram for IBoxIO:
IKernelObject IObject

List of all members.

Public Member Functions

Accessing the input chunks informations
virtual OpenViBE::uint32 getInputChunkCount (const OpenViBE::uint32 ui32InputIndex) const =0
 Gets the number of pending chunks for an input.
virtual OpenViBE::boolean getInputChunk (const OpenViBE::uint32 ui32InputIndex, const OpenViBE::uint32 ui32ChunkIndex, OpenViBE::uint64 &rStartTime, OpenViBE::uint64 &rEndTime, OpenViBE::uint64 &rChunkSize, const OpenViBE::uint8 *&rpChunkBuffer) const =0
 Gets an input chunk and its time validity.
virtual const
OpenViBE::IMemoryBuffer
getInputChunk (const OpenViBE::uint32 ui32InputIndex, const OpenViBE::uint32 ui32ChunkIndex) const =0
 Gets an input chunk.
virtual OpenViBE::uint64 getInputChunkStartTime (const OpenViBE::uint32 ui32InputIndex, const OpenViBE::uint32 ui32ChunkIndex) const =0
 Gets an input chunk start time.
virtual OpenViBE::uint64 getInputChunkEndTime (const OpenViBE::uint32 ui32InputIndex, const OpenViBE::uint32 ui32ChunkIndex) const =0
 Gets an input chunk end time.
virtual OpenViBE::boolean markInputAsDeprecated (const OpenViBE::uint32 ui32InputIndex, const OpenViBE::uint32 ui32ChunkIndex)=0
 Marks an input chunk as deprecated.
Accessing the output chunks information
virtual OpenViBE::uint64 getOutputChunkSize (const OpenViBE::uint32 ui32OutputIndex) const =0
 Gets the output chunk size.
virtual OpenViBE::boolean setOutputChunkSize (const OpenViBE::uint32 ui32OutputIndex, const OpenViBE::uint64 ui64Size, const OpenViBE::boolean bDiscard=true)=0
 Sets an output chunk size.
virtual OpenViBE::uint8getOutputChunkBuffer (const OpenViBE::uint32 ui32OutputIndex)=0
 Gets a pointer to the current output chunk buffer.
virtual OpenViBE::boolean appendOutputChunkData (const OpenViBE::uint32 ui32OutputIndex, const OpenViBE::uint8 *pBuffer, const OpenViBE::uint64 ui64BufferSize)=0
 Appends data to the output chunk.
virtual OpenViBE::IMemoryBuffergetOutputChunk (const OpenViBE::uint32 ui32OutputIndex)=0
 Gets an output chunk.
virtual OpenViBE::boolean markOutputAsReadyToSend (const OpenViBE::uint32 ui32OutputIndex, const OpenViBE::uint64 ui64StartTime, const OpenViBE::uint64 ui64EndTime)=0
 Marks output buffer as 'ready to send'.

Detailed Description

Main OpenViBE box interface to communicate with the kernel

This context allows the object which uses it to check inputs states, read them, write outputs while being in a dynamic context (used by player).

Author:
Yann Renard (INRIA/IRISA)
Date:
2006-06-21

Member Function Documentation

virtual OpenViBE::uint32 getInputChunkCount ( const OpenViBE::uint32  ui32InputIndex) const [pure virtual]

Gets the number of pending chunks for an input.

Parameters:
ui32InputIndex[in] : the input to work on.
Returns:
The number of pending chunks for an input
virtual OpenViBE::boolean getInputChunk ( const OpenViBE::uint32  ui32InputIndex,
const OpenViBE::uint32  ui32ChunkIndex,
OpenViBE::uint64 rStartTime,
OpenViBE::uint64 rEndTime,
OpenViBE::uint64 rChunkSize,
const OpenViBE::uint8 *&  rpChunkBuffer 
) const [pure virtual]

Gets an input chunk and its time validity.

Parameters:
ui32InputIndex[in] : the index of the desired input.
ui32ChunkIndex[in] : the index of the desired chunk in this input.
rStartTime[out] : the time which the chunk starts at
rEndTime[out] : the time which the chunk ends at
rChunkSize[out] : the chunk buffer size in bytes
rpChunkBuffer[out] : the chunk data itself
Returns:
true in case of success.
false in case of error.
Warning:
When returning false, none of the value rStartTime, rEndTime, rChunkSize nor rpChunkBuffer are defined.
The chunks are ordered like they arrived to the box, this means chunk 0 arrived before chunk 1, that arrived before chunk 2 and so on...
Note:
Both time value are given in fixed point 32:32 seconds
See also:
getInputChunkCount
markInputAsDeprecated
virtual const OpenViBE::IMemoryBuffer* getInputChunk ( const OpenViBE::uint32  ui32InputIndex,
const OpenViBE::uint32  ui32ChunkIndex 
) const [pure virtual]

Gets an input chunk.

Parameters:
ui32InputIndex[in] : the index of the desired input.
ui32ChunkIndex[in] : the index of the desired chunk in this input.
Returns:
The memory buffer for the specified chunk.
NULL in case of error.
Warning:
The chunks are ordered like they arrived to the box, this means chunk 0 arrived before chunk 1, that arrived before chunk 2 and so on...
See also:
getInputChunkCount
markInputAsDeprecated
virtual OpenViBE::uint64 getInputChunkStartTime ( const OpenViBE::uint32  ui32InputIndex,
const OpenViBE::uint32  ui32ChunkIndex 
) const [pure virtual]

Gets an input chunk start time.

Parameters:
ui32InputIndex[in] : the index of the desired input.
ui32ChunkIndex[in] : the index of the desired chunk in this input.
Returns:
The input chunk start time.
0 is returned in case of error.
Note:
Both time value are given in fixed point 32:32 seconds
See also:
getInputChunkCount
markInputAsDeprecated
virtual OpenViBE::uint64 getInputChunkEndTime ( const OpenViBE::uint32  ui32InputIndex,
const OpenViBE::uint32  ui32ChunkIndex 
) const [pure virtual]

Gets an input chunk end time.

Parameters:
ui32InputIndex[in] : the index of the desired input.
ui32ChunkIndex[in] : the index of the desired chunk in this input.
Returns:
The input chunk end time.
0 is returned in case of error.
Note:
Both time value are given in fixed point 32:32 seconds
See also:
getInputChunkCount
markInputAsDeprecated
virtual OpenViBE::boolean markInputAsDeprecated ( const OpenViBE::uint32  ui32InputIndex,
const OpenViBE::uint32  ui32ChunkIndex 
) [pure virtual]

Marks an input chunk as deprecated.

Parameters:
ui32InputIndex[in] : the index of the desired input.
ui32ChunkIndex[in] : the index of the chunk to mark.
Returns:
true in case of success.
false in case of error.
Warning:
The chunks are ordered like they arrived to the box, this means chunk 0 arrived before chunk 1, that arrived before chunk 2 and so on...

This function discards a chunk when it's been read and processed. This allows the kernel to know a chunk has been treated successfully and will not be used any more so it can be removed from memory.

See also:
getInputChunkCount
releaseChunk
virtual OpenViBE::uint64 getOutputChunkSize ( const OpenViBE::uint32  ui32OutputIndex) const [pure virtual]

Gets the output chunk size.

Parameters:
ui32OutputIndex[in] : the index of the output to work on
Returns:
The output chunk size in bytes
virtual OpenViBE::boolean setOutputChunkSize ( const OpenViBE::uint32  ui32OutputIndex,
const OpenViBE::uint64  ui64Size,
const OpenViBE::boolean  bDiscard = true 
) [pure virtual]

Sets an output chunk size.

Parameters:
ui32OutputIndex[in] : the index of the output to work on
ui64Size[in] : the new size of the output chunk
bDiscard[in] : tells if existing buffer should be discarded or not
Returns:
true in case of success.
false in case of error.
virtual OpenViBE::uint8* getOutputChunkBuffer ( const OpenViBE::uint32  ui32OutputIndex) [pure virtual]

Gets a pointer to the current output chunk buffer.

Parameters:
ui32OutputIndex[in] : the index of the output to work on
Returns:
A pointer to the current output chunk buffer
Warning:
The returned pointer may change if the caller resizes the chunk buffer using setChunkSize !
virtual OpenViBE::boolean appendOutputChunkData ( const OpenViBE::uint32  ui32OutputIndex,
const OpenViBE::uint8 pBuffer,
const OpenViBE::uint64  ui64BufferSize 
) [pure virtual]

Appends data to the output chunk.

Parameters:
ui32OutputIndex[in] : the index of the output to work on
pBuffer[in] : the buffer to append to the current buffer
ui64BufferSize[in] : the size of the appended buffer
Returns:
true in case of success.
false in case of error.
Warning:
This function resizes the chunk size calling setOutputChunkSize and then appends data doing a copy.
virtual OpenViBE::IMemoryBuffer* getOutputChunk ( const OpenViBE::uint32  ui32OutputIndex) [pure virtual]

Gets an output chunk.

Parameters:
ui32OutputIndex[in] : the index of the desired output.
Returns:
The output chunk memory buffer for the specified output.
NULL in case of error.
See also:
markOutputAsReadyToSend
virtual OpenViBE::boolean markOutputAsReadyToSend ( const OpenViBE::uint32  ui32OutputIndex,
const OpenViBE::uint64  ui64StartTime,
const OpenViBE::uint64  ui64EndTime 
) [pure virtual]

Marks output buffer as 'ready to send'.

Parameters:
ui32OutputIndex[in] : the index of the output to work on
ui64StartTime[in] : the start time for the related buffer.
ui64EndTime[in] : the end time for the related buffer.
Returns:
true in case of success.
false in case of error.

The output chunk should first be filled. For that, one will have to get a reference on it thanks to the getChunkBuffer or the appendOutputChunkData methods ! The player will then know the buffer can be sent.

When called, the function flushes the output chunk. Thus, after the call, the chunk size is turned to 0 and the output is ready for a new chunk when necessary...

Note:
Both time value are given in fixed point 32:32 seconds
See also:
getChunk