Skip to content

Commit

Permalink
Merge pull request #452 from AlwinEsch/Matrix-change
Browse files Browse the repository at this point in the history
[Matrix] API change updates
  • Loading branch information
AlwinEsch authored Apr 30, 2020
2 parents 08f0e0a + 8689666 commit 9767054
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 24 deletions.
2 changes: 1 addition & 1 deletion pvr.hts/addon.xml.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.hts"
version="5.4.7"
version="5.4.8"
name="Tvheadend HTSP Client"
provider-name="Adam Sutton, Sam Stenvall, Lars Op den Kamp, Kai Sommerfeld">
<requires>@ADDON_DEPENDS@</requires>
Expand Down
3 changes: 3 additions & 0 deletions pvr.hts/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
5.4.8
- Update PVR API 6.5.0

5.4.7
- Update PVR API 6.4.0

Expand Down
4 changes: 2 additions & 2 deletions src/Tvheadend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ using namespace tvheadend;
using namespace tvheadend::entity;
using namespace tvheadend::utilities;

CTvheadend::CTvheadend(PVR_PROPERTIES* pvrProps)
CTvheadend::CTvheadend(AddonProperties_PVR* pvrProps)
: m_conn(new HTSPConnection(*this)),
m_streamchange(false),
m_vfs(new HTSPVFS(*m_conn)),
Expand Down Expand Up @@ -3024,7 +3024,7 @@ PVR_ERROR CTvheadend::DemuxCurrentStreams(PVR_STREAM_PROPERTIES* streams)
return m_dmx_active->CurrentStreams(streams);
}

