From eeb71277e90d739df50e3b3a926c2ee09e7a9019 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 2 Jan 2024 00:43:08 +0100 Subject: [PATCH] zapit: rework start/stop pip code to get more readability Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d2b287525a81027153687c39d9e128c49b489f09 Author: vanhofen Date: 2024-01-02 (Tue, 02 Jan 2024) Origin message was: ------------------ - zapit: rework start/stop pip code to get more readability ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/zapit/src/zapit.cpp | 45 ++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 3e553adc3..311761cff 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -693,28 +693,34 @@ bool CZapit::StopPip(int pip) if (!g_info.hw_caps->can_pip) return false; -#if !HAVE_CST_HARDWARE && !HAVE_GENERIC_HARDWARE - if (CNeutrinoApp::getInstance()->avinput_pip) { - CNeutrinoApp::getInstance()->StopAVInputPiP(); - } -#endif +#if HAVE_CST_HARDWARE if (pip_channel_id[pip]) { INFO("[pip %d] stop %llx", pip, pip_channel_id[pip]); -#if !HAVE_CST_HARDWARE - pipVideoDecoder[pip]->ShowPig(0); -#endif CCamManager::getInstance()->Stop(pip_channel_id[pip], CCamManager::PIP); pipVideoDemux[pip]->Stop(); pipVideoDecoder[pip]->Stop(); -#if !HAVE_CST_HARDWARE - pipVideoDecoder[pip]->setBlank(pip); - pipAudioDemux[pip]->Stop(); - pipAudioDecoder[pip]->Stop(); -#endif pip_fe[pip] = NULL; pip_channel_id[pip] = 0; return true; } +#else + if (CNeutrinoApp::getInstance()->avinput_pip) { + CNeutrinoApp::getInstance()->StopAVInputPiP(); + } + if (pip_channel_id[pip]) { + INFO("[pip %d] stop %llx", pip, pip_channel_id[pip]); + pipVideoDecoder[pip]->ShowPig(0); + CCamManager::getInstance()->Stop(pip_channel_id[pip], CCamManager::PIP); + pipVideoDemux[pip]->Stop(); + pipVideoDecoder[pip]->Stop(); + pipVideoDecoder[pip]->setBlank(pip); + pipAudioDemux[pip]->Stop(); + pipAudioDecoder[pip]->Stop(); + pip_fe[pip] = NULL; + pip_channel_id[pip] = 0; + return true; + } +#endif return false; } @@ -775,6 +781,13 @@ bool CZapit::StartPip(const t_channel_id channel_id, int pip) } if (CFEManager::getInstance()->getFrontendCount() > 1) cDemux::SetSource(dnum, pip_fe[pip]->getNumber()); + + pipVideoDecoder[pip]->SetStreamType((VIDEO_FORMAT) newchannel->type); + pipVideoDemux[pip]->pesFilter(newchannel->getVideoPid()); + + pipVideoDecoder[pip]->Start(0, newchannel->getPcrPid(), newchannel->getVideoPid()); + pipVideoDemux[pip]->Start(); + pip_channel_id[pip] = channel_id; #else #ifdef DYNAMIC_DEMUX int dnum = CFEManager::getInstance()->getDemux(newchannel->getTransponderId(), pip_fe[pip]->getNumber()); @@ -797,15 +810,9 @@ bool CZapit::StartPip(const t_channel_id channel_id, int pip) pipVideoDemux[pip]->SetSource(dnum, pip_fe[pip]->getNumber()); newchannel->setPipDemux(dnum); newchannel->setRecordDemux(pip_fe[pip]->getNumber()); -#endif pipVideoDecoder[pip]->SetStreamType((VIDEO_FORMAT) newchannel->type); pipVideoDemux[pip]->pesFilter(newchannel->getVideoPid()); -#if HAVE_CST_HARDWARE - pipVideoDecoder[pip]->Start(0, newchannel->getPcrPid(), newchannel->getVideoPid()); - pipVideoDemux[pip]->Start(); - pip_channel_id[pip] = channel_id; -#else pipVideoDemux[pip]->Start(); pipVideoDecoder[pip]->Start(0, newchannel->getPcrPid(), newchannel->getVideoPid()); pip_channel_id[pip] = newchannel->getChannelID();