Lines Matching defs:ioplug

1061  * \brief Create an ioplug instance
1062 * \param ioplug the ioplug handle
1068 * Creates the ioplug instance.
1070 * The callback is the mandatory field of ioplug handle. At least, start, stop and
1074 int snd_pcm_ioplug_create(snd_pcm_ioplug_t *ioplug, const char *name,
1081 assert(ioplug && ioplug->callback);
1082 assert(ioplug->callback->start &&
1083 ioplug->callback->stop &&
1084 ioplug->callback->pointer);
1087 if (ioplug->version < 0x010000 ||
1088 ioplug->version > SND_PCM_IOPLUG_VERSION) {
1089 SNDERR("ioplug: Plugin version mismatch: 0x%x",
1090 ioplug->version);
1098 io->data = ioplug;
1099 ioplug->state = SND_PCM_STATE_OPEN;
1100 ioplug->stream = stream;
1108 ioplug->pcm = pcm;
1113 snd_pcm_set_hw_ptr(pcm, &ioplug->hw_ptr, -1, 0);
1114 snd_pcm_set_appl_ptr(pcm, &ioplug->appl_ptr, -1, 0);
1116 snd_pcm_ioplug_reinit_status(ioplug);
1122 * \brief Delete the ioplug instance
1123 * \param ioplug the ioplug handle
1126 int snd_pcm_ioplug_delete(snd_pcm_ioplug_t *ioplug)
1128 return snd_pcm_close(ioplug->pcm);
1133 * \brief Reset ioplug parameters
1134 * \param ioplug the ioplug handle
1136 * Resets the all parameters for the given ioplug handle.
1138 void snd_pcm_ioplug_params_reset(snd_pcm_ioplug_t *ioplug)
1140 ioplug_priv_t *io = ioplug->pcm->private_data;
1146 * \param ioplug the ioplug handle
1155 int snd_pcm_ioplug_set_param_list(snd_pcm_ioplug_t *ioplug, int type, unsigned int num_list, const unsigned int *list)
1157 ioplug_priv_t *io = ioplug->pcm->private_data;
1169 * \param ioplug the ioplug handle
1179 int snd_pcm_ioplug_set_param_minmax(snd_pcm_ioplug_t *ioplug, int type, unsigned int min, unsigned int max)
1181 ioplug_priv_t *io = ioplug->pcm->private_data;
1197 * \param ioplug the ioplug handle
1201 * Call this function to propagate the status change in the ioplug instance to
1204 int snd_pcm_ioplug_reinit_status(snd_pcm_ioplug_t *ioplug)
1206 ioplug->pcm->poll_fd = ioplug->poll_fd;
1207 ioplug->pcm->poll_events = ioplug->poll_events;
1208 if (ioplug->flags & SND_PCM_IOPLUG_FLAG_MONOTONIC)
1209 ioplug->pcm->tstamp_type = SND_PCM_TSTAMP_TYPE_MONOTONIC;
1211 ioplug->pcm->tstamp_type = SND_PCM_TSTAMP_TYPE_GETTIMEOFDAY;
1212 ioplug->pcm->mmap_rw = ioplug->mmap_rw;
1217 * \brief Get mmap area of ioplug
1218 * \param ioplug the ioplug handle
1224 const snd_pcm_channel_area_t *snd_pcm_ioplug_mmap_areas(snd_pcm_ioplug_t *ioplug)
1226 if (ioplug->mmap_rw)
1227 return snd_pcm_mmap_areas(ioplug->pcm);
1232 * \brief Change the ioplug PCM status
1233 * \param ioplug the ioplug handle
1237 * Changes the PCM status of the ioplug to the given value.
1241 int snd_pcm_ioplug_set_state(snd_pcm_ioplug_t *ioplug, snd_pcm_state_t state)
1243 ioplug->state = state;
1250 * \param ioplug the ioplug handle
1255 snd_pcm_uframes_t snd_pcm_ioplug_avail(const snd_pcm_ioplug_t * const ioplug,
1259 return __snd_pcm_avail(ioplug->pcm, hw_ptr, appl_ptr);
1265 * \param ioplug the ioplug handle
1270 snd_pcm_uframes_t snd_pcm_ioplug_hw_avail(const snd_pcm_ioplug_t * const ioplug,
1277 const snd_pcm_uframes_t user_avail = snd_pcm_ioplug_avail(ioplug,
1281 if (user_avail > ioplug->pcm->buffer_size) {
1286 return ioplug->pcm->buffer_size - user_avail;