root/branches/ppalmers-streaming/src/libstreaming/generic/IsoStream.cpp

Revision 719, 2.7 kB (checked in by ppalmers, 13 years ago)

backup commit

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 #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.