Commit Graph

2694 Commits

Author SHA1 Message Date
David Reid bc619957ca Remove an unnecessary function. 2021-07-04 20:02:34 +10:00
David Reid 33aae652fe API CHANGE: Update ma_get_standard_channel_map().
This adds a capacity parameter for added safety. It also changes the
order of parameters to make it a bit more consistent.
2021-07-04 19:46:00 +10:00
David Reid 3fad6cad86 API CHANGE: Add channel maps to ma_data_source_get_data_format().
This commit also removes the onGetChannelMap callback from the decoding
backend vtable.
2021-07-04 18:21:36 +10:00
David Reid def3140425 Clean up memory allocation routines. 2021-07-04 17:51:19 +10:00
David Reid 071291b848 API CHANGE: Update rules on realloc and allocation callbacks.
Allocation callbacks must now implement onRealloc() themselves. This is
no longer emulated by miniaudio.
2021-07-04 17:38:16 +10:00
David Reid bfe8358d9f Add ma_decoder_get_data_format().
With this change, ma_decoder should now be fully consistent with other
data sources.
2021-07-04 17:32:24 +10:00
David Reid 3ec737d83d Rearrange some code. 2021-07-04 17:26:01 +10:00
David Reid 29ef420ee1 API CHANGE: Update ma_decoder_read_pcm_frames().
This makes ma_decoder_read_pcm_frames() consistent with other data
sources. It now returns a result code and outputs the number of frames
read via an output parameter.
2021-07-04 17:23:53 +10:00
David Reid 2399359089 API CHANGE: Update ma_decoder_get_length_in_pcm_frames().
This is now consistent with all other data sources:

  * Returns a result code
  * Length is returned via an output parameter
2021-07-04 17:03:46 +10:00
David Reid 619822e1fe API CHANGE: Remove encoding-specific init APIs for decoders.
Use the `encodingFormat` variable in the config instead.
2021-07-04 16:55:54 +10:00
David Reid e327e22458 API CHANGE: Replace ma_resource_format with ma_encoding_format.
This also renames the `resourceFormat` variables used by the encoder to
`encodingFormat`.
2021-07-04 16:52:56 +10:00
David Reid 605429ef2a Update some logging to use the new system. 2021-07-04 16:49:52 +10:00
David Reid 468b412a5e API CHANGE: Remove MA_LOG_LEVEL.
This was used with the old logging level system which is no longer
being used.
2021-07-04 16:42:19 +10:00
David Reid 69773353db API CHANGE: Remove MA_LOG_LEVEL_VERBOSE.
This has been replaced with MA_LOG_LEVEL_DEBUG.
2021-07-04 16:41:19 +10:00
David Reid ba0b70e56e API CHANGE: Remove the old logging callback.
This was specific to devices, but now that miniaudio has expanded it's
no longer useful. The new logging system is more generic and useable by
parts outside of devices and contexts.
2021-07-04 16:40:09 +10:00
David Reid 1a4742e262 API CHANGE: Remove mapping from data sources.
This has proven to be exceptionally un-useful in practice and the
maintenance cost just isn't worth it.
2021-07-04 16:34:47 +10:00
David Reid e679602a56 Abandon the allocation type idea.
This might come back later, but for now this is no longer a thing.
2021-07-04 16:27:45 +10:00
David Reid 2bad69ace2 API CHANGE: Switch data sources over to the new vtable system. 2021-07-04 16:23:08 +10:00
David Reid 3e5e10d31a API CHANGE: Update ma_clip_pcm_frames_f32().
This now takes an input and output buffer rather than performing the
clipping in-place.
2021-07-04 16:11:46 +10:00
David Reid fb9716d9d1 API CHANGE: Update ma_clip_samples_f32() to take an input and output.
The previous version only allowed in-place clipping, whereas the new
one supports clipping into a separate buffer. The input and output
buffers can point to the same buffer in which case the clip will be
performed in-place.
2021-07-04 16:10:30 +10:00
David Reid b0927a4439 API CHANGE: Remove ma_zero_pcm_frames().
This has been replaced with ma_silence_pcm_frames().
2021-07-04 16:05:38 +10:00
David Reid 82f3b0eb7a API CHANGE: Remove unnecessary parameter from ring buffers.
This removes the `pBufferOut` parameter from the following APIs:

  * ma_rb_commit_read
  * ma_rb_commit_write
  * ma_pcm_rb_commit_read
  * ma_pcm_rb_commit_write
