diff --git a/src/include/sof/audio/buffer.h b/src/include/sof/audio/buffer.h index 647debc5a..acd2e151c 100644 --- a/src/include/sof/audio/buffer.h +++ b/src/include/sof/audio/buffer.h @@ -295,4 +295,25 @@ static inline int buffer_set_params(struct comp_buffer *buffer, return 0; } +static inline bool buffer_params_match(struct comp_buffer *buffer, + struct sof_ipc_stream_params *params, + uint32_t flag) +{ + assert(params && buffer); + + if ((flag & BUFF_PARAMS_FRAME_FMT) && + buffer->stream.frame_fmt != params->frame_fmt) + return false; + + if ((flag & BUFF_PARAMS_RATE) && + buffer->stream.rate != params->rate) + return false; + + if ((flag & BUFF_PARAMS_CHANNELS) && + buffer->stream.channels != params->channels) + return false; + + return true; +} + #endif /* __SOF_AUDIO_BUFFER_H__ */