Граф коммитов

34 Коммитов

Автор SHA1 Сообщение Дата
Paul Adenot b8765e132d Inline values for stream params in test_logging.cpp, undef defines in test to avoid breaking unified builds when building tests in Firefox. 2022-12-02 15:40:20 +01:00
Paul Adenot e6c328cdee Increase delay to really test the pulse backend.
Turns out it was testing the preroll, and with the preroll gone from the
pulse-rust backend in https://github.com/mozilla/cubeb-pulse-rs/pull/69,
this fails on (at least) docker-on-AWS hosts.
2021-07-28 11:22:26 +12:00
Alex Chronopoulos 5066cfcf42
tests: check correctly the audio buffer values range (BMO 1484541). (#461)
* 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-10-18 16:57:01 +02:00
Bryce Van Dyk 4c18a84a45 Explicitly init stream_params.prefs in tests.
Also update the example code comment in cubbeb.h to reflect new param usage.
2018-01-23 08:50:28 +13:00
Alex Chronopoulos af50e9c96f audiounit: clear tsan warnings 2017-06-06 15:46:05 +12:00
Dan Glastonbury c9641ca143 Add backend specification support to common.h
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-05-23 15:32:12 +12:00
Michael Maltese 72a9685857 tests: Remove code preferring floats on Win32
The WASAPI backend supports S16, same as the other backends.
2017-04-13 09:22:09 +12:00
Chun-Min Chang 6e3a6aea3b Use plain std::unique_ptr and new instead of custom deleter 2017-04-07 18:24:14 +12:00
Chun-Min Chang 2b1132b1e8 Using gtest style's error message in cubeb (#274)
* Replace printf by fprintf

* Turn error log into gtest's style

* Avoid scan-build warning by replacing raw pointer with unique_ptr
2017-04-07 15:44:24 +12:00
Chun-Min Chang 7d68ec269d Replace cubeb_cleaner and cubeb_stream_cleaner by unique_ptr 2017-04-06 20:14:00 +12:00
Chun-Min Chang 2612c2075b Using RAII helpers for cubeb context and stream but leaving test_sanity for explicit flow control 2017-04-06 20:14:00 +12:00
Damien Zammit 4c39aae8d3 cubeb-api: Give cubeb_init a third param, backend name
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 <damien@zamaudio.com>
2017-03-13 11:00:12 +13:00
Chun-Min Chang a900d6e511 Support multiple channels on Windows (#171)
* Multiple channel support on Windows

* Move up/down mixing code from cubeb_wasapi.cpp to standalone cubeb_mixer.cpp
2016-12-20 19:18:07 -10:00
Matthew Gregan 5fd234931f Fix existing Clang analyzer warnings to allow warnings-as-errors. 2016-11-15 16:25:27 +13:00
Matthew Gregan b46ffc5d12 Always include "gtest/gtest.h" first.
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-11 16:09:49 +13:00
Matthew Gregan e1da80422e Move gtests under general "cubeb" test case for better Gecko integration. 2016-11-11 15:00:23 +13:00
Matthew Gregan 5a2b774ba4 Allow building gtests as a single binary.
Syntax only changes.  This is necessary for Gecko integration.
2016-11-11 14:50:16 +13:00
Matthew Gregan 5574f4d3a1 Move tests out of main into their own test. 2016-11-11 09:44:29 +13:00
Matthew Gregan 55ed801cfd Convert tests to gtests. 2016-11-11 09:44:29 +13:00
Nicholas Nethercote 474c8ceb4b Remove unnecessary XPCOM dependency from unit tests. BMO #1314514. 2016-11-11 09:44:29 +13:00
Matthew Gregan 8c41e5641d Revert "Remove unnecessary XPCOM dependency from unit tests. BMO #1314514."
This reverts commit 70497380eb.

See comment 4 in the BMO bug for details.
2016-11-03 17:07:19 +13:00
Nicholas Nethercote 70497380eb Remove unnecessary XPCOM dependency from unit tests. BMO #1314514. 2016-11-02 17:54:53 +13:00
Matthew Gregan a1f417334b test: Fix unused parameter warnings. 2016-08-23 13:20:54 +12:00
Paul Adenot 5d41eb1b70 Update tests to have the latency in frames. 2016-07-20 14:20:37 +02:00
Alex Chronopoulos 22f38cd3ff Signature change for stream init and data callback 2016-01-20 20:17:11 +02:00
Paul Adenot 3e8df23930 Remove use of nullptr in tests. 2016-01-14 14:25:01 +01:00
Paul Adenot 46e32bdac9 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>
2016-01-13 17:36:53 +01:00
Matthew Gregan eb30ecdf0c test: follow-up to 1e626604; fix copy/paste error. 2015-12-02 11:30:34 +13:00
Matthew Gregan 1e6266043c test: follow-up to 5fa112ab; fix float/int16 ifdef. 2015-12-01 14:11:27 +13:00
Jan Beich 84a6e75dcc test: Bump _XOPEN_SOURCE to 600 to fix FreeBSD builds. 2015-12-01 12:55:42 +13:00
Matthew Gregan 46696c5337 tests: initialize XPCOM in Gecko builds. 2015-11-26 11:04:12 +13:00
Matthew Gregan 5fa112ab6b tests: handle backends that do not support S16 (WASAPI) correctly. 2015-11-26 10:57:04 +13:00
Matthew Gregan 14d97931da clarify and clean up handling of optional functions in the API. fixes #46. 2014-11-28 15:56:57 +13:00
Matthew Gregan 18a74a8dfd Sync changes with gecko-dev version. 2014-04-04 14:57:30 +13:00