diff options
author | Paul Adenot <[email protected]> | 2016-01-13 17:16:50 +0100 |
---|---|---|
committer | Paul Adenot <[email protected]> | 2016-01-13 17:36:53 +0100 |
commit | 46e32bdac90233b0a4e59d9b7d4319a28bf496ae (patch) | |
tree | 0e7d58fc9709e8a0d2e59d1a00ea7158e29e9a0c /src/cubeb_resampler.h | |
parent | 23a17cb4f9ed2de78a0df5ecdfefbbe47dc83c35 (diff) | |
download | cubeb-46e32bdac90233b0a4e59d9b7d4319a28bf496ae.tar.gz cubeb-46e32bdac90233b0a4e59d9b7d4319a28bf496ae.zip |
Preparatory work for the input and duplex code
This is changing all the signatures of the `cubeb_stream_init` implementations,
the signature of the `data_callback` type, so that cubeb can support audio
input.
`cubeb_stream_init` now has two `cubeb_stream_params` pointers, one for input,
one for output. If two pointers are passed, a "duplex" stream is opened. If only
one pointer is passed, an input-only or output-only stream is created.
Duplex streams have the same sample rate, and sample type. They don't have to
have the same number of channels.
`data_callback` now has two pointers to audio buffers: an input buffer (`NULL`
if this is an output-only stream) containing input data (e.g. a microphone), and
an output buffer, to be filled, as usual, with the audio frames to play. The
two buffers always have the exact same number of audio frames, and are
temporally correlated in a way that ensures the minimal loop-back latency on
the system if one directly copies the input buffer to the output buffer.
No functionnal changes are present in this patch, just signature changes.
Asserts have been added to prevent users to try to use the input code path for
now.
Actual implementations with the input code for different platforms will follow.
Green `mozilla-central` push:
<https://treeherder.mozilla.org/#/jobs?repo=try&revision=15b4dd3cbbe8>
Diffstat (limited to 'src/cubeb_resampler.h')
-rw-r--r-- | src/cubeb_resampler.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cubeb_resampler.h b/src/cubeb_resampler.h index e63c2c1..64f5d58 100644 --- a/src/cubeb_resampler.h +++ b/src/cubeb_resampler.h @@ -53,7 +53,8 @@ cubeb_resampler * cubeb_resampler_create(cubeb_stream * stream, * @retval CUBEB_ERROR on error. */ long cubeb_resampler_fill(cubeb_resampler * resampler, - void * buffer, long frames_needed); + void * input_buffer, + void * output_buffer, long frames_needed); /** * Destroy a cubeb_resampler. |