Changeset 412
- Timestamp:
- 02/22/07 08:49:35 (16 years ago)
- Files:
-
- branches/streaming-rework/config.h.in (modified) (1 diff)
- branches/streaming-rework/src/bebob/bebob_avdevice.cpp (modified) (1 diff)
- branches/streaming-rework/src/bebob/bebob_avdevice.h (modified) (1 diff)
- branches/streaming-rework/src/bounce/bounce_avdevice.cpp (modified) (1 diff)
- branches/streaming-rework/src/bounce/bounce_avdevice.h (modified) (1 diff)
- branches/streaming-rework/src/dice/dice_avdevice.cpp (modified) (4 diffs)
- branches/streaming-rework/src/dice/dice_avdevice.h (modified) (2 diffs)
- branches/streaming-rework/src/dice/dice_defines.h (added)
- branches/streaming-rework/src/freebob_streaming.cpp (modified) (2 diffs)
- branches/streaming-rework/src/iavdevice.h (modified) (13 diffs)
- branches/streaming-rework/src/libfreebobavc/ieee1394service.cpp (modified) (8 diffs)
- branches/streaming-rework/src/libfreebobavc/ieee1394service.h (modified) (3 diffs)
- branches/streaming-rework/src/maudio/maudio_avdevice.cpp (modified) (1 diff)
- branches/streaming-rework/src/maudio/maudio_avdevice.h (modified) (1 diff)
- branches/streaming-rework/src/metrichalo/mh_avdevice.cpp (modified) (1 diff)
- branches/streaming-rework/src/metrichalo/mh_avdevice.h (modified) (1 diff)
- branches/streaming-rework/src/motu/motu_avdevice.cpp (modified) (1 diff)
- branches/streaming-rework/src/motu/motu_avdevice.h (modified) (1 diff)
- branches/streaming-rework/src/rme/rme_avdevice.cpp (modified) (1 diff)
- branches/streaming-rework/src/rme/rme_avdevice.h (modified) (1 diff)
- branches/streaming-rework/src/threads.h (modified) (3 diffs)
- branches/streaming-rework/tests/Makefile.am (modified) (3 diffs)
- branches/streaming-rework/tests/test-freebob-cpp.cpp (added)
- branches/streaming-rework/tests/test-ieee1394service.cpp (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/streaming-rework/config.h.in
r406 r412 84 84 #undef const 85 85 86 /* Define to `unsigned int' if <sys/types.h> does not define. */86 /* Define to `unsigned' if <sys/types.h> does not define. */ 87 87 #undef size_t 88 88 branches/streaming-rework/src/bebob/bebob_avdevice.cpp
r408 r412 949 949 m_id=id; 950 950 return true; 951 } 952 953 bool 954 AvDevice::lock() { 955 956 return true; 957 } 958 959 960 bool 961 AvDevice::unlock() { 962 963 return true; 951 964 } 952 965 branches/streaming-rework/src/bebob/bebob_avdevice.h
r407 r412 73 73 74 74 virtual bool prepare(); 75 bool lock(); 76 bool unlock(); 75 77 76 78 virtual int startStreamByIndex(int i); branches/streaming-rework/src/bounce/bounce_avdevice.cpp
r407 r412 185 185 } 186 186 187 bool 188 BounceDevice::lock() { 189 190 return true; 191 } 192 193 194 bool 195 BounceDevice::unlock() { 196 197 return true; 198 } 199 187 200 void 188 201 BounceDevice::showDevice() const branches/streaming-rework/src/bounce/bounce_avdevice.h
r407 r412 66 66 67 67 virtual bool prepare(); 68 bool lock(); 69 bool unlock(); 68 70 69 71 virtual int getStreamCount(); branches/streaming-rework/src/dice/dice_avdevice.cpp
r407 r412 21 21 22 22 #include "dice/dice_avdevice.h" 23 #include "dice/dice_defines.h" 24 23 25 #include "configrom.h" 24 25 26 #include "libfreebobavc/ieee1394service.h" 26 #include "lib freebobavc/avc_definitions.h"27 #include "libstreaming/AmdtpStreamProcessor.h" 27 28 28 29 #include "debugmodule/debugmodule.h" … … 32 33 #include <assert.h> 33 34 #include <netinet/in.h> 34 35 35 #include <libraw1394/csr.h> 36 36 37 #include "libstreaming/AmdtpStreamProcessor.h"38 37 39 38 namespace Dice { 40 39 41 IMPL_DEBUG_MODULE( DiceAvDevice, DiceAvDevice, DEBUG_LEVEL_ NORMAL);40 IMPL_DEBUG_MODULE( DiceAvDevice, DiceAvDevice, DEBUG_LEVEL_VERBOSE ); 42 41 43 42 // to define the supported devices … … 59 58 , m_iso_recv_channel ( -1 ) 60 59 , m_iso_send_channel ( -1 ) 61 62 60 { 63 61 setDebugLevel( verboseLevel ); … … 159 157 } 160 158 159 bool 160 DiceAvDevice::lock() { 161 162 return true; 163 } 164 165 166 bool 167 DiceAvDevice::unlock() { 168 169 return true; 170 } 171 161 172 int 162 173 DiceAvDevice::getStreamCount() { branches/streaming-rework/src/dice/dice_avdevice.h
r407 r412 1 /* mh_avdevice.h1 /* dice_avdevice.h 2 2 * Copyright (C) 2007 by Pieter Palmers 3 3 * … … 48 48 int nodeId, 49 49 int verboseLevel ); 50 virtual~DiceAvDevice();50 ~DiceAvDevice(); 51 51 52 52 static bool probe( ConfigRom& configRom ); 53 virtualbool discover();54 virtualConfigRom& getConfigRom() const;53 bool discover(); 54 ConfigRom& getConfigRom() const; 55 55 56 56 // obsolete, will be removed soon, unused 57 virtualbool addXmlDescription( xmlNodePtr deviceNode ) {return true;};57 bool addXmlDescription( xmlNodePtr deviceNode ) {return true;}; 58 58 59 v irtual void showDevice() const;59 void showDevice() const; 60 60 61 virtualbool setSamplingFrequency( ESamplingFrequency samplingFrequency );62 virtualint getSamplingFrequency( );61 bool setSamplingFrequency( ESamplingFrequency samplingFrequency ); 62 int getSamplingFrequency( ); 63 63 64 virtualbool setId(unsigned int id);64 bool setId(unsigned int id); 65 65 66 virtualint getStreamCount();67 virtualFreebobStreaming::StreamProcessor *getStreamProcessorByIndex(int i);66 int getStreamCount(); 67 FreebobStreaming::StreamProcessor *getStreamProcessorByIndex(int i); 68 68 69 virtual bool prepare(); 70 71 virtual int startStreamByIndex(int i); 72 virtual int stopStreamByIndex(int i); 69 bool prepare(); 70 71 bool lock(); 72 bool unlock(); 73 74 int startStreamByIndex(int i); 75 int stopStreamByIndex(int i); 73 76 74 77 signed int getIsoRecvChannel(void); branches/streaming-rework/src/freebob_streaming.cpp
r407 r412 125 125 assert(device); 126 126 127 debugOutput(DEBUG_LEVEL_VERBOSE, "Locking device (%p)\n", device); 128 129 if (!device->lock()) { 130 debugWarning("Could not lock device, skipping device (%p)!\n", device); 131 continue; 132 } 133 127 134 debugOutput(DEBUG_LEVEL_VERBOSE, "Setting samplerate to %d for (%p)\n", 128 135 dev->options.sample_rate, device); … … 181 188 182 189 void freebob_streaming_finish(freebob_device_t *dev) { 183 184 assert(dev); 185 186 delete dev->processorManager; 187 delete dev->m_deviceManager; 188 delete dev; 189 190 return; 190 unsigned int i=0; 191 192 assert(dev); 193 194 // iterate over the found devices 195 for(i=0;i<dev->m_deviceManager->getAvDeviceCount();i++) { 196 IAvDevice *device=dev->m_deviceManager->getAvDeviceByIndex(i); 197 assert(device); 198 199 debugOutput(DEBUG_LEVEL_VERBOSE, "Unlocking device (%p)\n", device); 200 201 if (!device->unlock()) { 202 debugWarning("Could not unlock device (%p)!\n", device); 203 } 204 } 205 206 delete dev->processorManager; 207 delete dev->m_deviceManager; 208 delete dev; 209 210 return; 191 211 } 192 212 branches/streaming-rework/src/iavdevice.h
r336 r412 34 34 \brief Interface that is to be implemented to support a device. 35 35 36 This interface should be used to implement freebob support for a specific device. 36 This interface should be used to implement freebob support 37 for a specific device. 37 38 38 39 */ … … 45 46 46 47 /** 47 * This is called by the probe function to discover & configure the device 48 * 48 * @brief This is called by the DeviceManager to discover & configure the device 49 49 * 50 50 * @return true if the device was discovered successfully … … 53 53 54 54 /** 55 * Set the samping frequency55 * @brief Set the samping frequency 56 56 * @param samplingFrequency 57 57 * @return true if successfull … … 59 59 virtual bool setSamplingFrequency( ESamplingFrequency samplingFrequency ) = 0; 60 60 /** 61 * get the samplingfrequency as an integer61 * @brief get the samplingfrequency as an integer 62 62 * @return the sampling frequency as integer 63 63 */ … … 65 65 66 66 /** 67 * This is called by the device manager to give the device 68 * a unique ID. 67 * @brief This is called by the device manager to give the device a unique ID. 69 68 * 70 69 * The purpose of this is to allow for unique port naming … … 96 95 97 96 /** 98 * Constructs an XML description of the device [obsolete]97 * @brief Constructs an XML description of the device [obsolete] 99 98 * 100 99 * this is a leftover from v1.0 and isn't used … … 108 107 109 108 /** 110 * Outputs the device configuration to stderr/stdout [debug helper]109 * @brief Outputs the device configuration to stderr/stdout [debug helper] 111 110 * 112 111 * This function prints out a (detailed) description of the … … 114 113 */ 115 114 virtual void showDevice() const = 0; 116 117 /** 118 * Prepare the device 119 * \todo when exactly is this called? and what should it do? 115 116 /** 117 * @brief Lock the device 118 * 119 * This is called by the streaming layer before we start manipulating 120 * and/or using the device. 121 * 122 * It should implement the mechanisms provided by the device to 123 * make sure that no other controller claims control of the device. 124 * 125 */ 126 virtual bool lock() = 0; 127 128 /** 129 * @brief Unlock the device 130 * 131 * This is called by the streaming layer after we finish manipulating 132 * and/or using the device. 133 * 134 * It should implement the mechanisms provided by the device to 135 * give up exclusive control of the device. 136 * 137 */ 138 virtual bool unlock() = 0; 139 140 /** 141 * @brief Prepare the device 142 * 143 * This is called by the streaming layer after the configuration 144 * parameters (e.g. sample rate) are set, and before 145 * getStreamProcessor[*] functions are called. 146 * 147 * It should be used to prepare the device's streamprocessors 148 * based upon the device's current configuration. Normally 149 * the streaming layer will not change the device's configuration 150 * after calling this function. 151 * 120 152 */ 121 153 virtual bool prepare() = 0; 122 154 123 /// 124 /** 125 * Returns the number of ISO streams implemented/used by this device 155 /** 156 * @brief Returns the number of ISO streams implemented/used by this device 126 157 * 127 158 * Most likely this is 2 streams, i.e. one transmit stream and one … … 135 166 * getStreamProcessorByIndex(i) should return a valid StreamProcessor 136 167 * for i=0 to i=getStreamCount()-1 137 * \note138 168 * 139 169 * @return … … 142 172 143 173 /** 144 * Returns the StreamProcessor object for the stream with index i 174 * @brief Returns the StreamProcessor object for the stream with index i 175 * 145 176 * \note a streamprocessor returned by getStreamProcessorByIndex(i) 146 177 * cannot be the same object as one returned by 147 178 * getStreamProcessorByIndex(j) if i isn't equal to j 148 * \note you could have two streamprocessors handling the same ISO 149 * channel if that's needed 179 * \note you cannot have two streamprocessors handling the same ISO 180 * channel (on the same port) 181 * 150 182 * \param i : Stream index 151 183 * \pre \ref i smaller than getStreamCount() … … 155 187 156 188 /** 157 * starts the stream with index i189 * @brief starts the stream with index i 158 190 * 159 191 * This function is called by the streaming layer when this stream should … … 162 194 * 163 195 * It returns the channel number that was assigned for this stream. 164 * 165 * For BeBoB's this implements the IEC61883 connection management procedure (CMP). 166 * This CMP is a way to negotiate the channel that should be used, the bandwidth 167 * consumed and to start the device's streaming mode. 168 * 169 * Note that this IEC61883 CMP is nescessary to allow multiple ISO devices on the bus, 170 * because otherwise there is no way to know what ISO channels are already in use. 171 * or is there? 172 * \note I wouldn't know how to assign channels for devices that don't implement 173 * IEC61883 CMP (like the Motu?). As long as there is only one device on the 174 * bus this is no problem and can be solved with static assignments. 196 * Channel allocation should be done using the allocation functions provided by the 197 * Ieee1394Service object that is passed in the constructor. 175 198 * 176 199 * \param i : Stream index … … 181 204 182 205 /** 183 * stops the stream with index \ref i206 * @brief stops the stream with index \ref i 184 207 * 185 208 * \param i : Stream index branches/streaming-rework/src/libfreebobavc/ieee1394service.cpp
r411 r412 28 28 #include <netinet/in.h> 29 29 30 #include "string.h"30 #include <string.h> 31 31 32 32 #include <iostream> … … 57 57 stopRHThread(); 58 58 59 for ( arm_mapping_vec_t::iterator it = m_arm_mappings.begin(); 60 it != m_arm_mappings.end(); 61 ++it ) 62 { 63 debugOutput(DEBUG_LEVEL_VERBOSE, "Unregistering ARM handler for 0x%016llX\n", (*it)->start); 64 int err=raw1394_arm_unregister(m_resetHandle, (*it)->start); 65 if (err) { 66 debugError(" Failed to unregister ARM handler for 0x%016llX\n", (*it)->start); 67 debugError(" Error: %s\n", strerror(errno)); 68 } else { 69 delete *it; 70 } 71 } 72 59 73 if ( m_handle ) { 60 74 raw1394_destroy_handle( m_handle ); 61 75 } 76 62 77 if ( m_resetHandle ) { 63 78 raw1394_destroy_handle( m_resetHandle ); … … 75 90 debugFatal("libraw1394 not compatible\n"); 76 91 } else { 77 debugFatal("Ieee1394Service::initialize: Could not get 1394 handle: %s ",92 debugFatal("Ieee1394Service::initialize: Could not get 1394 handle: %s\n", 78 93 strerror(errno) ); 79 94 debugFatal("Is ieee1394 and raw1394 driver loaded?\n"); … … 100 115 raw1394_set_bus_reset_handler( m_resetHandle, 101 116 this->resetHandlerLowLevel ); 117 118 m_default_arm_handler = raw1394_set_arm_tag_handler( m_resetHandle, 119 this->armHandlerLowLevel ); 102 120 startRHThread(); 103 121 … … 296 314 } 297 315 316 bool Ieee1394Service::registerARMrange(nodeaddr_t start, 317 size_t length, byte_t *initial_value, 318 arm_options_t access_rights, 319 arm_options_t notification_options, 320 arm_options_t client_transactions, 321 Functor* functor) { 322 debugOutput(DEBUG_LEVEL_VERBOSE, "Registering ARM handler for 0x%016llX, length %u\n", start,length); 323 324 arm_mapping_t *new_mapping=NULL; 325 new_mapping = new arm_mapping_t; 326 327 new_mapping->start=start; 328 new_mapping->length=length; 329 new_mapping->access_rights=access_rights; 330 new_mapping->notification_options=notification_options; 331 new_mapping->client_transactions=client_transactions; 332 new_mapping->functor=functor; 333 334 int err=raw1394_arm_register(m_resetHandle, start, 335 length, initial_value, (octlet_t)new_mapping, 336 access_rights, 337 notification_options, 338 client_transactions); 339 if (err) { 340 debugError("Failed to register ARM handler for 0x%016llX\n", start); 341 debugError(" Error: %s\n", strerror(errno)); 342 delete new_mapping; 343 return false; 344 } 345 346 m_arm_mappings.push_back( new_mapping ); 347 348 return true; 349 } 350 351 bool Ieee1394Service::unregisterARMrange( nodeaddr_t start ) { 352 debugOutput(DEBUG_LEVEL_VERBOSE, "Unregistering ARM handler for 0x%016llX\n", start); 353 354 for ( arm_mapping_vec_t::iterator it = m_arm_mappings.begin(); 355 it != m_arm_mappings.end(); 356 ++it ) 357 { 358 if((*it)->start == start) { 359 int err=raw1394_arm_unregister(m_resetHandle, start); 360 if (err) { 361 debugError("Failed to unregister ARM handler for 0x%016llX\n", start); 362 debugError(" Error: %s\n", strerror(errno)); 363 } else { 364 m_arm_mappings.erase(it); 365 delete *it; 366 return true; 367 } 368 } 369 } 370 debugOutput(DEBUG_LEVEL_VERBOSE, " no handler found!\n"); 371 372 return false; 373 } 374 375 int 376 Ieee1394Service::armHandlerLowLevel(raw1394handle_t handle, 377 unsigned long arm_tag, 378 byte_t request_type, unsigned int requested_length, 379 void *data) 380 { 381 Ieee1394Service* instance 382 = (Ieee1394Service*) raw1394_get_userdata( handle ); 383 instance->armHandler( arm_tag, request_type, requested_length, data ); 384 385 return 0; 386 } 387 388 bool 389 Ieee1394Service::armHandler( unsigned long arm_tag, 390 byte_t request_type, unsigned int requested_length, 391 void *data) 392 { 393 for ( arm_mapping_vec_t::iterator it = m_arm_mappings.begin(); 394 it != m_arm_mappings.end(); 395 ++it ) 396 { 397 if((*it) == (arm_mapping_t *)arm_tag) { 398 debugOutput(DEBUG_LEVEL_VERBOSE,"ARM handler for address 0x%016llX called\n", (*it)->start); 399 Functor* func = (*it)->functor; 400 ( *func )(); 401 return true; 402 } 403 } 404 405 debugOutput(DEBUG_LEVEL_VERBOSE,"default ARM handler called\n"); 406 407 m_default_arm_handler(m_resetHandle, arm_tag, request_type, requested_length, data ); 408 return true; 409 } 410 298 411 bool 299 412 Ieee1394Service::startRHThread() … … 344 457 Ieee1394Service::addBusResetHandler( Functor* functor ) 345 458 { 459 debugOutput(DEBUG_LEVEL_VERBOSE, "Adding busreset handler (%p)\n", functor); 346 460 m_busResetHandlers.push_back( functor ); 347 461 return true; … … 351 465 Ieee1394Service::remBusResetHandler( Functor* functor ) 352 466 { 467 debugOutput(DEBUG_LEVEL_VERBOSE, "Removing busreset handler (%p)\n", functor); 468 353 469 for ( reset_handler_vec_t::iterator it = m_busResetHandlers.begin(); 354 470 it != m_busResetHandlers.end(); … … 356 472 { 357 473 if ( *it == functor ) { 474 debugOutput(DEBUG_LEVEL_VERBOSE, " found\n"); 358 475 m_busResetHandlers.erase( it ); 359 476 return true; 360 477 } 361 478 } 479 debugOutput(DEBUG_LEVEL_VERBOSE, " not found\n"); 362 480 return false; 363 481 } branches/streaming-rework/src/libfreebobavc/ieee1394service.h
r408 r412 125 125 bool addBusResetHandler( Functor* functor ); 126 126 bool remBusResetHandler( Functor* functor ); 127 128 /** 129 * @brief register an AddressRangeMapping 130 * 131 * @param start identifies addressrange 132 * @param length identifies addressrange length 133 * @param initial_value pointer to buffer containing (if necessary) initial value 134 * NULL means undefined 135 * @param access_rights access-rights for registered addressrange handled 136 * by kernel-part. Value is one or more binary or of the 137 * following flags - ARM_READ, ARM_WRITE, ARM_LOCK 138 * @param notification_options identifies for which type of request you want 139 * to be notified. Value is one or more binary or of the 140 * following flags - ARM_READ, ARM_WRITE, ARM_LOCK 141 * @param client_transactions identifies for which type of request you want 142 * to handle the request by the client application. 143 * for those requests no response will be generated, but 144 * has to be generated by the application. 145 * Value is one or more binary or of the 146 * following flags - ARM_READ, ARM_WRITE, ARM_LOCK 147 * For each bit set here, notification_options and 148 * access_rights will be ignored. 149 * @param functor the function to call when this range is written to 150 * 151 * @return true on success or false on failure 152 **/ 153 154 bool registerARMrange(nodeaddr_t start, 155 size_t length, byte_t *initial_value, 156 arm_options_t access_rights, 157 arm_options_t notification_options, 158 arm_options_t client_transactions, 159 Functor* functor); 160 161 /** 162 * @brief unregister ARM range 163 * @param start identifies addressrange 164 * @return true if successful, false otherwise 165 */ 166 bool unregisterARMrange( nodeaddr_t start ); 127 167 128 168 // ISO channel stuff … … 166 206 167 207 static int resetHandlerLowLevel( raw1394handle_t handle, 168 208 unsigned int generation ); 169 209 bool resetHandler( unsigned int generation ); 210 211 static int armHandlerLowLevel(raw1394handle_t handle, unsigned long arm_tag, 212 byte_t request_type, unsigned int requested_length, 213 void *data); 214 bool armHandler( unsigned long arm_tag, 215 byte_t request_type, unsigned int requested_length, 216 void *data); 170 217 171 218 raw1394handle_t m_handle; … … 181 228 reset_handler_vec_t m_busResetHandlers; 182 229 230 // ARM stuff 231 arm_tag_handler_t m_default_arm_handler; 232 233 typedef struct arm_mapping { 234 nodeaddr_t start; 235 size_t length; 236 arm_options_t access_rights; 237 arm_options_t notification_options; 238 arm_options_t client_transactions; 239 Functor* functor; 240 } arm_mapping_t; 241 242 typedef std::vector< arm_mapping_t* > arm_mapping_vec_t; 243 arm_mapping_vec_t m_arm_mappings; 244 183 245 DECLARE_DEBUG_MODULE; 184 246 }; branches/streaming-rework/src/maudio/maudio_avdevice.cpp
r407 r412 136 136 } 137 137 138 bool 139 AvDevice::lock() { 140 141 return true; 142 } 143 144 145 bool 146 AvDevice::unlock() { 147 148 return true; 149 } 138 150 139 151 void branches/streaming-rework/src/maudio/maudio_avdevice.h
r407 r412 61 61 62 62 virtual bool prepare(); 63 bool lock(); 64 bool unlock(); 65 63 66 64 67 virtual int startStreamByIndex(int i); branches/streaming-rework/src/metrichalo/mh_avdevice.cpp
r407 r412 144 144 } 145 145 146 bool 147 MHAvDevice::lock() { 148 149 return true; 150 } 151 152 153 bool 154 MHAvDevice::unlock() { 155 156 return true; 157 } 158 146 159 void 147 160 MHAvDevice::showDevice() const branches/streaming-rework/src/metrichalo/mh_avdevice.h
r407 r412 69 69 70 70 virtual bool prepare(); 71 bool lock(); 72 bool unlock(); 71 73 72 74 virtual int startStreamByIndex(int i); branches/streaming-rework/src/motu/motu_avdevice.cpp
r409 r412 308 308 } 309 309 310 bool 311 MotuDevice::lock() { 312 313 return true; 314 } 315 316 317 bool 318 MotuDevice::unlock() { 319 320 return true; 321 } 322 310 323 void 311 324 MotuDevice::showDevice() const branches/streaming-rework/src/motu/motu_avdevice.h
r407 r412 116 116 117 117 virtual bool prepare(); 118 118 bool lock(); 119 bool unlock(); 120 119 121 virtual int startStreamByIndex(int i); 120 122 virtual int stopStreamByIndex(int i); branches/streaming-rework/src/rme/rme_avdevice.cpp
r408 r412 169 169 } 170 170 171 bool 172 RmeDevice::lock() { 173 174 return true; 175 } 176 177 178 bool 179 RmeDevice::unlock() { 180 181 return true; 182 } 183 171 184 void 172 185 RmeDevice::showDevice() const branches/streaming-rework/src/rme/rme_avdevice.h
r407 r412 70 70 71 71 virtual bool prepare(); 72 bool lock(); 73 bool unlock(); 72 74 73 75 virtual int startStreamByIndex(int i); branches/streaming-rework/src/threads.h
r336 r412 41 41 public: 42 42 MemberFunctor0( const CalleePtr& pCallee, 43 44 43 MemFunPtr pMemFun, 44 bool bDelete = true ) 45 45 : m_pCallee( pCallee ) 46 46 , m_pMemFun( pMemFun ) 47 48 47 , m_pSem( 0 ) 48 , m_bDelete( bDelete ) 49 49 {} 50 50 51 51 MemberFunctor0( const CalleePtr& pCallee, 52 53 54 52 MemFunPtr pMemFun, 53 sem_t* pSem, 54 bool bDelete = true ) 55 55 : m_pCallee( pCallee ) 56 56 , m_pMemFun( pMemFun ) 57 58 57 , m_pSem( pSem ) 58 , m_bDelete( bDelete ) 59 59 {} 60 60 … … 63 63 64 64 virtual void operator() () 65 { 66 67 68 69 70 71 72 73 65 { 66 ( ( *m_pCallee ).*m_pMemFun )(); 67 if ( m_pSem ) { 68 sem_post( m_pSem); 69 } 70 if (m_bDelete) { 71 delete this; 72 } 73 } 74 74 75 75 private: … … 86 86 public: 87 87 MemberFunctor1( const CalleePtr& pCallee, 88 89 90 88 MemFunPtr pMemFun, 89 Parm0 parm0, 90 bool bDelete = true) 91 91 : m_pCallee( pCallee ) 92 92 , m_pMemFun( pMemFun ) 93 94 95 93 , m_parm0( parm0 ) 94 , m_pSem( 0 ) 95 , m_bDelete( bDelete ) 96 96 {} 97 97 98 98 MemberFunctor1( const CalleePtr& pCallee, 99 100 101 102 99 MemFunPtr pMemFun, 100 Parm0 parm0, 101 sem_t* pSem, 102 bool bDelete = true ) 103 103 : m_pCallee( pCallee ) 104 104 , m_pMemFun( pMemFun ) 105 106 107 105 , m_parm0( parm0 ) 106 , m_pSem( 0 ) 107 , m_bDelete( bDelete ) 108 108 {} 109 109 virtual ~MemberFunctor1() 110 110 {} 111 111 112 112 virtual void operator() () 113 {114 115 116 117 118 119 120 121 113 { 114 ( ( *m_pCallee ).*m_pMemFun )( m_parm0 ); 115 if ( m_pSem ) { 116 sem_post( m_pSem); 117 } 118 if (m_bDelete) { 119 delete this; 120 } 121 } 122 122 123 123 private: branches/streaming-rework/tests/Makefile.am
r407 r412 19 19 20 20 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src $(LIBXML_CFLAGS) \ 21 $(LIBAVC1394_CFLAGS) 21 $(LIBAVC1394_CFLAGS) $(LIBXMLCPP_CFLAGS) 22 22 23 23 noinst_PROGRAMS = 24 24 25 25 if BUILD_TESTS 26 noinst_PROGRAMS += test-freebob test- extplugcmd test-fw410 freebob-server \26 noinst_PROGRAMS += test-freebob test-freebob-cpp test-extplugcmd test-fw410 freebob-server \ 27 27 test-volume test-mixer test-cycletimer test-sytmonitor \ 28 test-timestampedbuffer 28 test-timestampedbuffer test-ieee1394service 29 29 endif 30 30 … … 33 33 test_freebob_SOURCES = test-freebob.c 34 34 test_freebob_LDADD = $(top_builddir)/src/libfreebob.la \ 35 $(LIBXML_LIBS) $(LIBAVC1394_LIBS) $(LIBIEC61883_LIBS) 36 37 test_freebob_cpp_SOURCES = test-freebob-cpp.cpp 38 test_freebob_cpp_LDADD = $(top_builddir)/src/libfreebob.la \ 35 39 $(LIBXML_LIBS) $(LIBAVC1394_LIBS) $(LIBIEC61883_LIBS) 36 40 … … 49 53 test_fw410_SOURCES = test-fw410.cpp 50 54 test_fw410_LDADD = $(LIBAVC1394_LIBS) $(LIBIEC61883_LIBS) -lrom1394 55 56 test_ieee1394service_SOURCES = test-ieee1394service.cpp 57 test_ieee1394service_LDADD = $(top_builddir)/src/libfreebob.la \ 58 $(LIBAVC1394_LIBS) $(LIBIEC61883_LIBS) -lrom1394 51 59 52 60 freebob_server_SOURCES = freebob-server.c