Permalink
Browse files

pvr: sync interface

  • Loading branch information...
1 parent 2623825 commit b9f138761f6fba46300ad3bbb4054a37c6f83edf @opdenkamp committed May 1, 2012
@@ -203,7 +203,7 @@ unsigned int CHTSPData::GetNumChannels()
return GetChannels().size();
}
-PVR_ERROR CHTSPData::GetChannels(PVR_HANDLE handle, bool bRadio)
+PVR_ERROR CHTSPData::GetChannels(ADDON_HANDLE handle, bool bRadio)
{
SChannels channels = GetChannels();
for(SChannels::iterator it = channels.begin(); it != channels.end(); ++it)
@@ -231,7 +231,7 @@ PVR_ERROR CHTSPData::GetChannels(PVR_HANDLE handle, bool bRadio)
return PVR_ERROR_NO_ERROR;
}
-PVR_ERROR CHTSPData::GetEpg(PVR_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd)
+PVR_ERROR CHTSPData::GetEpg(ADDON_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd)
{
PVR_ERROR retVal = PVR_ERROR_NO_ERROR;
SChannels channels = GetChannels();
@@ -317,7 +317,7 @@ unsigned int CHTSPData::GetNumRecordings()
return recordings.size();
}
-PVR_ERROR CHTSPData::GetRecordings(PVR_HANDLE handle)
+PVR_ERROR CHTSPData::GetRecordings(ADDON_HANDLE handle)
{
SRecordings recordings = GetDVREntries(true, false);
@@ -411,7 +411,7 @@ unsigned int CHTSPData::GetNumChannelGroups(void)
return m_tags.size();
}
-PVR_ERROR CHTSPData::GetChannelGroups(PVR_HANDLE handle)
+PVR_ERROR CHTSPData::GetChannelGroups(ADDON_HANDLE handle)
{
for(unsigned int iTagPtr = 0; iTagPtr < m_tags.size(); iTagPtr++)
{
@@ -427,7 +427,7 @@ PVR_ERROR CHTSPData::GetChannelGroups(PVR_HANDLE handle)
return PVR_ERROR_NO_ERROR;
}
-PVR_ERROR CHTSPData::GetChannelGroupMembers(PVR_HANDLE handle, const PVR_CHANNEL_GROUP &group)
+PVR_ERROR CHTSPData::GetChannelGroupMembers(ADDON_HANDLE handle, const PVR_CHANNEL_GROUP &group)
{
XBMC->Log(LOG_DEBUG, "%s - group '%s'", __FUNCTION__, group.strGroupName);
@@ -461,7 +461,7 @@ PVR_ERROR CHTSPData::GetChannelGroupMembers(PVR_HANDLE handle, const PVR_CHANNEL
return PVR_ERROR_NO_ERROR;
}
-PVR_ERROR CHTSPData::GetTimers(PVR_HANDLE handle)
+PVR_ERROR CHTSPData::GetTimers(ADDON_HANDLE handle)
{
SRecordings recordings = GetDVREntries(false, true);
@@ -64,20 +64,20 @@ class CHTSPData : public PLATFORM::CThread
bool GetDriveSpace(long long *total, long long *used);
bool GetBackendTime(time_t *utcTime, int *gmtOffset);
unsigned int GetNumChannels(void);
- PVR_ERROR GetChannels(PVR_HANDLE handle, bool bRadio);
- PVR_ERROR GetEpg(PVR_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd);
+ PVR_ERROR GetChannels(ADDON_HANDLE handle, bool bRadio);
+ PVR_ERROR GetEpg(ADDON_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd);
unsigned int GetNumRecordings();
- PVR_ERROR GetRecordings(PVR_HANDLE handle);
+ PVR_ERROR GetRecordings(ADDON_HANDLE handle);
PVR_ERROR DeleteRecording(const PVR_RECORDING &recinfo);
PVR_ERROR AddTimer(const PVR_TIMER &timerinfo);
PVR_ERROR UpdateTimer(const PVR_TIMER &timerinfo);
PVR_ERROR RenameRecording(const PVR_RECORDING &recinfo, const char* newname);
unsigned int GetNumTimers();
- PVR_ERROR GetTimers(PVR_HANDLE handle);
+ PVR_ERROR GetTimers(ADDON_HANDLE handle);
PVR_ERROR DeleteTimer(const PVR_TIMER &timerinfo, bool force);
unsigned int GetNumChannelGroups(void);
- PVR_ERROR GetChannelGroups(PVR_HANDLE handle);
- PVR_ERROR GetChannelGroupMembers(PVR_HANDLE handle, const PVR_CHANNEL_GROUP &group);
+ PVR_ERROR GetChannelGroups(ADDON_HANDLE handle);
+ PVR_ERROR GetChannelGroupMembers(ADDON_HANDLE handle, const PVR_CHANNEL_GROUP &group);
protected:
virtual void *Process(void);
@@ -333,7 +333,7 @@ PVR_ERROR GetDriveSpace(long long *iTotal, long long *iUsed)
return PVR_ERROR_SERVER_ERROR;
}
-PVR_ERROR GetEPGForChannel(PVR_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd)
+PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd)
{
if (!HTSPData || !HTSPData->IsConnected())
return PVR_ERROR_SERVER_ERROR;
@@ -349,7 +349,7 @@ int GetChannelsAmount(void)
return HTSPData->GetNumChannels();
}
-PVR_ERROR GetChannels(PVR_HANDLE handle, bool bRadio)
+PVR_ERROR GetChannels(ADDON_HANDLE handle, bool bRadio)
{
if (!HTSPData || !HTSPData->IsConnected())
return PVR_ERROR_SERVER_ERROR;
@@ -365,7 +365,7 @@ int GetRecordingsAmount(void)
return HTSPData->GetNumRecordings();
}
-PVR_ERROR GetRecordings(PVR_HANDLE handle)
+PVR_ERROR GetRecordings(ADDON_HANDLE handle)
{
if (!HTSPData || !HTSPData->IsConnected())
return PVR_ERROR_SERVER_ERROR;
@@ -397,7 +397,7 @@ int GetTimersAmount(void)
return HTSPData->GetNumTimers();
}
-PVR_ERROR GetTimers(PVR_HANDLE handle)
+PVR_ERROR GetTimers(ADDON_HANDLE handle)
{
if (!HTSPData || !HTSPData->IsConnected())
return PVR_ERROR_SERVER_ERROR;
@@ -506,7 +506,7 @@ int GetChannelGroupsAmount(void)
return HTSPData->GetNumChannelGroups();
}
-PVR_ERROR GetChannelGroups(PVR_HANDLE handle, bool bRadio)
+PVR_ERROR GetChannelGroups(ADDON_HANDLE handle, bool bRadio)
{
/* tvheadend doesn't support separated groups, so we only support TV groups */
if (bRadio)
@@ -518,7 +518,7 @@ PVR_ERROR GetChannelGroups(PVR_HANDLE handle, bool bRadio)
return HTSPData->GetChannelGroups(handle);
}
-PVR_ERROR GetChannelGroupMembers(PVR_HANDLE handle, const PVR_CHANNEL_GROUP &group)
+PVR_ERROR GetChannelGroupMembers(ADDON_HANDLE handle, const PVR_CHANNEL_GROUP &group)
{
/* tvheadend doesn't support separated groups, so we only support TV groups */
if (group.bIsRadio)
@@ -218,7 +218,7 @@ int cVNSIData::GetChannelsCount()
return count;
}
-bool cVNSIData::GetChannelsList(PVR_HANDLE handle, bool radio)
+bool cVNSIData::GetChannelsList(ADDON_HANDLE handle, bool radio)
{
cRequestPacket vrp;
if (!vrp.init(VNSI_CHANNELS_GETCHANNELS))
@@ -264,7 +264,7 @@ bool cVNSIData::GetChannelsList(PVR_HANDLE handle, bool radio)
return true;
}
-bool cVNSIData::GetEPGForChannel(PVR_HANDLE handle, const PVR_CHANNEL &channel, time_t start, time_t end)
+bool cVNSIData::GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL &channel, time_t start, time_t end)
{
cRequestPacket vrp;
if (!vrp.init(VNSI_EPG_GETFORCHANNEL))
@@ -395,7 +395,7 @@ PVR_ERROR cVNSIData::GetTimerInfo(unsigned int timernumber, PVR_TIMER &tag)
return PVR_ERROR_NO_ERROR;
}
-bool cVNSIData::GetTimersList(PVR_HANDLE handle)
+bool cVNSIData::GetTimersList(ADDON_HANDLE handle)
{
cRequestPacket vrp;
if (!vrp.init(VNSI_TIMER_GETLIST))
@@ -632,7 +632,7 @@ int cVNSIData::GetRecordingsCount()
return count;
}
-PVR_ERROR cVNSIData::GetRecordingsList(PVR_HANDLE handle)
+PVR_ERROR cVNSIData::GetRecordingsList(ADDON_HANDLE handle)
{
cRequestPacket vrp;
if (!vrp.init(VNSI_RECORDINGS_GETLIST))
@@ -919,7 +919,7 @@ int cVNSIData::GetChannelGroupCount(bool automatic)
return count;
}
-bool cVNSIData::GetChannelGroupList(PVR_HANDLE handle, bool bRadio)
+bool cVNSIData::GetChannelGroupList(ADDON_HANDLE handle, bool bRadio)
{
cRequestPacket vrp;
if (!vrp.init(VNSI_CHANNELGROUP_LIST))
@@ -952,7 +952,7 @@ bool cVNSIData::GetChannelGroupList(PVR_HANDLE handle, bool bRadio)
return true;
}
-bool cVNSIData::GetChannelGroupMembers(PVR_HANDLE handle, const PVR_CHANNEL_GROUP &group)
+bool cVNSIData::GetChannelGroupMembers(ADDON_HANDLE handle, const PVR_CHANNEL_GROUP &group)
{
cRequestPacket vrp;
if (!vrp.init(VNSI_CHANNELGROUP_MEMBERS))
@@ -45,14 +45,14 @@ class cVNSIData : public cVNSISession, public PLATFORM::CThread
bool GetDriveSpace(long long *total, long long *used);
int GetChannelsCount();
- bool GetChannelsList(PVR_HANDLE handle, bool radio = false);
- bool GetEPGForChannel(PVR_HANDLE handle, const PVR_CHANNEL &channel, time_t start, time_t end);
+ bool GetChannelsList(ADDON_HANDLE handle, bool radio = false);
+ bool GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL &channel, time_t start, time_t end);
int GetChannelGroupCount(bool automatic);
- bool GetChannelGroupList(PVR_HANDLE handle, bool bRadio);
- bool GetChannelGroupMembers(PVR_HANDLE handle, const PVR_CHANNEL_GROUP &group);
+ bool GetChannelGroupList(ADDON_HANDLE handle, bool bRadio);
+ bool GetChannelGroupMembers(ADDON_HANDLE handle, const PVR_CHANNEL_GROUP &group);
- bool GetTimersList(PVR_HANDLE handle);
+ bool GetTimersList(ADDON_HANDLE handle);
int GetTimersCount();
PVR_ERROR AddTimer(const PVR_TIMER &timerinfo);
PVR_ERROR GetTimerInfo(unsigned int timernumber, PVR_TIMER &tag);
@@ -61,7 +61,7 @@ class cVNSIData : public cVNSISession, public PLATFORM::CThread
PVR_ERROR UpdateTimer(const PVR_TIMER &timerinfo);
int GetRecordingsCount();
- PVR_ERROR GetRecordingsList(PVR_HANDLE handle);
+ PVR_ERROR GetRecordingsList(ADDON_HANDLE handle);
PVR_ERROR RenameRecording(const PVR_RECORDING& recinfo, const char* newname);
PVR_ERROR DeleteRecording(const PVR_RECORDING& recinfo);
@@ -361,7 +361,7 @@ PVR_ERROR DialogChannelScan(void)
/*******************************************/
/** PVR EPG Functions **/
-PVR_ERROR GetEPGForChannel(PVR_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd)
+PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd)
{
if (!VNSIData)
return PVR_ERROR_SERVER_ERROR;
@@ -381,7 +381,7 @@ int GetChannelsAmount(void)
return VNSIData->GetChannelsCount();
}
-PVR_ERROR GetChannels(PVR_HANDLE handle, bool bRadio)
+PVR_ERROR GetChannels(ADDON_HANDLE handle, bool bRadio)
{
if (!VNSIData)
return PVR_ERROR_SERVER_ERROR;
@@ -401,7 +401,7 @@ int GetChannelGroupsAmount()
return VNSIData->GetChannelGroupCount(g_bAutoChannelGroups);
}
-PVR_ERROR GetChannelGroups(PVR_HANDLE handle, bool bRadio)
+PVR_ERROR GetChannelGroups(ADDON_HANDLE handle, bool bRadio)
{
if (!VNSIData)
return PVR_ERROR_SERVER_ERROR;
@@ -412,7 +412,7 @@ PVR_ERROR GetChannelGroups(PVR_HANDLE handle, bool bRadio)
return PVR_ERROR_NO_ERROR;
}
-PVR_ERROR GetChannelGroupMembers(PVR_HANDLE handle, const PVR_CHANNEL_GROUP &group)
+PVR_ERROR GetChannelGroupMembers(ADDON_HANDLE handle, const PVR_CHANNEL_GROUP &group)
{
if (!VNSIData)
return PVR_ERROR_SERVER_ERROR;
@@ -432,7 +432,7 @@ int GetTimersAmount(void)
return VNSIData->GetTimersCount();
}
-PVR_ERROR GetTimers(PVR_HANDLE handle)
+PVR_ERROR GetTimers(ADDON_HANDLE handle)
{
if (!VNSIData)
return PVR_ERROR_SERVER_ERROR;
@@ -476,7 +476,7 @@ int GetRecordingsAmount(void)
return VNSIData->GetRecordingsCount();
}
-PVR_ERROR GetRecordings(PVR_HANDLE handle)
+PVR_ERROR GetRecordings(ADDON_HANDLE handle)
{
if (!VNSIData)
return PVR_ERROR_SERVER_ERROR;
View
@@ -78,19 +78,19 @@ class CHelper_libXBMC_pvr
dlsym(m_libXBMC_pvr, "PVR_unregister_me");
if (PVR_unregister_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
- TransferEpgEntry = (void (*)(const PVR_HANDLE handle, const EPG_TAG *epgentry))
+ TransferEpgEntry = (void (*)(const ADDON_HANDLE handle, const EPG_TAG *epgentry))
dlsym(m_libXBMC_pvr, "PVR_transfer_epg_entry");
if (TransferEpgEntry == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
- TransferChannelEntry = (void (*)(const PVR_HANDLE handle, const PVR_CHANNEL *chan))
+ TransferChannelEntry = (void (*)(const ADDON_HANDLE handle, const PVR_CHANNEL *chan))
dlsym(m_libXBMC_pvr, "PVR_transfer_channel_entry");
if (TransferChannelEntry == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
- TransferTimerEntry = (void (*)(const PVR_HANDLE handle, const PVR_TIMER *timer))
+ TransferTimerEntry = (void (*)(const ADDON_HANDLE handle, const PVR_TIMER *timer))
dlsym(m_libXBMC_pvr, "PVR_transfer_timer_entry");
if (TransferTimerEntry == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
- TransferRecordingEntry = (void (*)(const PVR_HANDLE handle, const PVR_RECORDING *recording))
+ TransferRecordingEntry = (void (*)(const ADDON_HANDLE handle, const PVR_RECORDING *recording))
dlsym(m_libXBMC_pvr, "PVR_transfer_recording_entry");
if (TransferRecordingEntry == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
@@ -118,11 +118,11 @@ class CHelper_libXBMC_pvr
dlsym(m_libXBMC_pvr, "PVR_trigger_channel_groups_update");
if (TriggerChannelGroupsUpdate == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
- TransferChannelGroup = (void (*)(const PVR_HANDLE handle, const PVR_CHANNEL_GROUP *group))
+ TransferChannelGroup = (void (*)(const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP *group))
dlsym(m_libXBMC_pvr, "PVR_transfer_channel_group");
if (TransferChannelGroup == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
- TransferChannelGroupMember = (void (*)(const PVR_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member))
+ TransferChannelGroupMember = (void (*)(const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member))
dlsym(m_libXBMC_pvr, "PVR_transfer_channel_group_member");
if (TransferChannelGroupMember == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
@@ -139,18 +139,18 @@ class CHelper_libXBMC_pvr
return PVR_register_me(m_Handle) > 0;
}
- void (*TransferEpgEntry)(const PVR_HANDLE handle, const EPG_TAG *epgentry);
- void (*TransferChannelEntry)(const PVR_HANDLE handle, const PVR_CHANNEL *chan);
- void (*TransferTimerEntry)(const PVR_HANDLE handle, const PVR_TIMER *timer);
- void (*TransferRecordingEntry)(const PVR_HANDLE handle, const PVR_RECORDING *recording);
+ void (*TransferEpgEntry)(const ADDON_HANDLE handle, const EPG_TAG *epgentry);
+ void (*TransferChannelEntry)(const ADDON_HANDLE handle, const PVR_CHANNEL *chan);
+ void (*TransferTimerEntry)(const ADDON_HANDLE handle, const PVR_TIMER *timer);
+ void (*TransferRecordingEntry)(const ADDON_HANDLE handle, const PVR_RECORDING *recording);
void (*AddMenuHook)(PVR_MENUHOOK *hook);
void (*Recording)(const char *Name, const char *FileName, bool On);
void (*TriggerTimerUpdate)();
void (*TriggerRecordingUpdate)();
void (*TriggerChannelUpdate)();
void (*TriggerChannelGroupsUpdate)();
- void (*TransferChannelGroup)(const PVR_HANDLE handle, const PVR_CHANNEL_GROUP *group);
- void (*TransferChannelGroupMember)(const PVR_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member);
+ void (*TransferChannelGroup)(const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP *group);
+ void (*TransferChannelGroupMember)(const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member);
#ifdef USE_DEMUX
void (*FreeDemuxPacket)(DemuxPacket* pPacket);
DemuxPacket* (*AllocateDemuxPacket)(int iDataSize);
@@ -46,6 +46,17 @@ typedef struct
unsigned int entry_elements;
} ADDON_StructSetting;
+/*!
+ * @brief Handle used to return data from the PVR add-on to CPVRClient
+ */
+struct ADDON_HANDLE_STRUCT
+{
+ void *callerAddress; /*!< address of the caller */
+ void *dataAddress; /*!< address to store data in */
+ int dataIdentifier; /*!< parameter to pass back when calling the callback */
+};
+typedef ADDON_HANDLE_STRUCT *ADDON_HANDLE;
+
#ifdef __cplusplus
};
#endif
Oops, something went wrong.

0 comments on commit b9f1387

Please sign in to comment.