52 lines
1.3 KiB
C++
52 lines
1.3 KiB
C++
#ifndef F16FAA29_322A_4A89_945E_E56FFADAC2CD
|
|
#define F16FAA29_322A_4A89_945E_E56FFADAC2CD
|
|
/*
|
|
*******************************************************************************
|
|
* INCLUDE
|
|
*******************************************************************************
|
|
*/
|
|
#include "AudioAdaptablePipe.h"
|
|
#include "util/FactoryManager.h"
|
|
#include "util/Task.h"
|
|
#include <string>
|
|
|
|
namespace Video
|
|
{
|
|
namespace Core
|
|
{
|
|
/*
|
|
*******************************************************************************
|
|
* CLASS DECLARE
|
|
*******************************************************************************
|
|
*/
|
|
|
|
class AudioOutputSelector
|
|
{
|
|
public:
|
|
static const std::string select(const std::string& arg)
|
|
{
|
|
auto pos = arg.find(':');
|
|
return (pos != std::string::npos) ? arg.substr(0, pos) : arg;
|
|
}
|
|
};
|
|
|
|
class AudioOutput
|
|
: public AudioAdaptablePipe,
|
|
public ::Util::FactoryManager<AudioOutput, const std::string, AudioOutputSelector, const std::string&>
|
|
{
|
|
public:
|
|
using AudioAdaptablePipe::AudioAdaptablePipe;
|
|
|
|
protected:
|
|
void start() override;
|
|
void stop() override;
|
|
|
|
virtual void writeFrame(Frame::Ptr pFrame) = 0;
|
|
void onLink(Core::Component::Ptr pPrevious) override;
|
|
|
|
private:
|
|
Util::Task _task;
|
|
};
|
|
}
|
|
}
|
|
#endif
|