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

Revision 412, 3.0 kB (checked in by pieterpalmers, 17 years ago)

- added some documentation
- added a lock()/unlock() to IAvDevice (see header)
- reimplemented test-freebob to the new C++ api
- started with support for AddressRangeMapping?, i.e. response

to reads/writes of the 1394 memory space on the host

Line 
1 /* bounce_avdevice.h
2  * Copyright (C) 2006 by Pieter Palmers
3  * Copyright (C) 2006 by Daniel Wagner
4  *
5  * This file is part of FreeBoB.
6  *
7  * FreeBoB is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  * FreeBoB is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with FreeBoB; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19  * MA 02111-1307 USA.
20  */
21 #ifndef BOUNCEDEVICE_H
22 #define BOUNCEDEVICE_H
23
24 #include "debugmodule/debugmodule.h"
25 #include "libfreebobavc/avc_definitions.h"
26 #include "libfreebobavc/avc_extended_cmd_generic.h"
27 #include "libfreebob/xmlparser.h"
28
29 #include "libstreaming/AmdtpStreamProcessor.h"
30 #include "libstreaming/AmdtpPort.h"
31 #include "libstreaming/AmdtpPortInfo.h"
32
33 #include "iavdevice.h"
34 #include "libfreebob/freebob_bounce.h"
35
36 class ConfigRom;
37 class Ieee1394Service;
38
39 namespace Bounce {
40
41 // struct to define the supported devices
42 struct VendorModelEntry {
43     unsigned int vendor_id;
44     unsigned int model_id;
45     unsigned int unit_specifier_id;
46     char *vendor_name;
47     char *model_name;
48 };
49
50 class BounceDevice : public IAvDevice {
51 public:
52     BounceDevice( std::auto_ptr<ConfigRom>( configRom ),
53                   Ieee1394Service& ieee1394Service,
54                   int nodeId,
55                   int verboseLevel );
56     virtual ~BounceDevice();
57
58     static bool probe( ConfigRom& configRom );
59     virtual bool discover();
60     virtual ConfigRom& getConfigRom() const;
61    
62     virtual bool addXmlDescription( xmlNodePtr deviceNode );
63    
64     virtual bool setSamplingFrequency( ESamplingFrequency samplingFrequency );
65         virtual int getSamplingFrequency( );
66    
67         virtual bool prepare();
68     bool lock();
69     bool unlock();
70        
71         virtual int getStreamCount();
72        
73         virtual FreebobStreaming::StreamProcessor *getStreamProcessorByIndex(int i);
74        
75         virtual int startStreamByIndex(int i);
76        
77         virtual int stopStreamByIndex(int i);
78    
79     virtual void showDevice() const;
80     virtual bool setId(unsigned int id);
81
82 protected:
83     std::auto_ptr<ConfigRom>( m_configRom );
84     Ieee1394Service* m_1394Service;
85     int              m_nodeId;
86     int              m_verboseLevel;
87
88 private:
89         std::string xmlDescription;
90
91     unsigned int m_samplerate;
92     struct VendorModelEntry* m_model;
93     unsigned int m_id;
94
95         // streaming stuff
96         FreebobStreaming::AmdtpReceiveStreamProcessor *m_receiveProcessor;
97         int m_receiveProcessorBandwidth;
98        
99         FreebobStreaming::AmdtpTransmitStreamProcessor *m_transmitProcessor;
100         int m_transmitProcessorBandwidth;
101
102     bool addPortsToProcessor(
103            FreebobStreaming::StreamProcessor *processor,
104            FreebobStreaming::AmdtpAudioPort::E_Direction direction);
105
106
107     DECLARE_DEBUG_MODULE;
108 };
109
110 }
111
112 #endif
Note: See TracBrowser for help on using the browser.