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

72 Коммитов

Автор SHA1 Сообщение Дата
Paul Adenot 54217bca3f Relax a single test_sanity.cpp assertion when using OpenSL 2023-11-21 11:08:34 +01:00
Paul Adenot 687b1e3446 Non-functional change: clang-format tests 2023-11-10 15:31:52 +01:00
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
Matthew Gregan 8942382280 Remove cubeb_stream_reset_default_device API. 2021-02-17 22:05:37 +13:00
Brendan Early 2e842a01f7 Add method to change stream name 2020-10-07 11:27:54 +13:00
Paul Adenot 660864ede5 Address review comments 2020-09-21 19:36:43 +02:00
Paul Adenot 9820ea03bf Add a test case for WASAPI reconfigure event 2020-09-21 19:36:43 +02:00
Paul Adenot 8c3e32bd24 Remove panning API from cubeb
This is best done by the host application, and had very little
implementation anyways.
2019-08-22 10:11:25 +12:00
Chun-Min Chang 008732ef72 trivial test to check if cubeb_stream_get_latency is callable (for Rust implementation) 2018-12-17 15:25:45 -05:00
Chun-Min Chang 5f025918a8 Remove misleading comments 2018-12-17 15:25:45 -05: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
Jean-Yves Avenard 789eaaa3b0 Multi-channels support for windows/mac/linux (#426)
* 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-03-19 14:57:07 +01: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
Dan Glastonbury 608affca8b test_sanity: Assert devid are same between two cubeb_eumerate_devices. 2017-08-29 19:05:30 +10:00
Matthew Gregan d59010398c Remove unused B2G-only stream_type field from cubeb_stream_params. (#347) 2017-08-07 22:45:24 +12:00
Alex Chronopoulos bb189841de New test for undefined layout on output 2017-07-12 09:27:20 +03:00
Dan Glastonbury d16db3b692 Change cubeb_get_min_latency to take params via pointer.
To be consistent with cubeb_stream_init, take the cubeb_stream_params
parameter via pointer instead of by value.  This is a public API
change only---Backends are handed params by value via ops table.
2017-06-24 00:51:53 +12:00
Chun-Min Chang f401f7ef69 cubeb_get_preferred_channel_layout should be verified in test_sanity instead of test_latency 2017-05-26 18:01:23 +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 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
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 9770b85bf7 Delete double newlines. 2016-11-30 19:40:01 +13:00
Alex Chronopoulos 023503faf8 OpenSL ES full duplex restored (#196)
* opensl: Restore full duplex for OpenSL ES from 1e26a908

* opensl: Fix build errors from gecko build system

* opensl: Add extra debug logs

* opensl: On cubeb_stop pause instead of stop

* opensl: Remove output queue and a small refactoring

* opensl: Remove extra stream destroy on error

* opensl: Change message on assert fail

* opensl: Restore logs after new log system change

* opensl: Android 6 expect EBUSY instead of EDEADLK
2016-11-18 18:03:27 +13:00
Matthew Gregan 5fd234931f Fix existing Clang analyzer warnings to allow warnings-as-errors. 2016-11-15 16:25:27 +13:00
Matthew Gregan 8bab182cd7 Fix TSAN issues in test_sanity. 2016-11-14 10:00:07 +01: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 6b6325d5c9 Remove redundant logging now handled by gtest. 2016-11-11 09:44:29 +13:00
Matthew Gregan 5574f4d3a1 Move tests out of main into their own test. 2016-11-11 09:44:29 +13:00
Matthew Gregan 66c8539ca0 Prefer binary comparison asserts over boolean asserts. 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
Paul Adenot caddb61cd4 Add a test that makes sure the clock value is not reset by starting/stopping the stream. 2016-10-25 17:23:21 +02:00
Paul Adenot 30ac9f0c8e Revert "opensl: Implement capture and full-duplex streams."
This reverts commit d880e44e19.
2016-10-17 15:31:33 +02:00
Matthew Gregan a17d262ea0 Fix unused param warning in ARRAY_LENGTH. 2016-10-13 15:15:57 +13:00
Matthew Gregan 3abb82add9 Trivial warning fixes. 2016-10-13 12:04:35 +13:00
Alex Chronopoulos d880e44e19 opensl: Implement capture and full-duplex streams.
Closes #114.
2016-09-22 17:13:39 +12:00
Matthew Gregan a1f417334b test: Fix unused parameter warnings. 2016-08-23 13:20:54 +12:00
Matthew Gregan a966fafbf7 test: remove VS2013 polyfill. 2016-07-25 10:20:07 +12:00
Paul Adenot 43bcb26999 Update tests for the new latency interface. 2016-07-12 19:42:58 +02:00
Alex Chronopoulos b8b4f3f8df Change stream type from voice to music 2016-06-09 13:31:11 +03:00
Alex Chronopoulos a676fb76a1 Set stream_type used by Android 2016-06-09 12:45:25 +03:00
Damien Zammit 6e2a74a304 test_sanity: Fix for zeroing buffers of correct type
Signed-off-by: Damien Zammit <damien@zamaudio.com>
2016-06-03 20:17:03 +10:00
Alex Chronopoulos 22f38cd3ff Signature change for stream init and data callback 2016-01-20 20:17:11 +02:00