整理代码

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

99
video/core/VideoMixer.cpp Normal file
View file

@ -0,0 +1,99 @@
/*
*******************************************************************************
* 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()
{
}
}
}