« Return to Thread: Callback question

Re: Callback question

by Gabriel M. Beddingfield :: Rate this Message:

Reply to Author | View in Thread


Hi Jorge,

On Wed, May 27, 2009 6:35 pm, Jorge Cardona wrote:
> I'm trying to understand how works jack, but i'm stuck on the way that
> the callbacks at the clients are called from the server. Is there a
> signaling system, like the posix signals? i was reading the code, but
> i can't find where exactly is stored the client process function
> pointer, and when is called.

For Jack1, look in engine.c for jack_engine_process().  Whenever it wants
to call the client callbacks, this is the function that does it.  The
JSList* node holds a linked-list to all the client data (void*
node->data).  For each client, either jack_process_internal() or
jack_process_external() is called.

Inside jack_process_internal(), you'll find:

        jack_client_internal_t *client;
        jack_client_control_t *ctl;

        client = (jack_client_internal_t *) node->data;
        ctl = client->control;

And later on:

        if (ctl->process_cbset)
                if (client->private_client->process (nframes,
client->private_client->process_arg)) {
                        jack_error ("internal client %s failed", ctl->name);
                        engine->process_errors++;
                }

ctl->process_cbset is a flag indicating whether or not the callback has
been set.  If so, client->private_client->process is the pointer to the
callback.

Someone correct me if I made a mistake here.

HTH,
Gabriel

--
               G a b r i e l   M   B e d d i n g f i e l d

_______________________________________________
Jack-Devel mailing list
Jack-Devel@...
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

 « Return to Thread: Callback question