- Timestamp:
- 01/05/08 11:38:26 (15 years ago)
- Files:
-
- branches/api-cleanup/src/ffado.cpp (modified) (2 diffs)
- branches/api-cleanup/src/libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp (modified) (1 diff)
- branches/api-cleanup/src/libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp (modified) (2 diffs)
- branches/api-cleanup/src/libstreaming/generic/Port.cpp (modified) (2 diffs)
- branches/api-cleanup/src/libstreaming/generic/PortManager.cpp (modified) (3 diffs)
- branches/api-cleanup/src/libstreaming/generic/StreamProcessor.cpp (modified) (1 diff)
- branches/api-cleanup/tests/streaming/teststreaming3.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/api-cleanup/src/ffado.cpp
r809 r811 184 184 if(!dev->m_deviceManager->prepareStreaming()) { 185 185 debugFatal("Could not prepare the streaming system\n"); 186 return 0;186 return -1; 187 187 } 188 188 return 0; … … 405 405 406 406 int ffado_streaming_set_capture_stream_buffer(ffado_device_t *dev, int i, char *buff) { 407 408 409 410 411 412 407 Streaming::Port *p = dev->m_deviceManager->getStreamProcessorManager().getPortByIndex(i, Streaming::Port::E_Capture); 408 // use an assert here performancewise, 409 // it should already have failed before, if not correct 410 assert(p); 411 p->setBufferAddress((void *)buff); 412 return 0; 413 413 } 414 414 415 415 int ffado_streaming_set_playback_stream_buffer(ffado_device_t *dev, int i, char *buff) { 416 417 418 419 420 421 422 } 416 Streaming::Port *p = dev->m_deviceManager->getStreamProcessorManager().getPortByIndex(i, Streaming::Port::E_Playback); 417 // use an assert here performancewise, 418 // it should already have failed before, if not correct 419 assert(p); 420 p->setBufferAddress((void *)buff); 421 return 0; 422 } branches/api-cleanup/src/libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp
r809 r811 421 421 sample_int=(sample_int >> 16) & 0x000000FF; 422 422 sample_int |= 0x01000000; // flag that there is a midi event present 423 *buffer = sample_int; 423 424 } 424 *buffer = sample_int;425 425 buffer += 8; // skip 8 frames 426 426 } branches/api-cleanup/src/libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp
r809 r811 656 656 debugError("bad type: %d\n", p->getDataType()); 657 657 return -1; 658 case Port::E_Midi :658 case Port::E_MidiEvent: 659 659 { 660 660 quadlet_t *buffer = (quadlet_t *)(p->getBufferAddress()); … … 734 734 debugError("bad type: %d\n", p->getDataType()); 735 735 return -1; 736 case Port::E_Midi: 737 { 738 assert(nevents + offset <= p->getBufferSize()); 736 case Port::E_MidiEvent: 737 { 739 738 for ( j = location; j < nevents; j += 8 ) 740 739 { branches/api-cleanup/src/libstreaming/generic/Port.cpp
r809 r811 49 49 50 50 Port::~Port() { 51 debugOutput( DEBUG_LEVEL_VERBOSE, "deleting port %s\n", getName().c_str()); 51 52 m_manager.unregisterPort(this); 52 53 } … … 66 67 } 67 68 68 if (m_buffersize ==0) {69 if (m_buffersize == 0) { 69 70 debugFatal("Cannot initialize a port with buffersize=0\n"); 71 return false; 72 } 73 74 if (m_buffer == NULL) { 75 debugFatal("Cannot initialize a port with no attached buffer\n"); 70 76 return false; 71 77 } branches/api-cleanup/src/libstreaming/generic/PortManager.cpp
r809 r811 40 40 41 41 PortManager::~PortManager() { 42 flushDebugOutput(); 42 43 // delete all ports that are still registered to the manager 43 44 for ( PortVectorIterator it = m_Ports.begin(); … … 45 46 ++it ) 46 47 { 47 delete *it; 48 debugOutput( DEBUG_LEVEL_VERBOSE, "deleting port %s at %p\n", (*it)->getName().c_str(), *it); 49 flushDebugOutput(); 50 delete *it; //FIXME 48 51 } 49 52 } … … 104 107 { 105 108 assert(port); 106 debugOutput( DEBUG_LEVEL_VERBOSE, " deleting port %s\n",port->getName().c_str());109 debugOutput( DEBUG_LEVEL_VERBOSE, "unregistering port %s\n",port->getName().c_str()); 107 110 108 111 for ( PortVectorIterator it = m_Ports.begin(); branches/api-cleanup/src/libstreaming/generic/StreamProcessor.cpp
r809 r811 88 88 debugOutput(DEBUG_LEVEL_VERBOSE,"Could not unregister stream processor with the Iso manager\n"); 89 89 } 90 sem_destroy(&m_signal_semaphore); 91 92 // FIXME: how do we ensure that nobody is using us? 90 93 91 94 if (m_data_buffer) delete m_data_buffer; 92 95 if (m_scratch_buffer) delete[] m_scratch_buffer; 93 sem_destroy(&m_signal_semaphore);94 96 } 95 97 branches/api-cleanup/tests/streaming/teststreaming3.cpp
r809 r811 354 354 case ffado_stream_type_midi: 355 355 ffado_streaming_set_playback_buffer_type(dev, i, ffado_buffer_type_midi); 356 ffado_streaming_set_playback_stream_buffer(dev, i, (char *)(audiobuffers_out[i])); 356 357 ffado_streaming_playback_stream_onoff(dev, i, 0); 357 358 default: … … 391 392 392 393 // start the streaming layer 393 ffado_streaming_prepare(dev); 394 if (ffado_streaming_prepare(dev)) { 395 debugFatal("Could not prepare streaming system\n"); 396 ffado_streaming_finish(dev); 397 return -1; 398 } 394 399 start_flag = ffado_streaming_start(dev); 395 400 … … 435 440 uint32_t midievent = *(midibuffer + idx); 436 441 if(midievent & 0xFF000000) { 437 debugOutput(DEBUG_LEVEL_NORMAL, " Received midi event %08X on idx %d of period%d\n",438 midievent, idx, nb_periods );442 debugOutput(DEBUG_LEVEL_NORMAL, " Received midi event %08X at idx %d of period %d on port %d\n", 443 midievent, idx, nb_periods, i); 439 444 } 440 445 }