root/branches/libfreebob-2.0/src/libstreaming/IsoStream.h

Revision 199, 2.1 kB (checked in by pieterpalmers, 18 years ago)

- start of a new streaming API implementation, C++ based

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) 2005,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 #ifndef __FREEBOB_ISOSTREAM__
29 #define __FREEBOB_ISOSTREAM__
30
31 #include <libraw1394/raw1394.h>
32
33 namespace FreebobStreaming
34 {
35
36 /*!
37 \brief The Base Class for ISO streams
38 */
39
40 class IsoStream
41 {
42         protected:
43
44     public:
45
46                 enum EStreamType {
47                         EST_Receive,
48                         EST_Transmit
49                 };
50
51
52         IsoStream(int channel) : m_Channel(channel)
53         {};
54         virtual ~IsoStream()
55         {};
56
57         private:
58                 int m_Channel;
59
60 };
61
62 class IsoRecvStream : public IsoStream
63 {
64         public:
65         IsoRecvStream(int);
66         virtual ~IsoRecvStream();
67
68                 virtual enum EStreamType getType() { return EST_Receive;};
69
70         private:
71                 int
72                         PutPacket(unsigned char *data, unsigned int length,
73                               unsigned char channel, unsigned char tag, unsigned char sy,
74                                   unsigned int cycle, unsigned int dropped);
75
76 };
77
78 class IsoXmitStream : public IsoStream
79 {
80        
81         public:
82         IsoXmitStream(int);
83         virtual ~IsoXmitStream();
84
85                 virtual enum EStreamType getType() { return EST_Transmit;};
86
87         private:
88                 int
89                         GetPacket(unsigned char *data, unsigned int *length,
90                               unsigned char *tag, unsigned char *sy,
91                               int cycle, unsigned int dropped);
92
93 };
94
95 }
96
97 #endif /* __FREEBOB_ISOSTREAM__ */
98
99
100
Note: See TracBrowser for help on using the browser.