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
13#ifndef __SOF_SOURCE_API_H__
14#define __SOF_SOURCE_API_H__
15
17
33void source_init(struct sof_source *source, const struct source_ops *ops,
34 struct sof_audio_stream_params *audio_stream_params);
35
42
48
54bool source_get_underrun(struct sof_source *source);
55
61uint32_t source_get_id(struct sof_source *source);
62
69int source_set_frm_fmt(struct sof_source *source, enum sof_ipc_frame frm_fmt);
70
78 enum sof_ipc_frame valid_sample_fmt);
79
86int source_set_rate(struct sof_source *source, unsigned int rate);
87
94int source_set_channels(struct sof_source *source, unsigned int channels);
95
102int source_set_underrun(struct sof_source *source, bool underrun_permitted);
103
110int source_set_buffer_fmt(struct sof_source *source, uint32_t buffer_fmt);
111
117void source_set_min_available(struct sof_source *source, size_t min_available);
118
126int source_set_params(struct sof_source *source,
127 struct sof_ipc_stream_params *params, bool force_update);
128
149 const uint32_t byte_align,
150 const uint32_t frame_align_req);
151
154#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 (freed by source_release_data()).
int source_set_valid_fmt(struct sof_source *source, enum sof_ipc_frame valid_sample_fmt)
Set valid sample format for source.
int source_set_underrun(struct sof_source *source, bool underrun_permitted)
Configure whether underrun is permitted on source.
void source_init(struct sof_source *source, const struct source_ops *ops, struct sof_audio_stream_params *audio_stream_params)
Initialize source API structure before any operation.
int source_set_frm_fmt(struct sof_source *source, enum sof_ipc_frame frm_fmt)
Set audio frame format for source.
int source_set_channels(struct sof_source *source, unsigned int channels)
Set channel count for source.
void source_reset_num_of_processed_bytes(struct sof_source *source)
Reset counter of total processed bytes to zero.
int source_set_buffer_fmt(struct sof_source *source, uint32_t buffer_fmt)
Set buffer format for source.
int source_set_alignment_constants(struct sof_source *source, const uint32_t byte_align, const uint32_t frame_align_req)
Set byte and frame alignment constants for source stream.
void source_set_min_available(struct sof_source *source, size_t min_available)
Set minimum available data requirement in bytes.
int source_set_rate(struct sof_source *source, unsigned int rate)
Set sample rate for source.
bool source_get_underrun(struct sof_source *source)
Check if buffer underrun is permitted on source stream.
int source_set_params(struct sof_source *source, struct sof_ipc_stream_params *params, bool force_update)
Configure initial set of audio parameters.
Source audio endpoint API for module input buffers.
static uint32_t source_get_id(struct sof_source *source)
Definition source_api.h:310
sof_ipc_frame
Definition stream.h:16
set of parameters describing audio stream this structure is shared between audio_stream....
Definition audio_stream.h:49
Definition stream.h:71
internals of source API.
Definition source_api.h:137
this is a definition of internals of source API
Definition source_api.h:71