Permalink
Browse files

Merge branch 'master' into pvr-ppa

  • Loading branch information...
2 parents ab82e45 + 26ec15a commit 248d3f123a1fac2931f20d8aae78c241860aeb46 @opdenkamp committed Apr 14, 2011
Showing with 943 additions and 5,221 deletions.
  1. +1 −1 addons/pvr.hts/resources/language/Dutch/strings.xml
  2. +1 −1 addons/pvr.hts/resources/language/English/strings.xml
  3. +0 −1 addons/pvr.hts/resources/language/Finnish/strings.xml
  4. +1 −1 addons/pvr.hts/resources/settings.xml
  5. +2 −2 addons/skin.confluence/720p/DialogPVRGuideOSD.xml
  6. +8 −8 addons/skin.confluence/720p/ViewsPVR.xml
  7. +1 −0 language/English/strings.xml
  8. +4 −4 xbmc/addons/AddonCallbacksPVR.cpp
  9. +13 −13 xbmc/addons/include/xbmc_pvr_types.h
  10. +4 −2 xbmc/epg/Epg.cpp
  11. +1 −1 xbmc/epg/Epg.h
  12. +58 −30 xbmc/epg/EpgContainer.cpp
  13. +14 −0 xbmc/epg/EpgContainer.h
  14. +6 −5 xbmc/pvr/PVRGUIInfo.cpp
  15. +48 −43 xbmc/pvr/PVRManager.cpp
  16. +2 −5 xbmc/pvr/PVRManager.h
  17. +41 −59 xbmc/pvr/addons/PVRClient.cpp
  18. +3 −3 xbmc/pvr/addons/PVRClient.h
  19. +4 −0 xbmc/pvr/channels/PVRChannel.cpp
  20. +4 −0 xbmc/pvr/channels/PVRChannelGroup.cpp
  21. +16 −7 xbmc/pvr/channels/PVRChannelGroupInternal.cpp
  22. +1 −1 xbmc/pvr/epg/PVREpgInfoTag.cpp
  23. +3 −0 xbmc/pvr/recordings/PVRRecordings.cpp
  24. +44 −28 xbmc/pvr/timers/PVRTimerInfoTag.cpp
  25. +1 −1 xbmc/pvr/timers/PVRTimerInfoTag.h
  26. +37 −34 xbmc/pvr/timers/PVRTimers.cpp
  27. +1 −1 xbmc/pvr/windows/GUIWindowPVR.cpp
  28. +6 −0 xbmc/pvr/windows/GUIWindowPVRChannels.cpp
  29. +5 −17 xbmc/pvr/windows/GUIWindowPVRCommon.cpp
  30. +8 −24 xbmc/pvr/windows/GUIWindowPVRGuide.cpp
  31. +1 −1 xbmc/pvr/windows/GUIWindowPVRGuide.h
  32. +5 −0 xbmc/pvr/windows/GUIWindowPVRRecordings.cpp
  33. +5 −0 xbmc/pvr/windows/GUIWindowPVRSearch.cpp
  34. +8 −14 xbmc/pvr/windows/GUIWindowPVRTimers.cpp
  35. +45 −37 xbmc/pvrclients/tvheadend/HTSPData.cpp
  36. +30 −24 xbmc/pvrclients/tvheadend/HTSPData.h
  37. +37 −129 xbmc/pvrclients/tvheadend/HTSPDemux.cpp
  38. +4 −3 xbmc/pvrclients/tvheadend/HTSPDemux.h
  39. +107 −58 xbmc/pvrclients/tvheadend/HTSPSession.cpp
  40. +33 −235 xbmc/pvrclients/tvheadend/HTSPSession.h
  41. +235 −0 xbmc/pvrclients/tvheadend/HTSPTypes.h
  42. +0 −4,333 xbmc/pvrclients/tvheadend/StdString.h
  43. +71 −64 xbmc/pvrclients/tvheadend/client.cpp
  44. +19 −26 xbmc/pvrclients/tvheadend/client.h
  45. +1 −1 xbmc/pvrclients/tvheadend/thread.cpp
  46. +1 −1 xbmc/pvrclients/tvheadend/tools.h
  47. +3 −3 xbmc/pvrclients/vdr-vnsi/VNSIData.cpp
