From dea5af73a3c230b22693b2ec9109c4ebb8641467 Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski Date: Wed, 16 Oct 2024 10:23:41 +0200 Subject: [PATCH] helpers --- src/include/sof/audio/audio_buffer.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/include/sof/audio/audio_buffer.h b/src/include/sof/audio/audio_buffer.h index f00af703f182..16e29b79c4b5 100644 --- a/src/include/sof/audio/audio_buffer.h +++ b/src/include/sof/audio/audio_buffer.h @@ -221,6 +221,32 @@ struct sof_audio_stream_params *audio_buffer_get_stream_params(struct sof_audio_ return buffer->audio_stream_params; } +/** set of functions for retrieve audio parameters */ +static inline enum sof_ipc_frame audio_buffer_get_valid_fmt(struct sof_audio_buffer *buffer) +{ + return audio_buffer_get_stream_params(buffer)->valid_sample_fmt; +} + +static inline uint32_t audio_buffer_get_rate(struct sof_audio_buffer *buffer) +{ + return audio_buffer_get_stream_params(buffer)->rate; +} + +static inline uint32_t audio_buffer_get_buffer_fmt(struct sof_audio_buffer *buffer) +{ + return audio_buffer_get_stream_params(buffer)->buffer_fmt; +} + +static inline enum sof_ipc_frame audio_buffer_get_frm_fmt(struct sof_audio_buffer *buffer) +{ + return audio_buffer_get_stream_params(buffer)->frame_fmt; +} + +static inline uint32_t audio_buffer_get_channels(struct sof_audio_buffer *buffer) +{ + return audio_buffer_get_stream_params(buffer)->channels; +} + /** * @brief return a pointer to struct sof_audio_buffer from sink pointer * NOTE! ensure that sink is really provided by sof_audio_buffer