Commit graph

24 commits

Author SHA1 Message Date
Wim Taymans
3e8cf31a96 audio-converter: perform dithering on the current format
Use the current (intermediate) format to decide how to set up dithering
instead of the input format.
2016-02-24 14:57:31 +01:00
Wim Taymans
5cef3f31ad audio-converter: make a copy if we can't write in unpack
If we don't have writable memory, make sure to make a copy of the input
samples into a temporary (writable) buffer, even if we are dealing with
a native intermediate format that we don't need to call the unpack
function for.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=761655
2016-02-10 12:51:23 +01:00
Wim Taymans
03566e5002 audio-converter: add reset function 2016-01-26 17:19:34 +01:00
Wim Taymans
2d971df593 audio-converter: handle NULL input
Allow NULL as input to mean silence samples.
2016-01-26 17:19:34 +01:00
Wim Taymans
6050509b65 audio-converter: improve _update_config
Allow NULL config to keep the existing parameters.
Fix the docs.
2016-01-26 17:19:34 +01:00
Wim Taymans
0f757bc23c audio-converter: audio-converter: make some optimized functions
Make optimized functions for generic and passthrough conversion.
2016-01-26 17:19:34 +01:00
Wim Taymans
3674742957 audio-converter: ensure correct alignment of samples
Make sure that the data we allocate for our temporary buffers is
properly aligned.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=760938
2016-01-21 16:27:50 +01:00
Wim Taymans
ef3844cf6f audio-converter: Avoid conversion when possible
When the input and output formats are the same and in a possible
intermediate format, avoid unpack and pack.
Never do passthrough channel mixing.
Only do dithering and noise shaping in S32 format
2016-01-12 15:27:16 +01:00
Wim Taymans
8a8b12189e audio-converter: improve processing loop
Process as many samples as we can from the input and return the number
of processed samples from the chain. This simplifies some code.
Fix the IN_WRITABLE handling, don't overwrite the flags.
2016-01-12 11:37:17 +01:00
Wim Taymans
85afad72ec audio-converter: small API tweaks
Pass flags in _converter_new() so that we can configure ourselves
differently depending on some options.
SOURCE_WRITABLE -> IN_WRITABLE because the array is called 'in'
2016-01-08 17:34:50 +01:00
Wim Taymans
7f49b946cc audio-converter: prepare API for rate changes
Use the update function to update the sample rates along with the config
once we implement resampling.
2016-01-08 17:28:31 +01:00
Wim Taymans
980163457e audio-convert: simplify API
Simplify the API, we don't need the consumed and produced output
arguments. The caller needs to use the _get_in_frames/get_out_frames API
to check how much input is needed and how much output will be produced.
2016-01-08 17:19:58 +01:00
Wim Taymans
40f4c5e352 audio: GstAudioChannelMix -> GstAudioChannelMixer
Rename the GstAudioChannelMix object to GstAudioChannelMixer because it
looks better and to avoid a conflict with a library in -bad.
2016-01-08 16:41:17 +01:00
Stefan Sauer
7bbfa39ada audioconvert: fix passthrough operation
We did not take the sample size into account. Rearrange the tests to have more
conversion test and an extra test case for passthrough operations.

Fixes #759890
2015-12-29 14:40:32 +01:00
Stefan Sauer
0bd3f818bb audio-converter: code cleanup
Rename samples to num_samples, since we also have samples in chain, but that is
the data pointer. Always use gzize for num_samples. Make the log output a bit
more homogenous.
2015-12-27 19:25:20 +01:00
Sebastian Dröge
3459bd6854 audio: Fix some documentation warnings
Remove/rename function parameters and skip some functions that can't
be used by bindings as they are now.
2015-12-26 09:43:56 +01:00
Wim Taymans
08734e7598 audio-converter: rework the main processing loop
Rework the main processing loop. We now create an audio processing
chain from small core functions. This is very similar to how the
video-converter core works and allows us to statically calculate an
optimal allocation strategy for all possible combinations of operations.
Make sure we support non-interleaved data everywhere.
Add functions to calculate in and out frames and latency.
2015-12-16 11:13:15 +01:00
Wim Taymans
f5a3f70571 audio: adapt API for non-interleaved formats
Allow an array of sample blocks to be passed to the channel mix and
quantizer functions to support non-interleaved formats.
2015-12-14 09:16:08 +01:00
Wim Taymans
aec17c63fd audio-converter: improve API for non-interleaved formats
Make it possible to pass an array of sample blocks when dealing with
non-interleaved formats.
2015-12-14 09:16:08 +01:00
Wim Taymans
5e55968546 audio-convert: improve converter API
Improve the converter API to allow for an max input and output number of
samples and return the number of consumed/produced samples.
2015-12-09 17:16:26 +01:00
Luis de Bethencourt
df16e8dd5a audio-converter: remove unneeded check for unsigned < 0
Commit ff6d1a2a25 changed sample's type from
gint to gsize (and renamed it to in_samples). gsize is an unsigned long,
which means it can never be a negative value and the check making sure that
in_samples is >= 0 is never going to be false. Removing it.

CID 1338689
2015-11-12 14:18:30 +00:00
Wim Taymans
ff6d1a2a25 audio-converter: add output size argument
Make it possible to have a different number of output samples than input
samples when we, for example, want to add resampling later.
2015-11-10 09:53:59 +01:00
Wim Taymans
30977cf1a5 audio-converter: require interleaved samples and no resampling
We can't yet do resampling or anything other than interleaved audio.
2015-11-06 18:00:41 +01:00
Wim Taymans
e3f0f3b91e audio-converter: move audio converter to audio libs
Move the audio-converter helper to the audio library.
2015-11-06 17:53:22 +01:00
Renamed from gst/audioconvert/audioconvert.c (Browse further)