root/branches/streaming-rework/src/bounce/bounce_slave_avdevice.h

Revision 424, 2.6 kB (checked in by pieterpalmers, 16 years ago)

- The library can now be started in 'slave mode', creating a BounceSlaveDevice?.

On a discovering node, this slave device is discovered as a BounceDevice?.
Streaming does not work yet, something wrong with the timestamps.

- Implemented the 'snoop mode', that allows a client to 'snoop' the streams

between another host and a device. It is only implemented for BeBoB devices.
The channel numbers and stream configuration are automatically detected.
Note that it currently relies on a rather hackish support for reading the
{i,o}PCR plugs by using private functions of libiec61883

- changed jack backend to support these two new features

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) 2007 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_BOUNCESLAVEDEVICE__
29 #define __FREEBOB_BOUNCESLAVEDEVICE__
30
31 #include "debugmodule/debugmodule.h"
32 #include "bounce_avdevice.h"
33
34 namespace Bounce {
35
36 class BounceSlaveDevice : public BounceDevice {
37     class BounceSlaveNotifier;
38 public:
39
40     BounceSlaveDevice( std::auto_ptr<ConfigRom>( configRom ),
41           Ieee1394Service& ieee1394Service,
42           int verboseLevel );
43     virtual ~BounceSlaveDevice();
44    
45     static bool probe( ConfigRom& configRom );
46     bool discover();
47     bool prepare();
48     bool lock();
49     bool unlock();
50    
51     bool startStreamByIndex(int i);
52     bool stopStreamByIndex(int i);
53    
54
55 protected:
56     DECLARE_DEBUG_MODULE;
57 private:
58     bool waitForRegisterNotEqualTo(nodeaddr_t offset, fb_quadlet_t v);
59     bool initMemSpace();
60     bool restoreMemSpace();
61    
62 private: // configrom shit
63
64     struct configrom_backup {
65         quadlet_t rom[0x100];
66         size_t rom_size;
67         unsigned char rom_version;
68     };
69     struct configrom_backup m_original_config_rom;
70    
71     struct configrom_backup
72         save_config_rom(raw1394handle_t handle);
73     int restore_config_rom(raw1394handle_t handle, struct configrom_backup old);
74     int init_config_rom(raw1394handle_t handle);
75    
76 private:
77     BounceSlaveNotifier *m_Notifier;
78     /**
79      * this class reacts on the ohter side writing to the
80      * hosts address space
81      */
82     class BounceSlaveNotifier : public ARMHandler
83     {
84     public:
85         BounceSlaveNotifier(BounceSlaveDevice *, nodeaddr_t start);
86         virtual ~BounceSlaveNotifier();
87        
88     private:
89         BounceSlaveDevice *m_bounceslavedevice;
90     };
91 };
92
93 } // end of namespace Bounce
94
95 #endif /* __FREEBOB_BOUNCESLAVEDEVICE__ */
96
97
Note: See TracBrowser for help on using the browser.