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

Renamed SidFinder to SidScanner.

This commit is contained in:
Rolf Ahrenberg 2007-10-01 18:14:57 +00:00
parent 206475928b
commit e210b8197b
7 changed files with 63 additions and 56 deletions

View File

@ -1,7 +1,7 @@
# #
# Makefile for a Video Disk Recorder plugin # Makefile for a Video Disk Recorder plugin
# #
# $Id: Makefile,v 1.13 2007/09/29 16:21:04 rahrenbe Exp $ # $Id: Makefile,v 1.14 2007/10/01 18:14:57 rahrenbe Exp $
# Debugging on/off # Debugging on/off
#IPTV_DEBUG = 1 #IPTV_DEBUG = 1
@ -58,7 +58,7 @@ endif
### The object files (add further files here): ### The object files (add further files here):
OBJS = $(PLUGIN).o config.o setup.o device.o streamer.o protocoludp.o \ OBJS = $(PLUGIN).o config.o setup.o device.o streamer.o protocoludp.o \
protocolhttp.o protocolfile.o sectionfilter.o sidfinder.o protocolhttp.o protocolfile.o sectionfilter.o sidscanner.o
### The main target: ### The main target:

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.48 2007/09/30 21:38:31 rahrenbe Exp $ * $Id: device.c,v 1.49 2007/10/01 18:14:57 rahrenbe Exp $
*/ */
#include "common.h" #include "common.h"
@ -34,23 +34,26 @@ cIptvDevice::cIptvDevice(unsigned int Index)
pIptvStreamer = new cIptvStreamer(tsBuffer, &mutex); pIptvStreamer = new cIptvStreamer(tsBuffer, &mutex);
// Initialize filter pointers // Initialize filter pointers
memset(&secfilters, '\0', sizeof(secfilters)); memset(&secfilters, '\0', sizeof(secfilters));
// Start section handler for iptv device
StartSectionHandler(); StartSectionHandler();
// Sid filter must be created after the section handler // Sid scanner must be created after the section handler
sidFinder = new cSidFinder; pSidScanner = new cSidScanner;
if (sidFinder) if (pSidScanner)
AttachFilter(sidFinder); AttachFilter(pSidScanner);
} }
cIptvDevice::~cIptvDevice() cIptvDevice::~cIptvDevice()
{ {
debug("cIptvDevice::~cIptvDevice(%d)\n", deviceIndex); debug("cIptvDevice::~cIptvDevice(%d)\n", deviceIndex);
delete pIptvStreamer; DELETENULL(pIptvStreamer);
delete pUdpProtocol; DELETENULL(pUdpProtocol);
delete tsBuffer; DELETENULL(pHttpProtocol);
DELETENULL(pFileProtocol);
DELETENULL(tsBuffer);
// Detach and destroy sid filter // Detach and destroy sid filter
if (sidFinder) { if (pSidScanner) {
Detach(sidFinder); Detach(pSidScanner);
delete sidFinder; DELETENULL(pSidScanner);
} }
// Destroy all filters // Destroy all filters
for (int i = 0; i < eMaxSecFilterCount; ++i) for (int i = 0; i < eMaxSecFilterCount; ++i)
@ -152,8 +155,8 @@ bool cIptvDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
return false; return false;
} }
pIptvStreamer->Set(addr, port, protocol); pIptvStreamer->Set(addr, port, protocol);
if (sidFinder && IptvConfig.GetSidScanning()) if (pSidScanner && IptvConfig.GetSectionFiltering() && IptvConfig.GetSidScanning())
sidFinder->SetChannel(Channel); pSidScanner->SetChannel(Channel);
return true; return true;
} }
@ -232,8 +235,8 @@ bool cIptvDevice::OpenDvr(void)
mutex.Unlock(); mutex.Unlock();
ResetBuffering(); ResetBuffering();
pIptvStreamer->Open(); pIptvStreamer->Open();
if (sidFinder && IptvConfig.GetSidScanning()) if (pSidScanner && IptvConfig.GetSectionFiltering() && IptvConfig.GetSidScanning())
sidFinder->SetStatus(true); pSidScanner->SetStatus(true);
isOpenDvr = true; isOpenDvr = true;
return true; return true;
} }
@ -241,8 +244,8 @@ bool cIptvDevice::OpenDvr(void)
void cIptvDevice::CloseDvr(void) void cIptvDevice::CloseDvr(void)
{ {
debug("cIptvDevice::CloseDvr(%d)\n", deviceIndex); debug("cIptvDevice::CloseDvr(%d)\n", deviceIndex);
if (sidFinder && IptvConfig.GetSidScanning()) if (pSidScanner && IptvConfig.GetSectionFiltering() && IptvConfig.GetSidScanning())
sidFinder->SetStatus(false); pSidScanner->SetStatus(false);
pIptvStreamer->Close(); pIptvStreamer->Close();
isOpenDvr = false; isOpenDvr = false;
} }

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.22 2007/09/29 16:21:05 rahrenbe Exp $ * $Id: device.h,v 1.23 2007/10/01 18:14:57 rahrenbe Exp $
*/ */
#ifndef __IPTV_DEVICE_H #ifndef __IPTV_DEVICE_H
@ -15,7 +15,7 @@
#include "protocolfile.h" #include "protocolfile.h"
#include "streamer.h" #include "streamer.h"
#include "sectionfilter.h" #include "sectionfilter.h"
#include "sidfinder.h" #include "sidscanner.h"
class cIptvDevice : public cDevice { class cIptvDevice : public cDevice {
// static ones // static ones
@ -39,7 +39,7 @@ private:
cIptvProtocolHttp *pHttpProtocol; cIptvProtocolHttp *pHttpProtocol;
cIptvProtocolFile *pFileProtocol; cIptvProtocolFile *pFileProtocol;
cIptvStreamer *pIptvStreamer; cIptvStreamer *pIptvStreamer;
cSidFinder *sidFinder; cSidScanner *pSidScanner;
cMutex mutex; cMutex mutex;
cIptvSectionFilter* secfilters[eMaxSecFilterCount]; cIptvSectionFilter* secfilters[eMaxSecFilterCount];

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: VDR 1.5.7\n" "Project-Id-Version: VDR 1.5.7\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n" "Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
"POT-Creation-Date: 2007-10-01 00:37+0300\n" "POT-Creation-Date: 2007-10-01 21:07+0300\n"
"PO-Revision-Date: 2007-08-12 23:22+0300\n" "PO-Revision-Date: 2007-08-12 23:22+0300\n"
"Last-Translator: Rolf Ahrenberg\n" "Last-Translator: Rolf Ahrenberg\n"
"Language-Team: <vdr@linuxtv.org>\n" "Language-Team: <vdr@linuxtv.org>\n"
@ -47,26 +47,30 @@ msgstr "Osoite"
msgid "Port" msgid "Port"
msgstr "Portti" msgstr "Portti"
#: setup.c:259 #: setup.c:195
msgid "Rid"
msgstr "Radio-ID"
#: setup.c:267
msgid "Cannot find unique channel settings!" msgid "Cannot find unique channel settings!"
msgstr "Yksilöllisiä kanava-asetuksia ei löydetä!" msgstr "Yksilöllisiä kanava-asetuksia ei löydetä!"
#: setup.c:333 #: setup.c:341
msgid "IPTV Channels" msgid "IPTV Channels"
msgstr "IPTV-kanavat" msgstr "IPTV-kanavat"
#: setup.c:478 #: setup.c:486
msgid "TS buffer size [MB]" msgid "TS buffer size [MB]"
msgstr "TS-puskurin koko [MB]" msgstr "TS-puskurin koko [MB]"
#: setup.c:479 #: setup.c:487
msgid "TS buffer prefill ratio [%]" msgid "TS buffer prefill ratio [%]"
msgstr "TS-puskurin esitäyttöaste [%]" msgstr "TS-puskurin esitäyttöaste [%]"
#: setup.c:480 #: setup.c:488
msgid "Use section filtering" msgid "Use section filtering"
msgstr "Käytä sektioiden suodatusta" msgstr "Käytä sektioiden suodatusta"
#: setup.c:482 #: setup.c:490
msgid "Scan Sid automatically" msgid "Scan Sid automatically"
msgstr "Etsi palvelu-ID automaattisesti" msgstr "Etsi palvelu-ID automaattisesti"

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: setup.c,v 1.18 2007/10/01 15:38:44 ajhseppa Exp $ * $Id: setup.c,v 1.19 2007/10/01 18:14:57 rahrenbe Exp $
*/ */
#include <string.h> #include <string.h>
@ -192,6 +192,7 @@ void cIptvMenuEditChannel::Setup(void)
Add(new cMenuEditIntItem(trVDR("Tpid"), &data.tpid, 0, 0x1FFF)); Add(new cMenuEditIntItem(trVDR("Tpid"), &data.tpid, 0, 0x1FFF));
Add(new cMenuEditIntItem(trVDR("CA"), &data.caids[0], 0, 0xFFFF)); Add(new cMenuEditIntItem(trVDR("CA"), &data.caids[0], 0, 0xFFFF));
Add(new cMenuEditIntItem(trVDR("Sid"), &data.sid, 1, 0xFFFF)); Add(new cMenuEditIntItem(trVDR("Sid"), &data.sid, 1, 0xFFFF));
Add(new cMenuEditIntItem(tr ("Rid"), &data.rid, 0, 0x1FFF));
SetCurrent(Get(current)); SetCurrent(Get(current));
Display(); Display();
} }
@ -218,7 +219,7 @@ eOSState cIptvMenuEditChannel::ProcessKey(eKeys Key)
newchannel.PluginParam())) { newchannel.PluginParam())) {
// If the channel RID is already at maximum, then fail the // If the channel RID is already at maximum, then fail the
// channel modification // channel modification
if (iteratorChannel->Rid() >= 8192) { if (iteratorChannel->Rid() >= 0x1FFF) {
debug("Cannot increment RID over maximum value\n"); debug("Cannot increment RID over maximum value\n");
uniquityFailed = true; uniquityFailed = true;
break; break;
@ -523,4 +524,3 @@ void cIptvPluginSetup::Store(void)
IptvConfig.SetSectionFiltering(sectionFiltering); IptvConfig.SetSectionFiltering(sectionFiltering);
IptvConfig.SetSidScanning(sidScanning); IptvConfig.SetSidScanning(sidScanning);
} }

View File

@ -1,46 +1,46 @@
/* /*
* sidfilter.c: IPTV plugin for the Video Disk Recorder * sidscanner.c: IPTV plugin for the Video Disk Recorder
* *
* 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: sidfinder.c,v 1.3 2007/09/30 17:33:02 ajhseppa Exp $ * $Id: sidscanner.c,v 1.1 2007/10/01 18:14:57 rahrenbe Exp $
*/ */
#include <libsi/section.h> #include <libsi/section.h>
#include "common.h" #include "common.h"
#include "sidfinder.h" #include "sidscanner.h"
cSidFinder::cSidFinder(void) cSidScanner::cSidScanner(void)
{ {
debug("cSidFinder::cSidFinder()\n"); debug("cSidScanner::cSidScanner()\n");
channel = cChannel(); channel = cChannel();
Set(0x00, 0x00); // PAT Set(0x00, 0x00); // PAT
} }
void cSidFinder::SetStatus(bool On) void cSidScanner::SetStatus(bool On)
{ {
debug("cSidFinder::SetStatus(): %d\n", On); debug("cSidScanner::SetStatus(): %d\n", On);
cFilter::SetStatus(On); cFilter::SetStatus(On);
} }
void cSidFinder::SetChannel(const cChannel *Channel) void cSidScanner::SetChannel(const cChannel *Channel)
{ {
if (Channel) { if (Channel) {
debug("cSidFinder::SetChannel(): %s\n", Channel->PluginParam()); debug("cSidScanner::SetChannel(): %s\n", Channel->PluginParam());
channel = *Channel; channel = *Channel;
} }
else { else {
debug("cSidFinder::SetChannel()\n"); debug("cSidScanner::SetChannel()\n");
channel = cChannel(); channel = cChannel();
} }
} }
void cSidFinder::Process(u_short Pid, u_char Tid, const u_char *Data, int Length) void cSidScanner::Process(u_short Pid, u_char Tid, const u_char *Data, int Length)
{ {
//debug("cSidFinder::Process()\n"); //debug("cSidScanner::Process()\n");
if ((Pid == 0x00) && (Tid == 0x00) && channel.GetChannelID().Valid()) { if ((Pid == 0x00) && (Tid == 0x00) && channel.GetChannelID().Valid()) {
debug("cSidFinder::Process(): Pid=%d Tid=%02X\n", Pid, Tid); debug("cSidScanner::Process(): Pid=%d Tid=%02X\n", Pid, Tid);
SI::PAT pat(Data, false); SI::PAT pat(Data, false);
if (!pat.CheckCRCAndParse()) if (!pat.CheckCRCAndParse())
return; return;
@ -48,11 +48,12 @@ void cSidFinder::Process(u_short Pid, u_char Tid, const u_char *Data, int Length
for (SI::Loop::Iterator it; pat.associationLoop.getNext(assoc, it); ) { for (SI::Loop::Iterator it; pat.associationLoop.getNext(assoc, it); ) {
if (!assoc.isNITPid()) { if (!assoc.isNITPid()) {
if (assoc.getServiceId() != channel.Sid()) { if (assoc.getServiceId() != channel.Sid()) {
debug("cSidFinder::Process(): Sid=%d\n", assoc.getServiceId()); debug("cSidScanner::Process(): Sid=%d\n", assoc.getServiceId());
if (!Channels.Lock(true, 10)) if (!Channels.Lock(true, 10))
return; return;
cChannel *IptvChannel = Channels.GetByChannelID(channel.GetChannelID()); cChannel *IptvChannel = Channels.GetByChannelID(channel.GetChannelID());
IptvChannel->SetId(IptvChannel->Nid(), IptvChannel->Tid(), assoc.getServiceId(), IptvChannel->Rid()); IptvChannel->SetId(IptvChannel->Nid(), IptvChannel->Tid(),
assoc.getServiceId(), IptvChannel->Rid());
Channels.Unlock(); Channels.Unlock();
} }
SetChannel(NULL); SetChannel(NULL);
@ -62,4 +63,3 @@ void cSidFinder::Process(u_short Pid, u_char Tid, const u_char *Data, int Length
} }
} }
} }

View File

@ -1,18 +1,18 @@
/* /*
* sidfinder.h: IPTV plugin for the Video Disk Recorder * sidscanner.h: IPTV plugin for the Video Disk Recorder
* *
* 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: sidfinder.h,v 1.1 2007/09/28 23:23:12 rahrenbe Exp $ * $Id: sidscanner.h,v 1.1 2007/10/01 18:14:57 rahrenbe Exp $
*/ */
#ifndef __SIDFINDER_H #ifndef __SIDSCANNER_H
#define __SIDFINDER_H #define __SIDSCANNER_H
#include <vdr/channels.h> #include <vdr/channels.h>
#include <vdr/filter.h> #include <vdr/filter.h>
class cSidFinder : public cFilter { class cSidScanner : public cFilter {
private: private:
cChannel channel; cChannel channel;
@ -20,9 +20,9 @@ protected:
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length); virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length);
public: public:
cSidFinder(void); cSidScanner(void);
virtual void SetStatus(bool On); virtual void SetStatus(bool On);
void SetChannel(const cChannel *Channel); void SetChannel(const cChannel *Channel);
}; };
#endif // __SIDFINDER_H #endif // __SIDSCANNER_H