@@ -24,7 +24,7 @@ cIptvDevice::cIptvDevice(unsigned int indexP)
24
24
{
25
25
unsigned int bufsize = (unsigned int )IPTV_BUFFER_SIZE ;
26
26
bufsize -= (bufsize % TS_SIZE );
27
- isyslog ( "creating IPTV device %d (CardIndex=%d)" , deviceIndexM , CardIndex ());
27
+ info ( "Creating IPTV device %d (CardIndex=%d)" , deviceIndexM , CardIndex ());
28
28
tsBufferM = new cRingBufferLinear (bufsize + 1 , TS_SIZE , false,
29
29
* cString ::sprintf ("IPTV TS %d" , deviceIndexM ));
30
30
if (tsBufferM ) {
@@ -50,13 +50,13 @@ cIptvDevice::cIptvDevice(unsigned int indexP)
50
50
if (S_ISFIFO (sb .st_mode )) {
51
51
dvrFdM = open (filename , O_RDWR | O_NONBLOCK );
52
52
if (dvrFdM >= 0 )
53
- dsyslog ("IPTV device %d redirecting input stream to '%s'" , deviceIndexM , * filename );
53
+ info ("IPTV device %d redirecting input stream to '%s'" , deviceIndexM , * filename );
54
54
}
55
55
}
56
56
57
57
cIptvDevice ::~cIptvDevice ()
58
58
{
59
- debug ( "cIptvDevice::%s(%d) " , __FUNCTION__ , deviceIndexM );
59
+ debug1 ( "%s [device %d] " , __PRETTY_FUNCTION__ , deviceIndexM );
60
60
// Stop section handler of iptv device
61
61
StopSectionHandler ();
62
62
DELETE_POINTER (pIptvSectionM );
@@ -79,7 +79,7 @@ cIptvDevice::~cIptvDevice()
79
79
80
80
bool cIptvDevice ::Initialize (unsigned int deviceCountP )
81
81
{
82
- debug ( "cIptvDevice::%s(%d )" , __FUNCTION__ , deviceCountP );
82
+ debug1 ( "%s (%u )" , __PRETTY_FUNCTION__ , deviceCountP );
83
83
new cIptvSourceParam (IPTV_SOURCE_CHARACTER , "IPTV ");
84
84
if (deviceCountP > IPTV_MAX_DEVICES )
85
85
deviceCountP = IPTV_MAX_DEVICES ;
@@ -92,7 +92,7 @@ bool cIptvDevice::Initialize(unsigned int deviceCountP)
92
92
93
93
void cIptvDevice ::Shutdown (void )
94
94
{
95
- debug ( "cIptvDevice::%s() " , __FUNCTION__ );
95
+ debug1 ( "%s " , __PRETTY_FUNCTION__ );
96
96
for (int i = 0 ; i < IPTV_MAX_DEVICES ; ++ i ) {
97
97
if (IptvDevicesS [i ])
98
98
IptvDevicesS [i ]-> CloseDvr ();
@@ -102,7 +102,7 @@ void cIptvDevice::Shutdown(void)
102
102
unsigned int cIptvDevice ::Count (void )
103
103
{
104
104
unsigned int count = 0 ;
105
- debug ( "cIptvDevice::%s() " , __FUNCTION__ );
105
+ debug1 ( "%s " , __PRETTY_FUNCTION__ );
106
106
for (unsigned int i = 0 ; i < IPTV_MAX_DEVICES ; ++ i ) {
107
107
if (IptvDevicesS [i ] != NULL )
108
108
count ++ ;
@@ -112,10 +112,10 @@ unsigned int cIptvDevice::Count(void)
112
112
113
113
cIptvDevice * cIptvDevice ::GetIptvDevice (int cardIndexP )
114
114
{
115
- //debug("cIptvDevice::%s (%d)", __FUNCTION__ , cardIndexP);
115
+ debug16 ( "%s (%d)" , __PRETTY_FUNCTION__ , cardIndexP );
116
116
for (unsigned int i = 0 ; i < IPTV_MAX_DEVICES ; ++ i ) {
117
117
if (IptvDevicesS [i ] && (IptvDevicesS [i ]-> CardIndex () == cardIndexP )) {
118
- //debug("cIptvDevice::%s (%d): found! ", __FUNCTION__ , cardIndexP);
118
+ debug16 ( "%s (%d) Found " , __PRETTY_FUNCTION__ , cardIndexP );
119
119
return IptvDevicesS [i ];
120
120
}
121
121
}
@@ -124,7 +124,7 @@ cIptvDevice *cIptvDevice::GetIptvDevice(int cardIndexP)
124
124
125
125
cString cIptvDevice ::GetGeneralInformation (void )
126
126
{
127
- //debug("cIptvDevice::%s(%d) ", __FUNCTION__ , deviceIndexM);
127
+ debug16 ( "%s [device %d] " , __PRETTY_FUNCTION__ , deviceIndexM );
128
128
return cString ::sprintf ("IPTV device: %d\nCardIndex: %d\nStream: %s\nStream bitrate: %s\n%sChannel: %s" ,
129
129
deviceIndexM , CardIndex (),
130
130
pIptvStreamerM ? * pIptvStreamerM -> GetInformation () : "" ,
@@ -135,13 +135,13 @@ cString cIptvDevice::GetGeneralInformation(void)
135
135
136
136
cString cIptvDevice ::GetPidsInformation (void )
137
137
{
138
- //debug("cIptvDevice::%s(%d) ", __FUNCTION__ , deviceIndexM);
138
+ debug16 ( "%s [device %d] " , __PRETTY_FUNCTION__ , deviceIndexM );
139
139
return GetPidStatistic ();
140
140
}
141
141
142
142
cString cIptvDevice ::GetFiltersInformation (void )
143
143
{
144
- //debug("cIptvDevice::%s(%d) ", __FUNCTION__ , deviceIndexM);
144
+ debug16 ( "%s [device %d] " , __PRETTY_FUNCTION__ , deviceIndexM );
145
145
return cString ::sprintf ("Active section filters:\n%s" , pIptvSectionM ? * pIptvSectionM -> GetInformation () : "" );
146
146
}
147
147
@@ -177,37 +177,37 @@ cString cIptvDevice::GetInformation(unsigned int pageP)
177
177
178
178
cString cIptvDevice ::DeviceType (void ) const
179
179
{
180
- //debug("cIptvDevice::%s(%d) ", __FUNCTION__ , deviceIndexM);
180
+ debug16 ( "%s [device %d] " , __PRETTY_FUNCTION__ , deviceIndexM );
181
181
return "IPTV" ;
182
182
}
183
183
184
184
cString cIptvDevice ::DeviceName (void ) const
185
185
{
186
- debug ( "cIptvDevice::%s(%d) " , __FUNCTION__ , deviceIndexM );
186
+ debug1 ( "%s [device %d] " , __PRETTY_FUNCTION__ , deviceIndexM );
187
187
return cString ::sprintf ("IPTV %d" , deviceIndexM );
188
188
}
189
189
190
190
int cIptvDevice ::SignalStrength (void ) const
191
191
{
192
- debug ( "cIptvDevice::%s(%d) " , __FUNCTION__ , deviceIndexM );
192
+ debug1 ( "%s [device %d] " , __PRETTY_FUNCTION__ , deviceIndexM );
193
193
return (100 );
194
194
}
195
195
196
196
int cIptvDevice ::SignalQuality (void ) const
197
197
{
198
- debug ( "cIptvDevice::%s(%d) " , __FUNCTION__ , deviceIndexM );
198
+ debug1 ( "%s [device %d] " , __PRETTY_FUNCTION__ , deviceIndexM );
199
199
return (100 );
200
200
}
201
201
202
202
bool cIptvDevice ::ProvidesSource (int sourceP ) const
203
203
{
204
- debug ( "cIptvDevice::%s(%d) " , __FUNCTION__ , deviceIndexM );
204
+ debug1 ( "%s [device %d] " , __PRETTY_FUNCTION__ , deviceIndexM );
205
205
return (cSource ::IsType (sourceP , IPTV_SOURCE_CHARACTER ));
206
206
}
207
207
208
208
bool cIptvDevice ::ProvidesTransponder (const cChannel * channelP ) const
209
209
{
210
- debug ( "cIptvDevice::%s(%d) " , __FUNCTION__ , deviceIndexM );
210
+ debug1 ( "%s [device %d] " , __PRETTY_FUNCTION__ , deviceIndexM );
211
211
return (ProvidesSource (channelP -> Source ()));
212
212
}
213
213
@@ -217,7 +217,7 @@ bool cIptvDevice::ProvidesChannel(const cChannel *channelP, int priorityP, bool
217
217
bool hasPriority = (priorityP == IDLEPRIORITY ) || (priorityP > this -> Priority ());
218
218
bool needsDetachReceivers = false;
219
219
220
- debug ( "cIptvDevice::%s(%d) " , __FUNCTION__ , deviceIndexM );
220
+ debug1 ( "%s [device %d] " , __PRETTY_FUNCTION__ , deviceIndexM );
221
221
222
222
if (channelP && ProvidesTransponder (channelP )) {
223
223
result = hasPriority ;
@@ -263,7 +263,7 @@ bool cIptvDevice::SetChannelDevice(const cChannel *channelP, bool liveViewP)
263
263
cIptvProtocolIf * protocol ;
264
264
cIptvTransponderParameters itp (channelP -> Parameters ());
265
265
266
- debug ( "cIptvDevice::%s(%d) " , __FUNCTION__ , deviceIndexM );
266
+ debug1 ( "%s [device %d] " , __PRETTY_FUNCTION__ , deviceIndexM );
267
267
268
268
if (isempty (itp .Address ())) {
269
269
error ("Unrecognized IPTV address: %s" , channelP -> Parameters ());
@@ -304,15 +304,15 @@ bool cIptvDevice::SetChannelDevice(const cChannel *channelP, bool liveViewP)
304
304
305
305
bool cIptvDevice ::SetPid (cPidHandle * handleP , int typeP , bool onP )
306
306
{
307
- debug ( "cIptvDevice::%s (%d): pid=%d type=%d on=%d " , __FUNCTION__ , deviceIndexM , handleP ? handleP -> pid : -1 , typeP , onP );
307
+ debug1 ( "%s (%d, %d, %d) [device %d] " , __PRETTY_FUNCTION__ , handleP ? handleP -> pid : -1 , typeP , onP , deviceIndexM );
308
308
if (pIptvStreamerM && handleP )
309
309
return pIptvStreamerM -> SetPid (handleP -> pid , typeP , onP );
310
310
return true;
311
311
}
312
312
313
313
int cIptvDevice ::OpenFilter (u_short pidP , u_char tidP , u_char maskP )
314
314
{
315
- //debug("cIptvDevice::%s (%d): pid=%d tid=%d mask=%d ", __FUNCTION__, deviceIndexM, pidP, tidP, maskP);
315
+ debug16 ( "%s (%d, %d, %d) [device %d] " , __PRETTY_FUNCTION__ , pidP , tidP , maskP , deviceIndexM );
316
316
if (pIptvSectionM && IptvConfig .GetSectionFiltering ()) {
317
317
if (pIptvStreamerM )
318
318
pIptvStreamerM -> SetPid (pidP , ptOther , true);
@@ -323,7 +323,7 @@ int cIptvDevice::OpenFilter(u_short pidP, u_char tidP, u_char maskP)
323
323
324
324
void cIptvDevice ::CloseFilter (int handleP )
325
325
{
326
- //debug("cIptvDevice::%s (%d): handle=%d ", __FUNCTION__, deviceIndexM, handleP );
326
+ debug16 ( "%s (%d) [device %d] " , __PRETTY_FUNCTION__ , handleP , deviceIndexM );
327
327
if (pIptvSectionM ) {
328
328
if (pIptvStreamerM )
329
329
pIptvStreamerM -> SetPid (pIptvSectionM -> GetPid (handleP ), ptOther , false);
@@ -333,7 +333,7 @@ void cIptvDevice::CloseFilter(int handleP)
333
333
334
334
bool cIptvDevice ::OpenDvr (void )
335
335
{
336
- debug ( "cIptvDevice::%s(%d) " , __FUNCTION__ , deviceIndexM );
336
+ debug1 ( "%s [device %d] " , __PRETTY_FUNCTION__ , deviceIndexM );
337
337
isPacketDeliveredM = false;
338
338
tsBufferM -> Clear ();
339
339
if (pIptvStreamerM )
@@ -348,7 +348,7 @@ bool cIptvDevice::OpenDvr(void)
348
348
349
349
void cIptvDevice ::CloseDvr (void )
350
350
{
351
- debug ( "cIptvDevice::%s(%d) " , __FUNCTION__ , deviceIndexM );
351
+ debug1 ( "%s [device %d] " , __PRETTY_FUNCTION__ , deviceIndexM );
352
352
if (pidScanEnabledM && pPidScannerM )
353
353
pPidScannerM -> Close ();
354
354
if (sidScanEnabledM && pSidScannerM )
@@ -360,19 +360,19 @@ void cIptvDevice::CloseDvr(void)
360
360
361
361
bool cIptvDevice ::HasLock (int timeoutMsP ) const
362
362
{
363
- //debug("cIptvDevice::%s (%d): timeoutMs=%d ", __FUNCTION__, deviceIndexM, timeoutMsP );
363
+ debug16 ( "%s (%d) [device %d] " , __PRETTY_FUNCTION__ , timeoutMsP , deviceIndexM );
364
364
return (pIptvStreamerM && pIptvStreamerM -> Active ());
365
365
}
366
366
367
367
bool cIptvDevice ::HasInternalCam (void )
368
368
{
369
- //debug("cIptvDevice::%s(%d) ", __FUNCTION__ , deviceIndexM);
369
+ debug16 ( "%s [device %d] " , __PRETTY_FUNCTION__ , deviceIndexM );
370
370
return false;
371
371
}
372
372
373
373
void cIptvDevice ::WriteData (uchar * bufferP , int lengthP )
374
374
{
375
- //debug("cIptvDevice::%s( %d)", __FUNCTION__ , deviceIndexM);
375
+ debug16 ( "%s (, %d) [device %d] " , __PRETTY_FUNCTION__ , lengthP , deviceIndexM );
376
376
int len ;
377
377
// Send data to dvr fifo
378
378
if (dvrFdM >= 0 )
@@ -390,15 +390,15 @@ void cIptvDevice::WriteData(uchar *bufferP, int lengthP)
390
390
391
391
unsigned int cIptvDevice ::CheckData (void )
392
392
{
393
- //debug("cIptvDevice::%s(%d) ", __FUNCTION__ , deviceIndexM);
393
+ debug16 ( "%s [device %d] " , __PRETTY_FUNCTION__ , deviceIndexM );
394
394
if (tsBufferM )
395
395
return (unsigned int )tsBufferM -> Free ();
396
396
return 0 ;
397
397
}
398
398
399
399
uchar * cIptvDevice ::GetData (int * availableP )
400
400
{
401
- //debug("cIptvDevice::%s(%d) ", __FUNCTION__ , deviceIndexM);
401
+ debug16 ( "%s [device %d] " , __PRETTY_FUNCTION__ , deviceIndexM );
402
402
if (isOpenDvrM && tsBufferM ) {
403
403
int count = 0 ;
404
404
if (isPacketDeliveredM )
@@ -429,7 +429,7 @@ uchar *cIptvDevice::GetData(int *availableP)
429
429
430
430
void cIptvDevice ::SkipData (int countP )
431
431
{
432
- //debug("cIptvDevice::%s (%d)", __FUNCTION__ , deviceIndexM);
432
+ debug16 ( "%s (%d) [device %d]] " , __PRETTY_FUNCTION__ , countP , deviceIndexM );
433
433
tsBufferM -> Del (countP );
434
434
isPacketDeliveredM = false;
435
435
// Update buffer statistics
@@ -438,7 +438,7 @@ void cIptvDevice::SkipData(int countP)
438
438
439
439
bool cIptvDevice ::GetTSPacket (uchar * & dataP )
440
440
{
441
- //debug("cIptvDevice::%s(%d) ", __FUNCTION__ , deviceIndexM);
441
+ debug16 ( "%s [device %d] " , __PRETTY_FUNCTION__ , deviceIndexM );
442
442
if (tsBufferM ) {
443
443
if (cCamSlot * cs = CamSlot ()) {
444
444
if (cs -> WantsTsData ()) {
0 commit comments