@@ -6,7 +6,7 @@
<string id="30002">HTSP poort</string>
<string id="30003">Gebruikersnaam</string>
<string id="30004">Wachtwoord</string>
- <string id="30005">Sla eerste I-frames over</string>
<string id="30006">Verbinding timeout in seconden</string>
<string id="30007">Antwoord timeout in seconden</string>
+ <string id="30008">Toon een melding bij timer updates</string>
</strings>
@@ -6,7 +6,7 @@
<string id="30002">HTSP port</string>
<string id="30003">Username</string>
<string id="30004">Password</string>
- <string id="30005">Skip first I-frames</string>
<string id="30006">Connect timeout in seconds</string>
<string id="30007">Response timeout in seconds</string>
+ <string id="30008">Display a notification on timer updates</string>
</strings>
@@ -6,5 +6,4 @@
<string id="30002">HTSP-portti</string>
<string id="30003">Käyttäjänimi</string>
<string id="30004">Salasana</string>
- <string id="30005">Ohita ensimmäinen I-frame</string>
</strings>
@@ -5,7 +5,7 @@
<setting id="htsp_port" type="integer" label="30002" default="9982" />
<setting id="user" type="text" label="30003" default="" />
<setting id="pass" type="text" label="30004" option="hidden" default="" />
- <setting id="skip_I_frame_count" type="enum" label="30005" values="0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15" default="0" />
<setting id="connect_timeout" type="enum" label="30006" values="1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60" default="29" />
<setting id="response_timeout" type="enum" label="30007" values="1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60" default="1" />
+ <setting id="notifications_timers" type="bool" label="30008" default="true" />
</settings>
@@ -140,7 +140,7 @@
<width>20</width>
<height>20</height>
<texture>PVR-HasTimer.png</texture>
- <visible>ListItem.HasTimer</visible>
+ <visible>ListItem.HasTimer + !ListItem.IsRecording</visible>
</control>
</itemlayout>
<focusedlayout height="60" width="500">
@@ -225,7 +225,7 @@
<posy>30</posy>
<width>20</width>
<height>20</height>
- <texture>PVR-HasTimer.png</texture>
+ <texture>PVR-HasTimer.png + !ListItem.IsRecording</texture>
<visible>ListItem.HasTimer</visible>
</control>
</focusedlayout>
@@ -777,7 +777,7 @@
<width>20</width>
<height>20</height>
<texture>PVR-HasTimer.png</texture>
- <visible>ListItem.HasTimer</visible>
+ <visible>ListItem.HasTimer + !ListItem.IsRecording</visible>
</control>
</itemlayout>
<focusedlayout height="52" width="40">
@@ -821,7 +821,7 @@
<width>20</width>
<height>20</height>
<texture>PVR-HasTimer.png</texture>
- <visible>ListItem.HasTimer</visible>
+ <visible>ListItem.HasTimer + !ListItem.IsRecording</visible>
</control>
</focusedlayout>
</control>
@@ -1262,7 +1262,7 @@
<width>20</width>
<height>20</height>
<texture>PVR-HasTimer.png</texture>
- <visible>ListItem.HasTimer</visible>
+ <visible>ListItem.HasTimer + !ListItem.IsRecording</visible>
</control>
<control type="label">
<posx>1000</posx>
@@ -1392,7 +1392,7 @@
<width>20</width>
<height>20</height>
<texture>PVR-HasTimer.png</texture>
- <visible>ListItem.HasTimer</visible>
+ <visible>ListItem.HasTimer + !ListItem.IsRecording</visible>
</control>
<control type="label">
<posx>1000</posx>
@@ -1583,7 +1583,7 @@
<width>20</width>
<height>20</height>
<texture>PVR-HasTimer.png</texture>
- <visible>ListItem.HasTimer</visible>
+ <visible>ListItem.HasTimer + !ListItem.IsRecording</visible>
</control>
<control type="label">
<posx>1000</posx>
@@ -1715,7 +1715,7 @@
<width>20</width>
<height>20</height>
<texture>PVR-HasTimer.png</texture>
- <visible>ListItem.HasTimer</visible>
+ <visible>ListItem.HasTimer + !ListItem.IsRecording</visible>
</control>
<control type="label">
<posx>1000</posx>
@@ -1938,7 +1938,7 @@
<width>20</width>
<height>20</height>
<texture>PVR-HasTimer.png</texture>
- <visible>ListItem.HasTimer</visible>
+ <visible>ListItem.HasTimer + !ListItem.IsRecording</visible>
</control>
<control type="label">
<posx>1000</posx>
@@ -2089,7 +2089,7 @@
<width>20</width>
<height>20</height>
<texture>PVR-HasTimer.png</texture>
- <visible>ListItem.HasTimer</visible>
+ <visible>ListItem.HasTimer + !ListItem.IsRecording</visible>
</control>
<control type="label">
<posx>1000</posx>
@@ -1749,6 +1749,7 @@
<string id="19220">Channels in</string>
<string id="19221">Synchronise channel groups with backends</string>
<string id="19222">EPG</string>
+ <string id="19223">No PVR add-on could be enabled. Check your settings or the log for more info.</string>
<string id="19499">Other/Unknown</string>
<string id="19500">Movie/Drama</string>
@@ -173,9 +173,9 @@ void CAddonCallbacksPVR::PVRTransferTimerEntry(void *addonData, const PVR_HANDLE
return;
}
- CPVRTimers *xbmcTimers = (CPVRTimers*) handle->dataAddress;
- CPVRClient* client = (CPVRClient*) handle->callerAddress;
- const CPVRChannel *channel = CPVRManager::GetChannelGroups()->GetByUniqueID(timer->iClientChannelUid, client->GetClientID());
+ CPVRTimers *xbmcTimers = (CPVRTimers*) handle->dataAddress;
+ CPVRClient* client = (CPVRClient*) handle->callerAddress;
+ CPVRChannel *channel = (CPVRChannel *) CPVRManager::GetChannelGroups()->GetByUniqueID(timer->iClientChannelUid, client->GetClientID());
if (channel == NULL)
{
@@ -184,7 +184,7 @@ void CAddonCallbacksPVR::PVRTransferTimerEntry(void *addonData, const PVR_HANDLE
return;
}
- CPVRTimerInfoTag tag(*timer, client->GetClientID());
+ CPVRTimerInfoTag tag(*timer, channel, client->GetClientID());
/* transfer this entry to the timers container */
xbmcTimers->UpdateFromClient(tag);
@@ -135,22 +135,22 @@ extern "C" {
} PVR_EVENT;
/*!
- * @brief PVR add-on capabilities.
+ * @brief PVR add-on capabilities. All capabilities are set to "false" as default.
*/
typedef struct PVR_ADDON_CAPABILITIES
{
- bool bSupportsChannelLogo; /*!< @brief (required) true if this add-on supports channel logos */
- bool bSupportsChannelSettings; /*!< @brief (required) true if this add-on supports changing channel settings on the backend */
- bool bSupportsTimeshift; /*!< @brief (required) true if the backend will handle timeshift. false if XBMC should handle it. */
- bool bSupportsEPG; /*!< @brief (required) true if the add-on provides EPG information */
- bool bSupportsTV; /*!< @brief (required) true if this add-on provides TV channels */
- bool bSupportsRadio; /*!< @brief (required) true if this add-on supports radio channels */
- bool bSupportsRecordings; /*!< @brief (required) true if this add-on supports playback of recordings stored on the backend */
- bool bSupportsTimers; /*!< @brief (required) true if this add-on supports the creation and editing of timers */
- bool bSupportsChannelGroups; /*!< @brief (required) true if this add-on supports channel groups */
- bool bSupportsChannelScan; /*!< @brief (required) true if this add-on support scanning for new channels on the backend */
- bool bHandlesInputStream; /*!< @brief (required) true if this add-on provides an input stream. false if XBMC handles the stream. */
- bool bHandlesDemuxing; /*!< @brief (required) true if this add-on demultiplexes packets. */
+ bool bSupportsChannelLogo; /*!< @brief (optional) true if this add-on supports channel logos */
+ bool bSupportsChannelSettings; /*!< @brief (optional) true if this add-on supports changing channel settings on the backend */
+ bool bSupportsTimeshift; /*!< @brief (optional) true if the backend will handle timeshift. false if XBMC should handle it. */
+ bool bSupportsEPG; /*!< @brief (optional) true if the add-on provides EPG information */
+ bool bSupportsTV; /*!< @brief (optional) true if this add-on provides TV channels */
+ bool bSupportsRadio; /*!< @brief (optional) true if this add-on supports radio channels */
+ bool bSupportsRecordings; /*!< @brief (optional) true if this add-on supports playback of recordings stored on the backend */
+ bool bSupportsTimers; /*!< @brief (optional) true if this add-on supports the creation and editing of timers */
+ bool bSupportsChannelGroups; /*!< @brief (optional) true if this add-on supports channel groups */
+ bool bSupportsChannelScan; /*!< @brief (optional) true if this add-on support scanning for new channels on the backend */
+ bool bHandlesInputStream; /*!< @brief (optional) true if this add-on provides an input stream. false if XBMC handles the stream. */
+ bool bHandlesDemuxing; /*!< @brief (optional) true if this add-on demultiplexes packets. */
} ATTRIBUTE_PACKED PVR_ADDON_CAPABILITIES;
/*!
View
@@ -151,14 +151,14 @@ void CEpg::Clear(void)
void CEpg::Cleanup(void)
{
- Cleanup(CDateTime::GetCurrentDateTime());
+ Cleanup(CDateTime::GetCurrentDateTime().GetAsUTCDateTime());
}
void CEpg::Cleanup(const CDateTime &Time)
{
CSingleLock lock(m_critSection);
- CDateTime firstDate = Time.GetAsUTCDateTime() - CDateTimeSpan(0, g_advancedSettings.m_iEpgLingerTime / 60, g_advancedSettings.m_iEpgLingerTime % 60, 0);
+ CDateTime firstDate = Time - CDateTimeSpan(0, g_advancedSettings.m_iEpgLingerTime / 60, g_advancedSettings.m_iEpgLingerTime % 60, 0);
CDateTime dummy; dummy.SetValid(false);
RemoveTagsBetween(dummy, firstDate);
@@ -245,6 +245,8 @@ const CEpgInfoTag *CEpg::InfoTagNow(void) const
const CEpgInfoTag *CEpg::InfoTagNext(void) const
{
+ CSingleLock lock(m_critSection);
+
const CEpgInfoTag *nowTag = InfoTagNow();
return nowTag ? nowTag->GetNextEvent() : NULL;
View
@@ -199,7 +199,7 @@ class CEpg : public std::vector<CEpgInfoTag*>
/*!
* @brief Remove all entries from this EPG that finished before the given time
* and that have no timers set.
- * @param Time Delete entries with an end time before this time.
+ * @param Time Delete entries with an end time before this time in UTC.
*/
virtual void Cleanup(const CDateTime &Time);
@@ -149,17 +149,14 @@ void CEpgContainer::Process(void)
AutoCreateTablesHook();
- bool bInitialLoadSucess = UpdateEPG(true);
-
while (!m_bStop)
{
CDateTime::GetCurrentDateTime().GetAsTime(iNow);
/* load or update the EPG */
if (!m_bStop && (iNow > m_iLastEpgUpdate + g_advancedSettings.m_iEpgUpdateCheckInterval || !m_bDatabaseLoaded))
{
- UpdateEPG(!bInitialLoadSucess);
- bInitialLoadSucess = true;
+ UpdateEPG(!m_bDatabaseLoaded);
}
/* clean up old entries */
@@ -299,12 +296,54 @@ bool CEpgContainer::DeleteEpg(const CEpg &epg, bool bDeleteFromDatabase /* = fal
return bReturn;
}
+bool CEpgContainer::UpdateSingleTable(CEpg *epg, const time_t start, const time_t end)
+{
+ bool bReturn(false);
+
+ if (!epg)
+ return bReturn;
+
+ if (m_bDatabaseLoaded)
+ epg->Cleanup();
+
+ bReturn = m_bDatabaseLoaded || m_bIgnoreDbForClient ?
+ epg->Update(start, end, m_iUpdateTime) :
+ epg->Load();
+
+ /* try to update the table from clients if nothing was loaded from the db */
+ if (!m_bDatabaseLoaded && !m_bIgnoreDbForClient && !bReturn)
+ bReturn = epg->Update(start, end, m_iUpdateTime);
+
+ if (!bReturn && m_bDatabaseLoaded)
+ {
+ CLog::Log(LOGERROR, "EpgContainer - %s - failed to update table '%s'",
+ __FUNCTION__, epg->Name().c_str());
+ }
+
+ return bReturn;
+}
+
+bool CEpgContainer::InterruptUpdate(void) const
+{
+ if (m_bStop || (CPVRManager::Get()->IsStarted() && CPVRManager::GetClients()->IsPlaying()))
+ {
+ CLog::Log(LOGNOTICE, "EpgContainer - %s - EPG load/update interrupted", __FUNCTION__);
+ return true;
+ }
+
+ return false;
+}
+
bool CEpgContainer::UpdateEPG(bool bShowProgress /* = false */)
{
CSingleLock lock(m_critSection);
unsigned int iEpgCount = size();
+
+ if (InterruptUpdate())
+ return false;
lock.Leave();
+ bool bInterrupted(false);
long iStartTime = CTimeUtils::GetTimeMS();
bool bUpdateSuccess = true;
CGUIDialogExtendedProgressBar *progress = NULL;
@@ -319,7 +358,7 @@ bool CEpgContainer::UpdateEPG(bool bShowProgress /* = false */)
/* set start and end time */
time_t start;
time_t end;
- CDateTime::GetCurrentDateTime().GetAsTime(start); // NOTE: XBMC stores the EPG times as local time
+ CDateTime::GetCurrentDateTime().GetAsUTCDateTime().GetAsTime(start);
end = start;
start -= g_advancedSettings.m_iEpgLingerTime * 60;
end += m_iDisplayTime;
@@ -344,32 +383,17 @@ bool CEpgContainer::UpdateEPG(bool bShowProgress /* = false */)
/* load or update all EPG tables */
for (unsigned int iEpgPtr = 0; iEpgPtr < iEpgCount; iEpgPtr++)
{
- /* interrupt the update on exit or when livetv is playing */
- if (m_bStop || (CPVRManager::Get()->IsStarted() && CPVRManager::GetClients()->IsPlaying()))
+ if (InterruptUpdate())
{
- CLog::Log(LOGNOTICE, "EpgContainer - %s - EPG load/update interrupted", __FUNCTION__);
- bUpdateSuccess = false;
+ bInterrupted = true;
break;
}
CEpg *epg = GetByIndex(iEpgPtr);
if (!epg)
continue;
- if (m_bDatabaseLoaded)
- at(iEpgPtr)->Cleanup();
-
- bool bCurrent = m_bDatabaseLoaded || m_bIgnoreDbForClient ?
- at(iEpgPtr)->Update(start, end, m_iUpdateTime) :
- at(iEpgPtr)->Load() && bUpdateSuccess;
-
- /* try to update the table from clients if nothing was loaded from the db */
- if (!m_bDatabaseLoaded && !m_bIgnoreDbForClient && !bCurrent)
- bCurrent = at(iEpgPtr)->Update(start, end, m_iUpdateTime);
-
- if (!bCurrent && m_bDatabaseLoaded)
- CLog::Log(LOGERROR, "EpgContainer - %s - failed to update table '%s'",
- __FUNCTION__, at(iEpgPtr)->Name().c_str());
+ bool bCurrent = UpdateSingleTable(epg, start, end);
bUpdateSuccess = bCurrent && bUpdateSuccess;
if (bCurrent)
@@ -387,10 +411,17 @@ bool CEpgContainer::UpdateEPG(bool bShowProgress /* = false */)
Sleep(50); /* give other threads a chance to get a lock on tables */
}
- CDateTime::GetCurrentDateTime().GetAsTime(m_iLastEpgUpdate);
- /* update the last scan time if we did a full update */
- if (bUpdateSuccess && m_bDatabaseLoaded && !m_bIgnoreDbForClient)
- m_database.PersistLastEpgScanTime(0);
+ if (!bInterrupted)
+ {
+ /* only try to load the database once */
+ m_bDatabaseLoaded = true;
+
+ CDateTime::GetCurrentDateTime().GetAsTime(m_iLastEpgUpdate);
+ /* update the last scan time if we did a full update */
+ if (bUpdateSuccess && m_bDatabaseLoaded && !m_bIgnoreDbForClient)
+ m_database.PersistLastEpgScanTime(0);
+ }
+
m_database.Close();
if (bShowProgress)
@@ -400,9 +431,6 @@ bool CEpgContainer::UpdateEPG(bool bShowProgress /* = false */)
CLog::Log(LOGINFO, "EpgContainer - %s - finished %s %d EPG tables after %li.%li seconds",
__FUNCTION__, m_bDatabaseLoaded ? "updating" : "loading", iEpgCount, lUpdateTime / 1000, lUpdateTime % 1000);
- /* only try to load the database once */
- m_bDatabaseLoaded = true;
-
/* notify observers */
if (iUpdatedTables > 0)
{
@@ -85,6 +85,20 @@ class CEpgContainer : public std::vector<CEpg *>,
virtual bool UpdateEPG(bool bShowProgress = false);
/*!
+ * @return True if a running update should be interrupted, false otherwise.
+ */
+ virtual bool InterruptUpdate(void) const;
+
+ /*!
+ * @brief Load or update a single table.
+ * @param epg The table to update.
+ * @param start The start time to use.
+ * @param end The end time to use.
+ * @return True if the load or update was successful, false otherwise.
+ */
+ virtual bool UpdateSingleTable(CEpg *epg, const time_t start, const time_t end);
+
+ /*!
* @brief A hook that will be called on every update thread iteration.
*/
virtual void ProcessHook(const CDateTime &time) {};
Oops, something went wrong. Retry.

0 comments on commit 248d3f1

Please sign in to comment.