#ifndef C0535B0C_9BD8_4FDC_9429_8FEF7E58BFCE
#define C0535B0C_9BD8_4FDC_9429_8FEF7E58BFCE
/*
*******************************************************************************
* INCLUDE
*******************************************************************************
*/
#include "../core/AbstractAudioInput.h"
#include "SoundCard.h"
#include "PCM.h"
#include "util/SimpleFactory.h"
namespace Video
{
namespace ALSA
{
/*
*******************************************************************************
* CLASS DECLARE
*******************************************************************************
*/
class Input: public Core::AbstractAudioInput, public ::Util::SimpleFactory
{
public:
using Ptr = Poco::AutoPtr;
public:
Input(const std::string& name);
~Input();
public:
CONFIGURABLE_DECLARE_PARAMETER(SoundCard, SoundCard::Ptr);
protected:
void start() override;
void stop() override;
void onConfigChanged(ParameterNames& names) override;
Core::Frame::Ptr readFrame() override;
bool tryEstablishSoundCard();
private:
PCM _pcm;
std::atomic _established;
int _linesize;
int _channels;
int _samples;
snd_pcm_access_t _access;
};
}
}
#endif