From 838c0094b71d8282a3c5caefedc41ec934c1f825 Mon Sep 17 00:00:00 2001 From: Dennis Hamester Date: Wed, 9 Nov 2016 15:43:01 +0100 Subject: [PATCH] Pass signal quality and snr to Kodi core --- src/client.cpp | 6 +++++- src/rtsp_client.cpp | 7 +++++++ src/rtsp_client.hpp | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/client.cpp b/src/client.cpp index 704bbde..c0eeec0 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -270,7 +270,11 @@ bool SwitchChannel(const PVR_CHANNEL& channel) { return OpenLiveStream(channel); } -PVR_ERROR SignalStatus(PVR_SIGNAL_STATUS& signalStatus) { return PVR_ERROR_NOT_IMPLEMENTED; } +PVR_ERROR SignalStatus(PVR_SIGNAL_STATUS& signalStatus) { + rtsp_fill_signal_status(signalStatus); + return PVR_ERROR_NO_ERROR; +} + const char* GetLiveStreamURL(const PVR_CHANNEL& channel) { return NULL; } PVR_ERROR GetStreamProperties(PVR_STREAM_PROPERTIES* pProperties) { return PVR_ERROR_NOT_IMPLEMENTED; } diff --git a/src/rtsp_client.cpp b/src/rtsp_client.cpp index 327490f..4dfe136 100644 --- a/src/rtsp_client.cpp +++ b/src/rtsp_client.cpp @@ -468,3 +468,10 @@ void rtsp_close() rtsp = NULL; } } + +void rtsp_fill_signal_status(PVR_SIGNAL_STATUS& signal_status) { + if(rtsp) { + signal_status.iSNR = 0x1111 * rtsp->quality; + signal_status.iSignal = 0x101 * rtsp->level; + } +} diff --git a/src/rtsp_client.hpp b/src/rtsp_client.hpp index 1186922..e839973 100644 --- a/src/rtsp_client.hpp +++ b/src/rtsp_client.hpp @@ -2,9 +2,11 @@ #define _RTSP_CLIENT_HPP_ #include +#include bool rtsp_open(const std::string& url_str); void rtsp_close(); int rtsp_read(void *buf, unsigned buf_size); +void rtsp_fill_signal_status(PVR_SIGNAL_STATUS& signal_status); #endif