Changeset 138
- Timestamp:
- 01/02/06 08:10:34 (18 years ago)
- Files:
-
- trunk/libfreebob/configure.ac (modified) (1 diff)
- trunk/libfreebob/INSTALL (modified) (10 diffs)
- trunk/libfreebob/src/avdevice.cpp (modified) (7 diffs)
- trunk/libfreebob/src/avdevice.h (modified) (1 diff)
- trunk/libfreebob/src/avplug.cpp (modified) (2 diffs)
- trunk/libfreebob/src/avplug.h (modified) (1 diff)
- trunk/libfreebob/src/devicemanager.cpp (modified) (2 diffs)
- trunk/libfreebob/src/devicemanager.h (modified) (1 diff)
- trunk/libfreebob/src/libfreebobavc/avc_connect.cpp (modified) (1 diff)
- trunk/libfreebob/src/libfreebobavc/avc_extended_stream_format.cpp (modified) (2 diffs)
- trunk/libfreebob/src/libfreebobavc/avc_extended_stream_format.h (modified) (2 diffs)
- trunk/libfreebob/src/libfreebobavc/avc_plug_info.cpp (modified) (1 diff)
- trunk/libfreebob/src/libfreebobavc/avc_signal_source.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libfreebob/configure.ac
r133 r138 23 23 m4_define(freebob_major_version, 0) 24 24 m4_define(freebob_minor_version, 0) 25 m4_define(freebob_micro_version, 2)25 m4_define(freebob_micro_version, 3) 26 26 m4_define(freebob_version, freebob_major_version.freebob_minor_version.freebob_micro_version) 27 27 trunk/libfreebob/INSTALL
r125 r138 1 Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software 2 Foundation, Inc. 3 4 This file is free documentation; the Free Software Foundation gives 1 Installation Instructions 2 ************************* 3 4 Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free 5 Software Foundation, Inc. 6 7 This file is free documentation; the Free Software Foundation gives 5 8 unlimited permission to copy, distribute and modify it. 6 9 … … 8 11 ================== 9 12 10 13 These are generic installation instructions. 11 14 12 15 The `configure' shell script attempts to guess correct values for … … 68 71 ===================== 69 72 70 Some systems require unusual options for compilation or linking that 71 the `configure' script does not know about. Run `./configure --help' 72 fordetails on some of the pertinent environment variables.73 Some systems require unusual options for compilation or linking that the 74 `configure' script does not know about. Run `./configure --help' for 75 details on some of the pertinent environment variables. 73 76 74 77 You can give `configure' initial values for configuration parameters … … 83 86 ==================================== 84 87 85 88 You can compile the package for more than one kind of computer at the 86 89 same time, by placing the object files for each architecture in their 87 90 own directory. To do this, you must use a version of `make' that … … 100 103 ================== 101 104 102 105 By default, `make install' will install the package's files in 103 106 `/usr/local/bin', `/usr/local/man', etc. You can specify an 104 107 installation prefix other than `/usr/local' by giving `configure' the 105 option `--prefix=P ATH'.108 option `--prefix=PREFIX'. 106 109 107 110 You can specify separate installation prefixes for 108 111 architecture-specific files and architecture-independent files. If you 109 give `configure' the option `--exec-prefix=P ATH', the package will use110 PATHas the prefix for installing programs and libraries.112 give `configure' the option `--exec-prefix=PREFIX', the package will 113 use PREFIX as the prefix for installing programs and libraries. 111 114 Documentation and other data files will still use the regular prefix. 112 115 113 116 In addition, if you use an unusual directory layout you can give 114 options like `--bindir= PATH' to specify different values for particular117 options like `--bindir=DIR' to specify different values for particular 115 118 kinds of files. Run `configure --help' for a list of the directories 116 119 you can set and what kinds of files go in them. … … 123 126 ================= 124 127 125 128 Some packages pay attention to `--enable-FEATURE' options to 126 129 `configure', where FEATURE indicates an optional part of the package. 127 130 They may also pay attention to `--with-PACKAGE' options, where PACKAGE … … 138 141 ========================== 139 142 140 There may be some features `configure' cannot figure out 141 automatically, but needs to determine by the type of machine the package 142 will run on. Usually, assuming the package is built to be run on the 143 _same_ architectures, `configure' can figure that out, but if it prints 144 amessage saying it cannot guess the machine type, give it the143 There may be some features `configure' cannot figure out automatically, 144 but needs to determine by the type of machine the package will run on. 145 Usually, assuming the package is built to be run on the _same_ 146 architectures, `configure' can figure that out, but if it prints a 147 message saying it cannot guess the machine type, give it the 145 148 `--build=TYPE' option. TYPE can either be a short name for the system 146 149 type, such as `sun4', or a canonical name which has the form: … … 168 171 ================ 169 172 170 If you want to set default values for `configure' scripts to share, 171 you can create a site shell script called `config.site' that gives 172 defaultvalues for variables like `CC', `cache_file', and `prefix'.173 If you want to set default values for `configure' scripts to share, you 174 can create a site shell script called `config.site' that gives default 175 values for variables like `CC', `cache_file', and `prefix'. 173 176 `configure' looks for `PREFIX/share/config.site' if it exists, then 174 177 `PREFIX/etc/config.site' if it exists. Or, you can set the … … 179 182 ================== 180 183 181 184 Variables not defined in a site shell script can be set in the 182 185 environment passed to `configure'. However, some packages may run 183 186 configure again during the build, and the customized values of these … … 187 190 ./configure CC=/usr/local2/bin/gcc 188 191 189 will cause the specified gcc to be used as the C compiler (unless it is 190 overridden in the site shell script). 192 causes the specified `gcc' to be used as the C compiler (unless it is 193 overridden in the site shell script). Here is a another example: 194 195 /bin/bash ./configure CONFIG_SHELL=/bin/bash 196 197 Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent 198 configuration-related scripts to be executed by `/bin/bash'. 191 199 192 200 `configure' Invocation 193 201 ====================== 194 202 195 `configure' recognizes the following options to control how it 196 operates. 203 `configure' recognizes the following options to control how it operates. 197 204 198 205 `--help' trunk/libfreebob/src/avdevice.cpp
r135 r138 1062 1062 nrOfChannels = ( nrOfChannels / 8 ); 1063 1063 } 1064 1064 /* 1065 1065 // sanity checks 1066 1066 if ( nrOfChannels != … … 1072 1072 "reported %d\n", 1073 1073 isoInputPlug->getPlugId(), 1074 clusterInfo->m_nrOfChannels,1074 nrOfChannels, 1075 1075 clusterInfo->m_name.c_str(), 1076 1076 streamFormatInfo->m_numberOfChannels); 1077 1077 return false; 1078 1078 } 1079 */ 1079 1080 clusterInfo->m_streamFormat = streamFormatInfo->m_streamFormat; 1080 1081 … … 1172 1173 nrOfChannels = ( nrOfChannels / 8 ); 1173 1174 } 1174 1175 /* 1175 1176 // sanity checks 1176 1177 if ( nrOfChannels != … … 1182 1183 "reported %d\n", 1183 1184 isoOutputPlug->getPlugId(), 1184 clusterInfo->m_nrOfChannels,1185 nrOfChannels, 1185 1186 clusterInfo->m_name.c_str(), 1186 1187 streamFormatInfo->m_numberOfChannels); 1187 1188 return false; 1188 1189 } 1190 */ 1189 1191 clusterInfo->m_streamFormat = streamFormatInfo->m_streamFormat; 1190 1192 … … 1406 1408 { 1407 1409 return m_configRom->getVendorName(); 1410 } 1411 1412 uint64_t 1413 AvDevice::getGuid() 1414 { 1415 return m_configRom->getGuid(); 1408 1416 } 1409 1417 … … 1464 1472 asprintf( &result, "%d", m_nodeId); 1465 1473 if ( !xmlNewChild( connection, 0, 1466 BAD_CAST "Node Id", BAD_CAST result ) ) {1467 debugError( "Couldn't create 'Node Id' node\n" );1474 BAD_CAST "Node", BAD_CAST result ) ) { 1475 debugError( "Couldn't create 'Node' node\n" ); 1468 1476 return false; 1469 1477 } … … 1629 1637 return true; 1630 1638 } 1639 1640 bool 1641 AvDevice::setSampleFrequency(int sr) 1642 { 1643 1644 std::cout << "Trying to set frequency (" << sr << "): " << std::endl; 1645 1646 std::cout << "Not implemented yet" << std::endl; 1647 1648 return true; 1649 } 1650 trunk/libfreebob/src/avdevice.h
r125 r138 48 48 std::string getVendorName(); 49 49 std::string getModelName(); 50 50 51 uint64_t getGuid(); 52 51 53 bool addXmlDescription( xmlNodePtr deviceNode ); 52 54 int getNodeId() 53 55 { return m_nodeId; } 56 57 bool setSampleFrequency(int sr); 58 54 59 55 60 protected: trunk/libfreebob/src/avplug.cpp
r125 r138 138 138 139 139 int 140 AvPlug::getNrOf Channels()140 AvPlug::getNrOfStreams() 141 141 { 142 142 int nrOfChannels = 0; … … 152 152 153 153 int 154 AvPlug::getNrOfChannels() 155 { 156 return m_nrOfChannels; 157 } 158 159 int 154 160 AvPlug::getSampleRate() 155 161 { trunk/libfreebob/src/avplug.h
r125 r138 52 52 int getSampleRate(); // 22050, 24000, 32000, ... 53 53 int getNrOfChannels(); 54 int getNrOfStreams(); 54 55 55 56 plug_type_t m_plugType; trunk/libfreebob/src/devicemanager.cpp
r130 r138 117 117 } 118 118 119 bool DeviceManager::isValidNode(int node) { 120 for ( AvDeviceVectorIterator it = m_avDevices.begin(); 121 it != m_avDevices.end(); 122 ++it ) 123 { 124 AvDevice* avDevice = *it; 125 126 if (avDevice->getNodeId() == node) { 127 return true; 128 } 129 } 130 return false; 131 } 132 133 int DeviceManager::getNbDevices() { 134 return m_avDevices.size(); 135 } 136 137 int DeviceManager::getDeviceNodeId(int device_nr) { 138 if ( ! (device_nr < getNbDevices()) ) { 139 cerr << "Device number out of range ( " 140 << device_nr << ")" << endl; 141 return -1; 142 } 143 144 AvDevice* avDevice = m_avDevices.at(device_nr); 145 146 if ( !avDevice ) { 147 cerr << "Could not get device at position ( " 148 << device_nr << ")" << endl; 149 return -1; 150 151 } 152 153 return avDevice->getNodeId(); 154 155 } 156 157 bool DeviceManager::setNodeSampleFrequency(int node, int samplerate) { 158 for ( AvDeviceVectorIterator it = m_avDevices.begin(); 159 it != m_avDevices.end(); 160 ++it ) 161 { 162 AvDevice* avDevice = *it; 163 164 if (avDevice->getNodeId() == node) { 165 return avDevice->setSampleFrequency(samplerate); 166 } 167 } 168 return false; 169 } 170 119 171 xmlDocPtr DeviceManager::getXmlDescription() 120 172 { … … 172 224 return 0; 173 225 } 226 227 res = avDevice->getVendorName(); 228 229 if ( !xmlNewChild( deviceNode, 230 0, 231 BAD_CAST "Vendor", 232 BAD_CAST res.c_str() ) ) { 233 debugError( "Couldn't create vendor node\n" ); 234 xmlFreeDoc( doc ); 235 xmlCleanupParser(); 236 return 0; 237 } 238 239 res = avDevice->getModelName(); 240 241 if ( !xmlNewChild( deviceNode, 242 0, 243 BAD_CAST "Model", 244 BAD_CAST res.c_str() ) ) { 245 debugError( "Couldn't create model node\n" ); 246 xmlFreeDoc( doc ); 247 xmlCleanupParser(); 248 return 0; 249 } 250 251 res = ""; 252 res = avDevice->getGuid(); 253 254 if ( !xmlNewChild( deviceNode, 255 0, 256 BAD_CAST "GUID", 257 BAD_CAST res.c_str() ) ) { 258 debugError( "Couldn't create GUID node\n" ); 259 xmlFreeDoc( doc ); 260 xmlCleanupParser(); 261 return 0; 262 } 174 263 175 264 if ( !avDevice->addXmlDescription( deviceNode ) ) { trunk/libfreebob/src/devicemanager.h
r125 r138 44 44 bool discover(); 45 45 46 bool isValidNode(int node); 47 int getNbDevices(); 48 int getDeviceNodeId(int device_nr); 49 50 bool setNodeSampleFrequency(int node_id, int samplerate); 51 46 52 xmlDocPtr getXmlDescription(); 47 53 protected: trunk/libfreebob/src/libfreebobavc/avc_connect.cpp
r125 r138 58 58 bool result = false; 59 59 60 #define STREAM_FORMAT_REQUEST_SIZE 10 // XXX random length60 #define STREAM_FORMAT_REQUEST_SIZE 20 // XXX random length 61 61 union UPacket { 62 62 quadlet_t quadlet[STREAM_FORMAT_REQUEST_SIZE]; trunk/libfreebob/src/libfreebobavc/avc_extended_stream_format.cpp
r132 r138 25 25 #include <netinet/in.h> 26 26 27 28 //////////////////////////////////////////////////////////// 27 /////////////////////////////////////////////////////////// 28 std::ostream& operator<<( std::ostream& stream, StreamFormatInfo info ) 29 { 30 /* stream << info.m_freq << " Hz ("; 31 if ( info.m_format ) { 32 stream << "sync "; 33 } else { 34 stream << "compound "; 35 } 36 stream << "stream, "; 37 stream << "audio channels: " << info.m_audioChannels 38 << ", midi channels: " << info.m_midiChannels << ")"; 39 */ 40 stream << " NbChannels " << (int)info.m_numberOfChannels << ", Format " << (int)info.m_streamFormat; 41 return stream; 42 } 29 43 30 44 StreamFormatInfo::StreamFormatInfo() … … 103 117 104 118 //////////////////////////////////////////////////////////// 119 std::ostream& operator<<( std::ostream& stream, FormatInformationStreamsCompound info ) 120 { 121 stream << (int)info.m_samplingFrequency << " Hz (rate control: "; 122 stream << (int)info.m_rateControl << ")" << std::endl; 123 124 for ( FormatInformationStreamsCompound::StreamFormatInfoVector::iterator it = info.m_streamFormatInfos.begin(); 125 it != info.m_streamFormatInfos.end(); 126 ++it ) 127 { 128 StreamFormatInfo* sfi=*it; 129 stream << " > " << *sfi << std::endl; 130 } 131 132 return stream; 133 } 105 134 106 135 FormatInformationStreamsCompound::FormatInformationStreamsCompound() trunk/libfreebob/src/libfreebobavc/avc_extended_stream_format.h
r125 r138 124 124 stream_format_t m_streamFormat; 125 125 }; 126 std::ostream& operator<<( std::ostream& stream, StreamFormatInfo info ); 126 127 127 128 //////////////////////////////////////////////////////////// … … 170 171 StreamFormatInfoVector m_streamFormatInfos; 171 172 }; 173 std::ostream& operator<<( std::ostream& stream, FormatInformationStreamsCompound info ); 172 174 173 175 trunk/libfreebob/src/libfreebobavc/avc_plug_info.cpp
r125 r138 124 124 bool result = false; 125 125 126 #define STREAM_FORMAT_REQUEST_SIZE 5// XXX random length126 #define STREAM_FORMAT_REQUEST_SIZE 20 // XXX random length 127 127 union UPacket { 128 128 quadlet_t quadlet[STREAM_FORMAT_REQUEST_SIZE]; trunk/libfreebob/src/libfreebobavc/avc_signal_source.cpp
r125 r138 235 235 bool result = false; 236 236 237 #define STREAM_FORMAT_REQUEST_SIZE 5// XXX random length237 #define STREAM_FORMAT_REQUEST_SIZE 20 // XXX random length 238 238 union UPacket { 239 239 quadlet_t quadlet[STREAM_FORMAT_REQUEST_SIZE];