Added device indexes into debug outputs.

This commit is contained in:
Rolf Ahrenberg 2007-09-12 18:55:31 +00:00
parent 9ddb1e688d
commit c71599d81d
1 changed files with 13 additions and 13 deletions

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.1 2007/09/12 17:28:59 rahrenbe Exp $ * $Id: device.c,v 1.2 2007/09/12 18:55:31 rahrenbe Exp $
*/ */
#include "common.h" #include "common.h"
@ -21,7 +21,7 @@ cIptvDevice::cIptvDevice(unsigned int Index)
isOpenDvr(false), isOpenDvr(false),
pIptvStreamer(NULL) pIptvStreamer(NULL)
{ {
debug("cIptvDevice::cIptvDevice()\n"); debug("cIptvDevice::cIptvDevice(%d)\n", deviceIndex);
tsBuffer = new cRingBufferLinear(MEGABYTE(8), TS_SIZE, false, "IPTV"); tsBuffer = new cRingBufferLinear(MEGABYTE(8), TS_SIZE, false, "IPTV");
tsBuffer->SetTimeouts(100, 100); tsBuffer->SetTimeouts(100, 100);
pIptvStreamer = new cIptvStreamer(tsBuffer, &mutex); pIptvStreamer = new cIptvStreamer(tsBuffer, &mutex);
@ -29,7 +29,7 @@ cIptvDevice::cIptvDevice(unsigned int Index)
cIptvDevice::~cIptvDevice() cIptvDevice::~cIptvDevice()
{ {
debug("cIptvDevice::~cIptvDevice()\n"); debug("cIptvDevice::~cIptvDevice(%d)\n", deviceIndex);
if (pIptvStreamer) if (pIptvStreamer)
delete pIptvStreamer; delete pIptvStreamer;
delete tsBuffer; delete tsBuffer;
@ -68,7 +68,7 @@ cString cIptvDevice::GetChannelSettings(const char *Param, int *IpPort, int *Pro
{ {
unsigned int a, b, c, d; unsigned int a, b, c, d;
debug("cIptvDevice::GetChannelSettings()\n"); debug("cIptvDevice::GetChannelSettings(%d)\n", deviceIndex);
if (sscanf(Param, "IPTV-UDP-%u.%u.%u.%u-%u", &a, &b, &c, &d, IpPort) == 5) { if (sscanf(Param, "IPTV-UDP-%u.%u.%u.%u-%u", &a, &b, &c, &d, IpPort) == 5) {
debug("UDP channel detected\n"); debug("UDP channel detected\n");
Protocol = (int*)(cIptvStreamer::PROTOCOL_UDP); Protocol = (int*)(cIptvStreamer::PROTOCOL_UDP);
@ -89,19 +89,19 @@ cString cIptvDevice::GetChannelSettings(const char *Param, int *IpPort, int *Pro
bool cIptvDevice::ProvidesIptv(const char *Param) const bool cIptvDevice::ProvidesIptv(const char *Param) const
{ {
debug("cIptvDevice::ProvidesIptv()\n"); debug("cIptvDevice::ProvidesIptv(%d)\n", deviceIndex);
return (strncmp(Param, "IPTV", 4) == 0); return (strncmp(Param, "IPTV", 4) == 0);
} }
bool cIptvDevice::ProvidesSource(int Source) const bool cIptvDevice::ProvidesSource(int Source) const
{ {
debug("cIptvDevice::ProvidesSource()\n"); debug("cIptvDevice::ProvidesSource(%d)\n", deviceIndex);
return ((Source & cSource::st_Mask) == cSource::stPlug); return ((Source & cSource::st_Mask) == cSource::stPlug);
} }
bool cIptvDevice::ProvidesTransponder(const cChannel *Channel) const bool cIptvDevice::ProvidesTransponder(const cChannel *Channel) const
{ {
debug("cIptvDevice::ProvidesTransponder()\n"); debug("cIptvDevice::ProvidesTransponder(%d)\n", deviceIndex);
return (ProvidesSource(Channel->Source()) && ProvidesIptv(Channel->Param())); return (ProvidesSource(Channel->Source()) && ProvidesIptv(Channel->Param()));
} }
@ -110,7 +110,7 @@ bool cIptvDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *N
bool result = false; bool result = false;
bool needsDetachReceivers = false; bool needsDetachReceivers = false;
debug("cIptvDevice::ProvidesChannel()\n"); debug("cIptvDevice::ProvidesChannel(%d)\n", deviceIndex);
if (ProvidesTransponder(Channel)) if (ProvidesTransponder(Channel))
result = true; result = true;
if (NeedsDetachReceivers) if (NeedsDetachReceivers)
@ -123,7 +123,7 @@ bool cIptvDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
int port, protocol; int port, protocol;
cString addr; cString addr;
debug("cIptvDevice::SetChannelDevice()\n"); debug("cIptvDevice::SetChannelDevice(%d)\n", deviceIndex);
addr = GetChannelSettings(Channel->Param(), &port, &protocol); addr = GetChannelSettings(Channel->Param(), &port, &protocol);
if (addr) if (addr)
pIptvStreamer->SetStream(addr, port, protocol); pIptvStreamer->SetStream(addr, port, protocol);
@ -132,13 +132,13 @@ bool cIptvDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
bool cIptvDevice::SetPid(cPidHandle *Handle, int Type, bool On) bool cIptvDevice::SetPid(cPidHandle *Handle, int Type, bool On)
{ {
debug("cIptvDevice::SetPid()\n"); debug("cIptvDevice::SetPid(%d)\n", deviceIndex);
return true; return true;
} }
bool cIptvDevice::OpenDvr(void) bool cIptvDevice::OpenDvr(void)
{ {
debug("cIptvDevice::OpenDvr()\n"); debug("cIptvDevice::OpenDvr(%d)\n", deviceIndex);
mutex.Lock(); mutex.Lock();
isPacketDelivered = false; isPacketDelivered = false;
tsBuffer->Clear(); tsBuffer->Clear();
@ -150,7 +150,7 @@ bool cIptvDevice::OpenDvr(void)
void cIptvDevice::CloseDvr(void) void cIptvDevice::CloseDvr(void)
{ {
debug("cIptvDevice::CloseDvr()\n"); debug("cIptvDevice::CloseDvr(%d)\n", deviceIndex);
pIptvStreamer->Deactivate(); pIptvStreamer->Deactivate();
isOpenDvr = false; isOpenDvr = false;
} }
@ -158,7 +158,7 @@ void cIptvDevice::CloseDvr(void)
bool cIptvDevice::GetTSPacket(uchar *&Data) bool cIptvDevice::GetTSPacket(uchar *&Data)
{ {
int Count = 0; int Count = 0;
//debug("cIptvDevice::GetTSPacket()\n"); //debug("cIptvDevice::GetTSPacket(%d)\n", deviceIndex);
if (isPacketDelivered) { if (isPacketDelivered) {
tsBuffer->Del(TS_SIZE); tsBuffer->Del(TS_SIZE);
isPacketDelivered = false; isPacketDelivered = false;