整理代码

This commit is contained in:
蒲爽 2026-09-28 21:33:04 +08:00
commit c7b4e178ec
364 changed files with 59691 additions and 0 deletions

50
video/alsa/Output.h Normal file
View file

@ -0,0 +1,50 @@
#ifndef A7586F47_A0A8_4B55_9701_8E79240D6736
#define A7586F47_A0A8_4B55_9701_8E79240D6736
/*
*******************************************************************************
* INCLUDE
*******************************************************************************
*/
#include "../core/AudioOutput.h"
#include "PCM.h"
#include "SoundCard.h"
#include "util/Task.h"
namespace Video
{
namespace ALSA
{
/*
*******************************************************************************
* CLASS DECLARE
*******************************************************************************
*/
class Output: public Core::AudioOutput
{
public:
Output(const std::string& arg);
~Output();
protected:
void initialize() override;
void deinitialize() override;
void onConfigChanged(ParameterNames& names) override;
void writeFrame(Core::Frame::Ptr pFrame) override;
SoundCard::Ptr getSoundCard();
bool tryEstablishSoundCard();
void runSearchTask();
PROPERTY_DECLARE(SoundCardEstablished, bool, false, protected, protected)
private:
std::string _soundCardID;
::Util::Task _searchTask;
PCM _pcm;
snd_pcm_access_t _access;
int _samples;
int _channels;
};
}
}
#endif