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.
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.
These decoders have been moved into their own subfolders under the
extras/decoders folder:
extras/decoders/libvorbis
extras/decoders/libopus
In addition to being relocated, they have also been split into separate
.c/h pairs. They now work like a more conventional library. The
implementation of these libraries have also been decoupled from the
miniaudio implementation which means they depend only on the header
section of miniaudio.h now.
With this change the custom_decoder and custom_decoder_engine examples
have been updated. To compile these you now need to link in the
miniaudio_libvorbis.c and miniaudio_libopus.c files via your build
tool. For your own code, you can still include the .c files directly
into your code if you want to compile as a single translation unit.