more pip changes

Origin commit data
------------------
Commit: 019fadbe29
Author: BPanther <bpanther_ts@hotmail.com>
Date: 2021-10-15 (Fri, 15 Oct 2021)
This commit is contained in:
BPanther
2021-10-15 14:55:29 +02:00
committed by vanhofen
parent 1fc8de297d
commit 40947e8c60
3 changed files with 44 additions and 36 deletions

View File

@@ -199,8 +199,9 @@ class CZapitMessages
t_channel_id channel_id; t_channel_id channel_id;
bool record; bool record;
bool pip; bool pip;
int pip_dev;
bool epg; bool epg;
commandZaptoServiceID():channel_id(0),record(false),pip(false),epg(false){} commandZaptoServiceID():channel_id(0), record(false), pip(false), pip_dev(0), epg(false){}
}; };
struct commandZaptoEpg struct commandZaptoEpg
{ {

View File

@@ -213,6 +213,7 @@ unsigned int CZapitClient::zapTo_pip(const t_channel_id channel_id, int pip)
msg.channel_id = channel_id; msg.channel_id = channel_id;
msg.record = false; msg.record = false;
msg.pip = true; msg.pip = true;
msg.pip_dev = pip;
msg.epg = false; msg.epg = false;
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(mutex); OpenThreads::ScopedLock<OpenThreads::Mutex> lock(mutex);

View File

@@ -691,16 +691,16 @@ bool CZapit::StopPip(int pip)
} }
#endif #endif
if (pip_channel_id[0]) { if (pip_channel_id[pip]) {
INFO("[pip] stop %llx", pip_channel_id); INFO("[pip] stop %llx", pip_channel_id[pip]);
#if !HAVE_CST_HARDWARE #if !HAVE_CST_HARDWARE
pipVideoDecoder[0]->ShowPig(0); pipVideoDecoder[pip]->ShowPig(0);
#endif #endif
CCamManager::getInstance()->Stop(pip_channel_id, CCamManager::PIP); CCamManager::getInstance()->Stop(pip_channel_id[pip], CCamManager::PIP);
pipVideoDemux[0]->Stop(); pipVideoDemux[pip]->Stop();
pipVideoDecoder[0]->Stop(); pipVideoDecoder[pip]->Stop();
pip_fe[0] = NULL; pip_fe[pip] = NULL;
pip_channel_id[0] = 0; pip_channel_id[pip] = 0;
return true; return true;
} }
return false; return false;
@@ -745,7 +745,7 @@ bool CZapit::StartPip(const t_channel_id channel_id, int pip)
if(!ParsePatPmt(newchannel)) if(!ParsePatPmt(newchannel))
return false; return false;
pip_fe[0] = frontend; pip_fe[pip] = frontend;
#if HAVE_CST_HARDWARE #if HAVE_CST_HARDWARE
INFO("[pip] vpid %X apid %X pcr %X", newchannel->getVideoPid(), newchannel->getAudioPid(), newchannel->getPcrPid()); INFO("[pip] vpid %X apid %X pcr %X", newchannel->getVideoPid(), newchannel->getAudioPid(), newchannel->getPcrPid());
@@ -765,41 +765,41 @@ bool CZapit::StartPip(const t_channel_id channel_id, int pip)
cDemux::SetSource(dnum, pip_fe->getNumber()); cDemux::SetSource(dnum, pip_fe->getNumber());
#else #else
#ifdef DYNAMIC_DEMUX #ifdef DYNAMIC_DEMUX
int dnum = CFEManager::getInstance()->getDemux(newchannel->getTransponderId(), pip_fe[0]->getNumber()); int dnum = CFEManager::getInstance()->getDemux(newchannel->getTransponderId(), pip_fe[pip]->getNumber());
INFO("[pip] dyn demux: %d", dnum); INFO("[pip] dyn demux: %d", dnum);
#else #else
/* FIXME until proper demux management */ /* FIXME until proper demux management */
int dnum = 1; int dnum = pip + 1;
INFO("[pip] demux: %d", dnum); INFO("[pip] demux: %d", dnum);
#endif #endif
INFO("[pip] vpid %X apid %X pcr %X", newchannel->getVideoPid(), newchannel->getAudioPid(), newchannel->getPcrPid()); INFO("[pip] vpid %X apid %X pcr %X", newchannel->getVideoPid(), newchannel->getAudioPid(), newchannel->getPcrPid());
if (!pipVideoDemux[0]) { if (!pipVideoDemux[pip]) {
pipVideoDemux[0] = new cDemux(dnum); pipVideoDemux[pip] = new cDemux(dnum);
pipVideoDemux[0]->Open(DMX_VIDEO_CHANNEL); pipVideoDemux[pip]->Open(DMX_VIDEO_CHANNEL);
if (!pipVideoDecoder[0]) { if (!pipVideoDecoder[pip]) {
pipVideoDecoder[0] = new cVideo(0, NULL, NULL, dnum); pipVideoDecoder[pip] = new cVideo(0, NULL, NULL, dnum);
} }
} }
pipVideoDemux[0]->SetSource(dnum, pip_fe[0]->getNumber()); pipVideoDemux[pip]->SetSource(dnum, pip_fe[pip]->getNumber());
newchannel->setPipDemux(dnum); newchannel->setPipDemux(dnum);
newchannel->setRecordDemux(pip_fe[0]->getNumber()); newchannel->setRecordDemux(pip_fe[pip]->getNumber());
#endif #endif
pipVideoDecoder[0]->SetStreamType((VIDEO_FORMAT)newchannel->type); pipVideoDecoder[pip]->SetStreamType((VIDEO_FORMAT) newchannel->type);
pipVideoDemux[0]->pesFilter(newchannel->getVideoPid()); pipVideoDemux[pip]->pesFilter(newchannel->getVideoPid());
#if HAVE_CST_HARDWARE #if HAVE_CST_HARDWARE
pipVideoDecoder[0]->Start(0, newchannel->getPcrPid(), newchannel->getVideoPid()); pipVideoDecoder[pip]->Start(0, newchannel->getPcrPid(), newchannel->getVideoPid());
pipVideoDemux[0]->Start(); pipVideoDemux[pip]->Start();
pip_channel_id = channel_id; pip_channel_id[pip] = channel_id;
#else #else
pipVideoDemux[0]->Start(); pipVideoDemux[pip]->Start();
pipVideoDecoder[0]->Start(0, newchannel->getPcrPid(), newchannel->getVideoPid()); pipVideoDecoder[pip]->Start(0, newchannel->getPcrPid(), newchannel->getVideoPid());
pip_channel_id[0] = newchannel->getChannelID(); pip_channel_id[pip] = newchannel->getChannelID();
pipVideoDecoder[0]->Pig(g_settings.pip_x,g_settings.pip_y,g_settings.pip_width,g_settings.pip_height,g_settings.screen_width,g_settings.screen_height); pipVideoDecoder[pip]->Pig(g_settings.pip_x,g_settings.pip_y,g_settings.pip_width,g_settings.pip_height,g_settings.screen_width,g_settings.screen_height);
pipVideoDecoder[0]->ShowPig(1); pipVideoDecoder[pip]->ShowPig(1);
#endif #endif
CCamManager::getInstance()->Start(newchannel->getChannelID(), CCamManager::PIP); CCamManager::getInstance()->Start(newchannel->getChannelID(), CCamManager::PIP);
@@ -1286,7 +1286,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
msgResponseZapComplete.zapStatus = ZapForRecord(msgZaptoServiceID.channel_id); msgResponseZapComplete.zapStatus = ZapForRecord(msgZaptoServiceID.channel_id);
#ifdef ENABLE_PIP #ifdef ENABLE_PIP
else if(msgZaptoServiceID.pip) else if(msgZaptoServiceID.pip)
msgResponseZapComplete.zapStatus = StartPip(msgZaptoServiceID.channel_id); msgResponseZapComplete.zapStatus = StartPip(msgZaptoServiceID.channel_id, msgZaptoServiceID.pip_dev);
#endif #endif
else else
msgResponseZapComplete.zapStatus = ZapTo(msgZaptoServiceID.channel_id, (rmsg.cmd == CZapitMessages::CMD_ZAPTO_SUBSERVICEID)); msgResponseZapComplete.zapStatus = ZapTo(msgZaptoServiceID.channel_id, (rmsg.cmd == CZapitMessages::CMD_ZAPTO_SUBSERVICEID));
@@ -2624,8 +2624,11 @@ bool CZapit::Start(Z_start_arg *ZapStart_arg)
pipVideoDemux[0]->Open(DMX_PIP_CHANNEL); pipVideoDemux[0]->Open(DMX_PIP_CHANNEL);
pipVideoDecoder[0] = new cVideo(video_mode, pipVideoDemux[0]->getChannel(), pipVideoDemux[0]->getBuffer(), 1); pipVideoDecoder[0] = new cVideo(video_mode, pipVideoDemux[0]->getChannel(), pipVideoDemux[0]->getBuffer(), 1);
#else #else
pipVideoDecoder[0] = new cVideo(0, NULL, NULL, 1); for (unsigned i=0; i < (unsigned int) g_info.hw_caps->pip_devs; i++)
pipVideoDecoder[0]->ShowPig(0); {
pipVideoDecoder[i] = new cVideo(0, NULL, NULL, i+1);
pipVideoDecoder[i]->ShowPig(0);
}
#endif #endif
} }
#endif #endif
@@ -2843,10 +2846,13 @@ void CZapit::run()
delete audioDemux; delete audioDemux;
#ifdef ENABLE_PIP #ifdef ENABLE_PIP
StopPip(); StopPip();
if (pipVideoDecoder[0]) for (unsigned i=0; i < (unsigned int) g_info.hw_caps->pip_devs; i++)
pipVideoDecoder[0] = NULL; {
if (pipVideoDemux[0]) if (pipVideoDecoder[i])
pipVideoDemux[0] = NULL; pipVideoDecoder[i] = NULL;
if (pipVideoDemux[i])
pipVideoDemux[i] = NULL;
}
#endif #endif
INFO("demuxes/decoders deleted"); INFO("demuxes/decoders deleted");