From 39ae9063a0a911c0e73237489bf9e71cf61b0927 Mon Sep 17 00:00:00 2001 From: BPanther Date: Tue, 2 Jan 2024 00:43:08 +0100 Subject: [PATCH] e4hdultra: fix pip (first start) Origin commit data ------------------ Commit: https://github.com/Duckbox-Developers/neutrino-ddt/commit/7204baa85e7fa75877131c69b82167a1e5888931 Author: BPanther Date: 2023-10-10 (Tue, 10 Oct 2023) --- src/neutrino.cpp | 9 +++++++++ src/zapit/include/zapit/zapit.h | 3 +++ src/zapit/src/zapit.cpp | 14 ++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 5ce688ae6..ec2739c7c 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3245,6 +3245,15 @@ TIMER_STOP("################################## after all ####################### xmltv_xml_readepg(); xmltv_xml_auto_readepg(); +#if ENABLE_PIP && BOXMODEL_E4HDULTRA + if (g_info.hw_caps->can_pip) + { + CZapit::getInstance()->OpenPip(0); + usleep(100); + CZapit::getInstance()->StopPip(0); + } +#endif + RealRun(); ExitRun(g_info.hw_caps->can_shutdown); diff --git a/src/zapit/include/zapit/zapit.h b/src/zapit/include/zapit/zapit.h index 18fe9c792..fcb2ef7ea 100644 --- a/src/zapit/include/zapit/zapit.h +++ b/src/zapit/include/zapit/zapit.h @@ -291,8 +291,11 @@ class CZapit : public OpenThreads::Thread int GetVolume() { return current_volume; }; int SetVolumePercent(int percent); void SetVolumePercent(int default_ac3, int default_pcm); +#ifdef ENABLE_PIP + bool OpenPip(int pip = 0); bool StartPip(const t_channel_id channel_id, int pip = 0); bool StopPip(int pip = 0); +#endif void Lock() { mutex.lock(); } void Unlock() { mutex.unlock(); } void EnablePlayback(bool enable) { playbackStopForced = !enable; } diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 47ad70a63..31d55072d 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -691,6 +691,20 @@ bool CZapit::ZapIt(const t_channel_id channel_id, bool forupdate, bool startplay } #if ENABLE_PIP +bool CZapit::OpenPip(int pip) +{ + if (!g_info.hw_caps->can_pip) + return false; + + pipVideoDecoder[pip] = new cVideo(0, NULL, NULL, pip+1); + pipVideoDecoder[pip]->ShowPig(0); + pipVideoDemux[pip] = new cDemux(pip+1); + pipVideoDemux[pip]->Open(DMX_VIDEO_CHANNEL); + pipAudioDecoder[pip] = new cAudio(0, NULL, NULL, pip+1); + pipAudioDemux[pip] = new cDemux(pip+1); + pipAudioDemux[pip]->Open(DMX_AUDIO_CHANNEL); +} + bool CZapit::StopPip(int pip) { if (!g_info.hw_caps->can_pip)