This is used for making a copy of a data source.
Data sources are not required to support copying, in which case this
callback can be set to NULL, or it can return MA_NOT_IMPLEMENTED.
This commit just sets up the infrastructure. As of this commit, no data
sources actually implement this, however future commits will be
introducing support in stages.
This should return the size of the implementations struct. For example,
`ma_decoder` would return `sizeof(ma_decoder)`.
This is in preparation for future work to support copying data sources.
This removes the onInitFile and onInitFileW callbacks from
ma_decoding_backend_vtable. This means decoding backends can no longer
implement a specialized initialization routine for loading from a file.
What this does is enforces all file IO to go through the same code path,
that being the `ma_decoder` and `ma_vfs` infrastructure. It also
simplifies the backend vtable.
The ability to initialize from memory (the onInitMemory callback) is
still available and there are not plans to remove this.
This removes the allocation callbacks parameter. These are now managed
internally. This is in preparation for some future changes to data
source management.
These have been renamed to the following:
ma_data_source_init > ma_data_source_base_init
ma_data_source_uninit > ma_data_source_base_uninit
The new naming scheme makes it clearer that you're initializing the
base data source structure.
The `onGetEncodingFormat` callback has been removed and replaced with an
`onInfo`. This new callback fills out a struct with the supported
encoding format (is recognized by miniaudio), in addition to the name of
the decoding backend, and the decoding library and vendor.
This was incorrectly choosing the wrong endian-specific sample format
when the endian.h header was not included. This commit switches to
runtime endian detection.