Changeset 709
- Timestamp:
- 11/04/07 10:47:05 (13 years ago)
- Files:
-
- branches/ppalmers-streaming/src/libstreaming/amdtp/AmdtpStreamProcessor.cpp (modified) (2 diffs)
- branches/ppalmers-streaming/src/libstreaming/amdtp/AmdtpStreamProcessor.h (modified) (2 diffs)
- branches/ppalmers-streaming/src/libstreaming/generic/StreamProcessor.cpp (modified) (1 diff)
- branches/ppalmers-streaming/src/libstreaming/generic/StreamProcessor.h (modified) (1 diff)
- branches/ppalmers-streaming/src/libstreaming/StreamProcessorManager.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/ppalmers-streaming/src/libstreaming/amdtp/AmdtpStreamProcessor.cpp
r707 r709 386 386 } 387 387 388 int AmdtpTransmitStreamProcessor::getMinimalSyncDelay() {389 return 0;390 }391 392 388 bool AmdtpTransmitStreamProcessor::prefill() { 393 389 … … 1036 1032 } 1037 1033 1038 // returns the delay between the actual (real) time of a timestamp as received,1039 // and the timestamp that is passed on for the same event. This is to cope with1040 // ISO buffering1041 int AmdtpReceiveStreamProcessor::getMinimalSyncDelay() {1042 return ((int)(m_handler->getWakeupInterval() * m_syt_interval * getTicksPerFrame()));1043 }1044 1045 1034 void AmdtpReceiveStreamProcessor::dumpInfo() { 1046 1035 StreamProcessor::dumpInfo(); branches/ppalmers-streaming/src/libstreaming/amdtp/AmdtpStreamProcessor.h
r707 r709 109 109 unsigned int getMaxPacketSize() {return 4 * (2 + m_syt_interval * m_dimension);}; 110 110 111 int getMinimalSyncDelay();112 113 111 protected: 114 112 bool processWriteBlock(char *data, unsigned int nevents, unsigned int offset); … … 197 195 198 196 void dumpInfo(); 199 200 int getMinimalSyncDelay();201 202 197 protected: 203 198 branches/ppalmers-streaming/src/libstreaming/generic/StreamProcessor.cpp
r707 r709 179 179 180 180 181 int StreamProcessor::getMaxFrameLatency() { 182 if (getType() == E_Receive) { 183 return (int)(m_handler->getWakeupInterval() * TICKS_PER_CYCLE); 184 } else { 185 return (int)(m_handler->getWakeupInterval() * TICKS_PER_CYCLE); 186 } 187 } 188 181 189 bool StreamProcessor::isRunning() { 182 190 return m_running; branches/ppalmers-streaming/src/libstreaming/generic/StreamProcessor.h
r707 r709 214 214 215 215 /** 216 * Returns the minimal sync delay a SP needs 217 * @return minimal sync delay 218 */ 219 virtual int getMinimalSyncDelay() = 0; 216 * @brief get the maximal frame latency 217 * 218 * The maximum frame latency is the maximum time that will elapse 219 * between the frame being received by the 1394 stack, and the moment this 220 * frame is presented to the StreamProcessor. 221 * 222 * For transmit SP's this is the maximum time that a frame is requested by 223 * the handler ahead of the time the frame is intended to be transmitted. 224 * 225 * This is useful to figure out how longer than the actual reception time 226 * we have to wait before trying to read the frame from the SP. 227 * 228 * @return maximal frame latency 229 */ 230 virtual int getMaxFrameLatency(); 220 231 221 232 bool setSyncSource(StreamProcessor *s); branches/ppalmers-streaming/src/libstreaming/StreamProcessorManager.cpp
r708 r709 320 320 } 321 321 322 // we want to make sure that everything is running well,323 // so wait for a while324 // usleep(USECS_PER_CYCLE * CYCLES_TO_SLEEP_AFTER_RUN_SIGNAL);325 326 322 debugOutput( DEBUG_LEVEL_VERBOSE, " StreamProcessor streams running...\n"); 327 323 324 // now find out how long we have to delay the wait operation such that 325 // the received frames will all be presented to the SP 328 326 debugOutput( DEBUG_LEVEL_VERBOSE, "Finding minimal sync delay...\n"); 329 330 327 int max_of_min_delay=0; 331 328 int min_delay=0; … … 333 330 it != m_ReceiveProcessors.end(); 334 331 ++it ) { 335 min_delay=(*it)->getM inimalSyncDelay();332 min_delay=(*it)->getMaxFrameLatency(); 336 333 if(min_delay>max_of_min_delay) max_of_min_delay=min_delay; 337 334 } 338 335 339 for ( StreamProcessorVectorIterator it = m_TransmitProcessors.begin(); 340 it != m_TransmitProcessors.end(); 341 ++it ) { 342 min_delay=(*it)->getMinimalSyncDelay(); 343 if(min_delay>max_of_min_delay) max_of_min_delay=min_delay; 344 } 345 346 debugOutput( DEBUG_LEVEL_VERBOSE, " %d ticks\n", max_of_min_delay); 336 debugOutput( DEBUG_LEVEL_VERBOSE, " %d ticks (%03us %04uc %04ut)...\n", 337 max_of_min_delay, 338 (unsigned int)TICKS_TO_SECS(max_of_min_delay), 339 (unsigned int)TICKS_TO_CYCLES(max_of_min_delay), 340 (unsigned int)TICKS_TO_OFFSET(max_of_min_delay)); 347 341 m_SyncSource->setSyncDelay(max_of_min_delay); 348 342