mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Removed snd_pcm_hwdiff() function
This commit is contained in:
parent
2dab1dfbc3
commit
7b09000813
7 changed files with 4 additions and 51 deletions
|
|
@ -410,7 +410,6 @@ int snd_pcm_drain(snd_pcm_t *pcm);
|
||||||
int snd_pcm_pause(snd_pcm_t *pcm, int enable);
|
int snd_pcm_pause(snd_pcm_t *pcm, int enable);
|
||||||
snd_pcm_state_t snd_pcm_state(snd_pcm_t *pcm);
|
snd_pcm_state_t snd_pcm_state(snd_pcm_t *pcm);
|
||||||
int snd_pcm_hwsync(snd_pcm_t *pcm);
|
int snd_pcm_hwsync(snd_pcm_t *pcm);
|
||||||
int snd_pcm_hwdiff(snd_pcm_t *pcm, snd_pcm_uframes_t *diff, snd_pcm_uframes_t *old_pos);
|
|
||||||
int snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp);
|
int snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp);
|
||||||
int snd_pcm_resume(snd_pcm_t *pcm);
|
int snd_pcm_resume(snd_pcm_t *pcm);
|
||||||
snd_pcm_sframes_t snd_pcm_avail_update(snd_pcm_t *pcm);
|
snd_pcm_sframes_t snd_pcm_avail_update(snd_pcm_t *pcm);
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,6 @@ ALSA_0.9.0rc4 {
|
||||||
ALSA_0.9.0rc8 {
|
ALSA_0.9.0rc8 {
|
||||||
global:
|
global:
|
||||||
|
|
||||||
snd_pcm_hwdiff;
|
|
||||||
snd_pcm_forward;
|
snd_pcm_forward;
|
||||||
|
|
||||||
} ALSA_0.9.0rc4;
|
} ALSA_0.9.0rc4;
|
||||||
|
|
|
||||||
|
|
@ -400,12 +400,6 @@ only when the stream is in the running or draining (playback only) state.
|
||||||
Note that this function does not update the current r/w pointer for applications,
|
Note that this function does not update the current r/w pointer for applications,
|
||||||
so the function \link ::snd_pcm_avail_update \endlink must be called afterwards
|
so the function \link ::snd_pcm_avail_update \endlink must be called afterwards
|
||||||
before any read/write begin+commit operations.
|
before any read/write begin+commit operations.
|
||||||
<p>
|
|
||||||
To determine the processed frames by hardware, the function \link ::snd_pcm_hwdiff \endlink
|
|
||||||
might be used. Note that this function returns cached value which is synchronized with
|
|
||||||
hardware using the \link ::snd_pcm_hwsync \endlink function. The application may
|
|
||||||
manage the right r/w pointer via \link ::snd_pcm_rewind \endlink and
|
|
||||||
\link ::snd_pcm_forward \endlink functions.
|
|
||||||
|
|
||||||
\section pcm_action Managing the stream state
|
\section pcm_action Managing the stream state
|
||||||
|
|
||||||
|
|
@ -874,44 +868,6 @@ int snd_pcm_hwsync(snd_pcm_t *pcm)
|
||||||
return pcm->fast_ops->hwsync(pcm->fast_op_arg);
|
return pcm->fast_ops->hwsync(pcm->fast_op_arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Return count of processed frames by hardware from last call
|
|
||||||
* \param pcm PCM handle
|
|
||||||
* \param diff Difference between last position and current
|
|
||||||
* \param old_pos Old position on entry, actual position on exit
|
|
||||||
* \return 0 on success otherwise a negative error code
|
|
||||||
*
|
|
||||||
* The old_ptr parameter is in range 0 ... (boundary - 1). It contains
|
|
||||||
* count_of_ring_buffer_crosses * buffer_size + offset in the ring buffer.
|
|
||||||
* Using this value is not intented
|
|
||||||
*
|
|
||||||
* Note this function does not obtain the real position from hardware.
|
|
||||||
* The function \link ::snd_pcm_hwsync \endlink have to be called
|
|
||||||
* before to obtain the real hardware position.
|
|
||||||
*/
|
|
||||||
#ifndef DOXYGEN
|
|
||||||
int INTERNAL(snd_pcm_hwdiff)(snd_pcm_t *pcm, snd_pcm_uframes_t *diff, snd_pcm_uframes_t *old_pos)
|
|
||||||
#else
|
|
||||||
int snd_pcm_hwdiff(snd_pcm_t *pcm, snd_pcm_uframes_t *diff, snd_pcm_uframes_t *old_pos)
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
snd_pcm_uframes_t d, hw_ptr;
|
|
||||||
|
|
||||||
assert(pcm && diff && old_pos);
|
|
||||||
assert(pcm->setup);
|
|
||||||
assert(*old_pos < pcm->boundary);
|
|
||||||
hw_ptr = *pcm->hw.ptr;
|
|
||||||
if (hw_ptr < *old_pos) {
|
|
||||||
d = (pcm->boundary - *old_pos) + hw_ptr;
|
|
||||||
} else {
|
|
||||||
d = hw_ptr - *old_pos;
|
|
||||||
}
|
|
||||||
*diff = d;
|
|
||||||
*old_pos = hw_ptr;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
default_symbol_version(__snd_pcm_hwdiff, snd_pcm_hwdiff, ALSA_0.9.0rc8);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Obtain delay for a running PCM handle
|
* \brief Obtain delay for a running PCM handle
|
||||||
* \param pcm PCM handle
|
* \param pcm PCM handle
|
||||||
|
|
|
||||||
|
|
@ -1096,7 +1096,7 @@ static snd_pcm_sframes_t snd_pcm_dmix_forward(snd_pcm_t *pcm, snd_pcm_uframes_t
|
||||||
avail = snd_pcm_mmap_avail(pcm);
|
avail = snd_pcm_mmap_avail(pcm);
|
||||||
if (avail < 0)
|
if (avail < 0)
|
||||||
return 0;
|
return 0;
|
||||||
if (frames > avail)
|
if (frames > (snd_pcm_uframes_t)avail)
|
||||||
frames = avail;
|
frames = avail;
|
||||||
snd_pcm_mmap_appl_forward(pcm, frames);
|
snd_pcm_mmap_appl_forward(pcm, frames);
|
||||||
return frames;
|
return frames;
|
||||||
|
|
|
||||||
|
|
@ -533,7 +533,7 @@ static snd_pcm_sframes_t snd_pcm_hw_forward(snd_pcm_t *pcm, snd_pcm_uframes_t fr
|
||||||
avail = snd_pcm_mmap_avail(pcm);
|
avail = snd_pcm_mmap_avail(pcm);
|
||||||
if (avail < 0)
|
if (avail < 0)
|
||||||
return 0;
|
return 0;
|
||||||
if (frames > avail)
|
if (frames > (snd_pcm_uframes_t)avail)
|
||||||
frames = avail;
|
frames = avail;
|
||||||
snd_pcm_mmap_appl_forward(pcm, frames);
|
snd_pcm_mmap_appl_forward(pcm, frames);
|
||||||
return frames;
|
return frames;
|
||||||
|
|
@ -715,7 +715,7 @@ static int snd_pcm_hw_close(snd_pcm_t *pcm)
|
||||||
}
|
}
|
||||||
|
|
||||||
static snd_pcm_sframes_t snd_pcm_hw_mmap_commit(snd_pcm_t *pcm,
|
static snd_pcm_sframes_t snd_pcm_hw_mmap_commit(snd_pcm_t *pcm,
|
||||||
snd_pcm_uframes_t offset,
|
snd_pcm_uframes_t offset ATTRIBUTE_UNUSED,
|
||||||
snd_pcm_uframes_t size)
|
snd_pcm_uframes_t size)
|
||||||
{
|
{
|
||||||
snd_pcm_hw_t *hw = pcm->private_data;
|
snd_pcm_hw_t *hw = pcm->private_data;
|
||||||
|
|
|
||||||
|
|
@ -550,7 +550,6 @@ int snd_pcm_hw_param_get_max(const snd_pcm_hw_params_t *params,
|
||||||
unsigned int *val, int *dir);
|
unsigned int *val, int *dir);
|
||||||
|
|
||||||
#ifdef INTERNAL
|
#ifdef INTERNAL
|
||||||
int INTERNAL(snd_pcm_hwdiff)(snd_pcm_t *pcm, snd_pcm_uframes_t *diff, snd_pcm_uframes_t *old_pos);
|
|
||||||
snd_pcm_sframes_t INTERNAL(snd_pcm_forward)(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
|
snd_pcm_sframes_t INTERNAL(snd_pcm_forward)(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
|
||||||
|
|
||||||
int INTERNAL(snd_pcm_hw_params_get_access)(const snd_pcm_hw_params_t *params, snd_pcm_access_t *access);
|
int INTERNAL(snd_pcm_hw_params_get_access)(const snd_pcm_hw_params_t *params, snd_pcm_access_t *access);
|
||||||
|
|
|
||||||
|
|
@ -325,7 +325,7 @@ snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frame
|
||||||
sframes = frames;
|
sframes = frames;
|
||||||
snd_atomic_write_begin(&plugin->watom);
|
snd_atomic_write_begin(&plugin->watom);
|
||||||
sframes = snd_pcm_forward(plugin->slave, (snd_pcm_uframes_t) sframes);
|
sframes = snd_pcm_forward(plugin->slave, (snd_pcm_uframes_t) sframes);
|
||||||
if (sframes < 0) {
|
if ((snd_pcm_sframes_t) sframes < 0) {
|
||||||
snd_atomic_write_end(&plugin->watom);
|
snd_atomic_write_end(&plugin->watom);
|
||||||
return sframes;
|
return sframes;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue