From 8f1b80278f3b8ef7f395b9e9ec3902450abb21de Mon Sep 17 00:00:00 2001 From: BPanther Date: Wed, 4 Oct 2023 22:31:58 +0200 Subject: [PATCH] small pip changes --- src/neutrino.cpp | 13 ++++++++++--- src/zapit/src/zapit.cpp | 30 +++++++++--------------------- 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index a7cb7d92d..51627b0ac 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -4396,6 +4396,9 @@ 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)); @@ -4663,6 +4666,9 @@ 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)); @@ -4732,13 +4738,14 @@ 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 dbbc67d39..6a056333a 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,21 +2264,9 @@ 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()*/); - -#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 = new cVideo(video_mode, videoDemux->getChannel(), videoDemux->getBuffer()); + videoDecoder->Standby(false); + audioDecoder = new cAudio(audioDemux->getBuffer(), videoDecoder->GetTVEnc(), NULL /*videoDecoder->GetTVEncSD()*/); videoDecoder->SetAudioHandle(audioDecoder->GetHandle());