Skip to content

Commit

Permalink
helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinszkudlinski committed Oct 16, 2024
1 parent 5ab25fb commit dea5af7
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/include/sof/audio/audio_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dea5af7

Please sign in to comment.