Browse Source

new driver design, part II

git-svn-id: svn+ssh://jackaudio.org/trunk/jack@367 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.109.0
pbd 23 years ago
parent
commit
af186bbbeb
2 changed files with 24 additions and 3 deletions
  1. +21
    -0
      jack/driver.h
  2. +3
    -3
      jackd/engine.c

+ 21
- 0
jack/driver.h View File

@@ -65,6 +65,7 @@ typedef jack_nframes_t (*JackDriverWaitFunction)(struct _jack_driver *, int fd,
3) engine starts driver
4) while (1) {
engine->wait ();
engine->audio_cycle ();
}
5) engine stops driver
6) engine detaches from driver
@@ -135,10 +136,30 @@ typedef jack_nframes_t (*JackDriverWaitFunction)(struct _jack_driver *, int fd,

JackDriverWaitFunction wait;

/* the JACK engine will call this to ask the driver to move
data from its inputs to its output port buffers. it should
return 0 to indicate successful completion, negative otherwise.
this function will always be called after the wait function (above).
*/

JackDriverReadFunction read;

/* the JACK engine will call this to ask the driver to move
data from its input port buffers to its outputs. it should
return 0 to indicate successful completion, negative otherwise.
this function will always be called after the read function (above).
*/
JackDriverWriteFunction write;

/* the JACK engine will call this after the wait function (above) has
been called, but for some reason the engine is unable to execute
a full "cycle". the driver should do whatever is necessary to
keep itself running correctly, but cannot reference ports
or other JACK data structures in any way.
*/

JackDriverNullCycleFunction null_cycle;
/* the engine will call this when it plans to stop calling the `wait'


+ 3
- 3
jackd/engine.c View File

@@ -2069,7 +2069,7 @@ jack_engine_wait (jack_engine_t *engine, jack_nframes_t* nframes)
}

static int
jack_audio_cycle (jack_engine_t *engine, jack_nframes_t nframes)
jack_run_cycle (jack_engine_t *engine, jack_nframes_t nframes)
{
int ret;
jack_driver_t* driver = engine->driver;
@@ -2137,8 +2137,8 @@ jack_main_thread (void *arg)
} else if (wait_status == 0) {
if (jack_audio_cycle (engine, nframes)) {
jack_error ("audio cycle failure, exiting");
if (jack_run_cycle (engine, nframes)) {
jack_error ("cycle execution failure, exiting");
break;
}



Loading…
Cancel
Save