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

Revision 742, 2.6 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 #include "IsoStream.h"
25 #include <assert.h>
26
27 namespace Streaming
28 {
29
30 IMPL_DEBUG_MODULE( IsoStream, IsoStream, DEBUG_LEVEL_NORMAL );
31
32 enum raw1394_iso_disposition
33 IsoStream::putPacket(unsigned char *data, unsigned int length,
34                      unsigned char channel, unsigned char tag, unsigned char sy,
35                      unsigned int cycle, unsigned int dropped) {
36
37     debugOutput( DEBUG_LEVEL_VERY_VERBOSE,
38                  "received packet: length=%d, channel=%d, cycle=%d\n",
39                  length, channel, cycle );
40
41     return RAW1394_ISO_OK;
42 }
43
44 enum raw1394_iso_disposition
45 IsoStream::getPacket(unsigned char *data, unsigned int *length,
46                      unsigned char *tag, unsigned char *sy,
47                      int cycle, unsigned int dropped, unsigned int max_length) {
48     debugOutput( DEBUG_LEVEL_VERY_VERBOSE,
49                  "sending packet: length=%d, cycle=%d\n",
50                  *length, cycle );
51
52     memcpy(data,&cycle,sizeof(cycle));
53     *length=sizeof(cycle);
54     *tag = 1;
55     *sy = 0;
56
57     return RAW1394_ISO_OK;
58 }
59
60 bool IsoStream::setChannel(int c) {
61     debugOutput( DEBUG_LEVEL_VERBOSE, "setting channel for (%p) to %d\n",this, c);
62     m_channel=c;
63     return true;
64 }
65
66 void IsoStream::setHandler(IsoHandler *h) {
67     debugOutput( DEBUG_LEVEL_VERBOSE, "setting handler of isostream %p to %p\n", this,h);
68     m_handler=h;
69 }
70
71 void IsoStream::clearHandler() {
72     debugOutput( DEBUG_LEVEL_VERBOSE, "clearing handler of isostream %p\n", this);
73     m_handler=0;
74 }
75
76 void IsoStream::dumpInfo()
77 {
78     debugOutputShort( DEBUG_LEVEL_NORMAL, "  Address        : %p\n",this);
79     debugOutputShort( DEBUG_LEVEL_NORMAL, "  Stream type    : %s\n",
80             (this->getStreamType()==eST_Receive ? "Receive" : "Transmit"));
81     debugOutputShort( DEBUG_LEVEL_NORMAL, "  Port, Channel  : %d, %d\n",
82             m_port, m_channel);
83 }
84
85 }
Note: See TracBrowser for help on using the browser.