Changeset 265
- Timestamp:
- 06/15/06 16:57:46 (16 years ago)
- Files:
-
- branches/libfreebob-2.0/src/devicemanager.cpp (modified) (2 diffs)
- branches/libfreebob-2.0/src/libstreaming/AmdtpStreamProcessor.cpp (modified) (4 diffs)
- branches/libfreebob-2.0/src/libstreaming/freebob_streaming.cpp (modified) (3 diffs)
- branches/libfreebob-2.0/src/libstreaming/MotuPort.h (modified) (3 diffs)
- branches/libfreebob-2.0/src/libstreaming/MotuPortInfo.h (modified) (4 diffs)
- branches/libfreebob-2.0/src/libstreaming/MotuStreamProcessor.cpp (modified) (7 diffs)
- branches/libfreebob-2.0/src/libstreaming/StreamProcessor.cpp (modified) (1 diff)
- branches/libfreebob-2.0/src/libstreaming/StreamProcessor.h (modified) (1 diff)
- branches/libfreebob-2.0/src/libstreaming/StreamProcessorManager.cpp (modified) (1 diff)
- branches/libfreebob-2.0/src/motu/motu_avdevice.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/libfreebob-2.0/src/devicemanager.cpp
r264 r265 39 39 #define BEBOB_AVCDEVICE_UNIT_VERSION 0x10001 40 40 41 // The vendor ID for MOTU devices 42 #define MOTU_VENDOR_ID 0x000001f2 43 41 44 using namespace std; 42 45 … … 196 199 DeviceManager::probeMotu(Ieee1394Service& service, ConfigRom& configRom, int id, int level) 197 200 { 198 IAvDevice* avDevice = new Motu::MotuDevice( service, id, level ); 201 IAvDevice* avDevice; 202 203 // Do a first-pass test to see if it's likely that this device is a MOTU 204 if (configRom.getUnitSpecifierId() != MOTU_VENDOR_ID) { 205 debugOutput( DEBUG_LEVEL_VERBOSE, "Not a MOTU device...\n"); 206 return NULL; 207 } 208 209 avDevice = new Motu::MotuDevice( service, id, level ); 199 210 if ( !avDevice ) { 200 211 return NULL; 201 212 } 202 213 203 // MOTU's discover() needs to differentiate between different models, 204 // so for now keep all probing code in there since it's very intermingled. 205 // The code is robust in the event that the device isn't a MOTU, so 206 // at this stage there seems no reason to do otherwise. 214 // MOTU's discover() needs to differentiate between different models, so 215 // for now keep all probing code in there since it's very intermingled. 216 // By this point it's fairly certain that we are dealing with a MOTU but 217 // in any case the code is robust in the event that the device isn't a 218 // MOTU, so at this stage there seems no reason to do otherwise. 207 219 if ( !avDevice->discover() ) { 208 220 debugOutput( DEBUG_LEVEL_VERBOSE, "Not a MOTU device...\n"); branches/libfreebob-2.0/src/libstreaming/AmdtpStreamProcessor.cpp
r263 r265 276 276 enum raw1394_iso_disposition retval = RAW1394_ISO_OK; 277 277 278 int read_size=nevents*sizeof(quadlet_t)*m_dimension;278 unsigned int read_size=nevents*sizeof(quadlet_t)*m_dimension; 279 279 280 280 if ((freebob_ringbuffer_read(m_event_buffer,(char *)(data+8),read_size)) < … … 379 379 { 380 380 return true; 381 //return (m_framecounter > (int)m_period);381 //return (m_framecounter > m_period); 382 382 } 383 383 … … 1194 1194 // therefore we first check if this is ok 1195 1195 1196 if(m_framecounter > (int)m_period) {1196 if(m_framecounter > m_period) { 1197 1197 // we make this signed, because this can be < 0 1198 1198 unsigned int m_last_timestamp_ticks = CYCLE_COUNTER_TO_TICKS(m_last_timestamp); … … 1266 1266 } 1267 1267 #else 1268 if(m_framecounter > (int)m_period) {1268 if(m_framecounter > m_period) { 1269 1269 return true; 1270 1270 } else return false; branches/libfreebob-2.0/src/libstreaming/freebob_streaming.cpp
r250 r265 69 69 70 70 freebob_device_t *freebob_streaming_init (freebob_device_info_t *device_info, freebob_options_t options) { 71 int i=0;71 unsigned int i=0; 72 72 73 73 struct _freebob_device *dev = new struct _freebob_device; … … 169 169 170 170 int freebob_streaming_start(freebob_device_t *dev) { 171 int i=0;171 unsigned int i=0; 172 172 debugOutput(DEBUG_LEVEL_VERBOSE,"------------- Start -------------\n"); 173 173 … … 194 194 195 195 int freebob_streaming_stop(freebob_device_t *dev) { 196 int i;196 unsigned int i; 197 197 debugOutput(DEBUG_LEVEL_VERBOSE,"------------- Stop -------------\n"); 198 198 branches/libfreebob-2.0/src/libstreaming/MotuPort.h
r246 r265 52 52 MotuAudioPort(std::string name, 53 53 enum E_Direction direction, 54 int position) 54 int position, 55 int size) 55 56 : AudioPort(name, direction), 56 MotuPortInfo(name, position ) // TODO: add more port information parameters here if nescessary57 MotuPortInfo(name, position, size) // TODO: add more port information parameters here if nescessary 57 58 {}; 58 59 … … 78 79 int position) 79 80 : MidiPort(name, direction), 80 MotuPortInfo(name, position ) // TODO: add more port information parameters here if nescessary81 MotuPortInfo(name, position, 16) // TODO: add more port information parameters here if nescessary 81 82 {}; 82 83 … … 103 104 int position) 104 105 : ControlPort(name, direction), 105 MotuPortInfo(name, position ) // TODO: add more port information parameters here if nescessary106 MotuPortInfo(name, position, 16) // TODO: add more port information parameters here if nescessary 106 107 {}; 107 108 branches/libfreebob-2.0/src/libstreaming/MotuPortInfo.h
r246 r265 51 51 * If all channels always have the same format, you won't be needing this 52 52 */ 53 /* 54 enum E_Formats { 55 E_MBLA, // Multibit linear audio, is acutally AMDTP. Change if needed 56 E_Midi, 57 E_SPDIF, 58 }; 59 */ 53 // enum E_Formats { 54 // E_MBLA, // Multibit linear audio 55 // E_Midi, // MIDI 56 // }; 60 57 61 58 /** … … 66 63 * the name parameter is mandatory 67 64 * 68 * @param name 69 * @param position example parameter 65 * @param name Port name 66 * @param position Start position of port's data in iso event 67 * @param format Format of data in iso event 68 * @param size Size in bits of port's data in iso event 70 69 * @return 71 70 */ 72 MotuPortInfo(std::string name, int position )73 : m_name(name), m_position(position) 71 MotuPortInfo(std::string name, int position, int size) 72 : m_name(name), m_position(position), m_size(size) 74 73 {}; 75 74 virtual ~MotuPortInfo() {}; … … 78 77 std::string getName() {return m_name;}; 79 78 int getPosition() {return m_position;}; 79 int getSize() {return m_size;}; 80 80 81 81 protected: … … 83 83 84 84 int m_position; 85 int m_size; 85 86 86 87 }; branches/libfreebob-2.0/src/libstreaming/MotuStreamProcessor.cpp
r253 r265 104 104 // note: an 'event' is one sample from all channels + possibly other midi and control data 105 105 int nevents=0; // TODO: determine 106 int read_size=nevents*m_dimension*sizeof(quadlet_t); // assumes each channel takes one quadlet106 unsigned int read_size=nevents*m_dimension*sizeof(quadlet_t); // assumes each channel takes one quadlet 107 107 108 108 // we read the packet data from a ringbuffer, because of efficiency … … 164 164 // this implementation just waits until there is one period of samples 165 165 // transmitted from the buffer 166 return (m_framecounter > (int)m_period);166 return (m_framecounter > m_period); 167 167 } 168 168 … … 342 342 // we received one period of frames 343 343 // this is period_size*dimension of events 344 int events2write=m_period*m_dimension;345 int bytes2write=events2write*sizeof(quadlet_t);344 unsigned int events2write=m_period*m_dimension; 345 unsigned int bytes2write=events2write*sizeof(quadlet_t); 346 346 347 347 /* write events2write bytes to the ringbuffer … … 353 353 * Make sure that we cannot end up on a non-cluster aligned position! 354 354 */ 355 int cluster_size=m_dimension*sizeof(quadlet_t);355 unsigned int cluster_size=m_dimension*sizeof(quadlet_t); 356 356 357 357 while(bytes2write>0) { … … 732 732 // this implementation just waits until there is one period of samples 733 733 // received into the buffer 734 if(m_framecounter > (int)m_period) {734 if(m_framecounter > m_period) { 735 735 return true; 736 736 } … … 871 871 // this is period_size*dimension of events 872 872 873 int events2read=m_period*m_dimension;874 int bytes2read=events2read*sizeof(quadlet_t);873 unsigned int events2read=m_period*m_dimension; 874 unsigned int bytes2read=events2read*sizeof(quadlet_t); 875 875 /* read events2read bytes from the ringbuffer 876 876 * first see if it can be done in one read. … … 881 881 * Make sure that we cannot end up on a non-cluster aligned position! 882 882 */ 883 int cluster_size=m_dimension*sizeof(quadlet_t);883 unsigned int cluster_size=m_dimension*sizeof(quadlet_t); 884 884 885 885 while(bytes2read>0) { branches/libfreebob-2.0/src/libstreaming/StreamProcessor.cpp
r255 r265 42 42 : IsoStream(type, port) 43 43 , m_nb_buffers(0) 44 , m_manager(0)45 44 , m_period(0) 46 45 , m_xruns(0) 47 46 , m_framecounter(0) 48 47 , m_framerate(framerate) 48 , m_manager(0) 49 49 , m_running(false) 50 50 , m_disabled(true) branches/libfreebob-2.0/src/libstreaming/StreamProcessor.h
r263 r265 121 121 122 122 unsigned int m_xruns; 123 int m_framecounter;123 unsigned int m_framecounter; 124 124 125 125 unsigned int m_framerate; branches/libfreebob-2.0/src/libstreaming/StreamProcessorManager.cpp
r253 r265 497 497 498 498 bool StreamProcessorManager::waitForPeriod() { 499 int ret; 499 500 500 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "enter...\n"); 501 501 branches/libfreebob-2.0/src/motu/motu_avdevice.cpp
r262 r265 226 226 buff, 227 227 FreebobStreaming::Port::E_Capture, 228 0, 228 229 0 // you can add all other port specific stuff you 229 230 // need to pass by extending MotuXXXPort and MotuPortInfo … … 319 320 buff, 320 321 FreebobStreaming::Port::E_Playback, 322 0, 321 323 0 // you can add all other port specific stuff you 322 324 // need to pass by extending MotuXXXPort and MotuPortInfo