2021-07-04 16:03:52 +10:00
David Reid f9c496a014 API CHANGE: Rename noPreZeroedOutputBuffer to noPreSilencedOutputBuffer 2021-07-04 16:00:24 +10:00
David Reid 57bc1a285a API CHANGE: Remove shareMode parameter from ma_context_get_device_info. 2021-07-04 15:57:49 +10:00
David Reid 01c8b8d953 API CHANGE: Remove old device config variables. 2021-07-04 15:55:28 +10:00
David Reid 13acb54ef6 Fix a minor typo. 2021-07-04 15:47:28 +10:00
David Reid 7025da51ab API CHANGE: Remove MA_MIN/MAX_SAMPLE_RATE.
These are replaced with ma_standard_sample_rate_min/max.
2021-07-04 15:46:55 +10:00
David Reid 77586a8a43 API CHANGE: Remove unused channel mixing mode. 2021-07-04 15:44:58 +10:00
David Reid 9cabd06494 Remove AVX-512 placeholders. 2021-07-04 15:44:26 +10:00
David Reid ecc9c6e5e7 Fix build when compiling with MA_NO_THREADING. 2021-07-04 15:40:20 +10:00
David Reid b84d222c5e Remove miniaudio_dll. 2021-07-04 15:27:09 +10:00
David Reid ffb5a995c0 Minor improvements to listener indexes. 2021-07-04 14:03:11 +10:00
David Reid cff3398af4 Move some macros over to the main library. 2021-07-04 13:48:11 +10:00
David Reid cc6ef11076 Clean up some old matrix code. 2021-07-04 13:42:43 +10:00
David Reid a99eac9f22 Use rectangular channel mixing instead of shuffling mode.
This fixes an issue where excess channels are not heard when the sound
source has more channels than the listener.
2021-07-04 13:37:16 +10:00
David Reid 2d8b0633a4 Fix some channel mapping bugs. 2021-07-04 13:35:29 +10:00
David Reid 35ce972bd3 Make sure heap layouts are aligned properly. 2021-07-04 11:53:21 +10:00
David Reid ebaa74d608 Improvements to channel conversion during spatialization.
This commit also fixes a bug where panning is incorrectly getting
applied to non-directional channels, such as mono and LFE channels.
2021-07-04 11:37:50 +10:00
David Reid 072efc6f8b Minor updates to channel mapping. 2021-07-04 11:36:24 +10:00
David Reid 81d720e09f Version 0.10.36 2021-07-03 20:29:03 +10:00
David Reid 204169285b Revert an earlier change. 2021-07-03 20:24:17 +10:00
David Reid b6387eb241 Add support for heap preallocation to nodes. 2021-07-03 19:33:45 +10:00
David Reid 5928aa9930 Add support for pre-allocation to engine nodes. 2021-07-03 18:51:17 +10:00
David Reid bf1b518357 Experimental work on a new memory allocation model.
This is work towards using the heap for storing per-channel data so we
can get rid of upper channel count limit and remove MA_MAX_CHANNELS or
at the very least stop MA_MAX_CHANNELS from affecting overall memory
usage.
2021-07-03 18:00:26 +10:00
David Reid 5af250cfea Add support for passing in a NULL channel map to the converter. 2021-07-03 17:34:21 +10:00
David Reid 8d00d9f5fa Add some error checking to ma_node_init(). 2021-07-03 14:22:42 +10:00
David Reid 366aa4346e Relax restrictions on the maximum input and output buses for nodes.
Previously this was restricted to 2 input buses and 2 output buses, but
this has been lifted to 254. When the number exceeds 2, internal data
structures will be allocated on the heap, otherwise they'll use a local
array contained within the ma_node structure.

This commit changes the node configuration. Previously there was a
fixed sized array for specifying the channel counts for each bus. This
array must now be defined outside of the config by the caller. The
following config variables have been renamed:

  * inputChannels > pInputChannels
  * outputChannels > pOutputChannels

This commit also adds the ability to configure input and output bus
counts on a per-instance basis rather than via the node vtable. To do
this, set the bus count in the vtable to MA_NODE_BUS_COUNT_UNKNOWN.
This will tell miniaudio to look at the node config to determine the
bus count rather than the vtable. It's an error to specify this in the
node config if the vtable specifies anything other than
MA_NODE_BUS_COUNT_UNKNOWN.
2021-07-03 12:40:13 +10:00
David Reid db7a3dfd23 Update stb_vorbis. 2021-07-03 07:48:12 +10:00
David Reid 4d1f619ff2 Formatting fixes. 2021-07-02 22:09:29 +10:00
David Reid f568dd8a79 Fix an infinite loop with the Vorbis decoder. 2021-07-02 21:54:50 +10:00