Changeset 185
- Timestamp:
- 04/24/06 13:59:21 (17 years ago)
- Files:
-
- trunk/libfreebob/ChangeLog (modified) (1 diff)
- trunk/libfreebob/config.h.in (modified) (3 diffs)
- trunk/libfreebob/configure.ac (modified) (7 diffs)
- trunk/libfreebob/INSTALL (modified) (10 diffs)
- trunk/libfreebob/libfreebob/freebob.h (modified) (2 diffs)
- trunk/libfreebob/libfreebob/freebob_streaming.h (modified) (3 diffs)
- trunk/libfreebob/src/avdevice.cpp (deleted)
- trunk/libfreebob/src/avdevice.h (deleted)
- trunk/libfreebob/src/avdevicesubunit.cpp (deleted)
- trunk/libfreebob/src/avdevicesubunit.h (deleted)
- trunk/libfreebob/src/avdevicexml.cpp (deleted)
- trunk/libfreebob/src/avplug.cpp (deleted)
- trunk/libfreebob/src/avplug.h (deleted)
- trunk/libfreebob/src/avplugxml.cpp (deleted)
- trunk/libfreebob/src/bebob (added)
- trunk/libfreebob/src/bebob/bebob_avdevice.cpp (added)
- trunk/libfreebob/src/bebob/bebob_avdevice.h (added)
- trunk/libfreebob/src/bebob/bebob_avdevice_subunit.cpp (added)
- trunk/libfreebob/src/bebob/bebob_avdevice_subunit.h (added)
- trunk/libfreebob/src/bebob/bebob_avdevice_xml.cpp (added)
- trunk/libfreebob/src/bebob/bebob_avplug.cpp (added)
- trunk/libfreebob/src/bebob/bebob_avplug.h (added)
- trunk/libfreebob/src/bebob/bebob_avplug_xml.cpp (added)
- trunk/libfreebob/src/bebob/bebob_functionblock.cpp (added)
- trunk/libfreebob/src/bebob/bebob_functionblock.h (added)
- trunk/libfreebob/src/bounce (added)
- trunk/libfreebob/src/bounce/bounce_avdevice.cpp (added)
- trunk/libfreebob/src/bounce/bounce_avdevice.h (added)
- trunk/libfreebob/src/configrom.cpp (modified) (4 diffs)
- trunk/libfreebob/src/configrom.h (modified) (3 diffs)
- trunk/libfreebob/src/devicemanager.cpp (modified) (14 diffs)
- trunk/libfreebob/src/devicemanager.h (modified) (2 diffs)
- trunk/libfreebob/src/freebob.cpp (modified) (2 diffs)
- trunk/libfreebob/src/functionblock.cpp (deleted)
- trunk/libfreebob/src/functionblock.h (deleted)
- trunk/libfreebob/src/iavdevice.h (added)
- trunk/libfreebob/src/libfreebobavc/avc_generic.cpp (modified) (4 diffs)
- trunk/libfreebob/src/libfreebobavc/ieee1394service.cpp (modified) (2 diffs)
- trunk/libfreebob/src/libfreebobavc/ieee1394service.h (modified) (1 diff)
- trunk/libfreebob/src/libfreebobstreaming/freebob_connections.c (modified) (1 diff)
- trunk/libfreebob/src/libfreebobstreaming/freebob_connections.h (modified) (1 diff)
- trunk/libfreebob/src/libfreebobstreaming/freebob_debug.h (modified) (1 diff)
- trunk/libfreebob/src/libfreebobstreaming/freebob_streaming.c (modified) (11 diffs)
- trunk/libfreebob/src/libfreebobstreaming/freebob_streaming_private.h (modified) (1 diff)
- trunk/libfreebob/src/libfreebobstreaming/messagebuffer.c (modified) (1 diff)
- trunk/libfreebob/src/libfreebobstreaming/messagebuffer.h (modified) (1 diff)
- trunk/libfreebob/src/libfreebobstreaming/ringbuffer.h (modified) (1 diff)
- trunk/libfreebob/src/libfreebobstreaming/thread.c (modified) (1 diff)
- trunk/libfreebob/src/libfreebobstreaming/thread.h (modified) (1 diff)
- trunk/libfreebob/src/Makefile.am (modified) (2 diffs)
- trunk/libfreebob/tests/freebob-server.c (added)
- trunk/libfreebob/tests/Makefile.am (modified) (2 diffs)
- trunk/libfreebob/tests/streaming/teststreaming.c (modified) (1 diff)
- trunk/libfreebob/tests/streaming/teststreaming3.c (modified) (4 diffs)
- trunk/libfreebob/tests/test-freebob.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libfreebob/ChangeLog
r183 r185 1 2006-04-23 Daniel Wagner <wagi@monom.org> 2 3 * configure.ac: Version bumped to 0.7.0 4 5 * Abstract interface IAvDevice introduced. 6 * BeBoB device discovering code moved into bebob directory. 7 * Bounce device added. 8 9 2006-04-17 Daniel Wagner <wagi@monom.org> 10 11 * configure.ac: Version bumped to 0.6.4 12 13 * src/libfreebobavc/avc_generic.cpp (serialize): Decode subunit_type 14 and subunit_id field. 15 (fire): avc1394_transaction_block2 inteface change update. 16 * src/libfreebobavc/ieee1394service.cpp (transactionBlock): Likewise. 17 * src/libfreebobavc/ieee1394service.h: Likewise. 18 19 2006-04-11 Daniel Wagner <wagi@monom.org> 20 21 * configure.ac: Version bumped to 0.6.3 22 23 * src/avdevicesubunit.cpp (discoverFunctionBlocks): reformating. 24 (discoverFunctionBlocksDo): Really added a correct 25 bugfix for the reuse of ExtendedSubunitInfoCmd. 26 27 2006-04-07 Pieter Palmers <pieterpalmers@users.sourceforge.net> 28 29 * src/avdevice.h src/avdevice.cpp: moved the include of stdint.h 30 from the implementation to the header, to fix certain compilation 31 problems wrt uint64_t. This datatype is also used in the class 32 definition in avdevice.h. 33 34 2006-04-05 Pieter Palmers <pieterpalmers@users.sourceforge.net> 35 36 * configure.ac: Version bump to 0.6.2 37 38 * src/freebob.cpp: Retry setting the sample rate if it fails the 39 first time. 40 41 * src/libfreebobstreaming/*: Added an way to choose for playback 42 or capture only (for ALSA plugin), using the options passed when 43 creating the freebob device. * src/libfreebobstreaming/*: fixed 44 the bug that prevented playback only operation. 45 46 2006-04-04 Daniel Wagner <wagi@monom.org> 47 48 * configure.ac: Version bump to 0.6.1 49 50 * src/avdevicesubunit.cpp (discoverFunctionBlocksDo): 51 ExtendedSubunitInfoCmd is not reusable at this point. 52 Moved into its own block so that's initatilialized correctly. 53 1 54 2006-03-30 Daniel Wagner <wagi@monom.org> 2 55 trunk/libfreebob/config.h.in
r155 r185 43 43 #undef HAVE_UNISTD_H 44 44 45 /* Define to 1 if your C compiler doesn't accept -c and -o together. */ 46 #undef NO_MINUS_C_MINUS_O 47 45 48 /* Name of package */ 46 49 #undef PACKAGE … … 64 67 #undef STDC_HEADERS 65 68 69 /* Define to 1 if MMX assembly is available. */ 70 #undef USE_MMX 71 72 /* Define to 1 if SSE assembly is available. */ 73 #undef USE_SSE 74 66 75 /* Version number of package */ 67 76 #undef VERSION … … 81 90 code using `volatile' can become incorrect without. Disable with care. */ 82 91 #undef volatile 92 93 /* "Nope it's intel" */ 94 #undef x86 trunk/libfreebob/configure.ac
r183 r185 1 1 # configure.ac - Configure script for FreeBob. 2 # Copyright (C) 2005 by Daniel Wagner. 2 # Copyright (C) 2005,06 by Daniel Wagner. 3 # Copyright (C) 2006 by Pieter Palmers. 3 4 # 4 5 # This file is part of FreeBob. … … 22 23 23 24 m4_define(freebob_major_version, 0) 24 m4_define(freebob_minor_version, 6)25 m4_define(freebob_minor_version, 7) 25 26 m4_define(freebob_micro_version, 0) 26 27 … … 47 48 AC_SUBST(FREEBOB_MICRO_VERSION, freebob_micro_version) 48 49 49 AM_INIT_AUTOMAKE 50 AM_INIT_AUTOMAKE([subdir-objects]) 50 51 AM_MAINTAINER_MODE 51 52 AC_CONFIG_SRCDIR([src/freebob.cpp]) … … 73 74 AC_PROG_CXX 74 75 AM_PROG_AS 76 AM_PROG_CC_C_O 75 77 AC_PROG_LIBTOOL 76 78 AC_CHECK_TOOL([AR], [ar], :) … … 125 127 esac],[debug=false]) 126 128 127 CFLAGS="$CFLAGS -g -Wall -std=gnu99" 128 CXXFLAGS="$CXXFLAGS -g -Wall" 129 130 dnl Check for MMX assembly 131 132 AC_ARG_ENABLE(mmx, 133 [ --enable-mmx enable MMX support (default=auto)],, 134 enable_mmx=yes) 135 136 AC_ARG_ENABLE(sse, 137 [ --enable-sse enable SSE support (default=auto)],, 138 enable_sse=$enable_mmx) 139 140 if test "x$enable_mmx" = xyes; then 141 142 AC_MSG_CHECKING(whether we can compile MMX code) 143 144 AC_COMPILE_IFELSE([asm ("movq 0, %mm0");], 145 146 AC_DEFINE(USE_MMX, 1, [Define to 1 if MMX assembly is available.]) 147 AC_MSG_RESULT(yes) 148 MMX_FLAGS="-mmmx" 149 150 if test "x$enable_sse" = xyes; then 151 152 AC_MSG_CHECKING(whether we can compile SSE code) 153 154 AC_COMPILE_IFELSE([asm ("movntps %xmm0, 0");], 155 AC_DEFINE(USE_SSE, 1, 156 [Define to 1 if SSE assembly is available.]) 157 SSE_FLAGS="-msse -mfpmath=sse" 158 AC_MSG_RESULT(yes) 159 , 160 enable_sse=no 161 AC_MSG_RESULT(no) 162 AC_MSG_WARN( 163 [The assembler does not support the SSE command set.] 164 ) 165 ) 166 167 fi 168 , 169 enable_mmx=no 170 AC_MSG_RESULT(no) 171 AC_MSG_WARN([The assembler does not support the MMX command set.]) 172 ) 173 fi 174 175 AC_DEFINE(x86, 1, "Nope it's intel") 176 COMMON_X86_OPT_FLAGS="-DREENTRANT -O3 -fomit-frame-pointer -ffast-math -funroll-loops" 177 178 if test "$target_cpu" = "i586"; then 179 FREEBOB_OPT_CFLAGS="-march=i586 " 180 elif test "$target_cpu" = "i686"; then 181 FREEBOB_OPT_CFLAGS="-march=i686" 182 else 183 : 184 fi 185 186 FREEBOB_OPT_CFLAGS="$COMMON_X86_OPT_FLAGS $FREEBOB_OPT_CFLAGS $MMX_FLAGS $SSE_FLAGS" 187 188 189 AC_ARG_ENABLE(optimize, 190 AC_HELP_STRING([--enable-optimize], 191 [ask the compiler for its best optimizations]), 192 [ if test x$enable_optimize != xno ; then 193 CFLAGS="$CFLAGS $FREEBOB_OPT_CFLAGS" ; 194 CXXFLAGS="$CXXFLAGS $FREEBOB_OPT_CFLAGS" 195 fi 196 ] 197 ) 198 199 200 CFLAGS="$CFLAGS -Wall -std=gnu99" 201 CXXFLAGS="$CXXFLAGS -Wall" 129 202 130 203 if test "${debug}" = true; then 131 CFLAGS="$CFLAGS -DDEBUG" 132 CXXFLAGS="$CXXFLAGS -DDEBUG" 133 else 134 CFLAGS="$CFLAGS -O2" 135 CXXFLAGS="$CXXFLAGS -O2" 204 CFLAGS="$CFLAGS -g -DDEBUG" 205 CXXFLAGS="$CXXFLAGS -g -DDEBUG" 136 206 fi; 137 207 … … 165 235 tests/streaming/Makefile 166 236 libfreebob.pc]) 237 167 238 AC_OUTPUT 168 239 … … 175 246 Installation prefix: $prefix 176 247 C++ compiler: $CXX $CXXFLAGS 248 249 libraw1394 CFLAGS: $LIBRAW1394_CFLAGS 250 libraw1394 LIBS: $LIBRAW1394_LIBS 251 libiec61883 CFLAGS: $LIBIEC61883_CFLAGS 252 libiec61883 LIBS: $LIBIEC61883_LIBS 253 libavc1394 CFLAGS: $LIBAVC1394_CFLAGS 254 libavc1394 LIBS: $LIBAVC1394_LIBS 177 255 ]) trunk/libfreebob/INSTALL
r166 r185 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/libfreebob/freebob.h
r183 r185 1 1 /* freebob.h 2 2 * Copyright (C) 2005 Pieter Palmers 3 * Copyright (C) 2006 Daniel Wagner 3 4 * 4 5 * This file is part of FreeBoB … … 24 25 25 26 #define FREEBOB_MAX_NAME_LEN 256 27 28 #define FREEBOB_BOUNCE_SERVER_VENDORNAME "FreeBoB Server" 29 #define FREEBOB_BOUNCE_SERVER_MODELNAME "freebob-server" 26 30 27 31 enum freebob_direction { trunk/libfreebob/libfreebob/freebob_streaming.h
r159 r185 1 /* $Id$ */2 3 1 /* 4 2 * FreeBob Streaming API … … 40 38 41 39 #define FREEBOB_STREAMING_MAX_URL_LENGTH 2048 40 41 #define FREEBOB_IGNORE_CAPTURE (1<<0) 42 #define FREEBOB_IGNORE_PLAYBACK (1<<1) 43 42 44 #include <stdlib.h> 43 45 … … 119 121 int port; 120 122 123 124 /* direction map */ 125 int directions; 126 121 127 } freebob_options_t; 122 128 trunk/libfreebob/src/configrom.cpp
r140 r185 155 155 } 156 156 157 // XXX This might work only for the M-Audio Audiophile 158 // but can easily extended. 159 #define VENDOR_ID_MAUDIO 0x00000d6c 160 #define MODEL_ID_MAUDIO_BOOTLOADER 0x00010060 161 162 const bool 163 ConfigRom::isBootloader() const 164 { 165 if ( ( m_vendorId == VENDOR_ID_MAUDIO ) 166 && ( m_modelId == MODEL_ID_MAUDIO_BOOTLOADER ) ) 167 { 168 return true; 169 } 170 return false; 171 } 157 172 158 173 static int … … 203 218 "\tvendor_id = 0x%08x\n", 204 219 kv->value.immediate); 220 m_vendorId = kv->value.immediate; 205 221 } 206 222 break; … … 210 226 "\tmodel_id = 0x%08x\n", 211 227 kv->value.immediate); 228 m_modelId = kv->value.immediate; 212 229 break; 213 230 … … 314 331 } 315 332 333 const fb_nodeid_t 334 ConfigRom::getNodeId() const 335 { 336 return m_nodeId; 337 } 338 316 339 const fb_octlet_t 317 340 ConfigRom::getGuid() const trunk/libfreebob/src/configrom.h
r125 r185 1 1 /* configrom.h 2 * Copyright (C) 2005 by Daniel Wagner2 * Copyright (C) 2005,06 by Daniel Wagner 3 3 * 4 4 * This file is part of FreeBob. … … 39 39 40 40 const bool isAvcDevice() const; 41 const bool isBootloader() const; 42 const fb_nodeid_t getNodeId() const; 41 43 const fb_octlet_t getGuid() const; 42 44 const std::string getModelName() const; 43 45 const std::string getVendorName() const; 46 44 47 45 48 protected: … … 56 59 std::string m_vendorName; 57 60 std::string m_modelName; 61 unsigned int m_vendorId; 62 unsigned int m_modelId; 58 63 59 64 /* only used during parsing */ trunk/libfreebob/src/devicemanager.cpp
r183 r185 22 22 23 23 #include "devicemanager.h" 24 #include " avdevice.h"24 #include "iavdevice.h" 25 25 #include "configrom.h" 26 26 27 27 #include "libfreebobavc/ieee1394service.h" 28 28 #include "debugmodule/debugmodule.h" 29 #include "bebob/bebob_avdevice.h" 30 #include "bounce/bounce_avdevice.h" 29 31 30 32 #include <iostream> … … 37 39 : m_1394Service( 0 ) 38 40 { 41 m_probeList.push_back( probeBeBoB ); 42 m_probeList.push_back( probeBounce ); 39 43 } 40 44 41 45 DeviceManager::~DeviceManager() 42 46 { 43 for ( AvDeviceVectorIterator it = m_avDevices.begin();47 for ( IAvDeviceVectorIterator it = m_avDevices.begin(); 44 48 it != m_avDevices.end(); 45 49 ++it ) … … 76 80 setDebugLevel( DEBUG_LEVEL_VERBOSE ); 77 81 } 78 for ( AvDeviceVectorIterator it = m_avDevices.begin();82 for ( IAvDeviceVectorIterator it = m_avDevices.begin(); 79 83 it != m_avDevices.end(); 80 84 ++it ) … … 88 92 ++nodeId ) 89 93 { 90 ConfigRom * configRom = new ConfigRom( m_1394Service, nodeId );91 if ( !configRom ->initialize() ) {94 ConfigRom configRom( m_1394Service, nodeId ); 95 if ( !configRom.initialize() ) { 92 96 // \todo If a PHY on the bus in power safe mode than 93 97 // the config rom is missing. So this might be just … … 99 103 "Skip device discovering for this node\n", 100 104 nodeId ); 101 delete configRom;102 105 continue; 103 106 } 104 107 105 if ( !configRom->isAvcDevice() ) { 106 delete configRom; 108 if ( !configRom.isAvcDevice() ) { 107 109 continue; 108 110 } 109 111 110 AvDevice* avDevice = new AvDevice( m_1394Service, 111 configRom, 112 nodeId, 113 verboseLevel ); 114 if ( !avDevice ) { 115 debugError( "discover: Could not allocate AvDevice\n" ); 116 delete configRom; 117 return false; 118 } 119 120 if ( !avDevice->discover() ) { 121 debugError( "discover: Could not discover device (node id %d)\n", 122 nodeId ); 123 delete avDevice; 124 return false; 125 } 126 if ( verboseLevel ) { 127 avDevice->showDevice(); 128 } 129 130 m_avDevices.push_back( avDevice ); 112 for ( ProbeFunctionVector::iterator it = m_probeList.begin(); 113 it != m_probeList.end(); 114 ++it ) 115 { 116 ProbeFunction func = *it; 117 IAvDevice* avDevice = func(*m_1394Service, nodeId, verboseLevel); 118 if ( avDevice ) { 119 m_avDevices.push_back( avDevice ); 120 if ( verboseLevel ) { 121 avDevice->showDevice(); 122 } 123 break; 124 } 125 } 126 131 127 } 132 128 133 129 return true; 130 } 131 132 133 IAvDevice* 134 DeviceManager::probeBeBoB(Ieee1394Service& service, int id, int level) 135 { 136 IAvDevice* avDevice = new BeBoB::AvDevice( service, id, level ); 137 if ( !avDevice ) { 138 return 0; 139 } 140 141 if ( !avDevice->discover() ) { 142 delete avDevice; 143 return 0; 144 } 145 return avDevice; 146 } 147 148 IAvDevice* 149 DeviceManager::probeBounce(Ieee1394Service& service, int id, int level) 150 { 151 IAvDevice* avDevice = new Bounce::BounceDevice( service, id, level ); 152 if ( !avDevice ) { 153 return 0; 154 } 155 156 if ( !avDevice->discover() ) { 157 delete avDevice; 158 return 0; 159 } 160 return avDevice; 134 161 } 135 162 … … 137 164 DeviceManager::isValidNode(int node) 138 165 { 139 for ( AvDeviceVectorIterator it = m_avDevices.begin();140 it != m_avDevices.end(); 141 ++it ) 142 { 143 AvDevice* avDevice = *it;144 145 if (avDevice->get NodeId() == node) {166 for ( IAvDeviceVectorIterator it = m_avDevices.begin(); 167 it != m_avDevices.end(); 168 ++it ) 169 { 170 IAvDevice* avDevice = *it; 171 172 if (avDevice->getConfigRom().getNodeId() == node) { 146 173 return true; 147 }148 174 } 149 return false; 175 } 176 return false; 150 177 } 151 178 … … 164 191 } 165 192 166 AvDevice* avDevice = m_avDevices.at( deviceNr );193 IAvDevice* avDevice = m_avDevices.at( deviceNr ); 167 194 168 195 if ( !avDevice ) { … … 170 197 } 171 198 172 return avDevice->get NodeId();173 } 174 175 AvDevice*199 return avDevice->getConfigRom().getNodeId(); 200 } 201 202 IAvDevice* 176 203 DeviceManager::getAvDevice( int nodeId ) 177 204 { 178 for ( AvDeviceVectorIterator it = m_avDevices.begin();179 it != m_avDevices.end(); 180 ++it ) 181 { 182 AvDevice* avDevice = *it;183 if ( avDevice->get NodeId() == nodeId ) {205 for ( IAvDeviceVectorIterator it = m_avDevices.begin(); 206 it != m_avDevices.end(); 207 ++it ) 208 { 209 IAvDevice* avDevice = *it; 210 if ( avDevice->getConfigRom().getNodeId() == nodeId ) { 184 211 return avDevice; 185 212 } … … 207 234 xmlDocSetRootElement( doc, rootNode ); 208 235 209 for ( AvDeviceVectorIterator it = m_avDevices.begin();210 it != m_avDevices.end(); 211 ++it ) 212 { 213 AvDevice* avDevice = *it;236 for ( IAvDeviceVectorIterator it = m_avDevices.begin(); 237 it != m_avDevices.end(); 238 ++it ) 239 { 240 IAvDevice* avDevice = *it; 214 241 215 242 xmlNodePtr deviceNode = xmlNewChild( rootNode, 0, … … 223 250 224 251 char* result; 225 asprintf( &result, "%d", avDevice->get NodeId() );252 asprintf( &result, "%d", avDevice->getConfigRom().getNodeId() ); 226 253 if ( !xmlNewChild( deviceNode, 0, 227 254 BAD_CAST "NodeId", BAD_CAST result ) ) … … 232 259 233 260 std::string res = "Connection Information for " 234 + avDevice->get VendorName()261 + avDevice->getConfigRom().getVendorName() 235 262 +", " 236 + avDevice->get ModelName()263 + avDevice->getConfigRom().getModelName() 237 264 + " configuration"; 238 265 if ( !xmlNewChild( deviceNode, … … 246 273 } 247 274 248 res = avDevice->get VendorName();275 res = avDevice->getConfigRom().getVendorName(); 249 276 250 277 if ( !xmlNewChild( deviceNode, … … 258 285 } 259 286 260 res = avDevice->get ModelName();287 res = avDevice->getConfigRom().getModelName(); 261 288 262 289 if ( !xmlNewChild( deviceNode, … … 271 298 272 299 asprintf( &result, "%08x%08x", 273 ( quadlet_t )( avDevice->get Guid() >> 32 ),274 ( quadlet_t )( avDevice->get Guid() & 0xfffffff ) );300 ( quadlet_t )( avDevice->getConfigRom().getGuid() >> 32 ), 301 ( quadlet_t )( avDevice->getConfigRom().getGuid() & 0xfffffff ) ); 275 302 if ( !xmlNewChild( deviceNode, 0, 276 303 BAD_CAST "GUID", BAD_CAST result ) ) { trunk/libfreebob/src/devicemanager.h
r183 r185 29 29 30 30 class Ieee1394Service; 31 class AvDevice;31 class IAvDevice; 32 32 33 typedef std::vector< AvDevice* > AvDeviceVector; 34 typedef std::vector< AvDevice* >::iterator AvDeviceVectorIterator; 33 typedef std::vector< IAvDevice* > IAvDeviceVector; 34 typedef std::vector< IAvDevice* >::iterator IAvDeviceVectorIterator; 35 36 typedef IAvDevice* (*ProbeFunction)(Ieee1394Service&, int, int); 37 typedef std::vector<ProbeFunction> ProbeFunctionVector; 38 typedef std::vector<ProbeFunction>::iterator ProbeFunctionVectorIterator; 35 39 36 40 class DeviceManager{ … … 48 52 int getDeviceNodeId( int deviceNr ); 49 53 50 AvDevice* getAvDevice( int nodeId );54 IAvDevice* getAvDevice( int nodeId ); 51 55 52 56 xmlDocPtr getXmlDescription(); 53 protected: 57 58 protected: 59 static IAvDevice* probeBeBoB(Ieee1394Service& service, int id, int level); 60 static IAvDevice* probeBounce(Ieee1394Service& service, int id, int level); 61 62 protected: 54 63 Ieee1394Service* m_1394Service; 55 AvDeviceVector m_avDevices; 64 IAvDeviceVector m_avDevices; 65 ProbeFunctionVector m_probeList; 56 66 57 67 DECLARE_DEBUG_MODULE; trunk/libfreebob/src/freebob.cpp
r183 r185 28 28 #include "fbtypes.h" 29 29 #include "devicemanager.h" 30 #include " avdevice.h"30 #include "iavdevice.h" 31 31 32 32 #include "libfreebobavc/avc_generic.h" … … 135 135 freebob_set_samplerate( freebob_handle_t freebob_handle, int node_id, int samplerate ) 136 136 { 137 AvDevice* avDevice = freebob_handle->m_deviceManager->getAvDevice( node_id );137 IAvDevice* avDevice = freebob_handle->m_deviceManager->getAvDevice( node_id ); 138 138 if ( avDevice ) { 139 139 if ( avDevice->setSamplingFrequency( parseSampleRate( samplerate ) ) ) { 140 140 return freebob_handle->m_deviceManager->discover(0)? 1 : 0; 141 } 142 } 143 return 0; 141 142 // retry 143 } else if ( avDevice->setSamplingFrequency( parseSampleRate( samplerate ) ) ) { 144 return freebob_handle->m_deviceManager->discover(0)? 1 : 0; 145 // failed 146 } else { 147 return -1; 148 } 149 } 150 return -1; 144 151 } 145 152 trunk/libfreebob/src/libfreebobavc/avc_generic.cpp
r183 r185 45 45 { 46 46 se.write( m_ctype, "AVCCommand ctype" ); 47 se.write( m_subunit, "AVCCommand subunit" ); 47 // XXX \todo improve IOSSerialize::write interface 48 char* buf; 49 asprintf( &buf, "AVCCommand subunit (subunit_type = %d, subunit_id = %d)", 50 getSubunitType(), getSubunitId() ); 51 se.write( m_subunit, buf ); 48 52 se.write( m_opcode, "AVCCommand opcode" ); 49 53 return true; … … 168 172 } 169 173 174 unsigned int resp_len; 170 175 quadlet_t* resp = m_1394Service->transactionBlock( m_nodeId, 171 176 (quadlet_t*)m_fcpFrame, 172 ( fcpFrameSize + 3 ) / 4 ); 177 ( fcpFrameSize+3 ) / 4, 178 &resp_len ); 173 179 bool result = false; 174 180 if ( resp ) { 181 resp_len *= 4; 175 182 unsigned char* buf = ( unsigned char* ) resp; 176 183 … … 182 189 case eR_NotImplemented: 183 190 { 184 BufferDeserialize de( buf, 512 ); // XXX magic number191 BufferDeserialize de( buf, resp_len ); 185 192 result = deserialize( de ); 186 193 … … 196 203 default: 197 204 printf( "unexpected response received (0x%x)\n", m_eResponse ); 205 if ( getVerboseLevel() >= DEBUG_EXTRA_VERBOSE) { 206 puts(" Response:"); 207 BufferDeserialize de( buf, resp_len ); 208 deserialize( de ); 209 210 showFcpFrame( buf, resp_len ); 211 } 212 198 213 } 199 214 } else { trunk/libfreebob/src/libfreebobavc/ieee1394service.cpp
r183 r185 84 84 Ieee1394Service::transactionBlock( fb_nodeid_t nodeId, 85 85 fb_quadlet_t* buf, 86 int len ) 86 int len, 87 unsigned int* resp_len ) 87 88 { 88 89 for (int i = 0; i < len; ++i) { … … 91 92 92 93 fb_quadlet_t* result = 93 avc1394_transaction_block( m_handle, nodeId, buf, len, 10 ); 94 avc1394_transaction_block2( m_handle, 95 nodeId, 96 buf, 97 len, 98 resp_len, 99 10 ); 94 100 95 for ( int i = 0; i < 512/4; ++i ) { //XXX101 for ( unsigned int i = 0; i < *resp_len; ++i ) { 96 102 result[i] = htonl( result[i] ); 97 103 } trunk/libfreebob/src/libfreebobavc/ieee1394service.h
r183 r185 82 82 fb_quadlet_t* transactionBlock( fb_nodeid_t nodeId, 83 83 fb_quadlet_t* buf, 84 int len ); 84 int len, 85 unsigned int* resp_len ); 85 86 86 87 bool transactionBlockClose(); trunk/libfreebob/src/libfreebobstreaming/freebob_connections.c
r159 r185 1 /* $Id$ */2 3 1 /* 4 2 * FreeBob Streaming API trunk/libfreebob/src/libfreebobstreaming/freebob_connections.h
r164 r185 1 /* $Id$ */2 3 1 /* 4 2 * FreeBob Streaming API trunk/libfreebob/src/libfreebobstreaming/freebob_debug.h
r164 r185 85 85 //#define DEBUG_LEVEL (DEBUG_LEVEL_BUFFERS | DEBUG_LEVEL_RUN_CYCLE | (DEBUG_LEVEL_XRUN_RECOVERY)| DEBUG_LEVEL_STARTUP ) 86 86 //#define DEBUG_LEVEL (DEBUG_LEVEL_RUN_CYCLE | (DEBUG_LEVEL_XRUN_RECOVERY)| DEBUG_LEVEL_STARTUP | DEBUG_LEVEL_PACKETCOUNTER| DEBUG_LEVEL_WAIT) 87 #define DEBUG_LEVEL ( DEBUG_LEVEL_RUN_CYCLE | DEBUG_LEVEL_XRUN_RECOVERY | \ 88 DEBUG_LEVEL_STARTUP | DEBUG_LEVEL_PACKETCOUNTER) 87 #define DEBUG_LEVEL ( \ 88 0 * DEBUG_LEVEL_BUFFERS | \ 89 0 * DEBUG_LEVEL_HANDLERS | \ 90 0 * DEBUG_LEVEL_HANDLERS_LOWLEVEL | \ 91 1 * DEBUG_LEVEL_XRUN_RECOVERY | \ 92 0 * DEBUG_LEVEL_WAIT | \ 93 0 * DEBUG_LEVEL_RUN_CYCLE | \ 94 1 * DEBUG_LEVEL_PACKETCOUNTER | \ 95 1 * DEBUG_LEVEL_STARTUP | \ 96 0 * DEBUG_LEVEL_THREADS | \ 97 0 * DEBUG_LEVEL_STREAMS \ 98 ) 89 99 90 100 //#define DEBUG_LEVEL (DEBUG_LEVEL_XRUN_RECOVERY | DEBUG_LEVEL_STARTUP | DEBUG_LEVEL_PACKETCOUNTER) trunk/libfreebob/src/libfreebobstreaming/freebob_streaming.c
r165 r185 104 104 printMessage(" RAW1394 ISO Prebuffers : %d\n",options.iso_prebuffers); 105 105 printMessage(" RAW1394 ISO IRQ Interval : %d\n",options.iso_irq_interval); 106 printMessage(" Directions : %X\n",options.directions); 106 107 107 108 // initialize the freebob_device … … 178 179 /* Read the connection specification 179 180 */ 180 181 libfreebob_capture_connections=freebob_get_connection_info(dev->fb_handle, options.node_id, 0); 182 libfreebob_playback_connections=freebob_get_connection_info(dev->fb_handle, options.node_id, 1); 183 181 182 if(!(options.directions & FREEBOB_IGNORE_CAPTURE)) { 183 libfreebob_capture_connections=freebob_get_connection_info(dev->fb_handle, options.node_id, 0); 184 } 185 186 if(!(options.directions & FREEBOB_IGNORE_PLAYBACK)) { 187 libfreebob_playback_connections=freebob_get_connection_info(dev->fb_handle, options.node_id, 1); 188 } 189 190 184 191 if (libfreebob_capture_connections) { 185 192 dev->nb_connections_capture=libfreebob_capture_connections->nb_connections; … … 925 932 } 926 933 934 int freebob_streaming_reset_playback_streams(freebob_device_t *dev) { 935 int i; 936 int err=0; 937 938 for(i=0; i < dev->nb_playback_streams; i++) { 939 freebob_stream_t *stream; 940 941 stream=*(dev->playback_streams+i); 942 943 assert(stream); 944 err=freebob_streaming_reset_stream(dev, stream); 945 if (err) { 946 printError("Could not reset stream %d\n",i); 947 return -1; 948 } 949 } 950 return 0; 951 952 } 953 927 954 int freebob_streaming_reset(freebob_device_t *dev) { 928 955 /* … … 1427 1454 connection->raw_handle, 1428 1455 iso_master_receive_handler, 1429 connection->iso.buffers*2, // use 2 times the transmit buffer for the receive buffer 1456 /* the receive buffer size doesn't matter for the latency, 1457 but it has a minimal value in order for libraw to operate correctly (300) 1458 */ 1459 400, 1430 1460 AMDTP_MAX_PACKET_SIZE, 1431 1461 connection->iso.iso_channel, 1432 RAW1394_DMA_BUFFERFILL, 1462 // RAW1394_DMA_BUFFERFILL, 1463 /* Packet per buffer enables low latency */ 1464 RAW1394_DMA_PACKET_PER_BUFFER, 1433 1465 connection->iso.irq_interval); 1434 1466 … … 1440 1472 connection->raw_handle, 1441 1473 iso_slave_receive_handler, 1442 connection->iso.buffers*2, // use 2 times the transmit buffer for the receive buffer 1474 /* the receive buffer size doesn't matter for the latency, 1475 but it has a minimal value in order for libraw to operate correctly (300) 1476 */ 1477 400, 1443 1478 AMDTP_MAX_PACKET_SIZE, 1444 1479 connection->iso.iso_channel, 1445 RAW1394_DMA_BUFFERFILL, 1480 // RAW1394_DMA_BUFFERFILL, 1481 /* Packet per buffer enables low latency */ 1482 RAW1394_DMA_PACKET_PER_BUFFER, 1446 1483 connection->iso.irq_interval); 1447 1484 } … … 1555 1592 1556 1593 // FIXME: only works for sync on receive stream because we don't prefill. 1557 1594 // ?FIXED? 1595 if(connection->spec.direction==1) { // playback 1596 int i; 1597 1598 if((err=freebob_streaming_reset_playback_streams(dev))<0) { 1599 printError("Could not reset playback streams.\n"); 1600 return err; 1601 } 1602 1603 // put nb_periods*period_size of null frames into the playback buffers 1604 if((err=freebob_streaming_prefill_playback_streams(dev))<0) { 1605 printError("Could not prefill playback streams.\n"); 1606 return err; 1607 } 1608 1609 // we should transfer nb_buffers periods of playback from the stream buffers to the event buffer 1610 for (i=0;i<dev->options.nb_buffers;i++) { 1611 freebob_streaming_transfer_playback_buffers(dev); 1612 } 1613 } 1614 1558 1615 debugPrint(DEBUG_LEVEL_STARTUP, " stream is running.\n"); 1559 1616 … … 1929 1986 // debugPrint(DEBUG_LEVEL_PACKETCOUNTER, "Stream %d,%d,%d is midi, dbc=%d [",s,stream->spec.location,stream->spec.position,dbc); 1930 1987 1931 for(j = (dbc%8)+stream->spec.location-1; j < nsamples; j += 8) { 1988 // for(j = (dbc%8)+stream->spec.location-1; j < nsamples; j += 8) { 1989 for(j = (dbc & 0x07)+stream->spec.location-1; j < nsamples; j += 8) { 1932 1990 target_event=(quadlet_t *)(events + ((j * connection->spec.dimension) + stream->spec.position)); 1933 1991 quadlet_t sample_int=ntohl(*target_event); … … 2012 2070 read=freebob_ringbuffer_read(stream->buffer, (char *)(stream->user_buffer), 1*sizeof(quadlet_t))/sizeof(quadlet_t); 2013 2071 if(read) { 2014 j = (dbc%8)+stream->spec.location-1; 2072 // j = (dbc%8)+stream->spec.location-1; 2073 j = (dbc & 0x07)+stream->spec.location-1; 2015 2074 target_event=(quadlet_t *)(events + ((j * connection->spec.dimension) + stream->spec.position)); 2016 2075 buffer=((quadlet_t *)(stream->user_buffer)); … … 2130 2189 return RAW1394_ISO_DEFER; 2131 2190 } 2132 if( (!(connection->status.packets % 2))) { 2191 // if( (!(connection->status.packets % 2))) { 2192 if( (!(connection->status.packets & 0x01))) { 2133 2193 return RAW1394_ISO_DEFER; 2134 2194 } … … 2211 2271 return RAW1394_ISO_DEFER; 2212 2272 } 2213 if( (!(connection->status.packets % 2))) { 2273 // if( (!(connection->status.packets % 2))) { 2274 if( (!(connection->status.packets & 0x01))) { 2214 2275 return RAW1394_ISO_DEFER; 2215 2276 } … … 2338 2399 return RAW1394_ISO_DEFER; 2339 2400 } 2340 if( (!(connection->status.packets % 2))) { 2401 // if( (!(connection->status.packets % 2))) { 2402 if( (!(connection->status.packets & 0x01))) { 2341 2403 return RAW1394_ISO_DEFER; 2342 2404 } trunk/libfreebob/src/libfreebobstreaming/freebob_streaming_private.h
r159 r185 1 /* $Id$ */2 3 1 /* 4 2 * FreeBob Streaming API trunk/libfreebob/src/libfreebobstreaming/messagebuffer.c
r159 r185 30 30 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 31 31 * 32 * $Id$33 32 */ 34 33 trunk/libfreebob/src/libfreebobstreaming/messagebuffer.h
r159 r185 31 31 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 32 32 * 33 * $Id$34 33 */ 35 34 trunk/libfreebob/src/libfreebobstreaming/ringbuffer.h
r159 r185 23 23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 24 24 25 $Id$26 25 */ 27 26 trunk/libfreebob/src/libfreebobstreaming/thread.c
r159 r185 27 27 Thread creation function including workarounds for real-time scheduling 28 28 behaviour on different glibc versions. 29 30 $Id$31 29 32 30 */ trunk/libfreebob/src/libfreebobstreaming/thread.h
r159 r185 22 22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 23 23 24 $Id$25 24 */ 26 25 trunk/libfreebob/src/Makefile.am
r171 r185 1 1 # Makefile.am - Makefile template 2 # Copyright (C) 2005 by Daniel Wagner.2 # Copyright (C) 2005,06 by Daniel Wagner. 3 3 # Copyright (C) 2006 by Pieter Palmers. 4 4 # … … 25 25 lib_LTLIBRARIES = libfreebob.la 26 26 27 libfreebob_la_SOURCES = \ 28 avdevice.cpp \ 29 avdevice.h \ 30 avdevicesubunit.cpp \ 31 avdevicesubunit.h \ 32 avdevicexml.cpp \ 33 avplug.cpp \ 34 avplug.h \ 35 avplugxml.cpp \ 36 configrom.cpp \ 37 configrom.h \ 38 csr1212.c \ 39 csr1212.h \ 40 devicemanager.cpp \ 41 devicemanager.h \ 42 fbtypes.h \ 43 freebob.cpp \ 44 functionblock.cpp \ 45 functionblock.h \ 46 xmlparser.c 27 libfreebob_la_SOURCES = \ 28 configrom.h \ 29 configrom.cpp \ 30 csr1212.h \ 31 csr1212.c \ 32 devicemanager.h \ 33 devicemanager.cpp \ 34 fbtypes.h \ 35 freebob.cpp \ 36 xmlparser.c \ 37 bebob/bebob_avdevice.h \ 38 bebob/bebob_avdevice.cpp \ 39 bebob/bebob_avdevice_xml.cpp \ 40 bebob/bebob_avdevice_subunit.h \ 41 bebob/bebob_avdevice_subunit.cpp \ 42 bebob/bebob_avplug.h \ 43 bebob/bebob_avplug.cpp \ 44 bebob/bebob_avplug_xml.cpp \ 45 bebob/bebob_functionblock.h \ 46 bebob/bebob_functionblock.cpp \ 47 bounce/bounce_avdevice.h \ 48 bounce/bounce_avdevice.cpp 49 50 47 51 48 52 libfreebob_la_LDFLAGS = -version-info $(LT_VERSION) -lpthread $(LIBSIGC_LIBS) \ 49 53 $(LIBRAW1394_LIBS) $(LIBIEC61883_LIBS) $(LIBAVC1394_LIBS) \ 50 $(LIBLO_LIBS) $(LIBXML_LIBS) debugmodule/libdebugmodule.la \51 libfreebobavc/libfreebobavc.la \ 52 libfreebobstreaming/libfreebobstreaming.la \53 -safe-temps54 $(LIBLO_LIBS) $(LIBXML_LIBS) -safe-temps 55 56 libfreebob_la_LIBADD = debugmodule/libdebugmodule.la libfreebobavc/libfreebobavc.la \ 57 libfreebobstreaming/libfreebobstreaming.la 54 58 55 59 trunk/libfreebob/tests/Makefile.am
r183 r185 21 21 $(LIBAVC1394_CFLAGS) 22 22 23 noinst_PROGRAMS = test-freebob test-extplugcmd 23 noinst_PROGRAMS = test-freebob test-extplugcmd freebob-server 24 24 noinst_HEADERS = 25 25 … … 30 30 test_extplugcmd_LDADD = $(top_builddir)/src/libfreebobavc/libfreebobavc.la -lavc1394 31 31 32 freebob_server_SOURCES = freebob-server.c 33 freebob_server_LDADD = $(top_builddir)/src/libfreebob.la $(LIBXML_LIBS) -lavc1394 -lrom1394 34 35 32 36 #TESTS_ENVIRONMENT 33 37 TEST = test-freebob trunk/libfreebob/tests/streaming/teststreaming.c
r160 r185 77 77 dev_options.iso_irq_interval=8; 78 78 79 dev_options.port= 1;79 dev_options.port=0; 80 80 dev_options.node_id=-1; 81 81 trunk/libfreebob/tests/streaming/teststreaming3.c
r160 r185 48 48 { 49 49 50 #define PERIOD_SIZE 6450 #define PERIOD_SIZE 256 51 51 52 52 int samplesread=0; … … 76 76 dev_options.period_size=PERIOD_SIZE; 77 77 78 dev_options.nb_buffers= 2;78 dev_options.nb_buffers=3; 79 79 80 80 dev_options.iso_buffers=40; … … 82 82 dev_options.iso_irq_interval=2; 83 83 84 dev_options.port= 1;84 dev_options.port=0; 85 85 dev_options.node_id=-1; 86 86 … … 119 119 120 120 for (i=0;i<nb_out_channels;i++) { 121 switch (freebob_streaming_get_ capture_stream_type(dev,i)) {121 switch (freebob_streaming_get_playback_stream_type(dev,i)) { 122 122 case freebob_stream_type_audio: 123 123 if (i<nb_in_channels) { trunk/libfreebob/tests/test-freebob.c
r183 r185 252 252 } 253 253 254 if ( freebob_discover_devices( fb_handle, 0) != 0 ) {254 if ( freebob_discover_devices( fb_handle, arguments.verbose ) != 0 ) { 255 255 fprintf( stderr, "Could not discover devices\n" ); 256 256 freebob_destroy_handle( fb_handle ); … … 350 350 } 351 351 352 if ( freebob_discover_devices( fb_handle, 0) != 0 ) {352 if ( freebob_discover_devices( fb_handle, arguments.verbose ) != 0 ) { 353 353 fprintf( stderr, "Could not discover devices\n" ); 354 354 freebob_destroy_handle( fb_handle ); … … 378 378 } 379 379 380 if ( freebob_discover_devices( fb_handle, 0) != 0 ) {380 if ( freebob_discover_devices( fb_handle, arguments.verbose ) != 0 ) { 381 381 fprintf( stderr, "Could not discover devices\n" ); 382 382 freebob_destroy_handle( fb_handle );