- Timestamp:
- 05/18/06 09:17:03 (18 years ago)
- Files:
-
- branches/libfreebob-2.0/src/libstreaming/IsoHandler.cpp (modified) (4 diffs)
- branches/libfreebob-2.0/src/libstreaming/IsoHandler.h (modified) (5 diffs)
- branches/libfreebob-2.0/src/libstreaming/IsoHandlerManager.cpp (modified) (2 diffs)
- branches/libfreebob-2.0/src/libstreaming/IsoHandlerManager.h (modified) (2 diffs)
- branches/libfreebob-2.0/src/libstreaming/IsoStream.cpp (modified) (3 diffs)
- branches/libfreebob-2.0/src/libstreaming/IsoStream.h (modified) (5 diffs)
- branches/libfreebob-2.0/src/libstreaming/IsoStreamManager.cpp (modified) (2 diffs)
- branches/libfreebob-2.0/src/libstreaming/IsoStreamManager.h (modified) (2 diffs)
- branches/libfreebob-2.0/src/libstreaming/Makefile.am (modified) (2 diffs)
- branches/libfreebob-2.0/src/libstreaming/Receiver.cpp (added)
- branches/libfreebob-2.0/src/libstreaming/Receiver.h (added)
- branches/libfreebob-2.0/src/libstreaming/ringbuffer.c (added)
- branches/libfreebob-2.0/src/libstreaming/ringbuffer.h (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/libfreebob-2.0/src/libstreaming/IsoHandler.cpp
r199 r200 28 28 29 29 #include "IsoHandler.h" 30 #include "IsoStream.h" 30 31 #include <errno.h> 31 32 #include <netinet/in.h> … … 38 39 { 39 40 41 IMPL_DEBUG_MODULE( IsoHandler, IsoHandler, DEBUG_LEVEL_NORMAL ); 42 40 43 /* the C callbacks */ 41 extern "C" { 42 enum raw1394_iso_disposition 43 iso_transmit_handler(raw1394handle_t handle, 44 unsigned char *data, unsigned int *length, 45 unsigned char *tag, unsigned char *sy, 46 int cycle, unsigned int dropped) { 47 48 IsoXmitHandler *xmitHandler=static_cast<IsoXmitHandler *>(raw1394_get_userdata(handle)); 49 assert(xmitHandler); 50 51 return xmitHandler->GetPacket(data, length, tag, sy, cycle, dropped); 52 } 53 54 enum raw1394_iso_disposition 55 iso_slave_receive_handler(raw1394handle_t handle, unsigned char *data, 56 unsigned int length, unsigned char channel, 57 unsigned char tag, unsigned char sy, unsigned int cycle, 58 unsigned int dropped) { 59 60 IsoRecvHandler *recvHandler=static_cast<IsoRecvHandler *>(raw1394_get_userdata(handle)); 61 assert(recvHandler); 62 63 // return recvHandler->PutPacket(data, length, channel, tag, sy, cycle, dropped); 64 } 65 66 } 67 44 enum raw1394_iso_disposition 45 IsoXmitHandler::iso_transmit_handler(raw1394handle_t handle, 46 unsigned char *data, unsigned int *length, 47 unsigned char *tag, unsigned char *sy, 48 int cycle, unsigned int dropped) { 49 50 IsoXmitHandler *xmitHandler=static_cast<IsoXmitHandler *>(raw1394_get_userdata(handle)); 51 assert(xmitHandler); 52 53 return xmitHandler->getPacket(data, length, tag, sy, cycle, dropped); 54 } 55 56 enum raw1394_iso_disposition 57 IsoRecvHandler::iso_receive_handler(raw1394handle_t handle, unsigned char *data, 58 unsigned int length, unsigned char channel, 59 unsigned char tag, unsigned char sy, unsigned int cycle, 60 unsigned int dropped) { 61 62 IsoRecvHandler *recvHandler=static_cast<IsoRecvHandler *>(raw1394_get_userdata(handle)); 63 assert(recvHandler); 64 65 return recvHandler->putPacket(data, length, channel, tag, sy, cycle, dropped); 66 } 67 68 /* Base class implementation */ 68 69 bool 69 IsoHandler::Initialize( int port ) 70 { 71 m_handle = raw1394_new_handle_on_port( port ); 70 IsoHandler::initialize() 71 { 72 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 73 74 m_handle = raw1394_new_handle_on_port( m_port ); 72 75 if ( !m_handle ) { 73 76 if ( !errno ) { … … 82 85 raw1394_set_userdata(m_handle, static_cast<void *>(this)); 83 86 84 m_port = port;85 87 return true; 86 88 } 87 89 88 89 IsoRecvHandler::IsoRecvHandler() 90 : IsoHandler() 91 { 92 93 } 94 90 void IsoHandler::stop() 91 { 92 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 93 raw1394_iso_stop(m_handle); 94 }; 95 96 /* Child class implementations */ 97 98 IsoRecvHandler::IsoRecvHandler(int port) 99 : IsoHandler(port), m_Client(0) 100 { 101 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 102 } 103 IsoRecvHandler::IsoRecvHandler(int port, unsigned int buf_packets, 104 unsigned int max_packet_size, int irq) 105 : IsoHandler(port, buf_packets,max_packet_size,irq), m_Client(0) 106 { 107 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 108 109 } 95 110 IsoRecvHandler::~IsoRecvHandler() 96 111 { 97 98 } 99 100 enum raw1394_iso_disposition IsoRecvHandler::PutPacket(unsigned char *data, unsigned int length, 112 raw1394_iso_shutdown(m_handle); 113 114 } 115 116 bool 117 IsoRecvHandler::initialize() { 118 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 119 120 IsoHandler *base=static_cast<IsoHandler *>(this); 121 122 if(!(base->initialize())) { 123 return false; 124 } 125 126 raw1394_set_userdata(m_handle, static_cast<void *>(this)); 127 128 return true; 129 130 } 131 132 enum raw1394_iso_disposition IsoRecvHandler::putPacket(unsigned char *data, unsigned int length, 101 133 unsigned char channel, unsigned char tag, unsigned char sy, 102 134 unsigned int cycle, unsigned int dropped) { 103 135 136 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, 137 "received packet: length=%d, channel=%d, cycle=%d\n", 138 length, channel, cycle ); 139 104 140 return RAW1394_ISO_OK; 105 141 } 106 142 107 IsoXmitHandler::IsoXmitHandler() 108 : IsoHandler() 109 { 143 int IsoRecvHandler::registerStream(IsoRecvStream *stream) 144 { 145 assert(stream); 146 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 147 148 if (m_Client) return -1; 149 150 m_Client=stream; 151 152 raw1394_iso_shutdown(m_handle); 153 154 if(raw1394_iso_recv_init(m_handle, iso_receive_handler, 155 m_buf_packets, 156 m_max_packet_size, 157 m_Client->getChannel(), 158 RAW1394_DMA_BUFFERFILL, 159 m_irq_interval)) { 160 debugFatal("Could not do receive initialisation!\n" ); 161 162 return -1; 163 } 164 165 return 0; 166 167 } 168 169 int IsoRecvHandler::unregisterStream(IsoRecvStream *stream) 170 { 171 assert(stream); 172 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 173 174 if(stream != m_Client) return -1; //not registered 175 176 m_Client=0; 177 return 0; 178 179 } 180 181 int IsoRecvHandler::start(int cycle) 182 { 183 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 184 return raw1394_iso_recv_start(m_handle, cycle, -1, 0); 185 } 186 187 /* ----------------- XMIT --------------- */ 188 189 IsoXmitHandler::IsoXmitHandler(int port) 190 : IsoHandler(port), m_Client(0), m_prebuffers(0) 191 { 192 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 193 194 } 195 IsoXmitHandler::IsoXmitHandler(int port, unsigned int buf_packets, 196 unsigned int max_packet_size, int irq) 197 : IsoHandler(port, buf_packets, max_packet_size,irq), 198 m_Client(0), m_speed(RAW1394_ISO_SPEED_400), m_prebuffers(0) 199 { 200 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 201 202 } 203 IsoXmitHandler::IsoXmitHandler(int port, unsigned int buf_packets, 204 unsigned int max_packet_size, int irq, 205 enum raw1394_iso_speed speed) 206 : IsoHandler(port, buf_packets,max_packet_size,irq), 207 m_Client(0), m_speed(speed), m_prebuffers(0) 208 { 209 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 110 210 111 211 } … … 113 213 IsoXmitHandler::~IsoXmitHandler() 114 214 { 115 116 } 117 118 enum raw1394_iso_disposition IsoXmitHandler::GetPacket(unsigned char *data, unsigned int *length, 215 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 216 raw1394_iso_shutdown(m_handle); 217 218 } 219 220 bool 221 IsoXmitHandler::initialize() { 222 223 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 224 IsoHandler *base=static_cast<IsoHandler *>(this); 225 226 if(!(base->initialize())) { 227 return false; 228 } 229 230 raw1394_set_userdata(m_handle, static_cast<void *>(this)); 231 232 // this is a dummy init, to see if everything works 233 // the real init is done when a stream is registered 234 if(raw1394_iso_xmit_init(m_handle, 235 iso_transmit_handler, 236 m_buf_packets, 237 m_max_packet_size, 238 0, 239 m_speed, 240 m_irq_interval)) { 241 debugFatal("Could not do xmit initialisation!\n" ); 242 243 return false; 244 } 245 246 return true; 247 248 } 249 250 enum raw1394_iso_disposition IsoXmitHandler::getPacket(unsigned char *data, unsigned int *length, 119 251 unsigned char *tag, unsigned char *sy, 120 252 int cycle, unsigned int dropped) { 121 253 254 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, 255 "sending packet: length=%d, cycle=%d\n", 256 *length, cycle ); 257 if(m_Client) { 258 if(m_Client->getPacket(data, length, tag, sy, cycle, dropped)) { 259 // return RAW1394_ISO_AGAIN; 260 } 261 } 262 122 263 return RAW1394_ISO_OK; 123 264 } 124 265 125 126 } 266 // an xmit handler can have only one source IsoStream 267 int IsoXmitHandler::registerStream(IsoXmitStream *stream) 268 { 269 assert(stream); 270 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 271 272 if (m_Client) return -1; 273 274 m_Client=stream; 275 276 raw1394_iso_shutdown(m_handle); 277 278 if(raw1394_iso_xmit_init(m_handle, 279 iso_transmit_handler, 280 m_buf_packets, 281 m_max_packet_size, 282 m_Client->getChannel(), 283 m_speed, 284 m_irq_interval)) { 285 debugFatal("Could not do xmit initialisation!\n" ); 286 287 return -1; 288 } 289 290 return 0; 291 292 } 293 294 int IsoXmitHandler::unregisterStream(IsoXmitStream *stream) 295 { 296 assert(stream); 297 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 298 299 if(stream != m_Client) return -1; //not registered 300 301 m_Client=0; 302 return 0; 303 304 } 305 306 int IsoXmitHandler::start(int cycle) 307 { 308 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 309 return raw1394_iso_xmit_start(m_handle, cycle, m_prebuffers); 310 } 311 312 } 313 314 /* multichannel receive */ 315 #if 0 316 IsoRecvHandler::IsoRecvHandler(int port) 317 : IsoHandler(port) 318 { 319 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 320 } 321 IsoRecvHandler::IsoRecvHandler(int port, unsigned int buf_packets, 322 unsigned int max_packet_size, int irq) 323 : IsoHandler(port, buf_packets,max_packet_size,irq) 324 { 325 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 326 327 } 328 IsoRecvHandler::~IsoRecvHandler() 329 { 330 raw1394_iso_shutdown(m_handle); 331 332 } 333 334 bool 335 IsoRecvHandler::initialize() { 336 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 337 338 IsoHandler *base=static_cast<IsoHandler *>(this); 339 340 if(!(base->initialize())) { 341 return false; 342 } 343 344 raw1394_set_userdata(m_handle, static_cast<void *>(this)); 345 346 if(raw1394_iso_multichannel_recv_init(m_handle, 347 iso_receive_handler, 348 m_buf_packets, 349 m_max_packet_size, 350 m_irq_interval)) { 351 debugFatal("Could not do multichannel receive initialisation!\n" ); 352 353 return false; 354 } 355 356 return true; 357 358 } 359 360 enum raw1394_iso_disposition IsoRecvHandler::putPacket(unsigned char *data, unsigned int length, 361 unsigned char channel, unsigned char tag, unsigned char sy, 362 unsigned int cycle, unsigned int dropped) { 363 364 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, 365 "received packet: length=%d, channel=%d, cycle=%d\n", 366 length, channel, cycle ); 367 368 return RAW1394_ISO_OK; 369 } 370 371 // an recv handler can have multiple destination IsoStreams 372 // NOTE: this implementation even allows for already registered 373 // streams to be registered again. 374 int IsoRecvHandler::registerStream(IsoRecvStream *stream) 375 { 376 assert(stream); 377 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 378 379 m_Clients.push_back(stream); 380 381 listen(stream->getChannel()); 382 return 0; 383 384 } 385 386 int IsoRecvHandler::unregisterStream(IsoRecvStream *stream) 387 { 388 assert(stream); 389 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 390 391 for ( IsoRecvStreamVectorIterator it = m_Clients.begin(); 392 it != m_Clients.end(); 393 ++it ) 394 { 395 IsoRecvStream* s = *it; 396 if ( s == stream ) { 397 unListen(s->getChannel()); 398 m_Clients.erase(it); 399 return 0; 400 } 401 } 402 403 return -1; //not found 404 405 } 406 407 void IsoRecvHandler::listen(int channel) { 408 int retval; 409 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 410 411 retval=raw1394_iso_recv_listen_channel(m_handle, channel); 412 413 } 414 415 void IsoRecvHandler::unListen(int channel) { 416 int retval; 417 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 418 419 retval=raw1394_iso_recv_unlisten_channel(m_handle, channel); 420 421 } 422 423 int IsoRecvHandler::start(int cycle) 424 { 425 debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n"); 426 return raw1394_iso_recv_start(m_handle, cycle, -1, 0); 427 } 428 #endif branches/libfreebob-2.0/src/libstreaming/IsoHandler.h
r199 r200 26 26 * 27 27 */ 28 #ifndef __FREEBOB_ISOHANDLER__ 29 #define __FREEBOB_ISOHANDLER__ 28 #ifndef __FREEBOB_ISOHANDLER__ 29 #define __FREEBOB_ISOHANDLER__ 30 31 #include "../debugmodule/debugmodule.h" 30 32 31 33 #include <libraw1394/raw1394.h> … … 36 38 { 37 39 38 extern "C" { 39 enum raw1394_iso_disposition iso_transmit_handler(raw1394handle_t handle, 40 unsigned char *data, unsigned int *length, 41 unsigned char *tag, unsigned char *sy, 42 int cycle, unsigned int dropped); 43 } 40 class IsoStream; 41 class IsoXmitStream; 42 class IsoRecvStream; 43 44 typedef std::vector<IsoStream *> IsoStreamVector; 45 typedef std::vector<IsoStream *>::iterator IsoStreamVectorIterator; 46 typedef std::vector<IsoXmitStream *> IsoXmitStreamVector; 47 typedef std::vector<IsoXmitStream *>::iterator IsoXmitStreamVectorIterator; 48 typedef std::vector<IsoRecvStream *> IsoRecvStreamVector; 49 typedef std::vector<IsoRecvStream *>::iterator IsoRecvStreamVectorIterator; 50 44 51 /*! 45 52 \brief The Base Class for ISO Handlers … … 62 69 }; 63 70 64 IsoHandler() : m_handle(0) 71 IsoHandler(int port) 72 : m_handle(0), m_port(port), 73 m_buf_packets(400), m_max_packet_size(1024), m_irq_interval(-1) 65 74 {} 75 76 IsoHandler(int port, unsigned int buf_packets, unsigned int max_packet_size, int irq) 77 : m_handle(0), m_port(port), 78 m_buf_packets(buf_packets), m_max_packet_size( max_packet_size), m_irq_interval(irq) 79 {} 80 66 81 virtual ~IsoHandler() 67 82 {} 68 83 69 bool Initialize( int port ); 84 bool initialize(); 85 int iterate() { if(m_handle) return raw1394_loop_iterate(m_handle); }; 70 86 87 void setVerboseLevel(int l) { setDebugLevel( l ); }; 88 89 // no setter functions, because those would require a re-init 90 unsigned int getMaxPacketSize() { return m_max_packet_size;}; 91 unsigned int getBuffersize() { return m_buf_packets;}; 92 int getWakeupInterval() { return m_irq_interval;}; 71 93 72 94 virtual enum EHandlerType getType() = 0; 73 95 74 private: 96 virtual int start(int cycle) = 0; 97 void stop(); 98 int getFileDescriptor() { raw1394_get_fd(m_handle);}; 99 100 protected: 75 101 raw1394handle_t m_handle; 76 102 int m_port; 103 unsigned int m_buf_packets; 104 unsigned int m_max_packet_size; 105 int m_irq_interval; 106 107 DECLARE_DEBUG_MODULE; 108 109 private: 110 111 77 112 78 113 }; … … 86 121 87 122 public: 88 IsoRecvHandler(); 123 IsoRecvHandler(int port); 124 IsoRecvHandler(int port, unsigned int buf_packets, unsigned int max_packet_size, int irq); 89 125 virtual ~IsoRecvHandler(); 90 126 91 bool Initialize( int port ); 92 93 virtual enum EHandlerType getType() { return EHT_Receive;}; 94 127 bool initialize(); 128 129 enum EHandlerType getType() { return EHT_Receive;}; 130 131 int registerStream(IsoRecvStream *); 132 int unregisterStream(IsoRecvStream *); 133 134 int start(int cycle); 135 95 136 private: 137 IsoRecvStream *m_Client; 138 139 static enum raw1394_iso_disposition 140 iso_receive_handler(raw1394handle_t handle, unsigned char *data, 141 unsigned int length, unsigned char channel, 142 unsigned char tag, unsigned char sy, unsigned int cycle, 143 unsigned int dropped); 144 96 145 enum raw1394_iso_disposition 97 PutPacket(unsigned char *data, unsigned int length,146 putPacket(unsigned char *data, unsigned int length, 98 147 unsigned char channel, unsigned char tag, unsigned char sy, 99 148 unsigned int cycle, unsigned int dropped); … … 108 157 { 109 158 public: 110 friend enum raw1394_iso_disposition iso_transmit_handler(raw1394handle_t handle, 159 IsoXmitHandler(int port); 160 IsoXmitHandler(int port, unsigned int buf_packets, 161 unsigned int max_packet_size, int irq); 162 IsoXmitHandler(int port, unsigned int buf_packets, 163 unsigned int max_packet_size, int irq, 164 enum raw1394_iso_speed speed); 165 virtual ~IsoXmitHandler(); 166 167 bool initialize(); 168 169 enum EHandlerType getType() { return EHT_Transmit;}; 170 171 int registerStream(IsoXmitStream *); 172 int unregisterStream(IsoXmitStream *); 173 174 unsigned int getPreBuffers() {return m_prebuffers;}; 175 void setPreBuffers(unsigned int n) {m_prebuffers=n;}; 176 177 int start(int cycle); 178 179 private: 180 IsoXmitStream *m_Client; 181 182 static enum raw1394_iso_disposition iso_transmit_handler(raw1394handle_t handle, 111 183 unsigned char *data, unsigned int *length, 112 184 unsigned char *tag, unsigned char *sy, 113 185 int cycle, unsigned int dropped); 114 115 IsoXmitHandler();116 virtual ~IsoXmitHandler();117 118 bool Initialize( int port );119 120 virtual enum EHandlerType getType() { return EHT_Transmit;};121 122 private:123 186 enum raw1394_iso_disposition 124 GetPacket(unsigned char *data, unsigned int *length,187 getPacket(unsigned char *data, unsigned int *length, 125 188 unsigned char *tag, unsigned char *sy, 126 189 int cycle, unsigned int dropped); 127 190 191 enum raw1394_iso_speed m_speed; 192 193 unsigned int m_prebuffers; 128 194 129 195 }; branches/libfreebob-2.0/src/libstreaming/IsoHandlerManager.cpp
r199 r200 44 44 } 45 45 46 int IsoHandlerManager:: RegisterHandler(IsoHandler *handler)46 int IsoHandlerManager::registerHandler(IsoHandler *handler) 47 47 { 48 48 assert(handler); … … 68 68 } 69 69 70 int IsoHandlerManager:: UnregisterHandler(IsoHandler *handler)70 int IsoHandlerManager::unregisterHandler(IsoHandler *handler) 71 71 { 72 72 assert(handler); branches/libfreebob-2.0/src/libstreaming/IsoHandlerManager.h
r199 r200 28 28 #ifndef __FREEBOB_ISOHANDLERMANAGER__ 29 29 #define __FREEBOB_ISOHANDLERMANAGER__ 30 31 #include "../debugmodule/debugmodule.h" 30 32 31 33 #include <vector> … … 62 64 virtual ~IsoHandlerManager(); 63 65 64 int RegisterHandler(IsoHandler *);65 int UnregisterHandler(IsoHandler *);66 int registerHandler(IsoHandler *); 67 int unregisterHandler(IsoHandler *); 66 68 67 69 branches/libfreebob-2.0/src/libstreaming/IsoStream.cpp
r199 r200 32 32 { 33 33 34 IMPL_DEBUG_MODULE( IsoStream, IsoStream, DEBUG_LEVEL_NORMAL ); 35 34 36 IsoRecvStream::IsoRecvStream(int channel) 35 37 : IsoStream(channel) … … 43 45 } 44 46 45 int IsoRecvStream:: PutPacket(unsigned char *data, unsigned int length,47 int IsoRecvStream::putPacket(unsigned char *data, unsigned int length, 46 48 unsigned char channel, unsigned char tag, unsigned char sy, 47 49 unsigned int cycle, unsigned int dropped) { 50 51 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, 52 "received packet: length=%d, channel=%d, cycle=%d\n", 53 length, channel, cycle ); 54 55 m_packetcount++; 56 48 57 49 58 return 0; … … 61 70 } 62 71 63 int IsoXmitStream:: GetPacket(unsigned char *data, unsigned int *length,72 int IsoXmitStream::getPacket(unsigned char *data, unsigned int *length, 64 73 unsigned char *tag, unsigned char *sy, 65 74 int cycle, unsigned int dropped) { 75 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, 76 "sending packet: length=%d, cycle=%d\n", 77 *length, cycle ); 78 79 memcpy(data,&cycle,sizeof(cycle)); 80 *length=sizeof(cycle); 81 *tag = 1; 82 *sy = 0; 83 84 m_packetcount++; 66 85 67 86 return 0; branches/libfreebob-2.0/src/libstreaming/IsoStream.h
r199 r200 30 30 31 31 #include <libraw1394/raw1394.h> 32 #include "../debugmodule/debugmodule.h" 32 33 33 34 namespace FreebobStreaming … … 40 41 class IsoStream 41 42 { 42 protected:43 43 44 44 public: … … 50 50 51 51 52 IsoStream(int channel) : m_Channel(channel) 52 IsoStream(int channel) : m_Channel(channel), m_packetcount(0) 53 53 {}; 54 54 virtual ~IsoStream() 55 55 {}; 56 56 57 private: 57 void setVerboseLevel(int l) { setDebugLevel( l ); }; 58 59 int getChannel() {return m_Channel;}; 60 int getPacketCount() {return m_packetcount;}; 61 void resetPacketCount() {m_packetcount=0;}; 62 63 protected: 58 64 int m_Channel; 65 66 int m_packetcount; 67 68 DECLARE_DEBUG_MODULE; 59 69 60 70 }; … … 68 78 virtual enum EStreamType getType() { return EST_Receive;}; 69 79 70 private:71 80 int 72 PutPacket(unsigned char *data, unsigned int length,81 putPacket(unsigned char *data, unsigned int length, 73 82 unsigned char channel, unsigned char tag, unsigned char sy, 74 83 unsigned int cycle, unsigned int dropped); 84 85 private: 75 86 76 87 }; … … 84 95 85 96 virtual enum EStreamType getType() { return EST_Transmit;}; 97 int 98 getPacket(unsigned char *data, unsigned int *length, 99 unsigned char *tag, unsigned char *sy, 100 int cycle, unsigned int dropped); 86 101 87 102 private: 88 int89 GetPacket(unsigned char *data, unsigned int *length,90 unsigned char *tag, unsigned char *sy,91 int cycle, unsigned int dropped);92 103 93 104 }; branches/libfreebob-2.0/src/libstreaming/IsoStreamManager.cpp
r199 r200 45 45 } 46 46 47 int IsoStreamManager:: RegisterStream(IsoStream *stream)47 int IsoStreamManager::registerStream(IsoStream *stream) 48 48 { 49 49 assert(stream); … … 66 66 } 67 67 68 return -1; 68 69 } 69 70 70 int IsoStreamManager:: UnregisterStream(IsoStream *stream)71 int IsoStreamManager::unregisterStream(IsoStream *stream) 71 72 { 72 73 assert(stream); branches/libfreebob-2.0/src/libstreaming/IsoStreamManager.h
r199 r200 28 28 #ifndef __FREEBOB_ISOSTREAMMANAGER__ 29 29 #define __FREEBOB_ISOSTREAMMANAGER__ 30 #include "../debugmodule/debugmodule.h" 30 31 31 32 #include <vector> … … 52 53 virtual ~IsoStreamManager(); 53 54 54 int RegisterStream(IsoStream *);55 int UnregisterStream(IsoStream *);55 int registerStream(IsoStream *); 56 int unregisterStream(IsoStream *); 56 57 57 58 private: branches/libfreebob-2.0/src/libstreaming/Makefile.am
r199 r200 25 25 FreebobThread.h \ 26 26 FreebobAtomic.h \ 27 freebob_streaming.c \27 freebob_streaming.cpp \ 28 28 IsoHandler.cpp \ 29 29 IsoHandler.h \ … … 33 33 IsoStream.h \ 34 34 IsoStreamManager.cpp \ 35 IsoStreamManager.h 36 35 IsoStreamManager.h \ 36 ringbuffer.c ringbuffer.h \ 37 Receiver.cpp Receiver.h 37 38 38 39 INCLUDES = $(LIBRAW1394_CFLAGS) $(LIBIEC61883_CFLAGS) -I$(top_srcdir)/src \