root/trunk/libffado/src/libstreaming/util/IsoHandlerManager.cpp

Revision 747, 22.1 kB (checked in by ppalmers, 13 years ago)

- get rid of IsoStream? class since it's only overhead and doesn't really do anything specific. Most of it's functionality is going somewhere else anyway.

Line 
1 /*
2  * Copyright (C) 2005-2007 by Pieter Palmers
3  *
4  * This file is part of FFADO
5  * FFADO = Free Firewire (pro-)audio drivers for linux
6  *
7  * FFADO is based upon FreeBoB.
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21  *
22  */
23
24 #include "IsoHandlerManager.h"
25 #include "IsoHandler.h"
26 #include "../generic/StreamProcessor.h"
27
28 #include "libutil/PosixThread.h"
29
30 #include <assert.h>
31
32 #define MINIMUM_INTERRUPTS_PER_PERIOD  4U
33 #define PACKETS_PER_INTERRUPT          4U
34
35 namespace Streaming
36 {
37
38 IMPL_DEBUG_MODULE( IsoHandlerManager, IsoHandlerManager, DEBUG_LEVEL_NORMAL );
39
40 IsoHandlerManager::IsoHandlerManager() :
41    m_State(E_Created),
42    m_poll_timeout(100), m_poll_fds(0), m_poll_nfds(0),
43    m_realtime(false), m_priority(0), m_xmit_nb_frames( 20 )
44 {}
45
46 IsoHandlerManager::IsoHandlerManager(bool run_rt, unsigned int rt_prio) :
47    m_State(E_Created),
48    m_poll_timeout(100), m_poll_fds(0), m_poll_nfds(0),
49    m_realtime(run_rt), m_priority(rt_prio), m_xmit_nb_frames( 20 )
50 {}
51
52 bool IsoHandlerManager::init()
53 {
54     // the tread that performs the actual packet transfer
55     // needs high priority
56     unsigned int prio=m_priority+6;
57
58     if (prio>98) prio=98;
59
60     m_isoManagerThread=new Util::PosixThread(
61         this,
62         m_realtime, prio,
63         PTHREAD_CANCEL_DEFERRED);
64
65     if(!m_isoManagerThread) {
66         debugFatal("Could not create iso manager thread\n");
67         return false;
68     }
69
70     // propagate the debug level
71     m_isoManagerThread->setVerboseLevel(getDebugLevel());
72
73     return true;
74 }
75
76 bool IsoHandlerManager::Init()
77 {
78     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
79     pthread_mutex_init(&m_debug_lock, NULL);
80
81     return true;
82 }
83
84 /**
85  * the IsoHandlerManager thread execute function iterates the handlers.
86  *
87  * This means that once the thread is running, streams are
88  * transmitted and received (if present on the bus). Make sure
89  * that the clients are registered & ready before starting the
90  * thread!
91  *
92  * The register and unregister functions are thread unsafe, so
93  * should not be used when the thread is running.
94  *
95  * @return false if the handlers could not be iterated.
96  */
97 bool IsoHandlerManager::Execute()
98 {
99 //     updateCycleTimers();
100
101     pthread_mutex_lock(&m_debug_lock);
102
103     if(!iterate()) {
104         debugFatal("Could not iterate the isoManager\n");
105         pthread_mutex_unlock(&m_debug_lock);
106         return false;
107     }
108
109     pthread_mutex_unlock(&m_debug_lock);
110
111     return true;
112 }
113
114 /**
115  * Poll the handlers managed by this manager, and iterate them
116  * when ready
117  *
118  * @return true when successful
119  */
120 bool IsoHandlerManager::iterate()
121 {
122     int err;
123     int i=0;
124     debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "poll %d fd's, timeout = %dms...\n", m_poll_nfds, m_poll_timeout);
125
126     err = poll (m_poll_fds, m_poll_nfds, m_poll_timeout);
127
128     if (err == -1) {
129         if (errno == EINTR) {
130             return true;
131         }
132         debugFatal("poll error: %s\n", strerror (errno));
133         return false;
134     }
135
136 //     #ifdef DEBUG
137 //     for (i = 0; i < m_poll_nfds; i++) {
138 //         IsoHandler *s = m_IsoHandlers.at(i);
139 //         assert(s);
140 //         debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "(%d) handler %p: iterate? %d, revents: %08X\n",
141 //             i, s, (m_poll_fds[i].revents & (POLLIN) == 1), m_poll_fds[i].revents);
142 //     }
143 //     #endif
144
145     for (i = 0; i < m_poll_nfds; i++) {
146         if (m_poll_fds[i].revents & POLLERR) {
147             debugWarning("error on fd for %d\n",i);
148         }
149
150         if (m_poll_fds[i].revents & POLLHUP) {
151             debugWarning("hangup on fd for %d\n",i);
152         }
153
154         if(m_poll_fds[i].revents & (POLLIN)) {
155             IsoHandler *s = m_IsoHandlers.at(i);
156             assert(s);
157             s->iterate();
158         }
159     }
160
161     return true;
162
163 }
164
165 bool IsoHandlerManager::registerHandler(IsoHandler *handler)
166 {
167     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
168     assert(handler);
169
170     m_IsoHandlers.push_back(handler);
171
172     handler->setVerboseLevel(getDebugLevel());
173
174     // rebuild the fd map for poll()'ing.
175     return rebuildFdMap();
176
177 }
178
179 bool IsoHandlerManager::unregisterHandler(IsoHandler *handler)
180 {
181     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
182     assert(handler);
183
184     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
185       it != m_IsoHandlers.end();
186       ++it )
187     {
188         if ( *it == handler ) {
189             // erase the iso handler from the list
190             m_IsoHandlers.erase(it);
191             // rebuild the fd map for poll()'ing.
192             return rebuildFdMap();
193         }
194     }
195     debugFatal("Could not find handler (%p)\n", handler);
196
197     return false; //not found
198
199 }
200
201 bool IsoHandlerManager::rebuildFdMap() {
202     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
203     int i=0;
204
205     m_poll_nfds=0;
206     if(m_poll_fds) free(m_poll_fds);
207
208     // count the number of handlers
209     m_poll_nfds=m_IsoHandlers.size();
210
211     // allocate the fd array
212     m_poll_fds   = (struct pollfd *) calloc (m_poll_nfds, sizeof (struct pollfd));
213     if(!m_poll_fds) {
214         debugFatal("Could not allocate memory for poll FD array\n");
215         return false;
216     }
217
218     // fill the fd map
219     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
220       it != m_IsoHandlers.end();
221       ++it )
222     {
223         m_poll_fds[i].fd=(*it)->getFileDescriptor();
224         m_poll_fds[i].events = POLLIN;
225         i++;
226     }
227
228     return true;
229 }
230
231 void IsoHandlerManager::disablePolling(StreamProcessor *stream) {
232     int i=0;
233
234     debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "Disable polling on stream %p\n",stream);
235
236     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
237         it != m_IsoHandlers.end();
238         ++it )
239     {
240         if ((*it)->isStreamRegistered(stream)) {
241             m_poll_fds[i].events = 0;
242             m_poll_fds[i].revents = 0;
243             debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "polling disabled\n");
244         }
245
246         i++;
247     }
248 }
249
250 void IsoHandlerManager::enablePolling(StreamProcessor *stream) {
251     int i=0;
252
253     debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "Enable polling on stream %p\n",stream);
254
255     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
256         it != m_IsoHandlers.end();
257         ++it )
258     {
259         if ((*it)->isStreamRegistered(stream)) {
260             m_poll_fds[i].events = POLLIN;
261             m_poll_fds[i].revents = 0;
262             debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "polling enabled\n");
263         }
264
265         i++;
266     }
267 }
268
269
270 /**
271  * Registers an StreamProcessor with the IsoHandlerManager.
272  *
273  * If nescessary, an IsoHandler is created to handle this stream.
274  * Once an StreamProcessor is registered to the handler, it will be included
275  * in the ISO streaming cycle (i.e. receive/transmit of it will occur).
276  *
277  * @param stream the stream to register
278  * @return true if registration succeeds
279  *
280  * \todo : currently there is a one-to-one mapping
281  *        between streams and handlers, this is not ok for
282  *        multichannel receive
283  */
284 bool IsoHandlerManager::registerStream(StreamProcessor *stream)
285 {
286     debugOutput( DEBUG_LEVEL_VERBOSE, "Registering stream %p\n",stream);
287     assert(stream);
288
289     // make sure the stream isn't already attached to a handler
290     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
291       it != m_IsoHandlers.end();
292       ++it )
293     {
294         if((*it)->isStreamRegistered(stream)) {
295             debugWarning( "stream already registered!\n");
296             (*it)->unregisterStream(stream);
297
298         }
299     }
300
301     // clean up all handlers that aren't used
302     pruneHandlers();
303
304     // allocate a handler for this stream
305     if (stream->getType()==StreamProcessor::ePT_Receive) {
306         // setup the optimal parameters for the raw1394 ISO buffering
307         unsigned int packets_per_period = stream->getPacketsPerPeriod();
308
309 #if 1
310         // hardware interrupts occur when one DMA block is full, and the size of one DMA
311         // block = PAGE_SIZE. Setting the max_packet_size makes sure that the HW irq
312         // occurs at a period boundary (optimal CPU use)
313
314         // NOTE: try and use MINIMUM_INTERRUPTS_PER_PERIOD hardware interrupts
315         //       per period for better latency.
316         unsigned int max_packet_size=(MINIMUM_INTERRUPTS_PER_PERIOD * getpagesize()) / packets_per_period;
317
318         if (max_packet_size < stream->getMaxPacketSize()) {
319             debugWarning("calculated max packet size (%u) < stream max packet size (%u)\n",
320                          max_packet_size ,(unsigned int)stream->getMaxPacketSize());
321             max_packet_size = stream->getMaxPacketSize();
322         }
323
324         // Ensure we don't request a packet size bigger than the
325         // kernel-enforced maximum which is currently 1 page.
326         if (max_packet_size > (unsigned int)getpagesize()) {
327             debugWarning("max packet size (%u) > page size (%u)\n", max_packet_size ,(unsigned int)getpagesize());
328             max_packet_size = getpagesize();
329         }
330
331         unsigned int irq_interval = packets_per_period / MINIMUM_INTERRUPTS_PER_PERIOD;
332         if(irq_interval <= 0) irq_interval=1;
333         // FIXME: test
334         //irq_interval=1;
335
336 #else
337         // hardware interrupts occur when one DMA block is full, and the size of one DMA
338         // block = PAGE_SIZE. Setting the max_packet_size enables control over the IRQ
339         // frequency, as the controller uses max_packet_size, and not the effective size
340         // when writing to the DMA buffer.
341
342         // configure it such that we have an irq for every PACKETS_PER_INTERRUPT packets
343         unsigned int irq_interval=PACKETS_PER_INTERRUPT;
344
345         // unless the period size doesn't allow this
346         if ((packets_per_period/MINIMUM_INTERRUPTS_PER_PERIOD) < irq_interval) {
347             irq_interval=1;
348         }
349
350         // FIXME: test
351         irq_interval=1;
352 #warning Using fixed irq_interval
353
354         unsigned int max_packet_size=getpagesize() / irq_interval;
355
356         if (max_packet_size < stream->getMaxPacketSize()) {
357             max_packet_size=stream->getMaxPacketSize();
358         }
359
360         // Ensure we don't request a packet size bigger than the
361         // kernel-enforced maximum which is currently 1 page.
362         if (max_packet_size > (unsigned int)getpagesize())
363                     max_packet_size = getpagesize();
364
365 #endif
366         /* the receive buffer size doesn't matter for the latency,
367            but it has a minimal value in order for libraw to operate correctly (300) */
368         int buffers=400;
369
370         // create the actual handler
371         IsoRecvHandler *h = new IsoRecvHandler(stream->getPort(), buffers,
372                                                max_packet_size, irq_interval);
373
374         debugOutput( DEBUG_LEVEL_VERBOSE, " registering IsoRecvHandler\n");
375
376         if(!h) {
377             debugFatal("Could not create IsoRecvHandler\n");
378             return false;
379         }
380
381         h->setVerboseLevel(getDebugLevel());
382
383         // init the handler
384         if(!h->init()) {
385             debugFatal("Could not initialize receive handler\n");
386             return false;
387         }
388
389         // register the stream with the handler
390         if(!h->registerStream(stream)) {
391             debugFatal("Could not register receive stream with handler\n");
392             return false;
393         }
394
395         // register the handler with the manager
396         if(!registerHandler(h)) {
397             debugFatal("Could not register receive handler with manager\n");
398             return false;
399         }
400         debugOutput( DEBUG_LEVEL_VERBOSE, " registered stream (%p) with handler (%p)\n",stream,h);
401     }
402
403     if (stream->getType()==StreamProcessor::ePT_Transmit) {
404         // setup the optimal parameters for the raw1394 ISO buffering
405         unsigned int packets_per_period = stream->getPacketsPerPeriod();
406
407 #if 1
408         // hardware interrupts occur when one DMA block is full, and the size of one DMA
409         // block = PAGE_SIZE. Setting the max_packet_size makes sure that the HW irq
410         // occurs at a period boundary (optimal CPU use)
411         // NOTE: try and use MINIMUM_INTERRUPTS_PER_PERIOD interrupts per period
412         //       for better latency.
413         unsigned int max_packet_size=MINIMUM_INTERRUPTS_PER_PERIOD * getpagesize() / packets_per_period;
414         if (max_packet_size < stream->getMaxPacketSize()) {
415             max_packet_size = stream->getMaxPacketSize();
416         }
417
418         // Ensure we don't request a packet size bigger than the
419         // kernel-enforced maximum which is currently 1 page.
420         if (max_packet_size > (unsigned int)getpagesize())
421                     max_packet_size = getpagesize();
422
423          unsigned int irq_interval = packets_per_period / MINIMUM_INTERRUPTS_PER_PERIOD;
424          if(irq_interval <= 0) irq_interval=1;
425 #else
426         // hardware interrupts occur when one DMA block is full, and the size of one DMA
427         // block = PAGE_SIZE. Setting the max_packet_size enables control over the IRQ
428         // frequency, as the controller uses max_packet_size, and not the effective size
429         // when writing to the DMA buffer.
430
431         // configure it such that we have an irq for every PACKETS_PER_INTERRUPT packets
432         unsigned int irq_interval = PACKETS_PER_INTERRUPT;
433
434         // unless the period size doesn't allow this
435         if ((packets_per_period/MINIMUM_INTERRUPTS_PER_PERIOD) < irq_interval) {
436             irq_interval = 1;
437         }
438
439         // FIXME: test
440         irq_interval = 1;
441 #warning Using fixed irq_interval
442
443         unsigned int max_packet_size = getpagesize() / irq_interval;
444
445         if (max_packet_size < stream->getMaxPacketSize()) {
446             max_packet_size = stream->getMaxPacketSize();
447         }
448
449         // Ensure we don't request a packet size bigger than the
450         // kernel-enforced maximum which is currently 1 page.
451         if (max_packet_size > (unsigned int)getpagesize())
452                     max_packet_size = getpagesize();
453 #endif
454         // the transmit buffer size should be as low as possible for latency.
455         // note however that the raw1394 subsystem tries to keep this buffer
456         // full, so we have to make sure that we have enough events in our
457         // event buffers
458
459         // FIXME: latency spoiler
460         // every irq_interval packets an interrupt will occur. that is when
461         // buffers get transfered, meaning that we should have at least some
462         // margin here
463 //         int buffers=irq_interval * 2;
464
465         // the SPM specifies how many packets to buffer
466         int buffers = stream->getNominalPacketsNeeded(m_xmit_nb_frames);
467
468         // create the actual handler
469         IsoXmitHandler *h = new IsoXmitHandler(stream->getPort(), buffers,
470                                                max_packet_size, irq_interval);
471
472         debugOutput( DEBUG_LEVEL_VERBOSE, " registering IsoXmitHandler\n");
473
474         if(!h) {
475             debugFatal("Could not create IsoXmitHandler\n");
476             return false;
477         }
478
479         h->setVerboseLevel(getDebugLevel());
480
481         // init the handler
482         if(!h->init()) {
483             debugFatal("Could not initialize transmit handler\n");
484             return false;
485         }
486
487         // register the stream with the handler
488         if(!h->registerStream(stream)) {
489             debugFatal("Could not register transmit stream with handler\n");
490             return false;
491         }
492
493         // register the handler with the manager
494         if(!registerHandler(h)) {
495             debugFatal("Could not register transmit handler with manager\n");
496             return false;
497         }
498         debugOutput( DEBUG_LEVEL_VERBOSE, " registered stream (%p) with handler (%p)\n",stream,h);
499     }
500
501     m_StreamProcessors.push_back(stream);
502     debugOutput( DEBUG_LEVEL_VERBOSE, " %d streams, %d handlers registered\n",
503                                       m_StreamProcessors.size(), m_IsoHandlers.size());
504
505     return true;
506 }
507
508 bool IsoHandlerManager::unregisterStream(StreamProcessor *stream)
509 {
510     debugOutput( DEBUG_LEVEL_VERBOSE, "Unregistering stream %p\n",stream);
511     assert(stream);
512
513     // make sure the stream isn't attached to a handler anymore
514     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
515       it != m_IsoHandlers.end();
516       ++it )
517     {
518         if((*it)->isStreamRegistered(stream)) {
519             if(!(*it)->unregisterStream(stream)) {
520                 debugOutput( DEBUG_LEVEL_VERBOSE, " could not unregister stream (%p) from handler (%p)...\n",stream,*it);
521                 return false;
522             }
523
524             debugOutput( DEBUG_LEVEL_VERBOSE, " unregistered stream (%p) from handler (%p)...\n",stream,*it);
525         }
526     }
527
528     // clean up all handlers that aren't used
529     pruneHandlers();
530
531     // remove the stream from the registered streams list
532     for ( StreamProcessorVectorIterator it = m_StreamProcessors.begin();
533       it != m_StreamProcessors.end();
534       ++it )
535     {
536         if ( *it == stream ) {
537             m_StreamProcessors.erase(it);
538
539             debugOutput( DEBUG_LEVEL_VERBOSE, " deleted stream (%p) from list...\n", *it);
540             return true;
541         }
542     }
543
544     return false; //not found
545
546 }
547
548 void IsoHandlerManager::pruneHandlers() {
549     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
550     IsoHandlerVector toUnregister;
551
552     // find all handlers that are not in use
553     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
554           it != m_IsoHandlers.end();
555           ++it )
556     {
557         if(!((*it)->inUse())) {
558             debugOutput( DEBUG_LEVEL_VERBOSE, " handler (%p) not in use\n",*it);
559             toUnregister.push_back(*it);
560         }
561     }
562     // delete them
563     for ( IsoHandlerVectorIterator it = toUnregister.begin();
564           it != toUnregister.end();
565           ++it )
566     {
567         unregisterHandler(*it);
568         debugOutput( DEBUG_LEVEL_VERBOSE, " deleting handler (%p)\n",*it);
569
570         // Now the handler's been unregistered it won't be reused
571         // again.  Therefore it really needs to be formally deleted
572         // to free up the raw1394 handle.  Otherwise things fall
573         // apart after several xrun recoveries as the system runs
574         // out of resources to support all the disused but still
575         // allocated raw1394 handles.  At least this is the current
576         // theory as to why we end up with "memory allocation"
577         // failures after several Xrun recoveries.
578         delete *it;
579     }
580
581 }
582
583
584 bool IsoHandlerManager::prepare()
585 {
586     bool retval=true;
587
588     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
589
590     // check state
591     if(m_State != E_Created) {
592         debugError("Incorrect state, expected E_Created, got %d\n",(int)m_State);
593         return false;
594     }
595
596     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
597           it != m_IsoHandlers.end();
598           ++it )
599     {
600         if(!(*it)->prepare()) {
601             debugFatal("Could not prepare handlers\n");
602             retval=false;
603         }
604     }
605
606     if (retval) {
607         m_State=E_Prepared;
608     } else {
609         m_State=E_Error;
610     }
611
612     return retval;
613 }
614
615 bool IsoHandlerManager::startHandlers() {
616     return startHandlers(-1);
617 }
618
619 bool IsoHandlerManager::startHandlers(int cycle) {
620     bool retval=true;
621
622     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
623
624     // check state
625     if(m_State != E_Prepared) {
626         debugError("Incorrect state, expected E_Prepared, got %d\n",(int)m_State);
627         return false;
628     }
629
630     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
631         it != m_IsoHandlers.end();
632         ++it )
633     {
634         debugOutput( DEBUG_LEVEL_VERBOSE, " starting handler (%p)\n",*it);
635         if(!(*it)->start(cycle)) {
636             debugOutput( DEBUG_LEVEL_VERBOSE, " could not start handler (%p)\n",*it);
637             retval=false;
638         }
639     }
640
641     debugOutput( DEBUG_LEVEL_VERBOSE, "Starting ISO iterator thread...\n");
642
643     // note: libraw1394 doesn't like it if you poll() and/or iterate() before
644     //       starting the streams.
645     // start the iso runner thread
646     m_isoManagerThread->Start();
647
648     if (retval) {
649         m_State=E_Running;
650     } else {
651         m_State=E_Error;
652     }
653
654     return retval;
655 }
656
657 bool IsoHandlerManager::stopHandlers() {
658     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
659
660     // check state
661     if(m_State != E_Running) {
662         debugError("Incorrect state, expected E_Running, got %d\n",(int)m_State);
663         return false;
664     }
665
666     bool retval=true;
667
668     debugOutput( DEBUG_LEVEL_VERBOSE, "Stopping ISO iterator thread...\n");
669     m_isoManagerThread->Stop();
670
671     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
672         it != m_IsoHandlers.end();
673         ++it )
674     {
675         debugOutput( DEBUG_LEVEL_VERBOSE, "Stopping handler (%p)\n",*it);
676         if(!(*it)->stop()){
677             debugOutput( DEBUG_LEVEL_VERBOSE, " could not stop handler (%p)\n",*it);
678             retval=false;
679         }
680     }
681
682     if (retval) {
683         m_State=E_Prepared;
684     } else {
685         m_State=E_Error;
686     }
687
688     return retval;
689 }
690
691 bool IsoHandlerManager::reset() {
692     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
693
694     // check state
695     if(m_State == E_Error) {
696         debugFatal("Resetting from error condition not yet supported...\n");
697         return false;
698     }
699
700     // if not in an error condition, reset means stop the handlers
701     return stopHandlers();
702 }
703
704
705 void IsoHandlerManager::setVerboseLevel(int i) {
706     setDebugLevel(i);
707
708     // propagate the debug level
709     if(m_isoManagerThread) {
710         m_isoManagerThread->setVerboseLevel(getDebugLevel());
711     }
712
713     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
714           it != m_IsoHandlers.end();
715           ++it )
716     {
717         (*it)->setVerboseLevel(i);
718     }
719 }
720
721 void IsoHandlerManager::dumpInfo() {
722     int i=0;
723
724     debugOutputShort( DEBUG_LEVEL_NORMAL, "Dumping IsoHandlerManager Stream handler information...\n");
725     debugOutputShort( DEBUG_LEVEL_NORMAL, " State: %d\n",(int)m_State);
726
727     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
728           it != m_IsoHandlers.end();
729           ++it )
730     {
731         debugOutputShort( DEBUG_LEVEL_NORMAL, " IsoHandler %d (%p)\n",i++,*it);
732
733         (*it)->dumpInfo();
734     }
735
736 }
737
738 } // end of namespace Streaming
739
Note: See TracBrowser for help on using the browser.