整理代码
This commit is contained in:
commit
c7b4e178ec
364 changed files with 59691 additions and 0 deletions
53
video/alsa/Input.h
Normal file
53
video/alsa/Input.h
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
#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<Input, const std::string&>
|
||||
{
|
||||
public:
|
||||
using Ptr = Poco::AutoPtr<Input>;
|
||||
|
||||
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<bool> _established;
|
||||
int _linesize;
|
||||
int _channels;
|
||||
int _samples;
|
||||
snd_pcm_access_t _access;
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue