* Revert "Merge pull request #72 from ChunMinChang/rm-debug-trait"
This reverts commit 828efbcf50, reversing
changes made to 20daa86ae2.
* Implement empty Debug for BufferManager to unbreak the build
* Create a friendly wrapper around dispatch_queue_t
Instead of using low-level dispatch APIs directly, we should create a
wrapper around `dispatch_queue_t` that can retain or release the
reference count automatically.
* Hide low-level dispatch APIs
With the new `Queue` struct is introduced, there is no need to expose
the low-level dispatch APIs. Those low-level dispatch APIs should be
prevented from being used directly.
* Make the task queue stream-local
The stream start, stop, destroy, reinit tasks, from different streams,
will be dispatched to the same task queue and then be executed one by
one. In fact, those tasks dispatched from different streams can be run
separately in parallel since those tasks don't share data in common. We
can create a task queue per stream and dispatch the stream's own task to
its own task queue so those tasks fired from different streams can be
run in parallel. This should boost the speed of creating, staring,
stopping, or reinitializing multiple streams at the same time.
* Implement a sync task runner that runs the final task
Any task appended after the stream-destroy task should be cancelled.
After moving the task queue from being owned by the cubeb context to the
cubeb stream, we can easily cancel the stream X's job in the task queue
after stream X is destroyed, without interfering other stream's tasks.
* Give task queue an unique label
The task queue in the cubeb stream should have a unique lable so it
would be easier to identify the task queue's owner when debugging
issues.
* Merge create_dispatch_queue to Queue::new
* Merge release_dispatch_queue to Queue::drop
* Merge retain_dispatch_queue to Queue::clone
* Merge get_dispatch_context to Queue::get_context
* Merge set_dispatch_context to Queue::set_context
* Init should_cancel to false in new instead of run_final
* Replace generic type by AtomicBool type in {get, set}_context
* Rename {get,set}_context to {get,set}_should_cancel
* Merge async_dispatch to run_async
* Merge sync_dispatch to Queue::run_{sync, final}
* Move create_closure_and_executor into Queue
* Destroy AudioUnitContext properly
* Revise comments
* Set RUST_BACKTRACE in the environment
* Add Rust format check in Travis CI
* Add Rust clippy check in Travis CI
* Fix warning: array_into_iter
Replace `.into_iter()` by `.iter()` used in the Rust array
* Fix warning: private_in_public
Allow private struct AudioUnitStream in public interface when running tests
* Fix clippy errors in audio_unit_get_property_info
* Fix clippy errors in audio_unit_render
* Align interface of audio_unit_get_property with audio_unit_get_property_info
- Change `data` and `size` of audio_unit_get_property from raw pointers
to references
- Make the variable `size` used when calling audio_unit_get_property in
test_audiounit_scope_is_enabled live when the calling explicitly
* Align interface of audio_unit_set_property with audio_unit_get_property's one
* Fix clippy warning: redundant_field_names in create_device_info
* Fix clippy warning: let_and_return in create_blank_device
* Fix clippy warning: let_and_return in audiounit_input_callback
* Fix clippy warning: needless_return in host_time_to_ns
* Fix clippy warning: or_fun_call in get_device_label
The function within `or(...)` will always be called and potentially
allocate an object acting as the default. We don't need to call
get_device_name if get_device_source_name works
* Fix clippy warning: len_zero in Mixer::new
* Fix clippy warning: option_map_unit_fn in Finalizer::drop
* Fix clippy error: float_cmp in minimum_resampling_input_frames
* Fix clippy warning: needless_range_loop in audiounit_output_callback
* Allow clippy::mutex_atomic on set_buffer_size_sync
* Fix clippy warning: redundant_clone in get_range_of_sample_rates
* Fix clippy warning: cmp_null in DevicesData::is_empty
* Fix clippy warning: unnecessary_unwrap in reinit
* Fix clippy warning: or_fun_call in current_device
* Allow clippy::cognitive_complexity on CoreStreamData::setup
* Allow clippy::cast_ptr_alignment on get_device_stream_configuration
* Fix clippy warning: needless_range_loop in get_default_channel_order
* Fix clippy warning: missing_safety_doc for audiounit_rust_init
* Avoid using set_len in allocate_array
`set_len` is unsafe function that should be avoided if possible. On the
other hand, we should initialize the item value when allocating the
array by expected size or the number of the items.
* Fix warning: unused_parens in stream_init
* Fix warning: unused_parens in CoreStreamData::setup
* Skip test changing the default device if no device is available
* Automatically install latest clippy and rustfmt
- Download and install the latest available rustfmt if rustfmt isn't
available in the nightly
- Install latest available clippy if clippy in nightly isn't available
* Move STREAM_FORMAT to the function using it
* Add a test template with default callbacks
* Revise comments
* Add manual tests: Loop in input/output/duplex streams
* Remove unnecessary type declarations
* Set RUST_BACKTRACE in test script
* Move common test code to tests/utils.rs
* Fix type
* Terminate stream by pressing q
* Create a stream tester with common testing operations
* Add a choice to quit early
* Revise stream tester
To add the command to create or destroy the stream, the cubeb context
need to be passed to the test function. Instead of using the test
template that will pass the cubeb stream, using the test template that
will give te cubeb context is the right way to create the test.
* Revise command line interface
* Make utf8_from_cfstringref work with empty CFStringRef
Passing a CFStringRef whose internal string is ""(empty) to
utf8_from_cfstringref will hit an assertion that asserts the passed
CFStringRef cannot be empty. Instead of using the assertion, an empty u8
vec should be returned directly when the passed CFStringRef is empty,
which will yeild an empty String or CString in to_string or to_cstring.
* Move the static strings to their corresponding tests
* Use official coreaudio-sys
* Remove duplicate tests
`cargo test --verbose` will be called in run_test.sh so there is no need
to call `cargo test --verbose` in the .travis.yml
* Replace audiounit_create_device_from_hwdev by create_cubeb_device_info
* Replace get_device_name by get_device_uid
* Replace audiounit_get_channel_count by get_channel_count
* Set the devid of cubeb_device_info anyway
* Rewrite get_device_uid to get device info by scope
* Create get_device_source to get device info
* Create get_device_source_name to get device info
* Create get_property_address to generate property address
* Create get_device_name to get device info
* Create get_device_label to get device info
* Implement StringRef
* Apply StringRef in device property utils
* Create get_device_manufacturer to get device info
* Move audiounit_strref_to_cstr_utf8 to test-only file
* Make device_type more type-sensible
* Move the position of the max_channels assignment
* Create get_device_buffer_frame_size_range to get device info
* Use DeviceType in audiounit_get_available_samplerate
* Use DeviceType in audiounit_get_device_presentation_latency
* Remove unnecessary code
* Add tests for device property utils
* Return OSStatus when failing to get device info
* update todo list
* Print error directly when failing to get device vendor info