99 lines
2.1 KiB
C++
99 lines
2.1 KiB
C++
/*
|
|
*******************************************************************************
|
|
* INCLUDE
|
|
*******************************************************************************
|
|
*/
|
|
#include "VideoMixer.h"
|
|
|
|
namespace Video
|
|
{
|
|
namespace Core
|
|
{
|
|
/*
|
|
*******************************************************************************
|
|
* CLASS DEFINE
|
|
*******************************************************************************
|
|
*/
|
|
VideoMixer::Channel::Channel(const std::string& name, VideoMixer::Ptr pMixer, uint32_t id)
|
|
: VideoComponent(Poco::format(name + "/CH#%u", id)), _pMixer(pMixer), _id(id)
|
|
{
|
|
Region region = {
|
|
0.0,
|
|
0.0f,
|
|
1.0f,
|
|
1.0f,
|
|
};
|
|
setRegion(region);
|
|
setAttach(false);
|
|
setInput(nullptr);
|
|
setZOrder(0);
|
|
}
|
|
|
|
VideoMixer::Channel::~Channel()
|
|
{
|
|
}
|
|
|
|
void VideoMixer::Channel::onConfigChanged(ParameterNames& names)
|
|
{
|
|
if (names.exists(_Input))
|
|
{
|
|
unlink(true, false);
|
|
if (getAttach())
|
|
{
|
|
auto pInput = getInput();
|
|
if (pInput)
|
|
{
|
|
getInput()->link(sharedFromThis());
|
|
link(mixer());
|
|
}
|
|
|
|
return;
|
|
}
|
|
}
|
|
|
|
if (names.exists(_Attach))
|
|
{
|
|
auto pInput = getInput();
|
|
if (pInput)
|
|
{
|
|
if (getAttach())
|
|
{
|
|
getInput()->link(sharedFromThis());
|
|
link(mixer());
|
|
}
|
|
else
|
|
getInput()->unlink(sharedFromThis());
|
|
}
|
|
}
|
|
}
|
|
|
|
/*
|
|
*******************************************************************************
|
|
* CLASS DEFINE
|
|
*******************************************************************************
|
|
*/
|
|
VideoMixer::VideoMixer(const std::string& name): VideoComponent(name)
|
|
{
|
|
}
|
|
|
|
VideoMixer::~VideoMixer()
|
|
{
|
|
}
|
|
|
|
VideoMixer::Channel::Ptr VideoMixer::getChannel(uint32_t id)
|
|
{
|
|
if (_channels.find(id) == _channels.end())
|
|
_channels[id] = createChannel(id);
|
|
|
|
return _channels[id];
|
|
}
|
|
|
|
void VideoMixer::start()
|
|
{
|
|
}
|
|
|
|
void VideoMixer::stop()
|
|
{
|
|
}
|
|
}
|
|
}
|