Changeset 46
- Timestamp:
- 01/10/05 14:56:42 (19 years ago)
- Files:
-
- trunk/freebob/src/avdevice.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/freebob/src/avdevice.cpp
r43 r46 22 22 #include <libavc1394/avc1394_vcr.h> 23 23 #include "avdevice.h" 24 #include "avdevicepool.h" 24 25 #include "avdevicesubunit.h" 25 26 #include "avdeviceaudiosubunit.h" 26 27 #include "avdevicemusicsubunit.h" 28 29 #undef AVC1394_GET_RESPONSE_OPERAN 30 #define AVC1394_GET_RESPONSE_OPERAND(x, n) (((x) & (0xFF000000 >> (((n)%4)*8))) >> (((3-(n))%4)*8)) 27 31 28 32 AvDevice::AvDevice(octlet_t oGuid) … … 41 45 , m_iNbExtSourcePlugs( 0 ) 42 46 { 43 setDebugLevel( DEBUG_LEVEL_ALL ); 47 setDebugLevel( DEBUG_LEVEL_MODERATE ); 48 AvDevicePool::instance()->registerAvDevice( this ); 49 } 50 51 52 AvDevice::~AvDevice() 53 { 54 vector<AvDeviceSubunit *>::iterator it; 55 for( it = cSubUnits.begin(); it != cSubUnits.end(); it++ ) { 56 delete *it; 57 } 58 59 if ( m_handle ) { 60 raw1394_destroy_handle( m_handle ); 61 m_handle = 0; 62 } 63 AvDevicePool::instance()->unregisterAvDevice( this ); 44 64 } 45 65 … … 68 88 { 69 89 return m_bInitialised; 70 }71 72 AvDevice::~AvDevice()73 {74 vector<AvDeviceSubunit *>::iterator it;75 for( it = cSubUnits.begin(); it != cSubUnits.end(); it++ ) {76 delete *it;77 }78 79 if ( m_handle ) {80 raw1394_destroy_handle( m_handle );81 m_handle = 0;82 }83 90 } 84 91 … … 135 142 response = request; 136 143 if ( response ) { 137 138 144 m_iNbIsoDestinationPlugs 139 145 = AVC1394_GET_RESPONSE_OPERAND( response[1], 0 ); … … 144 150 m_iNbExtSourcePlugs 145 151 = AVC1394_GET_RESPONSE_OPERAND( response[1], 3 ); 146 147 /*148 m_iNbIsoDestinationPlugs = (unsigned char) ((response[1]>>24) & 0xff);149 m_iNbIsoSourcePlugs = (unsigned char) ((response[1]>>16) & 0xff);150 m_iNbExtDestinationPlugs = (unsigned char) ((response[1]>>8) & 0xff);151 m_iNbExtSourcePlugs = (unsigned char) ((response[1]>>0) & 0xff);152 */153 152 } 154 153 … … 159 158 | 0x01; 160 159 request[1] = 0xFFFFFFFF; 161 response = avcExecuteTransaction(request, 2, 2); 162 if (response != NULL) { 163 m_iNbAsyncDestinationPlugs= (unsigned char) ((response[1]>>24) & 0xff); 164 m_iNbAsyncSourcePlugs= (unsigned char) ((response[1]>>16) & 0xff); 160 response = avcExecuteTransaction( request, 2, 2 ); 161 if ( response != NULL ) { 162 m_iNbAsyncDestinationPlugs 163 = AVC1394_GET_RESPONSE_OPERAND( response[1], 0 ); 164 m_iNbAsyncSourcePlugs 165 = AVC1394_GET_RESPONSE_OPERAND( response[1], 1 ); 165 166 } 166 167