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

Revision 742, 3.0 kB (checked in by ppalmers, 16 years ago)

- Remove some obsolete support files and dirs

- Clean up the license statements in the source files. Everything is

GPL version 3 now.

- Add license and copyright notices to scons scripts

- Clean up some other text files

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 #ifndef __FFADO_ISOSTREAM__
25 #define __FFADO_ISOSTREAM__
26
27 #include "../util/IsoHandler.h"
28
29 #include "debugmodule/debugmodule.h"
30
31 #include <libraw1394/raw1394.h>
32
33 namespace Streaming
34 {
35
36 class PacketBuffer;
37
38 /*!
39 \brief The Base Class for ISO streams
40 */
41
42 class IsoStream
43 {
44     friend class IsoHandler;
45     friend class IsoRecvHandler;
46     friend class IsoXmitHandler;
47
48     public:
49
50         enum eStreamType {
51                 eST_Receive,
52                 eST_Transmit
53         };
54
55         IsoStream(enum eStreamType type)
56             : m_channel(-1), m_port(0), m_handler(0), m_isostream_type(type)
57         {};
58         IsoStream(enum eStreamType type, int port)
59                     : m_channel(-1), m_port(port), m_handler(0), m_isostream_type(type)
60         {};
61         virtual ~IsoStream()
62         {};
63
64         virtual void setVerboseLevel(int l) { setDebugLevel( l ); };
65
66         int getChannel() {return m_channel;};
67         bool setChannel(int c);
68
69         int getPort() {return m_port;};
70
71         enum eStreamType getStreamType() { return m_isostream_type;};
72
73         virtual unsigned int getPacketsPerPeriod() {return 1;};
74         virtual unsigned int getMaxPacketSize() {return 1024;}; //FIXME: arbitrary
75         virtual unsigned int getNominalPacketsNeeded(unsigned int nframes) {return 1;}; //FIXME: arbitrary
76
77         virtual enum raw1394_iso_disposition
78                 putPacket(unsigned char *data, unsigned int length,
79                         unsigned char channel, unsigned char tag, unsigned char sy,
80                             unsigned int cycle, unsigned int dropped);
81         virtual enum raw1394_iso_disposition
82                 getPacket(unsigned char *data, unsigned int *length,
83                         unsigned char *tag, unsigned char *sy,
84                         int cycle, unsigned int dropped, unsigned int max_length);
85
86         void dumpInfo();
87
88     protected:
89         void setHandler( IsoHandler * h) ;
90         void clearHandler();
91
92         int m_channel;
93         int m_port;
94
95         IsoHandler *m_handler;
96
97     private: // should be set in the constructor
98         enum eStreamType m_isostream_type;
99
100         DECLARE_DEBUG_MODULE;
101
102 };
103
104 }
105
106 #endif /* __FFADO_ISOSTREAM__ */
107
108
109
Note: See TracBrowser for help on using the browser.