Changeset 905

Show
Ignore:
Timestamp:
03/06/08 01:05:31 (13 years ago)
Author:
ppalmers
Message:

convert some const values into defines

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/config.h.in

    r904 r905  
    8686#define TIMESTAMPEDBUFFER_DLL_BANDWIDTH                     (0.01) 
    8787 
     88// -- AMDTP options -- // 
     89 
    8890// in ticks 
    8991// as per AMDTP2.1: 
     
    110112#define AMDTP_CLIP_FLOATS                                   1 
    111113 
     114// -- MOTU options -- // 
    112115 
     116// the transfer delay is substracted from the ideal presentation 
     117// time to obtain a corrected presentation time. This values is 
     118// then used to stamp the packet and determine the transmission 
     119// time instant. 
    113120#define MOTU_TRANSMIT_TRANSFER_DELAY    (11776U) 
    114121 
     122// the absolute minimum number of cycles we want to transmit 
     123// a packet ahead of the presentation time. The nominal time 
     124// the packet is transmitted ahead of the presentation time is 
     125// given by MOTU_TRANSMIT_TRANSFER_DELAY (in ticks), but in case we 
     126// are too late for that, this constant defines how late we can 
     127// be. 
     128#define MOTU_MIN_CYCLES_BEFORE_PRESENTATION                1 
     129 
     130// the absolute maximum number of cycles we want to transmit 
     131// a packet ahead of the ideal transmit time. The nominal time 
     132// the packet is transmitted ahead of the presentation time is 
     133// given by MOTU_TRANSMIT_TRANSFER_DELAY (in ticks), but we can send 
     134// packets early if we want to. 
     135#define MOTU_MAX_CYCLES_TO_TRANSMIT_EARLY                  6 
     136 
    115137#endif // CONFIG_H 
  • trunk/libffado/src/libstreaming/motu/MotuTransmitStreamProcessor.cpp

    r873 r905  
    100100    int cycles_until_transmit; 
    101101 
    102     // FIXME: should become a define 
    103     // the absolute minimum number of cycles we want to transmit 
    104     // a packet ahead of the presentation time. The nominal time 
    105     // the packet is transmitted ahead of the presentation time is 
    106     // given by MOTU_TRANSMIT_TRANSFER_DELAY (in ticks), but in case we 
    107     // are too late for that, this constant defines how late we can 
    108     // be. 
    109     const int min_cycles_before_presentation = 1; 
    110     // FIXME: should become a define 
    111     // the absolute maximum number of cycles we want to transmit 
    112     // a packet ahead of the ideal transmit time. The nominal time 
    113     // the packet is transmitted ahead of the presentation time is 
    114     // given by MOTU_TRANSMIT_TRANSFER_DELAY (in ticks), but we can send 
    115     // packets early if we want to. (not completely according to spec) 
    116     const int max_cycles_to_transmit_early = 2; 
    117  
    118102    debugOutput ( DEBUG_LEVEL_ULTRA_VERBOSE, "Try for cycle %d\n", cycle ); 
    119103    // check whether the packet buffer has packets for us to send. 
     
    168152        // we can still postpone the queueing of the packets 
    169153        // if we are far enough ahead of the presentation time 
    170         if ( cycles_until_presentation <= min_cycles_before_presentation
     154        if ( cycles_until_presentation <= MOTU_MIN_CYCLES_BEFORE_PRESENTATION
    171155        { 
    172156            debugOutput ( DEBUG_LEVEL_VERBOSE, 
     
    217201            // NOTE: dangerous since the device has no way of reporting that it didn't get 
    218202            //       this packet on time. 
    219             if(cycles_until_presentation >= min_cycles_before_presentation
     203            if(cycles_until_presentation >= MOTU_MIN_CYCLES_BEFORE_PRESENTATION
    220204            { 
    221205                // we are not that late and can still try to transmit the packet 
     
    230214            } 
    231215        } 
    232         else if(cycles_until_transmit <= max_cycles_to_transmit_early
     216        else if(cycles_until_transmit <= MOTU_MAX_CYCLES_TO_TRANSMIT_EARLY
    233217        { 
    234218            // it's time send the packet 
     
    247231                        presentation_time, ( unsigned int ) TICKS_TO_CYCLES ( presentation_time ) ); 
    248232#ifdef DEBUG 
    249             if ( cycles_until_transmit > max_cycles_to_transmit_early + 1 ) 
     233            if ( cycles_until_transmit > MOTU_MAX_CYCLES_TO_TRANSMIT_EARLY + 1 ) 
    250234            { 
    251235                debugOutput ( DEBUG_LEVEL_VERY_VERBOSE,