Refactor audio buffering API, this should mainly prevent SDL audio driver from allocating memory in the mixer callback.

This commit is contained in:
elasota
2021-04-25 00:34:02 -04:00
parent f9d3b91f72
commit 5d9dde6589
17 changed files with 374 additions and 180 deletions

View File

@@ -2,6 +2,8 @@
#include "PLCore.h"
struct IGpAudioBuffer;
namespace PortabilityLayer
{
struct AudioChannel;
@@ -11,7 +13,7 @@ namespace PortabilityLayer
struct AudioChannel
{
virtual void Destroy(bool wait) = 0;
virtual bool AddBuffer(const void *lengthTaggedBuffer, bool blocking) = 0;
virtual bool AddBuffer(IGpAudioBuffer *buffer, bool blocking) = 0;
virtual bool AddCallback(AudioChannelCallback_t callback, bool blocking) = 0;
virtual void ClearAllCommands() = 0;
virtual void Stop() = 0;