1
0
mirror of https://github.com/DigitalDevices/pvr.octonet.git synced 2023-10-10 13:36:57 +02:00

Pass channel name to rtsp_client

This commit is contained in:
Dennis Hamester 2016-11-10 11:33:56 +01:00
parent 844a5c3cd4
commit 0adb1ade91
3 changed files with 6 additions and 3 deletions

View File

@ -249,7 +249,7 @@ PVR_ERROR UpdateTimer(const PVR_TIMER& timer) { return PVR_ERROR_NOT_IMPLEMENTED
/* entirely unused, as we use standard RTSP+TS mux, which can be handlded by /* entirely unused, as we use standard RTSP+TS mux, which can be handlded by
* Kodi core */ * Kodi core */
bool OpenLiveStream(const PVR_CHANNEL& channel) { bool OpenLiveStream(const PVR_CHANNEL& channel) {
return rtsp_open(data->getUrl(channel.iUniqueId)); return rtsp_open(data->getName(channel.iUniqueId), data->getUrl(channel.iUniqueId));
} }
int ReadLiveStream(unsigned char* pBuffer, unsigned int iBufferSize) { int ReadLiveStream(unsigned char* pBuffer, unsigned int iBufferSize) {

View File

@ -75,6 +75,7 @@ struct rtsp_client {
size_t fifo_size; size_t fifo_size;
uint16_t last_seq_nr; uint16_t last_seq_nr;
string name;
int level; int level;
int quality; int quality;
}; };
@ -291,7 +292,7 @@ static enum rtsp_result rtsp_handle() {
return (enum rtsp_result)rtsp_result; return (enum rtsp_result)rtsp_result;
} }
bool rtsp_open(const string& url_str) bool rtsp_open(const string& name, const string& url_str)
{ {
string setup_url_str; string setup_url_str;
const char *psz_setup_url; const char *psz_setup_url;
@ -304,6 +305,7 @@ bool rtsp_open(const string& url_str)
if (rtsp == NULL) if (rtsp == NULL)
return false; return false;
rtsp->name = name;
rtsp->level = 0; rtsp->level = 0;
rtsp->quality = 0; rtsp->quality = 0;
@ -471,6 +473,7 @@ void rtsp_close()
void rtsp_fill_signal_status(PVR_SIGNAL_STATUS& signal_status) { void rtsp_fill_signal_status(PVR_SIGNAL_STATUS& signal_status) {
if(rtsp) { if(rtsp) {
strncpy(signal_status.strServiceName, rtsp->name.c_str(), PVR_ADDON_NAME_STRING_LENGTH - 1);
signal_status.iSNR = 0x1111 * rtsp->quality; signal_status.iSNR = 0x1111 * rtsp->quality;
signal_status.iSignal = 0x101 * rtsp->level; signal_status.iSignal = 0x101 * rtsp->level;
} }

View File

@ -4,7 +4,7 @@
#include <string> #include <string>
#include <xbmc_pvr_types.h> #include <xbmc_pvr_types.h>
bool rtsp_open(const std::string& url_str); bool rtsp_open(const std::string& name, const std::string& url_str);
void rtsp_close(); void rtsp_close();
int rtsp_read(void *buf, unsigned buf_size); int rtsp_read(void *buf, unsigned buf_size);
void rtsp_fill_signal_status(PVR_SIGNAL_STATUS& signal_status); void rtsp_fill_signal_status(PVR_SIGNAL_STATUS& signal_status);