*/
#define SND_PCM_IOPLUG_VERSION_MAJOR 1 /**< Protocol major version */
#define SND_PCM_IOPLUG_VERSION_MINOR 0 /**< Protocol minor version */
-#define SND_PCM_IOPLUG_VERSION_TINY 0 /**< Protocol tiny version */
+#define SND_PCM_IOPLUG_VERSION_TINY 1 /**< Protocol tiny version */
/**
* IO-plugin protocol version
*/
* dump; optional
*/
void (*dump)(snd_pcm_ioplug_t *io, snd_output_t *out);
+ /**
+ * get the delay for the running PCM; optional
+ */
+ int (*delay)(snd_pcm_ioplug_t *io, snd_pcm_sframes_t *delayp);
};
static int snd_pcm_ioplug_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp)
{
- snd_pcm_ioplug_hw_ptr_update(pcm);
- *delayp = snd_pcm_mmap_hw_avail(pcm);
+ ioplug_priv_t *io = pcm->private_data;
+
+ if (io->data->version >= 0x010001 &&
+ io->data->callback->delay)
+ return io->data->callback->delay(io->data, delayp);
+ else {
+ snd_pcm_ioplug_hw_ptr_update(pcm);
+ *delayp = snd_pcm_mmap_hw_avail(pcm);
+ }
return 0;
}
ioplug->callback->stop &&
ioplug->callback->pointer);
- if (ioplug->version != SND_PCM_IOPLUG_VERSION) {
+ /* We support 1.0.0 to current */
+ if (ioplug->version < 0x010000 ||
+ ioplug->version > SND_PCM_IOPLUG_VERSION) {
SNDERR("ioplug: Plugin version mismatch\n");
return -ENXIO;
}