PVR_ERROR CTvheadend::DemuxCurrentSignal(PVR_SIGNAL_STATUS& sig)
PVR_ERROR CTvheadend::DemuxCurrentSignal(PVR_SIGNAL_STATUS* sig)
{
return m_dmx_active->CurrentSignal(sig);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Tvheadend.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ typedef P8PLATFORM::SyncedBuffer<tvheadend::HTSPMessage> HTSPMessageQueue;
class CTvheadend : public P8PLATFORM::CThread, public tvheadend::IHTSPConnectionListener
{
public:
CTvheadend(PVR_PROPERTIES* pvrProps);
CTvheadend(AddonProperties_PVR* pvrProps);
~CTvheadend() override;

void Start();
Expand Down Expand Up @@ -198,7 +198,7 @@ class CTvheadend : public P8PLATFORM::CThread, public tvheadend::IHTSPConnection
void DemuxSpeed(int speed);
void DemuxFillBuffer(bool mode);
PVR_ERROR DemuxCurrentStreams(PVR_STREAM_PROPERTIES* streams);
PVR_ERROR DemuxCurrentSignal(PVR_SIGNAL_STATUS& sig);
PVR_ERROR DemuxCurrentSignal(PVR_SIGNAL_STATUS* sig);
PVR_ERROR DemuxCurrentDescramble(PVR_DESCRAMBLE_INFO* info);
bool DemuxIsTimeShifting() const;
bool DemuxIsRealTimeStream() const;
Expand Down
9 changes: 4 additions & 5 deletions src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "client.h"

#include "Tvheadend.h"
#include "kodi/libKODI_guilib.h"
#include "kodi/xbmc_pvr_dll.h"
#include "p8-platform/util/util.h"
#include "tvheadend/Settings.h"
Expand Down Expand Up @@ -102,7 +101,7 @@ ADDON_STATUS ADDON_Create(void* hdl, void* props)

ADDON_ReadSettings();

tvh = new CTvheadend(reinterpret_cast<PVR_PROPERTIES*>(props));
tvh = new CTvheadend(reinterpret_cast<AddonProperties_PVR*>(props));
tvh->Start();

m_CurStatus = ADDON_STATUS_OK;
Expand Down Expand Up @@ -145,7 +144,7 @@ void OnPowerSavingDeactivated() {}
* Capabilities / Info
* *************************************************************************/

PVR_ERROR GetAddonCapabilities(PVR_ADDON_CAPABILITIES* pCapabilities)
PVR_ERROR GetCapabilities(PVR_ADDON_CAPABILITIES* pCapabilities)
{
pCapabilities->bSupportsEPG = true;
pCapabilities->bSupportsTV = true;
Expand Down Expand Up @@ -288,12 +287,12 @@ PVR_ERROR GetStreamProperties(PVR_STREAM_PROPERTIES* pProperties)

void FillBuffer(bool mode) { tvh->DemuxFillBuffer(mode); }

PVR_ERROR SignalStatus(PVR_SIGNAL_STATUS& signalStatus)
PVR_ERROR GetSignalStatus(int channelUid, PVR_SIGNAL_STATUS* signalStatus)
{
return tvh->DemuxCurrentSignal(signalStatus);
}

PVR_ERROR GetDescrambleInfo(PVR_DESCRAMBLE_INFO* descrambleInfo)
PVR_ERROR GetDescrambleInfo(int channelUid, PVR_DESCRAMBLE_INFO* descrambleInfo)
{
if (!descrambleInfo)
return PVR_ERROR_INVALID_PARAMETERS;
Expand Down
26 changes: 13 additions & 13 deletions src/tvheadend/HTSPDemuxer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,24 +255,24 @@ PVR_ERROR HTSPDemuxer::CurrentStreams(PVR_STREAM_PROPERTIES* props)
return PVR_ERROR_NO_ERROR;
}

PVR_ERROR HTSPDemuxer::CurrentSignal(PVR_SIGNAL_STATUS& sig)
PVR_ERROR HTSPDemuxer::CurrentSignal(PVR_SIGNAL_STATUS* sig)
{
CLockObject lock(m_mutex);

sig = {0};
*sig = {0};

std::strncpy(sig.strAdapterName, m_sourceInfo.si_adapter.c_str(), sizeof(sig.strAdapterName) - 1);
std::strncpy(sig.strAdapterStatus, m_signalInfo.fe_status.c_str(),
sizeof(sig.strAdapterStatus) - 1);
std::strncpy(sig.strServiceName, m_sourceInfo.si_service.c_str(), sizeof(sig.strServiceName) - 1);
std::strncpy(sig.strProviderName, m_sourceInfo.si_provider.c_str(),
sizeof(sig.strProviderName) - 1);
std::strncpy(sig.strMuxName, m_sourceInfo.si_mux.c_str(), sizeof(sig.strMuxName) - 1);
std::strncpy(sig->strAdapterName, m_sourceInfo.si_adapter.c_str(), sizeof(sig->strAdapterName) - 1);
std::strncpy(sig->strAdapterStatus, m_signalInfo.fe_status.c_str(),
sizeof(sig->strAdapterStatus) - 1);
std::strncpy(sig->strServiceName, m_sourceInfo.si_service.c_str(), sizeof(sig->strServiceName) - 1);
std::strncpy(sig->strProviderName, m_sourceInfo.si_provider.c_str(),
sizeof(sig->strProviderName) - 1);
std::strncpy(sig->strMuxName, m_sourceInfo.si_mux.c_str(), sizeof(sig->strMuxName) - 1);

sig.iSNR = m_signalInfo.fe_snr;
sig.iSignal = m_signalInfo.fe_signal;
sig.iBER = m_signalInfo.fe_ber;
sig.iUNC = m_signalInfo.fe_unc;
sig->iSNR = m_signalInfo.fe_snr;
sig->iSignal = m_signalInfo.fe_signal;
sig->iBER = m_signalInfo.fe_ber;
sig->iUNC = m_signalInfo.fe_unc;

return PVR_ERROR_NO_ERROR;
}
Expand Down
2 changes: 1 addition & 1 deletion src/tvheadend/HTSPDemuxer.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class HTSPDemuxer
void Weight(tvheadend::eSubscriptionWeight weight);

PVR_ERROR CurrentStreams(PVR_STREAM_PROPERTIES* streams);
PVR_ERROR CurrentSignal(PVR_SIGNAL_STATUS& sig);
PVR_ERROR CurrentSignal(PVR_SIGNAL_STATUS* sig);
PVR_ERROR CurrentDescrambleInfo(PVR_DESCRAMBLE_INFO* info);

bool IsTimeShifting() const;
Expand Down

0 comments on commit 9767054

Please sign in to comment.