mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-01 09:51:22 +02:00
some pip changes
Conflicts: src/zapit/src/zapit.cpp
This commit is contained in:
@@ -64,7 +64,8 @@ CScreenSaver::CScreenSaver()
|
|||||||
status_mute = CAudioMute::getInstance()->getStatus();
|
status_mute = CAudioMute::getInstance()->getStatus();
|
||||||
|
|
||||||
clr.i_color = COL_DARK_GRAY;
|
clr.i_color = COL_DARK_GRAY;
|
||||||
pip_channel_id = 0;
|
for (unsigned int i = 0; i < 3; i++)
|
||||||
|
pip_channel_id[i] = 0;
|
||||||
idletime = time(NULL);
|
idletime = time(NULL);
|
||||||
force_refresh = false;
|
force_refresh = false;
|
||||||
thr_exit = false;
|
thr_exit = false;
|
||||||
@@ -123,8 +124,8 @@ void CScreenSaver::Start()
|
|||||||
g_Radiotext->OnAfterDecodeLine.block();
|
g_Radiotext->OnAfterDecodeLine.block();
|
||||||
|
|
||||||
#ifdef ENABLE_PIP
|
#ifdef ENABLE_PIP
|
||||||
pip_channel_id = CZapit::getInstance()->GetPipChannelID();
|
pip_channel_id[0] = CZapit::getInstance()->GetPipChannelID();
|
||||||
if (pip_channel_id)
|
if (pip_channel_id[0])
|
||||||
g_Zapit->stopPip();
|
g_Zapit->stopPip();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -159,9 +160,9 @@ void CScreenSaver::Stop()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_PIP
|
#ifdef ENABLE_PIP
|
||||||
if(pip_channel_id) {
|
if(pip_channel_id[0]) {
|
||||||
CNeutrinoApp::getInstance()->StartPip(pip_channel_id);
|
CNeutrinoApp::getInstance()->StartPip(pip_channel_id[0]);
|
||||||
pip_channel_id = 0;
|
pip_channel_id[0] = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -46,7 +46,7 @@ class CScreenSaver : public sigc::trackable
|
|||||||
|
|
||||||
std::vector<std::string> v_bg_files;
|
std::vector<std::string> v_bg_files;
|
||||||
unsigned int index;
|
unsigned int index;
|
||||||
t_channel_id pip_channel_id;
|
t_channel_id pip_channel_id[3];
|
||||||
bool force_refresh;
|
bool force_refresh;
|
||||||
bool status_mute;
|
bool status_mute;
|
||||||
uint seed[6];
|
uint seed[6];
|
||||||
|
@@ -149,7 +149,7 @@ class CZapit : public OpenThreads::Thread
|
|||||||
|
|
||||||
CZapitChannel * current_channel;
|
CZapitChannel * current_channel;
|
||||||
t_channel_id live_channel_id;
|
t_channel_id live_channel_id;
|
||||||
t_channel_id pip_channel_id;
|
t_channel_id pip_channel_id[3];
|
||||||
t_channel_id lock_channel_id;
|
t_channel_id lock_channel_id;
|
||||||
t_channel_id last_channel_id;
|
t_channel_id last_channel_id;
|
||||||
/* scan params */
|
/* scan params */
|
||||||
@@ -157,7 +157,7 @@ class CZapit : public OpenThreads::Thread
|
|||||||
fast_scan_type_t scant;
|
fast_scan_type_t scant;
|
||||||
|
|
||||||
CFrontend * live_fe;
|
CFrontend * live_fe;
|
||||||
CFrontend * pip_fe;
|
CFrontend * pip_fe[3];
|
||||||
|
|
||||||
audio_map_t audio_map;
|
audio_map_t audio_map;
|
||||||
volume_map_t vol_map;
|
volume_map_t vol_map;
|
||||||
@@ -269,13 +269,13 @@ class CZapit : public OpenThreads::Thread
|
|||||||
|
|
||||||
CZapitChannel * GetCurrentChannel() { return current_channel; };
|
CZapitChannel * GetCurrentChannel() { return current_channel; };
|
||||||
t_channel_id GetCurrentChannelID() { return live_channel_id; };
|
t_channel_id GetCurrentChannelID() { return live_channel_id; };
|
||||||
t_channel_id GetPipChannelID() { return pip_channel_id; };
|
t_channel_id GetPipChannelID(int pip = 0) { return pip_channel_id[pip]; };
|
||||||
t_channel_id GetLastTVChannel() { return lastChannelTV; }
|
t_channel_id GetLastTVChannel() { return lastChannelTV; }
|
||||||
t_channel_id GetLastRADIOChannel() { return lastChannelRadio; }
|
t_channel_id GetLastRADIOChannel() { return lastChannelRadio; }
|
||||||
void SetCurrentChannelID(const t_channel_id channel_id) { live_channel_id = channel_id; };
|
void SetCurrentChannelID(const t_channel_id channel_id) { live_channel_id = channel_id; };
|
||||||
void SetLiveFrontend(CFrontend * fe) { if(fe) live_fe = fe; }
|
void SetLiveFrontend(CFrontend * fe) { if(fe) live_fe = fe; }
|
||||||
CFrontend * GetLiveFrontend() { return live_fe; };
|
CFrontend * GetLiveFrontend() { return live_fe; };
|
||||||
CFrontend * GetPipFrontend() { return pip_fe; };
|
CFrontend * GetPipFrontend(int pip = 0) { return pip_fe[pip]; };
|
||||||
|
|
||||||
int GetPidVolume(t_channel_id channel_id, int pid, bool ac3 = false);
|
int GetPidVolume(t_channel_id channel_id, int pid, bool ac3 = false);
|
||||||
void SetPidVolume(t_channel_id channel_id, int pid, int percent);
|
void SetPidVolume(t_channel_id channel_id, int pid, int percent);
|
||||||
|
@@ -138,9 +138,11 @@ CZapit::CZapit()
|
|||||||
currentMode = 0;
|
currentMode = 0;
|
||||||
current_volume = 100;
|
current_volume = 100;
|
||||||
volume_percent = 0;
|
volume_percent = 0;
|
||||||
pip_channel_id = 0;
|
for (unsigned int i = 0; i < 3; i++)
|
||||||
|
pip_channel_id[i] = 0;
|
||||||
lock_channel_id = 0;
|
lock_channel_id = 0;
|
||||||
pip_fe = NULL;
|
for (unsigned int i = 0; i < 3; i++)
|
||||||
|
pip_fe[i] = NULL;
|
||||||
#if ENABLE_AIT
|
#if ENABLE_AIT
|
||||||
ait = new CAit();
|
ait = new CAit();
|
||||||
#endif
|
#endif
|
||||||
@@ -555,11 +557,11 @@ bool CZapit::ZapIt(const t_channel_id channel_id, bool forupdate, bool startplay
|
|||||||
#ifdef ENABLE_PIP
|
#ifdef ENABLE_PIP
|
||||||
/* executed async if zap NOWAIT, race possible with record lock/allocate */
|
/* executed async if zap NOWAIT, race possible with record lock/allocate */
|
||||||
CFEManager::getInstance()->Lock();
|
CFEManager::getInstance()->Lock();
|
||||||
if (pip_fe)
|
if (pip_fe[0])
|
||||||
CFEManager::getInstance()->lockFrontend(pip_fe);
|
CFEManager::getInstance()->lockFrontend(pip_fe[0]);
|
||||||
CFrontend * fe = CFEManager::getInstance()->allocateFE(newchannel);
|
CFrontend * fe = CFEManager::getInstance()->allocateFE(newchannel);
|
||||||
if (pip_fe)
|
if (pip_fe[0])
|
||||||
CFEManager::getInstance()->unlockFrontend(pip_fe);
|
CFEManager::getInstance()->unlockFrontend(pip_fe[0]);
|
||||||
if (fe == NULL) {
|
if (fe == NULL) {
|
||||||
StopPip();
|
StopPip();
|
||||||
fe = CFEManager::getInstance()->allocateFE(newchannel);
|
fe = CFEManager::getInstance()->allocateFE(newchannel);
|
||||||
@@ -614,7 +616,7 @@ bool CZapit::ZapIt(const t_channel_id channel_id, bool forupdate, bool startplay
|
|||||||
SendEvent(CZapitClient::EVT_TUNE_COMPLETE, &live_channel_id, sizeof(t_channel_id));
|
SendEvent(CZapitClient::EVT_TUNE_COMPLETE, &live_channel_id, sizeof(t_channel_id));
|
||||||
|
|
||||||
#ifdef ENABLE_PIP
|
#ifdef ENABLE_PIP
|
||||||
if (transponder_change && (live_fe == pip_fe))
|
if (transponder_change && (live_fe == pip_fe[0]))
|
||||||
StopPip();
|
StopPip();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -689,7 +691,7 @@ bool CZapit::StopPip()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (pip_channel_id) {
|
if (pip_channel_id[0]) {
|
||||||
INFO("[pip] stop %llx", pip_channel_id);
|
INFO("[pip] stop %llx", pip_channel_id);
|
||||||
#if !HAVE_CST_HARDWARE
|
#if !HAVE_CST_HARDWARE
|
||||||
pipVideoDecoder[0]->ShowPig(0);
|
pipVideoDecoder[0]->ShowPig(0);
|
||||||
@@ -697,8 +699,8 @@ bool CZapit::StopPip()
|
|||||||
CCamManager::getInstance()->Stop(pip_channel_id, CCamManager::PIP);
|
CCamManager::getInstance()->Stop(pip_channel_id, CCamManager::PIP);
|
||||||
pipVideoDemux[0]->Stop();
|
pipVideoDemux[0]->Stop();
|
||||||
pipVideoDecoder[0]->Stop();
|
pipVideoDecoder[0]->Stop();
|
||||||
pip_fe = NULL;
|
pip_fe[0] = NULL;
|
||||||
pip_channel_id = 0;
|
pip_channel_id[0] = 0;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -743,7 +745,7 @@ bool CZapit::StartPip(const t_channel_id channel_id)
|
|||||||
if(!ParsePatPmt(newchannel))
|
if(!ParsePatPmt(newchannel))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
pip_fe = frontend;
|
pip_fe[0] = 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());
|
||||||
@@ -763,7 +765,7 @@ bool CZapit::StartPip(const t_channel_id channel_id)
|
|||||||
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->getNumber());
|
int dnum = CFEManager::getInstance()->getDemux(newchannel->getTransponderId(), pip_fe[0]->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 */
|
||||||
@@ -776,13 +778,13 @@ bool CZapit::StartPip(const t_channel_id channel_id)
|
|||||||
pipVideoDemux[0] = new cDemux(dnum);
|
pipVideoDemux[0] = new cDemux(dnum);
|
||||||
pipVideoDemux[0]->Open(DMX_VIDEO_CHANNEL);
|
pipVideoDemux[0]->Open(DMX_VIDEO_CHANNEL);
|
||||||
if (!pipVideoDecoder[0]) {
|
if (!pipVideoDecoder[0]) {
|
||||||
pipVideoDecoder[0] = new cVideo(0, NULL, NULL, 1);
|
pipVideoDecoder[0] = new cVideo(0, NULL, NULL, dnum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pipVideoDemux[0]->SetSource(dnum, pip_fe->getNumber());
|
pipVideoDemux[0]->SetSource(dnum, pip_fe[0]->getNumber());
|
||||||
newchannel->setPipDemux(dnum);
|
newchannel->setPipDemux(dnum);
|
||||||
newchannel->setRecordDemux(pip_fe->getNumber());
|
newchannel->setRecordDemux(pip_fe[0]->getNumber());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pipVideoDecoder[0]->SetStreamType((VIDEO_FORMAT)newchannel->type);
|
pipVideoDecoder[0]->SetStreamType((VIDEO_FORMAT)newchannel->type);
|
||||||
@@ -794,7 +796,7 @@ bool CZapit::StartPip(const t_channel_id channel_id)
|
|||||||
#else
|
#else
|
||||||
pipVideoDemux[0]->Start();
|
pipVideoDemux[0]->Start();
|
||||||
pipVideoDecoder[0]->Start(0, newchannel->getPcrPid(), newchannel->getVideoPid());
|
pipVideoDecoder[0]->Start(0, newchannel->getPcrPid(), newchannel->getVideoPid());
|
||||||
pip_channel_id = newchannel->getChannelID();
|
pip_channel_id[0] = 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[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[0]->ShowPig(1);
|
pipVideoDecoder[0]->ShowPig(1);
|
||||||
@@ -835,7 +837,7 @@ bool CZapit::ZapForRecord(const t_channel_id channel_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_PIP
|
#ifdef ENABLE_PIP
|
||||||
if (transponder_change && (frontend == pip_fe))
|
if (transponder_change && (frontend == pip_fe[0]))
|
||||||
StopPip();
|
StopPip();
|
||||||
#endif
|
#endif
|
||||||
if(!ParsePatPmt(newchannel))
|
if(!ParsePatPmt(newchannel))
|
||||||
@@ -871,8 +873,8 @@ bool CZapit::ZapForEpg(const t_channel_id channel_id, bool instandby)
|
|||||||
if (!IS_WEBCHAN(live_channel_id))
|
if (!IS_WEBCHAN(live_channel_id))
|
||||||
CFEManager::getInstance()->lockFrontend(live_fe);
|
CFEManager::getInstance()->lockFrontend(live_fe);
|
||||||
#ifdef ENABLE_PIP
|
#ifdef ENABLE_PIP
|
||||||
if (pip_fe /* && pip_fe != live_fe */)
|
if (pip_fe[0] /* && pip_fe[0] != live_fe */)
|
||||||
CFEManager::getInstance()->lockFrontend(pip_fe);
|
CFEManager::getInstance()->lockFrontend(pip_fe[0]);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
CFrontend * frontend = CFEManager::getInstance()->allocateFE(newchannel);
|
CFrontend * frontend = CFEManager::getInstance()->allocateFE(newchannel);
|
||||||
@@ -881,8 +883,8 @@ bool CZapit::ZapForEpg(const t_channel_id channel_id, bool instandby)
|
|||||||
if (!IS_WEBCHAN(live_channel_id))
|
if (!IS_WEBCHAN(live_channel_id))
|
||||||
CFEManager::getInstance()->unlockFrontend(live_fe);
|
CFEManager::getInstance()->unlockFrontend(live_fe);
|
||||||
#ifdef ENABLE_PIP
|
#ifdef ENABLE_PIP
|
||||||
if (pip_fe /* && pip_fe != live_fe */)
|
if (pip_fe[0] /* && pip_fe[0] != live_fe */)
|
||||||
CFEManager::getInstance()->unlockFrontend(pip_fe);
|
CFEManager::getInstance()->unlockFrontend(pip_fe[0]);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
CFEManager::getInstance()->Unlock();
|
CFEManager::getInstance()->Unlock();
|
||||||
@@ -2581,10 +2583,6 @@ bool CZapit::Start(Z_start_arg *ZapStart_arg)
|
|||||||
audioDemux = new cDemux();
|
audioDemux = new cDemux();
|
||||||
audioDemux->Open(DMX_AUDIO_CHANNEL);
|
audioDemux->Open(DMX_AUDIO_CHANNEL);
|
||||||
|
|
||||||
#ifdef ENABLE_PIP
|
|
||||||
/* FIXME until proper demux management */
|
|
||||||
int dnum = 1;
|
|
||||||
#endif
|
|
||||||
#ifdef BOXMODEL_CST_HD2
|
#ifdef BOXMODEL_CST_HD2
|
||||||
videoDecoder = cVideo::GetDecoder(0);
|
videoDecoder = cVideo::GetDecoder(0);
|
||||||
audioDecoder = cAudio::GetDecoder(0);
|
audioDecoder = cAudio::GetDecoder(0);
|
||||||
@@ -2616,7 +2614,6 @@ bool CZapit::Start(Z_start_arg *ZapStart_arg)
|
|||||||
videoDecoder = new cVideo(video_mode, videoDemux->getChannel(), videoDemux->getBuffer());
|
videoDecoder = new cVideo(video_mode, videoDemux->getChannel(), videoDemux->getBuffer());
|
||||||
#endif
|
#endif
|
||||||
videoDecoder->Standby(false);
|
videoDecoder->Standby(false);
|
||||||
|
|
||||||
audioDecoder = new cAudio(audioDemux->getBuffer(), videoDecoder->GetTVEnc(), NULL /*videoDecoder->GetTVEncSD()*/);
|
audioDecoder = new cAudio(audioDemux->getBuffer(), videoDecoder->GetTVEnc(), NULL /*videoDecoder->GetTVEncSD()*/);
|
||||||
|
|
||||||
#ifdef ENABLE_PIP
|
#ifdef ENABLE_PIP
|
||||||
|
Reference in New Issue
Block a user