Changeset 410

Show
Ignore:
Timestamp:
02/20/07 15:06:00 (15 years ago)
Author:
jwoithe
Message:

MOTU: rough fixups towards restoring functionality under the new streaming framework. It is not yet functional.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/streaming-rework/src/libstreaming/MotuStreamProcessor.cpp

    r407 r410  
    282282                // appears to do rounding. 
    283283 
     284float ticks_per_frame = m_SyncSource->m_data_buffer->getRate(); 
    284285                for (i=0; i<n_events; i++, quadlet += dbs) { 
    285                         *quadlet = htonl( TICKS_TO_CYCLE_TIMER(ts) ); 
     286                        unsigned int ts_frame = ts; 
     287                        ts_frame += (unsigned int)((float)i * ticks_per_frame); 
     288                        *quadlet = htonl( TICKS_TO_CYCLE_TIMER(ts_frame) ); 
    286289                } 
    287290 
     
    581584    } 
    582585     
    583     uint64_t ts_head= now_secs*TICKS_PER_SECOND; 
    584     ts_head+=time_to_enable_at*TICKS_PER_CYCLE; 
     586//    uint64_t ts_head= now_secs*TICKS_PER_SECOND; 
     587    uint64_t ts_head = time_to_enable_at*TICKS_PER_CYCLE; 
    585588     
    586589    // we also add the nb of cycles we transmit in advance 
     
    959962 
    960963        //=> convert the SYT to a full timestamp in ticks 
    961         m_last_timestamp=sytRecvToFullTicks((uint32_t)ntohl(*(quadlet_t *)(data+8)),  
    962                                         cycle, m_handler->getCycleTimer()); 
     964//        m_last_timestamp=sytRecvToFullTicks((uint32_t)ntohl(*(quadlet_t *)(data+8)),  
     965//                                        cycle, m_handler->getCycleTimer()); 
     966//*** 
     967// FIXME: it given that we later advance this to be the timestamp of the sample immediately following 
     968// this packet, it perhaps makes more sense to acquire the timestamp of the last frame in the packet. 
     969// Then it's just a matter of adding m_ticks_per_frame rather than frame_size times this. 
     970uint32_t first_sph = ntohl(*(quadlet_t *)(data+8)); 
     971//        m_last_timestamp = ((first_sph & 0x1fff000)>>12)*3072 + (first_sph & 0xfff); 
     972        m_last_timestamp = CYCLE_TIMER_TO_TICKS(first_sph & 0x1ffffff); 
    963973 
    964974                // Signal that we're running