mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-09 13:29:59 -05:00
alsa-sink/source, sink, source: Consider sample format for avoid-resampling/passthrough
Sample format(e.g. 16 bit, 24 bit) was not considered even if the avoid-resampling option is set or the passthrough mode is used. This patch checks both sample format and rate of a stream to determine whether to avoid resampling in case of the option is set. In other word, it is possble to use the stream's original sample format and rate without resampling as long as these are supported by the device. pa_sink_input_update_rate() and pa_source_output_update_rate() are renamed to pa_sink_input_update_resampler() and pa_source_output _update_resampler() respectively. functions are added as below. pa_sink_set_sample_format(), pa_sink_set_sample_rate(), pa_source_set_sample_format(), pa_source_set_sample_rate() Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
This commit is contained in:
parent
73156649e7
commit
547998db44
11 changed files with 335 additions and 165 deletions
|
|
@ -267,7 +267,7 @@ struct pa_sink {
|
|||
|
||||
/* Called whenever device parameters need to be changed. Called from
|
||||
* main thread. */
|
||||
int (*reconfigure)(pa_sink *s, pa_sample_spec *spec, bool passthrough);
|
||||
void (*reconfigure)(pa_sink *s, pa_sample_spec *spec, bool passthrough);
|
||||
|
||||
/* Contains copies of the above data so that the real-time worker
|
||||
* thread can work without access locking */
|
||||
|
|
@ -443,7 +443,7 @@ unsigned pa_device_init_priority(pa_proplist *p);
|
|||
|
||||
/**** May be called by everyone, from main context */
|
||||
|
||||
int pa_sink_reconfigure(pa_sink *s, pa_sample_spec *spec, bool passthrough);
|
||||
void pa_sink_reconfigure(pa_sink *s, pa_sample_spec *spec, bool passthrough);
|
||||
void pa_sink_set_port_latency_offset(pa_sink *s, int64_t offset);
|
||||
|
||||
/* The returned value is supposed to be in the time domain of the sound card! */
|
||||
|
|
@ -512,6 +512,9 @@ bool pa_sink_set_formats(pa_sink *s, pa_idxset *formats);
|
|||
bool pa_sink_check_format(pa_sink *s, pa_format_info *f);
|
||||
pa_idxset* pa_sink_check_formats(pa_sink *s, pa_idxset *in_formats);
|
||||
|
||||
void pa_sink_set_sample_format(pa_sink *s, pa_sample_format_t format);
|
||||
void pa_sink_set_sample_rate(pa_sink *s, uint32_t rate);
|
||||
|
||||
/*** To be called exclusively by the sink driver, from IO context */
|
||||
|
||||
void pa_sink_render(pa_sink*s, size_t length, pa_memchunk *result);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue