Loading...
Searching...
No Matches
pcm_ioplug.c File Reference
External PCM plugin SDK

I/O Plugin SDK. More...

Include dependency graph for pcm_ioplug.c:

## Functions

int | snd_pcm_ioplug_create (snd_pcm_ioplug_t *ioplug, const char *name, snd_pcm_stream_t stream, int mode)
| Create an ioplug instance.
int | snd_pcm_ioplug_delete (snd_pcm_ioplug_t *ioplug)
| Delete the ioplug instance.
void | snd_pcm_ioplug_params_reset (snd_pcm_ioplug_t *ioplug)
| Reset ioplug parameters.
int | snd_pcm_ioplug_set_param_list (snd_pcm_ioplug_t *ioplug, int type, unsigned int num_list, const unsigned int *list)
| Set parameter as the list.
int | snd_pcm_ioplug_set_param_minmax (snd_pcm_ioplug_t *ioplug, int type, unsigned int min, unsigned int max)
| Set parameter as the min/max values.
int | snd_pcm_ioplug_reinit_status (snd_pcm_ioplug_t *ioplug)
| Reinitialize the poll and mmap status.
const snd_pcm_channel_area_t * | snd_pcm_ioplug_mmap_areas (snd_pcm_ioplug_t *ioplug)
| Get mmap area of ioplug.
int | snd_pcm_ioplug_set_state (snd_pcm_ioplug_t *ioplug, snd_pcm_state_t state)
| Change the ioplug PCM status.
snd_pcm_uframes_t | snd_pcm_ioplug_avail (const snd_pcm_ioplug_t *const ioplug, const snd_pcm_uframes_t hw_ptr, const snd_pcm_uframes_t appl_ptr)
| Get the available frames. This function can be used to calculate the the available frames before calling snd_pcm_avail_update()
snd_pcm_uframes_t | snd_pcm_ioplug_hw_avail (const snd_pcm_ioplug_t *const ioplug, const snd_pcm_uframes_t hw_ptr, const snd_pcm_uframes_t appl_ptr)
| Get the available frames. This function can be used to calculate the the available frames before calling snd_pcm_avail_update()

## Detailed Description

I/O Plugin SDK.

Author
  Takashi Iwai tiwai.nosp@m.@sus.nosp@m.e.de

Date
  2005

## Function Documentation

## snd_pcm_ioplug_avail()

snd_pcm_uframes_t snd_pcm_ioplug_avail | ( | const snd_pcm_ioplug_t *const | ioplug,
|  | const snd_pcm_uframes_t | hw_ptr,
|  | const snd_pcm_uframes_t | appl_ptr
| ) |  |

Get the available frames. This function can be used to calculate the the available frames before calling snd_pcm_avail_update()

Parameters

  ioplug | the ioplug handle
  hw_ptr | hardware pointer in frames
  appl_ptr | application pointer in frames

Returns
  available frames for the application

## snd_pcm_ioplug_create()

int snd_pcm_ioplug_create | ( | snd_pcm_ioplug_t * | ioplug,
|  | const char * | name,
|  | snd_pcm_stream_t | stream,
|  | int | mode
| ) |  |

Create an ioplug instance.

Parameters

  ioplug | the ioplug handle
  name | name of PCM
  stream | stream direction
  mode | PCM open mode

Returns
  0 if successful, or a negative error code

Creates the ioplug instance.

The callback is the mandatory field of ioplug handle. At least, start, stop and pointer callbacks must be set before calling this function.

## snd_pcm_ioplug_delete()

int snd_pcm_ioplug_delete | ( | snd_pcm_ioplug_t * | ioplug | ) |

Delete the ioplug instance.

Parameters

  ioplug | the ioplug handle

Returns
  0 if successful, or a negative error code

## snd_pcm_ioplug_hw_avail()

snd_pcm_uframes_t snd_pcm_ioplug_hw_avail | ( | const snd_pcm_ioplug_t *const | ioplug,
|  | const snd_pcm_uframes_t | hw_ptr,
|  | const snd_pcm_uframes_t | appl_ptr
| ) |  |

Get the available frames. This function can be used to calculate the the available frames before calling snd_pcm_avail_update()

Parameters

  ioplug | the ioplug handle
  hw_ptr | hardware pointer in frames
  appl_ptr | application pointer in frames

Returns
  available frames for the hardware

## snd_pcm_ioplug_mmap_areas()

const snd_pcm_channel_area_t * snd_pcm_ioplug_mmap_areas | ( | snd_pcm_ioplug_t * | ioplug | ) |

Get mmap area of ioplug.

Parameters

  ioplug | the ioplug handle

Returns
  the mmap channel areas if available, or NULL

Returns the mmap channel areas if available. When mmap_rw field is not set, this function always returns NULL.

## snd_pcm_ioplug_params_reset()

void snd_pcm_ioplug_params_reset | ( | snd_pcm_ioplug_t * | ioplug | ) |

Reset ioplug parameters.

Parameters

  ioplug | the ioplug handle

Resets the all parameters for the given ioplug handle.

## snd_pcm_ioplug_reinit_status()

int snd_pcm_ioplug_reinit_status | ( | snd_pcm_ioplug_t * | ioplug | ) |

Reinitialize the poll and mmap status.

Parameters

  ioplug | the ioplug handle

Returns
  0 if successful, or a negative error code

Reinitializes the poll and the mmap status of the PCM. Call this function to propagate the status change in the ioplug instance to its PCM internals.

## snd_pcm_ioplug_set_param_list()

int snd_pcm_ioplug_set_param_list | ( | snd_pcm_ioplug_t * | ioplug,
|  | int | type,
|  | unsigned int | num_list,
|  | const unsigned int * | list
| ) |  |

Set parameter as the list.

Parameters

  ioplug | the ioplug handle
  type | parameter type
  num_list | number of available values
  list | the list of available values

Returns
  0 if successful, or a negative error code

Sets the parameter as the list. The available values of the given parameter type is restricted to the ones of the given list.

## snd_pcm_ioplug_set_param_minmax()

int snd_pcm_ioplug_set_param_minmax | ( | snd_pcm_ioplug_t * | ioplug,
|  | int | type,
|  | unsigned int | min,
|  | unsigned int | max
| ) |  |

Set parameter as the min/max values.

Parameters

  ioplug | the ioplug handle
  type | parameter type
  min | the minimum value
  max | the maximum value

Returns
  0 if successful, or a negative error code

Sets the parameter as the min/max values. The available values of the given parameter type is restricted between the given minimum and maximum values.

## snd_pcm_ioplug_set_state()

int snd_pcm_ioplug_set_state | ( | snd_pcm_ioplug_t * | ioplug,
|  | snd_pcm_state_t | state
| ) |  |

Change the ioplug PCM status.

Parameters

  ioplug | the ioplug handle
  state | the PCM status

Returns
  zero if successful or a negative error code

Changes the PCM status of the ioplug to the given value. This function can be used for external plugins to notify the status change, e.g. XRUN.