zapit/src/zapit.cpp: add support to use PiP on any transponder in file play mode -

only if no record running;
do not send capmt for PLAY mode, if playback is stopped and its not pmt update


Origin commit data
------------------
Branch: ni/coolstream
Commit: 11d77c3030
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2013-10-17 (Thu, 17 Oct 2013)



------------------
This commit was generated by Migit
This commit is contained in:
[CST] Focus
2013-10-17 19:12:59 +04:00
parent 97608e9c7d
commit f73fcdbdc8
2 changed files with 28 additions and 7 deletions

View File

@@ -134,6 +134,7 @@ class CZapit : public OpenThreads::Thread
CZapitChannel * current_channel;
t_channel_id live_channel_id;
t_channel_id pip_channel_id;
t_channel_id lock_channel_id;
/* scan params */
TP_params TP;
fast_scan_type_t scant;

View File

@@ -130,6 +130,7 @@ CZapit::CZapit()
current_volume = 100;
volume_percent = 0;
pip_channel_id = 0;
lock_channel_id = 0;
pip_fe = NULL;
}
@@ -350,7 +351,7 @@ void CZapit::ConfigFrontend()
void CZapit::SendPMT(bool forupdate)
{
if(!current_channel)
if(!current_channel || (!forupdate && playbackStopForced))
return;
CCamManager::getInstance()->Start(current_channel->getChannelID(), CCamManager::PLAY, forupdate);
@@ -525,6 +526,7 @@ bool CZapit::ZapIt(const t_channel_id channel_id, bool forupdate, bool startplay
current_channel = newchannel;
live_channel_id = current_channel->getChannelID();
lock_channel_id = live_channel_id;
SaveSettings(false);
if(!TuneChannel(live_fe, newchannel, transponder_change)) {
@@ -534,7 +536,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));
#if 0 // def ENABLE_PIP
#ifdef ENABLE_PIP
if (transponder_change && (live_fe == pip_fe))
StopPip();
#endif
@@ -598,7 +600,9 @@ bool CZapit::StartPip(const t_channel_id channel_id)
{
CZapitChannel* newchannel;
bool transponder_change;
/* do lock if live is running, or in record mode -
this is for the case temporary timeshift is running, it do not lock its frontend */
bool need_lock = !playbackStopForced || (currentMode & RECORD_MODE);
if((newchannel = CServiceManager::getInstance()->FindChannel(channel_id)) == NULL) {
INFO("channel_id " PRINTF_CHANNEL_ID_TYPE " not found", channel_id);
@@ -606,14 +610,22 @@ bool CZapit::StartPip(const t_channel_id channel_id)
}
INFO("[pip] zap to %s (%llx tp %llx)", newchannel->getName().c_str(), newchannel->getChannelID(), newchannel->getTransponderId());
CFEManager::getInstance()->lockFrontend(live_fe);
if (need_lock)
CFEManager::getInstance()->lockFrontend(live_fe);
CFrontend * frontend = CFEManager::getInstance()->allocateFE(newchannel);
CFEManager::getInstance()->unlockFrontend(live_fe);
if (need_lock)
CFEManager::getInstance()->unlockFrontend(live_fe);
if(frontend == NULL) {
ERROR("Cannot get frontend\n");
return false;
}
StopPip();
if (!need_lock && !SAME_TRANSPONDER(newchannel->getChannelID(), live_channel_id))
live_channel_id = newchannel->getChannelID();
if(!TuneChannel(frontend, newchannel, transponder_change))
return false;
@@ -1605,12 +1617,20 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
StopPlayBack(true);
standby = false;
playbackStopForced = true;
lock_channel_id = live_channel_id;
SendCmdReady(connfd);
break;
case CZapitMessages::CMD_SB_UNLOCK_PLAYBACK:
playbackStopForced = false;
StartPlayBack(current_channel);
SendPMT();
if (lock_channel_id == live_channel_id) {
StartPlayBack(current_channel);
SendPMT();
} else {
live_fe->setTsidOnid(0);
ZapIt(lock_channel_id);
lock_channel_id = 0;
}
SendCmdReady(connfd);
break;
#if 0