2018-09-13 13:23:06 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "renderer.h"
|
|
|
|
#include <SDL.h>
|
|
|
|
|
2018-09-23 00:12:54 +00:00
|
|
|
#ifndef HAVE_SLVIDEO
|
|
|
|
#error SDL audio backend is only available for Steam Link
|
|
|
|
#error Please install PortAudio to build for Linux
|
|
|
|
#endif
|
|
|
|
|
2018-09-13 13:23:06 +00:00
|
|
|
class SdlAudioRenderer : public IAudioRenderer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SdlAudioRenderer();
|
|
|
|
|
|
|
|
virtual ~SdlAudioRenderer();
|
|
|
|
|
|
|
|
virtual bool prepareForPlayback(const OPUS_MULTISTREAM_CONFIGURATION* opusConfig);
|
|
|
|
|
|
|
|
virtual void submitAudio(short* audioBuffer, int audioSize);
|
|
|
|
|
2018-09-30 05:19:41 +00:00
|
|
|
virtual int detectAudioConfiguration() const;
|
2018-09-13 13:23:06 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
SDL_AudioDeviceID m_AudioDevice;
|
2018-09-13 21:09:03 +00:00
|
|
|
Uint32 m_ChannelCount;
|
|
|
|
Uint32 m_PendingDrops;
|
|
|
|
Uint32 m_PendingHardDrops;
|
|
|
|
Uint32 m_SampleIndex;
|
2018-09-13 13:23:06 +00:00
|
|
|
Uint32 m_BaselinePendingData;
|
|
|
|
};
|