Bela
Real-time, ultra-low-latency audio and sensor processing system for BeagleBone Black
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Classes | Public Member Functions | Static Public Member Functions | List of all members
BelaContextSplitter Class Reference

Public Member Functions

 BelaContextSplitter (unsigned int in=1, unsigned int out=1, const BelaContext *context=nullptr)
 
int setup (unsigned int in, unsigned int out, const BelaContext *context)
 
int push (const BelaContext *inContext)
 
BelaContextpop ()
 
void cleanup ()
 
BelaContextgetContext ()
 

Static Public Member Functions

static bool contextEqual (const InternalBelaContext *ctx1, const InternalBelaContext *ctx2)
 
static void contextCopy (const InternalBelaContext *src, InternalBelaContext *dst)
 
static void contextCopyData (const InternalBelaContext *src, InternalBelaContext *dst)
 
static void contextAllocate (InternalBelaContext *ctx)
 
static bool test ()
 

Member Function Documentation

int BelaContextSplitter::setup ( unsigned int  in,
unsigned int  out,
const BelaContext context 
)

Initialize the object. The #in and #out parameters will determine the frames ratio between the input context (passsed through push(), and of which a template has to be provided here as #context), and the output contexts (retrieved via pop()) The output contexts will have a frame count that is #out/#in the ones of the input contexts.

Parameters
inhow many input contexts are needed to create 1 output context
outhow many output contexts
contexta template input context. F
Precondition
One of #in or #out has to be 1.
Calls to push() will have to pass a BelaContext which is compatible (same number of channels) with the one passed here
Returns
0 on success, an error code otherwise.
int BelaContextSplitter::push ( const BelaContext inContext)

Add a context for processing.

Parameters
inContextthe context to process. This has to have the same number of I/O channels as the one passed to setup()
BelaContext* BelaContextSplitter::pop ( )

Retrieve an output BelaContext, if there is one available.

Returns
a pointer to a BelaContext, or null if there is none available.
BelaContext* BelaContextSplitter::getContext ( )

Return one of the output contexts, initialised, but containing invalid data.

static void BelaContextSplitter::contextCopy ( const InternalBelaContext src,
InternalBelaContext dst 
)
static

Copy context by allocating memory as necessary.

static void BelaContextSplitter::contextCopyData ( const InternalBelaContext src,
InternalBelaContext dst 
)
static

Copy context data between two pre-allocated contexts. The caller has to ensure that the number of analog, audio and digital frames and channels has to be the same between the two contexts.


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