Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pvr] add IsRealTimeStream to api #8896

Merged
merged 1 commit into from Jan 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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