pcm: add support for get/set_audio_htstamp_config

Enable kernel-side functionality by letting user select what sort of
timestamp it desires

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Pierre-Louis Bossart 2015-07-01 15:40:55 -05:00 committed by Takashi Iwai
parent 6cb31b4444
commit 6ec2464f39
2 changed files with 82 additions and 0 deletions

View file

@ -6366,6 +6366,44 @@ void snd_pcm_status_get_audio_htstamp(const snd_pcm_status_t *obj, snd_htimestam
*ptr = obj->audio_tstamp;
}
/**
* \brief Get "now" hi-res driver timestamp from a PCM status container. Defines when the status
* was generated by driver, may differ from normal timestamp.
* \param obj pointer to #snd_pcm_status_t
* \param ptr Pointer to returned timestamp
*/
void snd_pcm_status_get_driver_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr)
{
assert(obj && ptr);
*ptr = obj->driver_tstamp;
}
/**
* \brief Get audio_tstamp_report from a PCM status container
* \param obj pointer to #snd_pcm_status_t
* \param ptr Pointer to returned report (valid fields are accuracy and type)
*/
void snd_pcm_status_get_audio_htstamp_report(const snd_pcm_status_t *obj,
snd_pcm_audio_tstamp_report_t *audio_tstamp_report)
{
assert(obj && audio_tstamp_report);
snd_pcm_unpack_audio_tstamp_report(obj->audio_tstamp_data,
obj->audio_tstamp_accuracy,
audio_tstamp_report);
}
/**
* \brief set audio_tstamp_config from a PCM status container
* \param obj pointer to #snd_pcm_status_t
* \param ptr Pointer to config (valid fields are type and report_analog_delay)
*/
void snd_pcm_status_set_audio_htstamp_config(snd_pcm_status_t *obj,
snd_pcm_audio_tstamp_config_t *audio_tstamp_config)
{
assert(obj && audio_tstamp_config);
snd_pcm_pack_audio_tstamp_config(&obj->audio_tstamp_data, audio_tstamp_config);
}
/**
* \brief Get delay from a PCM status container (see #snd_pcm_delay)
* \return Delay in frames