root/trunk/libffado/src/libstreaming/IsoStream.h

Revision 445, 2.9 kB (checked in by pieterpalmers, 15 years ago)

* name change from FreeBoB to FFADO
* replaced tabs by 4 spaces
* got rid of end-of-line spaces
* made all license and copyrights conform

library becomes LGPL, apps become GPL
explicitly state LGPL v2.1 and GPL v2 (don't like v3 draft)

copyrights are 2005-2007 Daniel & Pieter
except for the MotU stuff (C) Jonathan, Pieter

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 library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License version 2.1, as published by the Free Software Foundation;
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21  * MA 02110-1301 USA
22  */
23
24 #ifndef __FFADO_ISOSTREAM__
25 #define __FFADO_ISOSTREAM__
26
27 #include <libraw1394/raw1394.h>
28 #include "../debugmodule/debugmodule.h"
29 #include "IsoHandler.h"
30
31 namespace Streaming
32 {
33
34 class PacketBuffer;
35
36 /*!
37 \brief The Base Class for ISO streams
38 */
39
40 class IsoStream
41 {
42     friend class IsoHandler;
43     friend class IsoRecvHandler;
44     friend class IsoXmitHandler;
45
46     public:
47
48         enum EStreamType {
49                 EST_Receive,
50                 EST_Transmit
51         };
52
53         IsoStream(enum EStreamType type)
54                     : m_type(type), m_channel(-1), m_port(0), m_handler(0)
55         {};
56         IsoStream(enum EStreamType type, int port)
57                     : m_type(type), m_channel(-1), m_port(port), m_handler(0)
58         {};
59         virtual ~IsoStream()
60         {};
61
62         virtual void setVerboseLevel(int l) { setDebugLevel( l ); };
63
64         int getChannel() {return m_channel;};
65         bool setChannel(int c);
66
67         int getPort() {return m_port;};
68
69         enum EStreamType getType() { return m_type;};
70
71         virtual unsigned int getPacketsPerPeriod() {return 1;};
72         virtual unsigned int getMaxPacketSize() {return 1024;}; //FIXME: arbitrary
73
74         virtual bool init();
75
76         virtual enum raw1394_iso_disposition
77                 putPacket(unsigned char *data, unsigned int length,
78                         unsigned char channel, unsigned char tag, unsigned char sy,
79                             unsigned int cycle, unsigned int dropped);
80         virtual enum raw1394_iso_disposition
81                 getPacket(unsigned char *data, unsigned int *length,
82                         unsigned char *tag, unsigned char *sy,
83                         int cycle, unsigned int dropped, unsigned int max_length);
84
85         void dumpInfo();
86
87         int getNodeId();
88
89         virtual bool reset();
90         virtual bool prepare();
91
92     protected:
93
94         void setHandler( IsoHandler * h) ;
95         void clearHandler();
96
97         enum EStreamType m_type;
98         int m_channel;
99         int m_port;
100
101         IsoHandler *m_handler;
102
103         DECLARE_DEBUG_MODULE;
104
105 };
106
107 }
108
109 #endif /* __FFADO_ISOSTREAM__ */
110
111
112
Note: See TracBrowser for help on using the browser.