buf: provide API to access sink/source components

An API for accessing components providing and
consuming data from the buffer added

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
This commit is contained in:
Marcin Szkudlinski 2024-09-27 12:41:26 +02:00 committed by Liam Girdwood
parent 7142931d19
commit 3c672d2681
1 changed files with 16 additions and 0 deletions

View File

@ -143,6 +143,22 @@ struct comp_buffer {
struct list_item sink_list; /* list in comp buffers */
};
/*
* get a component providing data to the buffer
*/
static inline struct comp_dev *comp_buffer_get_source_component(const struct comp_buffer *buffer)
{
return buffer->source;
}
/*
* get a component consuming data from the buffer
*/
static inline struct comp_dev *comp_buffer_get_sink_component(const struct comp_buffer *buffer)
{
return buffer->sink;
}
/* Only to be used for synchronous same-core notifications! */
struct buffer_cb_transact {
struct comp_buffer *buffer;