aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/test_audio.cpp
AgeCommit message (Collapse)Author
2023-11-10Non-functional change: clang-format testsPaul Adenot
2022-12-02Inline values for stream params in test_logging.cpp, undef defines in test ↵Paul Adenot
to avoid breaking unified builds when building tests in Firefox.
2019-08-22Remove panning API from cubebPaul Adenot
This is best done by the host application, and had very little implementation anyways.
2018-10-18 tests: check correctly the audio buffer values range (BMO 1484541). (#461)Alex Chronopoulos
* tests: check correctly the audio buffer values range (BMO 1484541). * tests: create a comfortable way to enable logs in tests * duplex test: check audio range correctly and change the input channel to stereo to avoid AD mixer (BMO 1484541). * test_duplex: Revert back input channel to mono
2018-03-19Multi-channels support for windows/mac/linux (#426)Jean-Yves Avenard
* Add QUAD and QUAD_LFE layouts. * Remove dual mono layout. It makes no sense to have a case for those as the data structure used (a bitmask) do not allow to represent this channel layout (a channel can only be present once). As such it was a non-functional layout * Fix up cubeb_pulse compilation using C++ keyword. * Remove the concept of preferred layout. Channel layout is derived by the content being played. The concept of preferred layout is meaningless. Either we have a layout defined, or we don't. There's no in-between. So we remove it. * Remove CHANNEL_MONO concept. * Add cubeb_sample_size convenience method. * Rework cubeb_mixer. This completely replace the existing remixer which had serious limitations: 1- Had no memory bound checks 2- Could only downmix 5.1 and 7.1 to stereo. This mixer allows to convert from any sane layout to any other and work directly on interleaved samples. This cubeb_mixer doesn't have an API compatible with the previous one. This commit is non-fonctional, and was split for ease of review. * Fix remixing on mac, windows and pulse backend. * Make cubeb_mixer creation infallible. Rather than ignore nonsensical layouts, we attempt to play it according to the stream channels count instead. The audio data will be played as-is, dropping the extra channels or inserting silence where needed. * User proper sample size when calculating offsets. Should the user data be of a different type to what the AudioUnit output is set to, we would have written outside the end of our allocated buffer. * Fix input mixing and clarify frames vs samples terminology * If a layout is unknown or invalid, always treat it as plain stereo or mono.
2018-01-23Explicitly init stream_params.prefs in tests.Bryce Van Dyk
Also update the example code comment in cubbeb.h to reflect new param usage.
2017-05-23Add backend specification support to common.hDan Glastonbury
Set CUBEB_BACKEND env var to the name of valid backend supported by the current platform to prefer that backend over the default choice. If CUBEB_BACKEND is not valid, backend selection falls back to the standard behaviour. A warning is printed to stderr if the chosen backend id doesn't match the requested one.
2017-04-13tests: Remove code preferring floats on Win32Michael Maltese
The WASAPI backend supports S16, same as the other backends.
2017-04-06Replace cubeb_cleaner and cubeb_stream_cleaner by unique_ptrChun-Min Chang
2017-04-06Using RAII helpers for cubeb context and stream but leaving test_sanity for ↵Chun-Min Chang
explicit flow control
2017-03-13cubeb-api: Give cubeb_init a third param, backend nameDamien Zammit
This allows forcing of a particular backend by name, *if* it was compiled in, otherwise default list is tried in default order as before. Tests updated to reflect new api. (Gecko change required) Using JACK backend: 100% tests passed, 0 tests failed out of 13 Total Test time (real) = 183.75 sec Signed-off-by: Damien Zammit <[email protected]>
2017-01-24Test code simplification (#220)Sebastien Alaiwan
* Tests: don't use dynamic memory allocation for synth_state * Tests: avoid explicit control flow for error/resource management, use RAII helpers * Tests: put synth_run into synth_state struct * Tests: use std::string to simplify backend matching code * Use range-based for loop
2017-01-23tests: don't duplicate code that can be parameterized by its type (#219)Sebastien Alaiwan
2016-12-20Support multiple channels on Windows (#171)Chun-Min Chang
* Multiple channel support on Windows * Move up/down mixing code from cubeb_wasapi.cpp to standalone cubeb_mixer.cpp
2016-11-24pulse: Complete pulse_stream_set_panning implementation.Matthew Gregan
The existing implementation called pa_cvolume_set_balance on an uninitialized pa_cvolume (which triggered a Valgrind warning) and then forgot to apply the result to the sink input.
2016-11-11Always include "gtest/gtest.h" first.Matthew Gregan
This is primarily required to fix Gecko integration bustage on the OS X 10.7 builders, where defining _XOPEN_SOURCE before including <iostream> causes errors with _asprintf_l in the C++ <locale> header.
2016-11-11Move gtests under general "cubeb" test case for better Gecko integration.Matthew Gregan
2016-11-11Allow building gtests as a single binary.Matthew Gregan
Syntax only changes. This is necessary for Gecko integration.
2016-11-11Move tests out of main into their own test.Matthew Gregan
2016-11-11Prefer binary comparison asserts over boolean asserts.Matthew Gregan
2016-11-11Convert tests to gtests.Matthew Gregan
2016-11-11Remove unnecessary XPCOM dependency from unit tests. BMO #1314514.Nicholas Nethercote
2016-11-03Revert "Remove unnecessary XPCOM dependency from unit tests. BMO #1314514."Matthew Gregan
This reverts commit 70497380eb5351f967c3fa52f3eb432969c2e65d. See comment 4 in the BMO bug for details.
2016-11-02Remove unnecessary XPCOM dependency from unit tests. BMO #1314514.Nicholas Nethercote
2016-08-23test: Fix unused parameter warnings.Matthew Gregan
2016-07-20Update tests to have the latency in frames.Paul Adenot
2016-07-19Update a test to have the latency in frames.Paul Adenot
2016-01-20Signature change for stream init and data callbackAlex Chronopoulos
2016-01-14Remove use of nullptr in tests.Paul Adenot
2016-01-13Preparatory work for the input and duplex codePaul Adenot
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>
2015-12-01test: Bump _XOPEN_SOURCE to 600 to fix FreeBSD builds.Jan Beich
2015-11-26tests: initialize XPCOM in Gecko builds.Matthew Gregan
2015-11-26tests: handle backends that do not support S16 (WASAPI) correctly.Matthew Gregan
2015-09-25test: return NULL if malloc fails in synth_create.Matthew Gregan
2014-11-28clarify and clean up handling of optional functions in the API. fixes #46.Matthew Gregan
2014-10-14jack backend: handle cubeb_stream_set_volume correctly. Add corresponding ↵Sebastien Alaiwan
test to test_audio.
2014-04-04Sync changes with gecko-dev version.Matthew Gregan