Skip to content

Commit

Permalink
[pvr] add IsRealTimeStream to api
Browse files Browse the repository at this point in the history
  • Loading branch information
FernetMenta committed Jan 19, 2016
1 parent 4d2f23f commit c44f35a
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 4 deletions.
4 changes: 2 additions & 2 deletions addons/xbmc.pvr/addon.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon id="xbmc.pvr" version="4.1.0" provider-name="Team Kodi">
<backwards-compatibility abi="4.1.0"/>
<addon id="xbmc.pvr" version="4.2.0" provider-name="Team Kodi">
<backwards-compatibility abi="4.2.0"/>
<requires>
<import addon="xbmc.core" version="0.1.0"/>
</requires>
Expand Down
7 changes: 7 additions & 0 deletions xbmc/addons/include/xbmc_pvr_dll.h
Expand Up @@ -634,6 +634,12 @@ extern "C"
*/
bool IsTimeshifting();

/*!
* Check for real-time streaming
* @return true if current stream is real-time
*/
bool IsRealTimeStream();

/*!
* Called by XBMC to assign the function pointers of this add-on to pClient.
* @param pClient The struct to assign the function pointers to.
Expand Down Expand Up @@ -721,6 +727,7 @@ extern "C"
pClient->GetBackendHostname = GetBackendHostname;

pClient->IsTimeshifting = IsTimeshifting;
pClient->IsRealTimeStream = IsRealTimeStream;
};
};

5 changes: 3 additions & 2 deletions xbmc/addons/include/xbmc_pvr_types.h
Expand Up @@ -77,10 +77,10 @@ struct DemuxPacket;
#define PVR_STREAM_MAX_STREAMS 20

/* current PVR API version */
#define XBMC_PVR_API_VERSION "4.1.0"
#define XBMC_PVR_API_VERSION "4.2.0"

/* min. PVR API version */
#define XBMC_PVR_MIN_API_VERSION "4.1.0"
#define XBMC_PVR_MIN_API_VERSION "4.2.0"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -566,6 +566,7 @@ extern "C" {
time_t (__cdecl* GetBufferTimeEnd)(void);
const char* (__cdecl* GetBackendHostname)(void);
bool (__cdecl* IsTimeshifting)(void);
bool (__cdecl* IsRealTimeStream)(void);
} PVRClient;

#ifdef __cplusplus
Expand Down
14 changes: 14 additions & 0 deletions xbmc/pvr/addons/PVRClient.cpp
Expand Up @@ -1972,3 +1972,17 @@ bool CPVRClient::Autoconfigure(void)

return bReturn;
}

bool CPVRClient::IsRealTimeStream(void) const
{
bool bReturn(false);
if (IsPlaying())
{
try
{
bReturn = m_pStruct->IsRealTimeStream();
}
catch (std::exception &e) { LogException(e, __FUNCTION__); }
}
return bReturn;
}
5 changes: 5 additions & 0 deletions xbmc/pvr/addons/PVRClient.h
Expand Up @@ -593,6 +593,11 @@ namespace PVR
*/
bool Autoconfigure(void);

/*!
* @brief is real-time stream?
*/
bool IsRealTimeStream() const;

private:
/*!
* @brief Checks whether the provided API version is compatible with XBMC
Expand Down
8 changes: 8 additions & 0 deletions xbmc/pvr/addons/PVRClients.cpp
Expand Up @@ -1759,3 +1759,11 @@ time_t CPVRClients::GetBufferTimeEnd() const
return time;
}

bool CPVRClients::IsRealTimeStream(void) const
{
PVR_CLIENT client;
if (GetPlayingClient(client))
return client->IsRealTimeStream();
return false;
}

2 changes: 2 additions & 0 deletions xbmc/pvr/addons/PVRClients.h
Expand Up @@ -672,6 +672,8 @@ namespace PVR

int GetClientId(const std::string& strId) const;

bool IsRealTimeStream() const;

private:
/*!
* @brief Update add-ons from the AddonManager
Expand Down

0 comments on commit c44f35a

Please sign in to comment.