Sound Open Firmware
Loading...
Searching...
No Matches
source_api.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 *
3 * Copyright(c) 2023 Intel Corporation. All rights reserved.
4 *
5 */
6
7#ifndef __SOF_SOURCE_API_H__
8#define __SOF_SOURCE_API_H__
9
10#include <module/audio/source_api.h>
11
22void source_init(struct sof_source *source, const struct source_ops *ops,
23 struct sof_audio_stream_params *audio_stream_params);
24
28size_t source_get_num_of_processed_bytes(struct sof_source *source);
29
33void source_reset_num_of_processed_bytes(struct sof_source *source);
34
36bool source_get_underrun(struct sof_source *source);
37uint32_t source_get_id(struct sof_source *source);
38
40int source_set_frm_fmt(struct sof_source *source, enum sof_ipc_frame frm_fmt);
41int source_set_valid_fmt(struct sof_source *source,
42 enum sof_ipc_frame valid_sample_fmt);
43int source_set_rate(struct sof_source *source, unsigned int rate);
44int source_set_channels(struct sof_source *source, unsigned int channels);
45int source_set_underrun(struct sof_source *source, bool underrun_permitted);
46int source_set_buffer_fmt(struct sof_source *source, uint32_t buffer_fmt);
47void source_set_min_available(struct sof_source *source, size_t min_available);
48
57int source_set_params(struct sof_source *source,
58 struct sof_ipc_stream_params *params, bool force_update);
59
75int source_set_alignment_constants(struct sof_source *source,
76 const uint32_t byte_align,
77 const uint32_t frame_align_req);
78
79#endif /* __SOF_SOURCE_API_H__ */
size_t source_get_num_of_processed_bytes(struct sof_source *source)
Get total number of bytes processed by the source (meaning - freed by source_release_data()).
int source_set_valid_fmt(struct sof_source *source, enum sof_ipc_frame valid_sample_fmt)
int source_set_underrun(struct sof_source *source, bool underrun_permitted)
void source_init(struct sof_source *source, const struct source_ops *ops, struct sof_audio_stream_params *audio_stream_params)
Init of the API, must be called before any operation.
uint32_t source_get_id(struct sof_source *source)
int source_set_frm_fmt(struct sof_source *source, enum sof_ipc_frame frm_fmt)
set of functions for setting audio parameters
int source_set_channels(struct sof_source *source, unsigned int channels)
void source_reset_num_of_processed_bytes(struct sof_source *source)
sets counter of total number of bytes processed to zero
int source_set_buffer_fmt(struct sof_source *source, uint32_t buffer_fmt)
int source_set_alignment_constants(struct sof_source *source, const uint32_t byte_align, const uint32_t frame_align_req)
Set frame_align_shift and frame_align of stream according to byte_align and frame_align_req alignment...
void source_set_min_available(struct sof_source *source, size_t min_available)
int source_set_rate(struct sof_source *source, unsigned int rate)
bool source_get_underrun(struct sof_source *source)
set of functions for retrieve audio parameters
int source_set_params(struct sof_source *source, struct sof_ipc_stream_params *params, bool force_update)
initial set of audio parameters, provided in sof_ipc_stream_params
Definition stream.h:71