From 70b8527628f2c13031c393a9749247124c3ecb58 Mon Sep 17 00:00:00 2001 From: BPanther Date: Wed, 4 Oct 2023 23:44:37 +0200 Subject: [PATCH] Revert "small pip changes" This reverts commit 8f1b80278f3b8ef7f395b9e9ec3902450abb21de. --- src/neutrino.cpp | 13 +++---------- src/zapit/src/zapit.cpp | 30 +++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 51627b0ac..a7cb7d92d 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -4396,9 +4396,6 @@ void CNeutrinoApp::tvMode( bool rezap ) #ifdef ENABLE_PIP if (g_info.hw_caps->can_pip) { - if (!pipVideoDecoder[0]) { - pipVideoDecoder[0] = new cVideo(0, NULL, NULL, 1); - } pipVideoDecoder[0]->Pig(g_settings.pip_x, g_settings.pip_y, g_settings.pip_width, g_settings.pip_height, frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true)); @@ -4666,9 +4663,6 @@ void CNeutrinoApp::radioMode( bool rezap) #ifdef ENABLE_PIP if (g_info.hw_caps->can_pip) { - if (!pipVideoDecoder[0]) { - pipVideoDecoder[0] = new cVideo(0, NULL, NULL, 1); - } pipVideoDecoder[0]->Pig(g_settings.pip_radio_x, g_settings.pip_radio_y, g_settings.pip_radio_width, g_settings.pip_radio_height, frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true)); @@ -4738,14 +4732,13 @@ void CNeutrinoApp::StartAVInputPiP() { if (!g_info.hw_caps->can_pip) return; - if (!pipVideoDecoder[0]) { - pipVideoDecoder[0] = new cVideo(0, NULL, NULL, 1); - } if (!pipVideoDemux[0]) { pipVideoDemux[0] = new cDemux(1); pipVideoDemux[0]->Open(DMX_VIDEO_CHANNEL); + if (!pipVideoDecoder[0]) { + pipVideoDecoder[0] = new cVideo(0, NULL, NULL, 1); + } } - pipVideoDemux[0]->SetSource(1, 2); pipVideoDecoder[0]->SetStreamType((VIDEO_FORMAT) 1); pipVideoDemux[0]->Start(); diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 6a056333a..dbbc67d39 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -726,12 +726,12 @@ bool CZapit::StartPip(const t_channel_id channel_id, int pip) #endif INFO("[pip %d] vpid %X apid %X pcr %X", pip, newchannel->getVideoPid(), newchannel->getAudioPid(), newchannel->getPcrPid()); - if (!pipVideoDecoder[pip]) { - pipVideoDecoder[pip] = new cVideo(0, NULL, NULL, dnum); - } if (!pipVideoDemux[pip]) { pipVideoDemux[pip] = new cDemux(dnum); pipVideoDemux[pip]->Open(DMX_VIDEO_CHANNEL); + if (!pipVideoDecoder[pip]) { + pipVideoDecoder[pip] = new cVideo(0, NULL, NULL, dnum); + } } pipVideoDemux[pip]->SetSource(dnum, pip_fe[pip]->getNumber()); @@ -747,12 +747,12 @@ bool CZapit::StartPip(const t_channel_id channel_id, int pip) 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[pip]->ShowPig(1); - if (!pipAudioDecoder[pip]) { - pipAudioDecoder[pip] = new cAudio(0, NULL, NULL, dnum); - } if (!pipAudioDemux[pip]) { pipAudioDemux[pip] = new cDemux(dnum); pipAudioDemux[pip]->Open(DMX_AUDIO_CHANNEL); + if (!pipAudioDecoder[pip]) { + pipAudioDecoder[pip] = new cAudio(0, NULL, NULL, dnum); + } } if (newchannel->getAudioChannel()) @@ -2264,9 +2264,21 @@ bool CZapit::Start(Z_start_arg *ZapStart_arg) audioDemux = new cDemux(); audioDemux->Open(DMX_AUDIO_CHANNEL); - videoDecoder = new cVideo(video_mode, videoDemux->getChannel(), videoDemux->getBuffer()); - videoDecoder->Standby(false); - audioDecoder = new cAudio(audioDemux->getBuffer(), videoDecoder->GetTVEnc(), NULL /*videoDecoder->GetTVEncSD()*/); + videoDecoder = new cVideo(video_mode, videoDemux->getChannel(), videoDemux->getBuffer()); + videoDecoder->Standby(false); + audioDecoder = new cAudio(audioDemux->getBuffer(), videoDecoder->GetTVEnc(), NULL /*videoDecoder->GetTVEncSD()*/); + +#ifdef ENABLE_PIP + if (g_info.hw_caps->can_pip) + { + for (unsigned i=0; i < (unsigned int) g_info.hw_caps->pip_devs; i++) + { + pipVideoDecoder[i] = new cVideo(0, NULL, NULL, i+1); + pipVideoDecoder[i]->ShowPig(0); + pipAudioDecoder[i] = new cAudio(0, NULL, NULL, i+1); + } + } +#endif videoDecoder->SetAudioHandle(audioDecoder->GetHandle());