Commit Graph

7 Commits

Author SHA1 Message Date
David Reid a9043ba26d API CHANGE: Add an onCopy callback to ma_data_source_vtable.
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.
2026-04-29 07:33:50 +10:00
David Reid d7802c3b14 API CHANGE: Remove decoding backend file initialization specializations.
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.
2026-04-28 19:07:23 +10:00
David Reid 77074f0597 API CHANGE: Add an onUninit callback to ma_data_source_vtable.
This callback to execute the data source's uninitialization routine.
2026-04-28 17:27:31 +10:00
David Reid 882d7329f9 Add getter functions for backend vtables. 2026-01-07 09:22:43 +10:00
David Reid 8c52072f43 Remove const qualifiers from decoding backend vtable arrays. 2025-02-23 12:54:19 +10:00
David Reid 8ad250ccf6 Updates to custom decoders. 2025-02-19 12:02:37 +10:00
David Reid 46788d59a8 Rework the libvorbis and libopus custom decoders.
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.
2025-02-17 16:57:47 +10:00