1
0
mirror of https://github.com/rofafor/vdr-plugin-iptv.git synced 2023-10-10 13:37:03 +02:00

Reworked channel parameter field.

This commit is contained in:
Rolf Ahrenberg 2007-09-16 13:11:19 +00:00
parent 2751ba9d7f
commit b95e93408f
3 changed files with 29 additions and 16 deletions

6
README
View File

@ -37,8 +37,7 @@ make plugins
Channels.conf example: Channels.conf example:
TV1;IPTV:1:IPTV-UDP-192.168.0.1-1234:P:27500:512:650:2321:0:17:8438:4097:0 TV1;IPTV:1:IPTV|UDP|192.168.0.1|1234:P:27500:512:650:2321:0:17:8438:4097:0
TV2;IPTV:2:IPTV-UDP-192.168.0.2-1234:P:27500:513:660:2321:0:33:8438:4097:0
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
| | | | | Source type ("P") | | | | | Source type ("P")
| | | | IP Port Number | | | | IP Port Number
@ -47,6 +46,9 @@ TV2;IPTV:2:IPTV-UDP-192.168.0.2-1234:P:27500:513:660:2321:0:33:8438:4097:0
| Plugin ID ("IPTV") | Plugin ID ("IPTV")
Unique enumeration Unique enumeration
TV2;IPTV:2:IPTV|HTTP|127.0.0.1/TS/2|8080:P:27500:513:660:2321:0:33:8438:4097:0
TV3;IPTV:2:IPTV|FILE|/media/video.ts|8080:P:27500:513:660:2321:0:33:8438:4097:0
Notes: Notes:
- Remember to open IGMP in the firewall for multicast streams - Remember to open IGMP in the firewall for multicast streams

View File

@ -3,7 +3,7 @@
* *
* See the README file for copyright information and how to reach the author. * See the README file for copyright information and how to reach the author.
* *
* $Id: device.c,v 1.18 2007/09/16 12:18:15 ajhseppa Exp $ * $Id: device.c,v 1.19 2007/09/16 13:11:19 rahrenbe Exp $
*/ */
#include "common.h" #include "common.h"
@ -32,9 +32,9 @@ cIptvDevice::cIptvDevice(unsigned int Index)
tsBufferPrefill -= (tsBufferPrefill % TS_SIZE); tsBufferPrefill -= (tsBufferPrefill % TS_SIZE);
//debug("Buffer=%d Prefill=%d\n", MEGABYTE(IptvConfig.GetBufferSizeMB()), tsBufferPrefill); //debug("Buffer=%d Prefill=%d\n", MEGABYTE(IptvConfig.GetBufferSizeMB()), tsBufferPrefill);
pUdpProtocol = new cIptvProtocolUdp(); pUdpProtocol = new cIptvProtocolUdp();
//pRtspProtocol = new cIptvProtocolRtsp();
pHttpProtocol = new cIptvProtocolHttp(); pHttpProtocol = new cIptvProtocolHttp();
pFileProtocol = new cIptvProtocolFile(); pFileProtocol = new cIptvProtocolFile();
//pRtspProtocol = new cIptvProtocolRtsp();
pIptvStreamer = new cIptvStreamer(tsBuffer, &mutex); pIptvStreamer = new cIptvStreamer(tsBuffer, &mutex);
StartSectionHandler(); StartSectionHandler();
} }
@ -78,21 +78,32 @@ cIptvDevice *cIptvDevice::Get(unsigned int DeviceIndex)
cString cIptvDevice::GetChannelSettings(const char *Param, int *IpPort, cIptvProtocolIf* *Protocol) cString cIptvDevice::GetChannelSettings(const char *Param, int *IpPort, cIptvProtocolIf* *Protocol)
{ {
unsigned int a, b, c, d;
debug("cIptvDevice::GetChannelSettings(%d)\n", deviceIndex); debug("cIptvDevice::GetChannelSettings(%d)\n", deviceIndex);
if (sscanf(Param, "IPTV-UDP-%u.%u.%u.%u-%u", &a, &b, &c, &d, IpPort) == 5) { char *loc = NULL;
if (sscanf(Param, "IPTV|UDP|%a[^|]|%u", &loc, IpPort) == 5) {
cString addr(loc, true);
free(loc);
*Protocol = pUdpProtocol; *Protocol = pUdpProtocol;
return cString::sprintf("%u.%u.%u.%u", a, b, c, d); return addr;
} }
//else if (sscanf(Param, "IPTV-RTSP-%u.%u.%u.%u-%u", &a, &b, &c, &d, IpPort) == 5) { else if (sscanf(Param, "IPTV|HTTP|%a[^|]|%u", &loc, IpPort) == 5) {
// *Protocol = pRtspProtocol; cString addr(loc, true);
// return cString::sprintf("%u.%u.%u.%u", a, b, c, d); free(loc);
// }
else if (sscanf(Param, "IPTV-HTTP-%u.%u.%u.%u-%u", &a, &b, &c, &d, IpPort) == 5) {
*Protocol = pHttpProtocol; *Protocol = pHttpProtocol;
return cString::sprintf("%u.%u.%u.%u", a, b, c, d); return addr;
} }
//else if (sscanf(Param, "IPTV|FILE|%a[^|]|%u", &loc, IpPort) == 5) {
// cString addr(loc, true);
// free(loc);
// *Protocol = pFileProtocol;
// return addr;
// }
//else if (sscanf(Param, "IPTV|RTSP|%a[^|]|%u", &loc, IpPort) == 5) {
// cString addr(loc, true);
// free(loc);
// *Protocol = pRtspProtocol;
// return addr;
// }
return NULL; return NULL;
} }

View File

@ -3,7 +3,7 @@
* *
* See the README file for copyright information and how to reach the author. * See the README file for copyright information and how to reach the author.
* *
* $Id: device.h,v 1.8 2007/09/16 12:18:15 ajhseppa Exp $ * $Id: device.h,v 1.9 2007/09/16 13:11:19 rahrenbe Exp $
*/ */
#ifndef __IPTV_DEVICE_H #ifndef __IPTV_DEVICE_H
@ -32,9 +32,9 @@ private:
cRingBufferLinear *tsBuffer; cRingBufferLinear *tsBuffer;
int tsBufferPrefill; int tsBufferPrefill;
cIptvProtocolUdp *pUdpProtocol; cIptvProtocolUdp *pUdpProtocol;
//cIptvProtocolRtsp *pRtspProtocol;
cIptvProtocolHttp *pHttpProtocol; cIptvProtocolHttp *pHttpProtocol;
cIptvProtocolFile *pFileProtocol; cIptvProtocolFile *pFileProtocol;
//cIptvProtocolRtsp *pRtspProtocol;
cIptvStreamer *pIptvStreamer; cIptvStreamer *pIptvStreamer;
cMutex mutex; cMutex mutex;