root/branches/streaming-rework/src/libstreaming/IsoHandler.cpp

Revision 398, 20.4 kB (checked in by pieterpalmers, 17 years ago)

remove cycle timer prediction & DLL code from the IsoHandler?, as it is replaced by a raw1394 API call

Line 
1 /* $Id$ */
2
3 /*
4  *   FreeBob Streaming API
5  *   FreeBob = Firewire (pro-)audio for linux
6  *
7  *   http://freebob.sf.net
8  *
9  *   Copyright (C) 2006 Pieter Palmers <pieterpalmers@users.sourceforge.net>
10  *
11  *   This program is free software {} you can redistribute it and/or modify
12  *   it under the terms of the GNU General Public License as published by
13  *   the Free Software Foundation {} either version 2 of the License, or
14  *   (at your option) any later version.
15  *
16  *   This program is distributed in the hope that it will be useful,
17  *   but WITHOUT ANY WARRANTY {} without even the implied warranty of
18  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  *   GNU General Public License for more details.
20  *
21  *   You should have received a copy of the GNU General Public License
22  *   along with this program {} if not, write to the Free Software
23  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  *
25  *
26  *
27  */
28
29 #include "IsoHandler.h"
30 #include "IsoStream.h"
31 #include "cycletimer.h"
32
33 #include "libutil/TimeSource.h"
34 #include "libutil/SystemTimeSource.h"
35
36 #include <errno.h>
37 #include <netinet/in.h>
38 #include <assert.h>
39 #include <unistd.h>
40 #include <string.h>
41
42 #include <iostream>
43 using namespace std;
44
45 #define CC_SLEEP_TIME_AFTER_UPDATE    1000
46 #define CC_SLEEP_TIME_AFTER_FAILURE     10
47 #define CC_DLL_COEFF     ((0.001)*((float)(CC_SLEEP_TIME_AFTER_UPDATE/1000.0)))
48
49 #define CC_MAX_RATE_ERROR           (2.0/100.0)
50 #define CC_INIT_MAX_TRIES 10
51
52
53 namespace FreebobStreaming
54 {
55
56 IMPL_DEBUG_MODULE( IsoHandler, IsoHandler, DEBUG_LEVEL_NORMAL );
57
58 /* the C callbacks */
59 enum raw1394_iso_disposition
60 IsoXmitHandler::iso_transmit_handler(raw1394handle_t handle,
61                 unsigned char *data, unsigned int *length,
62                 unsigned char *tag, unsigned char *sy,
63                 int cycle, unsigned int dropped) {
64
65         IsoXmitHandler *xmitHandler=static_cast<IsoXmitHandler *>(raw1394_get_userdata(handle));
66         assert(xmitHandler);
67
68         return xmitHandler->getPacket(data, length, tag, sy, cycle, dropped);
69 }
70
71 enum raw1394_iso_disposition
72 IsoRecvHandler::iso_receive_handler(raw1394handle_t handle, unsigned char *data,
73                                                 unsigned int length, unsigned char channel,
74                                                 unsigned char tag, unsigned char sy, unsigned int cycle,
75                                                 unsigned int dropped) {
76
77         IsoRecvHandler *recvHandler=static_cast<IsoRecvHandler *>(raw1394_get_userdata(handle));
78         assert(recvHandler);
79
80         return recvHandler->putPacket(data, length, channel, tag, sy, cycle, dropped);
81 }
82
83 int IsoHandler::busreset_handler(raw1394handle_t handle, unsigned int generation)
84 {       
85         debugOutput( DEBUG_LEVEL_VERBOSE, "Busreset happened, generation %d...\n", generation);
86
87         IsoHandler *handler=static_cast<IsoHandler *>(raw1394_get_userdata(handle));
88         assert(handler);
89         return handler->handleBusReset(generation);
90 }
91
92
93 /* Base class implementation */
94 IsoHandler::IsoHandler(int port)
95    :  m_handle(0), m_handle_util(0), m_port(port),
96    m_buf_packets(400), m_max_packet_size(1024), m_irq_interval(-1),
97    m_packetcount(0), m_dropped(0), m_Client(0),
98    m_State(E_Created)
99 {
100 }
101
102 IsoHandler::IsoHandler(int port, unsigned int buf_packets, unsigned int max_packet_size, int irq)
103    : m_handle(0), m_port(port),
104    m_buf_packets(buf_packets), m_max_packet_size( max_packet_size),
105    m_irq_interval(irq),
106    m_packetcount(0), m_dropped(0), m_Client(0),
107    m_State(E_Created)
108 {
109 }
110
111 IsoHandler::~IsoHandler() {
112
113 // Don't call until libraw1394's raw1394_new_handle() function has been
114 // fixed to correctly initialise the iso_packet_infos field.  Bug is
115 // confirmed present in libraw1394 1.2.1.  In any case,
116 // raw1394_destroy_handle() will do any iso system shutdown required.
117 //     raw1394_iso_shutdown(m_handle);
118
119     if(m_handle) {
120         if (m_State == E_Running) {
121             stop();
122         }
123        
124         raw1394_destroy_handle(m_handle);
125     }
126    
127     if(m_handle_util) raw1394_destroy_handle(m_handle_util);
128
129 }
130
131 bool IsoHandler::iterate() {
132     debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "IsoHandler (%p) iterate...\n",this);
133
134     if(m_handle) {
135         if(raw1394_loop_iterate(m_handle)) {
136             debugOutput( DEBUG_LEVEL_VERBOSE,
137                  "IsoHandler (%p): Failed to iterate handler: %s\n",
138                  this,strerror(errno));
139             return false;
140         } else {
141             return true;
142         }
143     } else {
144         return false;
145     }
146 }
147
148 bool
149 IsoHandler::init()
150 {
151     debugOutput( DEBUG_LEVEL_VERBOSE, "IsoHandler (%p) enter...\n",this);
152
153     // check the state
154     if(m_State != E_Created) {
155         debugError("Incorrect state, expected E_Created, got %d\n",(int)m_State);
156         return false;
157     }
158    
159     // the main handle for the ISO traffic
160     m_handle = raw1394_new_handle_on_port( m_port );
161     if ( !m_handle ) {
162         if ( !errno ) {
163             debugError("libraw1394 not compatible\n");
164         } else {
165             debugError("Could not get 1394 handle: %s\n", strerror(errno) );
166             debugError("Are ieee1394 and raw1394 drivers loaded?\n");
167         }
168         return false;
169     }
170     raw1394_set_userdata(m_handle, static_cast<void *>(this));
171    
172     // a second handle for utility stuff
173     m_handle_util = raw1394_new_handle_on_port( m_port );
174     if ( !m_handle_util ) {
175         if ( !errno ) {
176             debugError("libraw1394 not compatible\n");
177         } else {
178             debugError("Could not get 1394 handle: %s\n", strerror(errno) );
179             debugError("Are ieee1394 and raw1394 drivers loaded?\n");
180         }
181        
182         raw1394_destroy_handle(m_handle);
183         return false;
184     }
185     raw1394_set_userdata(m_handle_util, static_cast<void *>(this));
186        
187     // bus reset handling
188     if(raw1394_busreset_notify (m_handle, RAW1394_NOTIFY_ON)) {
189         debugWarning("Could not enable busreset notification.\n");
190         debugWarning(" Error message: %s\n",strerror(errno));
191         debugWarning("Continuing without bus reset support.\n");
192     } else {
193         // apparently this cannot fail
194         raw1394_set_bus_reset_handler(m_handle, busreset_handler);
195     }
196
197     // test the cycle timer read function
198     int err;
199     uint32_t cycle_timer;
200     uint64_t local_time;
201     err=raw1394_read_cycle_timer(m_handle_util, &cycle_timer, &local_time);
202     if(err) {
203         debugError("raw1394_read_cycle_timer failed.\n");
204         debugError(" Error: %s\n", strerror(err));
205         debugError(" Your system doesn't seem to support the raw1394_read_cycle_timer call\n");
206         return false;
207     }
208
209     // update the internal state
210     m_State=E_Initialized;
211    
212     return true;
213 }
214
215 bool IsoHandler::prepare()
216 {
217     debugOutput( DEBUG_LEVEL_VERBOSE, "IsoHandler (%p) enter...\n",this);
218
219     // check the state
220     if(m_State != E_Initialized) {
221         debugError("Incorrect state, expected E_Initialized, got %d\n",(int)m_State);
222         return false;
223     }
224    
225     // Don't call until libraw1394's raw1394_new_handle() function has been
226     // fixed to correctly initialise the iso_packet_infos field.  Bug is
227     // confirmed present in libraw1394 1.2.1.
228
229 //     raw1394_iso_shutdown(m_handle);
230    
231     m_State = E_Prepared;
232    
233     return true;
234 }
235
236 bool IsoHandler::start(int cycle)
237 {
238     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
239    
240     // check the state
241     if(m_State != E_Prepared) {
242         debugError("Incorrect state, expected E_Prepared, got %d\n",(int)m_State);
243         return false;
244     }
245
246     m_State=E_Running;
247
248     return true;
249 }
250
251 bool IsoHandler::stop()
252 {
253     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
254    
255     // check state
256     if(m_State != E_Running) {
257         debugError("Incorrect state, expected E_Running, got %d\n",(int)m_State);
258         return false;
259     }
260    
261     // this is put here to try and avoid the
262     // Runaway context problem
263     // don't know if it will help though.
264     raw1394_iso_xmit_sync(m_handle);
265    
266     raw1394_iso_stop(m_handle);
267    
268     m_State=E_Prepared;
269    
270     return true;
271 }
272
273 /**
274  * Bus reset handler
275  *
276  * @return ?
277  */
278  
279 int IsoHandler::handleBusReset(unsigned int generation) {
280     debugOutput( DEBUG_LEVEL_VERBOSE, "bus reset...\n");
281    
282    
283     return 0;
284 }
285
286 /**
287  * Returns the current value of the cycle timer (in ticks)
288  *
289  * @return the current value of the cycle timer (in ticks)
290  */
291
292 unsigned int IsoHandler::getCycleTimerTicks() {
293     // the new api should be realtime safe.
294     // it might cause a reschedule when turning preemption,
295     // back on but that won't hurt us if we have sufficient
296     // priority
297     int err;
298     uint32_t cycle_timer;
299     uint64_t local_time;
300     err=raw1394_read_cycle_timer(m_handle_util, &cycle_timer, &local_time);
301     if(err) {
302         debugWarning("raw1394_read_cycle_timer: %s\n", strerror(err));
303     }
304     return CYCLE_TIMER_TO_TICKS(cycle_timer);
305 }
306
307 /**
308  * Returns the current value of the cycle timer (as is)
309  *
310  * @return the current value of the cycle timer (as is)
311  */
312
313 unsigned int IsoHandler::getCycleTimer() {
314     // the new api should be realtime safe.
315     // it might cause a reschedule when turning preemption,
316     // back on but that won't hurt us if we have sufficient
317     // priority
318     int err;
319     uint32_t cycle_timer;
320     uint64_t local_time;
321     err=raw1394_read_cycle_timer(m_handle_util, &cycle_timer, &local_time);
322     if(err) {
323         debugWarning("raw1394_read_cycle_timer: %s\n", strerror(err));
324     }
325     return cycle_timer;
326 }
327
328 void IsoHandler::dumpInfo()
329 {
330
331     int channel=-1;
332     if (m_Client) channel=m_Client->getChannel();
333
334     debugOutputShort( DEBUG_LEVEL_NORMAL, "  Handler type    : %s\n",
335             (this->getType()==EHT_Receive ? "Receive" : "Transmit"));
336     debugOutputShort( DEBUG_LEVEL_NORMAL, "  Port, Channel   : %2d, %2d\n",
337             m_port, channel);
338     debugOutputShort( DEBUG_LEVEL_NORMAL, "  Packet count    : %10d (%5d dropped)\n",
339             this->getPacketCount(), this->getDroppedCount());
340 }
341
342 void IsoHandler::setVerboseLevel(int l)
343 {
344     setDebugLevel(l);
345 }
346
347 bool IsoHandler::registerStream(IsoStream *stream)
348 {
349     assert(stream);
350     debugOutput( DEBUG_LEVEL_VERBOSE, "registering stream (%p)\n", stream);
351
352     if (m_Client) {
353             debugFatal( "Generic IsoHandlers can have only one client\n");     
354             return false;
355     }
356
357     m_Client=stream;
358
359     m_Client->setHandler(this);
360
361     return true;
362
363 }
364
365 bool IsoHandler::unregisterStream(IsoStream *stream)
366 {
367     assert(stream);
368     debugOutput( DEBUG_LEVEL_VERBOSE, "unregistering stream (%p)\n", stream);
369
370     if(stream != m_Client) {
371             debugFatal( "no client registered\n");     
372             return false;
373     }
374
375     m_Client->clearHandler();
376    
377     m_Client=0;
378     return true;
379
380 }
381
382 /* Child class implementations */
383
384 IsoRecvHandler::IsoRecvHandler(int port)
385                 : IsoHandler(port)
386 {
387     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
388 }
389 IsoRecvHandler::IsoRecvHandler(int port, unsigned int buf_packets,
390                                unsigned int max_packet_size, int irq)
391                 : IsoHandler(port, buf_packets,max_packet_size,irq)
392 {
393     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
394
395 }
396 IsoRecvHandler::~IsoRecvHandler()
397 {
398
399 }
400
401 bool
402 IsoRecvHandler::init() {
403     debugOutput( DEBUG_LEVEL_VERBOSE, "init recv handler %p\n",this);
404
405     if(!(IsoHandler::init())) {
406         return false;
407     }
408     return true;
409
410 }
411
412 enum raw1394_iso_disposition IsoRecvHandler::putPacket(
413                     unsigned char *data, unsigned int length,
414                     unsigned char channel, unsigned char tag, unsigned char sy,
415                     unsigned int cycle, unsigned int dropped) {
416
417     debugOutput( DEBUG_LEVEL_VERY_VERBOSE,
418                  "received packet: length=%d, channel=%d, cycle=%d\n",
419                  length, channel, cycle );
420     m_packetcount++;
421     m_dropped+=dropped;
422
423     if(m_Client) {
424         return m_Client->putPacket(data, length, channel, tag, sy, cycle, dropped);
425     }
426    
427     return RAW1394_ISO_OK;
428 }
429
430 bool IsoRecvHandler::prepare()
431 {
432    
433     // prepare the generic IsoHandler
434     if(!IsoHandler::prepare()) {
435         return false;
436     }
437
438     debugOutput( DEBUG_LEVEL_VERBOSE, "Preparing iso receive handler (%p)\n",this);
439     debugOutput( DEBUG_LEVEL_VERBOSE, " Buffers         : %d \n",m_buf_packets);
440     debugOutput( DEBUG_LEVEL_VERBOSE, " Max Packet size : %d \n",m_max_packet_size);
441     debugOutput( DEBUG_LEVEL_VERBOSE, " Channel         : %d \n",m_Client->getChannel());
442     debugOutput( DEBUG_LEVEL_VERBOSE, " Irq interval    : %d \n",m_irq_interval);
443
444     if(m_irq_interval > 1) {
445         if(raw1394_iso_recv_init(m_handle,   
446                                 iso_receive_handler,
447                                 m_buf_packets,
448                                 m_max_packet_size,
449                                 m_Client->getChannel(),
450                                 RAW1394_DMA_BUFFERFILL,
451                                 m_irq_interval)) {
452             debugFatal("Could not do receive initialisation!\n" );
453             debugFatal("  %s\n",strerror(errno));
454    
455             return false;
456         }
457     } else {
458         if(raw1394_iso_recv_init(m_handle,   
459                                 iso_receive_handler,
460                                 m_buf_packets,
461                                 m_max_packet_size,
462                                 m_Client->getChannel(),
463                                 RAW1394_DMA_PACKET_PER_BUFFER,
464                                 m_irq_interval)) {
465             debugFatal("Could not do receive initialisation!\n" );
466             debugFatal("  %s\n",strerror(errno));
467    
468             return false;
469         }   
470     }
471     return true;
472 }
473
474 bool IsoRecvHandler::start(int cycle)
475 {
476     debugOutput( DEBUG_LEVEL_VERBOSE, "start on cycle %d\n", cycle);
477    
478     // start the generic IsoHandler
479     if(!IsoHandler::start(cycle)) {
480         return false;
481     }
482    
483     if(raw1394_iso_recv_start(m_handle, cycle, -1, 0)) {
484         debugFatal("Could not start receive handler (%s)\n",strerror(errno));
485         return false;
486     }
487     return true;
488 }
489
490 int IsoRecvHandler::handleBusReset(unsigned int generation) {
491     debugOutput( DEBUG_LEVEL_VERBOSE, "handle bus reset...\n");
492    
493     //TODO: implement busreset
494    
495     // pass on the busreset signal
496     if(IsoHandler::handleBusReset(generation)) {
497         return -1;
498     }
499     return 0;
500 }
501
502 /* ----------------- XMIT --------------- */
503
504 IsoXmitHandler::IsoXmitHandler(int port)
505                 : IsoHandler(port), m_prebuffers(0)
506 {
507     debugOutput( DEBUG_LEVEL_VERBOSE, "IsoXmitHandler enter...\n");
508
509 }
510 IsoXmitHandler::IsoXmitHandler(int port, unsigned int buf_packets,
511                                unsigned int max_packet_size, int irq)
512                 : IsoHandler(port, buf_packets, max_packet_size,irq),
513                   m_speed(RAW1394_ISO_SPEED_400), m_prebuffers(0)
514 {
515     debugOutput( DEBUG_LEVEL_VERBOSE, "IsoXmitHandler enter...\n");
516
517 }
518 IsoXmitHandler::IsoXmitHandler(int port, unsigned int buf_packets,
519                                unsigned int max_packet_size, int irq,
520                                enum raw1394_iso_speed speed)
521                 : IsoHandler(port, buf_packets,max_packet_size,irq),
522                   m_speed(speed), m_prebuffers(0)
523 {
524     debugOutput( DEBUG_LEVEL_VERBOSE, "IsoXmitHandler enter...\n");
525
526 }
527
528 IsoXmitHandler::~IsoXmitHandler()
529 {
530     // handle cleanup is done in the IsoHanlder destructor
531 }
532
533 bool
534 IsoXmitHandler::init() {
535
536     debugOutput( DEBUG_LEVEL_VERBOSE, "init xmit handler %p\n",this);
537
538     if(!(IsoHandler::init())) {
539         return false;
540     }
541
542     return true;
543 }
544
545 bool IsoXmitHandler::prepare()
546 {
547     debugOutput( DEBUG_LEVEL_VERBOSE, "Preparing iso transmit handler (%p, client=%p)\n",this,m_Client);
548
549     if(!(IsoHandler::prepare())) {
550         return false;
551     }
552
553     debugOutput( DEBUG_LEVEL_VERBOSE, " Buffers         : %d \n",m_buf_packets);
554     debugOutput( DEBUG_LEVEL_VERBOSE, " Max Packet size : %d \n",m_max_packet_size);
555     debugOutput( DEBUG_LEVEL_VERBOSE, " Channel         : %d \n",m_Client->getChannel());
556     debugOutput( DEBUG_LEVEL_VERBOSE, " Speed           : %d \n",m_speed);
557     debugOutput( DEBUG_LEVEL_VERBOSE, " Irq interval    : %d \n",m_irq_interval);
558
559     if(raw1394_iso_xmit_init(m_handle,
560                              iso_transmit_handler,
561                              m_buf_packets,
562                              m_max_packet_size,
563                              m_Client->getChannel(),
564                              m_speed,
565                              m_irq_interval)) {
566         debugFatal("Could not do xmit initialisation!\n" );
567
568         return false;
569     }
570
571     return true;
572 }
573
574 bool IsoXmitHandler::start(int cycle)
575 {
576     debugOutput( DEBUG_LEVEL_VERBOSE, "start on cycle %d\n", cycle);
577    
578     if(!(IsoHandler::start(cycle))) {
579         return false;
580     }
581    
582     if(raw1394_iso_xmit_start(m_handle, cycle, m_prebuffers)) {
583         debugFatal("Could not start xmit handler (%s)\n",strerror(errno));
584         return false;
585     }
586     return true;
587 }
588
589 enum raw1394_iso_disposition IsoXmitHandler::getPacket(
590                     unsigned char *data, unsigned int *length,
591                     unsigned char *tag, unsigned char *sy,
592                     int cycle, unsigned int dropped) {
593
594     debugOutput( DEBUG_LEVEL_VERY_VERBOSE,
595                     "sending packet: length=%d, cycle=%d\n",
596                     *length, cycle );
597     m_packetcount++;
598     m_dropped+=dropped;
599
600     if(m_Client) {
601         return m_Client->getPacket(data, length, tag, sy, cycle, dropped, m_max_packet_size);
602     }
603
604     return RAW1394_ISO_OK;
605 }
606
607 int IsoXmitHandler::handleBusReset(unsigned int generation) {
608     debugOutput( DEBUG_LEVEL_VERBOSE, "bus reset...\n");
609     //TODO: implement busreset
610    
611     // pass on the busreset signal
612     if(IsoHandler::handleBusReset(generation)) {
613             return -1;
614     }
615    
616     return 0;
617 }
618
619 }
620
621 /* multichannel receive  */
622 #if 0
623 IsoRecvHandler::IsoRecvHandler(int port)
624                 : IsoHandler(port)
625 {
626         debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
627 }
628 IsoRecvHandler::IsoRecvHandler(int port, unsigned int buf_packets,
629                                unsigned int max_packet_size, int irq)
630                 : IsoHandler(port, buf_packets,max_packet_size,irq)
631 {
632         debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
633
634 }
635 IsoRecvHandler::~IsoRecvHandler()
636 {
637 // Don't call until libraw1394's raw1394_new_handle() function has been
638 // fixed to correctly initialise the iso_packet_infos field.  Bug is
639 // confirmed present in libraw1394 1.2.1.  In any case,
640 // raw1394_destroy_handle() (in the base class destructor) will do any iso
641 // system shutdown required.
642         raw1394_iso_shutdown(m_handle);
643
644 }
645
646 bool
647 IsoRecvHandler::initialize() {
648         debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
649
650         IsoHandler *base=static_cast<IsoHandler *>(this);
651
652         if(!(base->initialize())) {
653                 return false;
654         }
655
656         raw1394_set_userdata(m_handle, static_cast<void *>(this));
657
658         if(raw1394_iso_multichannel_recv_init(m_handle,
659                                          iso_receive_handler,
660                                          m_buf_packets,
661                                          m_max_packet_size,
662                                          m_irq_interval)) {
663                 debugFatal("Could not do multichannel receive initialisation!\n" );
664
665                 return false;
666         }
667
668         return true;
669
670 }
671
672 enum raw1394_iso_disposition IsoRecvHandler::putPacket(unsigned char *data, unsigned int length,
673                               unsigned char channel, unsigned char tag, unsigned char sy,
674                                   unsigned int cycle, unsigned int dropped) {
675
676         debugOutput( DEBUG_LEVEL_VERY_VERBOSE,
677                      "received packet: length=%d, channel=%d, cycle=%d\n",
678                      length, channel, cycle );
679        
680         return RAW1394_ISO_OK;
681 }
682
683 // an recv handler can have multiple destination IsoStreams
684 // NOTE: this implementation even allows for already registered
685 // streams to be registered again.
686 int IsoRecvHandler::registerStream(IsoRecvStream *stream)
687 {
688         assert(stream);
689         debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
690
691         m_Clients.push_back(stream);
692
693         listen(stream->getChannel());
694         return 0;
695
696 }
697
698 int IsoRecvHandler::unregisterStream(IsoRecvStream *stream)
699 {
700         assert(stream);
701         debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
702
703     for ( IsoRecvStreamVectorIterator it = m_Clients.begin();
704           it != m_Clients.end();
705           ++it )
706     {
707         IsoRecvStream* s = *it;
708         if ( s == stream ) {
709                         unListen(s->getChannel());
710             m_Clients.erase(it);
711                         return 0;
712         }
713     }
714
715         return -1; //not found
716
717 }
718
719 void IsoRecvHandler::listen(int channel) {
720         int retval;
721         debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
722
723         retval=raw1394_iso_recv_listen_channel(m_handle, channel);
724
725 }
726
727 void IsoRecvHandler::unListen(int channel) {
728         int retval;
729         debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
730
731         retval=raw1394_iso_recv_unlisten_channel(m_handle, channel);
732
733 }
734
735 int IsoRecvHandler::start(int cycle)
736 {
737         debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
738         return raw1394_iso_recv_start(m_handle, cycle, -1, 0);
739 }
740 #endif
Note: See TracBrowser for help on using the browser.