代码拉取完成,页面将自动刷新
同步操作将从 广州灵派科技有限公司/Encoder 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include "ChannelVI.h"
#include <math.h>
#include <QFile>
#include "Config.h"
ChannelVI::ChannelVI(QObject *parent) :
Channel(parent)
{
vi=Link::create("InputVi");
encA=Link::create("EncodeA");
encV=Link::create("EncodeV");
encV2=Link::create("EncodeV");
#if (defined HI3519A) || (defined HI3559A)
viR=Link::create("InputVi");
AVS=Link::create("SAVS");
video=AVS;
#else
video=vi;
dei=Link::create("Deinterlace");
#endif
}
void ChannelVI::init(QVariantMap cfg)
{
if(cfg.contains("alsa"))
{
alsa=Link::create("InputAlsa");
audio=Link::create("Resample");
audio->start();
alsa->linkA(audio);
}
else
audio=Link::create("InputAi");
gain->linkA(encA);
if(cfg["encv"].toMap()["lowLatency"].toBool())
video->linkV(encV);
else
overlay->linkV(encV);
if(cfg["encv2"].toMap()["lowLatency"].toBool())
video->linkV(encV2);
else
overlay->linkV(encV2);
#if (defined HI3519A) || (defined HI3559A)
if(enableAVS)
{
vi->linkV(AVS);
viR->linkV(AVS);
AVS->start();
}
else
{
video=vi;
}
#else
vi->linkV(dei);
#endif
Channel::init();
}
void ChannelVI::updateConfig(QVariantMap cfg)
{
if(cfg["enable"].toBool())
{
QVariantMap ad;
if(cfg.contains("alsa"))
{
ad["path"]=cfg["alsa"].toString();
ad["channels"]=2;
alsa->start(ad);
}
else
{
ad["interface"]=cfg["interface"].toString();
#if !(defined HI3521D) && !(defined HI3516E)
ad["resamplerate"]=cfg["enca"].toMap()["samplerate"].toInt();
#endif
#ifdef HI3516E
ad["type"]=(cfg["enca"].toMap()["audioSrc"].toString()=="hdmi")?"i2s":"codec";
#endif
audio->start(ad);
}
#if (defined HI3519A) || (defined HI3559A)
if(enableAVS)
{
QVariantMap vd;
vd["interface"]=cfg["interface"].toString()+"-L";
vi->start(vd);
vd["interface"]=cfg["interface"].toString()+"-R";
viR->start(vd);
}
else
{
QVariantMap vd;
vd["interface"]=cfg["interface"].toString();
vi->start(vd);
}
#else
if(cfg["cap"].toMap()["deinterlace"].toBool())
{
video=dei;
dei->start();
vi->unLinkV(overlay);
dei->linkV(overlay);
}
else
{
video=vi;
dei->stop();
dei->unLinkV(overlay);
vi->linkV(overlay);
}
QVariantMap vd;
vd["interface"]=cfg["interface"].toString();
vd["crop"]=cfg["cap"].toMap()["crop"].toMap();
if(cfg["cap"].toMap().contains("rotate"))
vd["rotate"]=cfg["cap"].toMap()["rotate"].toInt();
vi->start(vd);
#endif
if(cfg["enca"].toMap()["codec"].toString()!="close")
encA->start(cfg["enca"].toMap());
else
encA->stop();
if(cfg["encv"].toMap()["codec"].toString()!="close")
{
QVariantMap dataEncv=cfg["encv"].toMap();
#if (defined HI3519A) || (defined HI3559A)
dataEncv["scaleUp"]=true;
#endif
encV->start(dataEncv);
}
else
encV->stop();
if(data["enable2"].toBool() && cfg["encv2"].toMap()["codec"].toString()!="close")
encV2->start(cfg["encv2"].toMap());
else
encV2->stop();
}
else
{
encA->stop();
encV->stop();
}
Channel::updateConfig(cfg);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。