Changeset 766

Show
Ignore:
Timestamp:
12/23/07 07:19:15 (13 years ago)
Author:
ppalmers
Message:

introduce local references to frequently used objects

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp

    r750 r766  
    4545unsigned int 
    4646AmdtpReceiveStreamProcessor::getSytInterval() { 
    47     switch (m_Parent.getDeviceManager().getStreamProcessorManager().getNominalRate()) { 
     47    switch (m_StreamProcessorManager.getNominalRate()) { 
    4848        case 32000: 
    4949        case 44100: 
     
    5757            return 32; 
    5858        default: 
    59             debugError("Unsupported rate: %d\n", m_Parent.getDeviceManager().getStreamProcessorManager().getNominalRate()); 
     59            debugError("Unsupported rate: %d\n", m_StreamProcessorManager.getNominalRate()); 
    6060            return 0; 
    6161    } 
     
    9393                  (length >= 2*sizeof(quadlet_t)); 
    9494    if(ok) { 
    95         uint64_t now = m_Parent.get1394Service().getCycleTimer(); 
     95        uint64_t now = m_1394service.getCycleTimer(); 
    9696        //=> convert the SYT to a full timestamp in ticks 
    9797        m_last_timestamp = sytRecvToFullTicks((uint32_t)ntohs(packet->syt), 
  • trunk/libffado/src/libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp

    r753 r766  
    6060    /* Our node ID can change after a bus reset, so it is best to fetch 
    6161    * our node ID for each packet. */ 
    62     packet->sid = m_Parent.get1394Service().getLocalNodeId() & 0x3f; 
     62    packet->sid = m_1394service.getLocalNodeId() & 0x3f; 
    6363 
    6464    packet->dbs = m_dimension; 
     
    165165                        "Insufficient frames (NP): N=%02d, CY=%04u, TC=%04u, CUT=%04d\n", 
    166166                        fc, cycle, transmit_at_cycle, cycles_until_transmit ); 
     167            debugWarning( "Insufficient frames (NP): N=%02d, CY=%04u, TC=%04u, CUT=%04d\n", 
     168                          fc, cycle, transmit_at_cycle, cycles_until_transmit ); 
    167169            // there is still time left to send the packet 
    168170            // we want the system to give this packet another go at a later time instant 
     
    294296    /* Our node ID can change after a bus reset, so it is best to fetch 
    295297    * our node ID for each packet. */ 
    296     packet->sid = m_Parent.get1394Service().getLocalNodeId() & 0x3f; 
     298    packet->sid = m_1394service.getLocalNodeId() & 0x3f; 
    297299 
    298300    packet->dbs = m_dimension; 
     
    365367unsigned int 
    366368AmdtpTransmitStreamProcessor::getSytInterval() { 
    367     switch (m_Parent.getDeviceManager().getStreamProcessorManager().getNominalRate()) { 
     369    switch (m_StreamProcessorManager.getNominalRate()) { 
    368370        case 32000: 
    369371        case 44100: 
     
    377379            return 32; 
    378380        default: 
    379             debugError("Unsupported rate: %d\n", m_Parent.getDeviceManager().getStreamProcessorManager().getNominalRate()); 
     381            debugError("Unsupported rate: %d\n", m_StreamProcessorManager.getNominalRate()); 
    380382            return 0; 
    381383    } 
     
    383385unsigned int 
    384386AmdtpTransmitStreamProcessor::getFDF() { 
    385     switch (m_Parent.getDeviceManager().getStreamProcessorManager().getNominalRate()) { 
     387    switch (m_StreamProcessorManager.getNominalRate()) { 
    386388        case 32000: return IEC61883_FDF_SFC_32KHZ; 
    387389        case 44100: return IEC61883_FDF_SFC_44K1HZ; 
     
    392394        case 192000: return IEC61883_FDF_SFC_192KHZ; 
    393395        default: 
    394             debugError("Unsupported rate: %d\n", m_Parent.getDeviceManager().getStreamProcessorManager().getNominalRate()); 
     396            debugError("Unsupported rate: %d\n", m_StreamProcessorManager.getNominalRate()); 
    395397            return 0; 
    396398    } 
     
    407409        IEC61883_FMT_AMDTP, 
    408410        m_fdf, 
    409         m_Parent.getDeviceManager().getStreamProcessorManager().getNominalRate(), 
     411        m_StreamProcessorManager.getNominalRate(), 
    410412        m_dimension, 
    411413        m_syt_interval ); 
  • trunk/libffado/src/libstreaming/generic/StreamProcessor.cpp

    r763 r766  
    4646    , m_cycle_to_switch_state( 0 ) 
    4747    , m_Parent( parent ) 
     48    , m_1394service( parent.get1394Service() ) // local cache 
     49    , m_IsoHandlerManager( parent.get1394Service().getIsoHandlerManager() ) // local cache 
     50    , m_StreamProcessorManager( m_Parent.getDeviceManager().getStreamProcessorManager() ) // local cache 
    4851    , m_channel( -1 ) 
    4952    , m_dropped(0) 
     
    6265 
    6366StreamProcessor::~StreamProcessor() { 
    64     m_Parent.getDeviceManager().getStreamProcessorManager().unregisterProcessor(this); 
    65     if(!m_Parent.get1394Service().getIsoHandlerManager().unregisterStream(this)) { 
     67    m_StreamProcessorManager.unregisterProcessor(this); 
     68    if(!m_IsoHandlerManager.unregisterStream(this)) { 
    6669        debugOutput(DEBUG_LEVEL_VERBOSE,"Could not unregister stream processor with the Iso manager\n"); 
    6770    } 
     
    7275 
    7376uint64_t StreamProcessor::getTimeNow() { 
    74     return m_Parent.get1394Service().getCycleTimerTicks(); 
     77    return m_1394service.getCycleTimerTicks(); 
    7578} 
    7679 
    7780int StreamProcessor::getMaxFrameLatency() { 
    7881    if (getType() == ePT_Receive) { 
    79         return (int)(m_Parent.get1394Service().getIsoHandlerManager().getPacketLatencyForStream( this ) * TICKS_PER_CYCLE); 
     82        return (int)(m_IsoHandlerManager.getPacketLatencyForStream( this ) * TICKS_PER_CYCLE); 
    8083    } else { 
    81         return (int)(m_Parent.get1394Service().getIsoHandlerManager().getPacketLatencyForStream( this ) * TICKS_PER_CYCLE); 
     84        return (int)(m_IsoHandlerManager.getPacketLatencyForStream( this ) * TICKS_PER_CYCLE); 
    8285    } 
    8386} 
     
    8790{ 
    8891    unsigned int nominal_frames_per_second  
    89                     = m_Parent.getDeviceManager().getStreamProcessorManager().getNominalRate(); 
     92                    = m_StreamProcessorManager.getNominalRate(); 
    9093    uint64_t nominal_ticks_per_frame = TICKS_PER_SECOND / nominal_frames_per_second; 
    9194    uint64_t nominal_ticks = nominal_ticks_per_frame * nframes; 
     
    97100StreamProcessor::getPacketsPerPeriod() 
    98101{ 
    99     return getNominalPacketsNeeded(m_Parent.getDeviceManager().getStreamProcessorManager().getPeriodSize()); 
    100 
    101  
     102    return getNominalPacketsNeeded(m_StreamProcessorManager.getPeriodSize()); 
     103
     104 
     105unsigned int 
     106StreamProcessor::getNbPacketsIsoXmitBuffer() 
     107
     108    return (getPacketsPerPeriod() * 1000)/1000; 
     109
    102110 
    103111/*********************************************** 
     
    105113 ***********************************************/ 
    106114void StreamProcessor::flush() { 
    107     m_Parent.get1394Service().getIsoHandlerManager().flushHandlerForStream(this); 
     115    m_IsoHandlerManager.flushHandlerForStream(this); 
    108116} 
    109117 
     
    125133    // pass before these packets are processed. Adding this extra term makes that 
    126134    // the period boundary is signalled later 
    127     time_at_period = addTicks(time_at_period, m_Parent.getDeviceManager().getStreamProcessorManager().getSyncSource().getSyncDelay()); 
    128  
    129     uint64_t cycle_timer=m_Parent.get1394Service().getCycleTimerTicks(); 
     135    time_at_period = addTicks(time_at_period, m_StreamProcessorManager.getSyncSource().getSyncDelay()); 
     136 
     137    uint64_t cycle_timer=m_1394service.getCycleTimerTicks(); 
    130138 
    131139    // calculate the time until the next period 
     
    145153void 
    146154StreamProcessor::setSyncDelay(int d) { 
    147     debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "Setting SP %p SyncDelay to %d ticks\n", this, d); 
     155    debugOutput(DEBUG_LEVEL_ULTRA_VERBOSE, "Setting SP %p SyncDelay to %d ticks\n", this, d); 
    148156    m_sync_delay = d; 
    149157} 
     
    159167{ 
    160168    if (getType() == ePT_Receive) { 
    161         ffado_timestamp_t next_period_boundary=m_data_buffer->getTimestampFromHead(m_Parent.getDeviceManager().getStreamProcessorManager().getPeriodSize()); 
     169        ffado_timestamp_t next_period_boundary=m_data_buffer->getTimestampFromHead(m_StreamProcessorManager.getPeriodSize()); 
    162170     
    163171        #ifdef DEBUG 
     
    172180        return (uint64_t)next_period_boundary; 
    173181    } else { 
    174         ffado_timestamp_t next_period_boundary=m_data_buffer->getTimestampFromTail((m_Parent.getDeviceManager().getStreamProcessorManager().getNbBuffers()-1) * m_Parent.getDeviceManager().getStreamProcessorManager().getPeriodSize()); 
     182        ffado_timestamp_t next_period_boundary=m_data_buffer->getTimestampFromTail((m_StreamProcessorManager.getNbBuffers()-1) * m_StreamProcessorManager.getPeriodSize()); 
    175183     
    176184        #ifdef DEBUG 
     
    243251            m_dropped += dropped_cycles; 
    244252            m_in_xrun = true; 
     253            //flushDebugOutput(); 
     254            //assert(0); 
    245255        } 
    246256    } 
     
    349359                // this is an xrun situation 
    350360                m_in_xrun = true; 
    351                 debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state to WaitingForStreamDisable due to dropped packet xrun\n"); 
     361                debugWarning("Should update state to WaitingForStreamDisable due to dropped packet xrun\n"); 
    352362                m_cycle_to_switch_state = cycle + 1; // switch in the next cycle 
    353363                m_next_state = ePS_WaitingForStreamDisable; 
     
    368378        // allow for the xrun to be picked up 
    369379        if (result2 == eCRV_XRun) { 
     380            debugWarning("processPacketData xrun\n"); 
    370381            m_in_xrun = true; 
    371382            debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state to WaitingForStreamDisable due to data xrun\n"); 
     
    421432            debugWarning("(%p) dropped %d packets on cycle %u (last_cycle=%u, dropped=%d)\n", this, dropped_cycles, cycle, m_last_cycle, dropped); 
    422433            m_dropped += dropped_cycles; 
     434//             flushDebugOutput(); 
     435//             assert(0); 
    423436        } 
    424437    } 
     
    444457    // we the packet we are constructing will be sent out 
    445458    // on 'cycle', not 'now'. 
    446     unsigned int ctr = m_Parent.get1394Service().getCycleTimer(); 
     459    unsigned int ctr = m_1394service.getCycleTimer(); 
    447460    int now_cycles = (int)CYCLE_TIMER_GET_CYCLES(ctr); 
    448461 
     
    455468        debugWarning("Requesting packet for cycle %04d which is in the past (now=%04dcy)\n", 
    456469            cycle, now_cycles); 
     470        if(m_state == ePS_Running) { 
     471            debugShowBackLogLines(200); 
     472//             flushDebugOutput(); 
     473//             assert(0); 
     474        } 
    457475    } 
    458476    #endif 
     
    538556            // allow for the xrun to be picked up 
    539557            if (result2 == eCRV_XRun) { 
     558                debugWarning("generatePacketData xrun\n"); 
     559                m_in_xrun = true; 
    540560                debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state to WaitingForStreamDisable due to data xrun\n"); 
    541                 m_in_xrun = true; 
    542561                m_cycle_to_switch_state = cycle+1; // switch in the next cycle 
    543562                m_next_state = ePS_WaitingForStreamDisable; 
     
    556575                return RAW1394_ISO_OK; 
    557576        } else if (result == eCRV_XRun) { // pick up the possible xruns 
     577            debugWarning("generatePacketHeader xrun\n"); 
     578            m_in_xrun = true; 
    558579            debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state to WaitingForStreamDisable due to header xrun\n"); 
    559             m_in_xrun = true; 
    560580            m_cycle_to_switch_state = cycle+1; // switch in the next cycle 
    561581            m_next_state = ePS_WaitingForStreamDisable; 
     
    565585                return RAW1394_ISO_ERROR; 
    566586            } 
    567         } else if ((result == eCRV_EmptyPacket) || (result == eCRV_Again)) { 
     587        } else if (result == eCRV_EmptyPacket) { 
    568588            if(m_state != m_next_state) { 
    569589                debugOutput(DEBUG_LEVEL_VERBOSE, "Should update state from %s to %s\n", 
     
    587607                } 
    588608            } 
    589             //force some delay 
    590             usleep(125); 
     609            //usleep(125); // only when using thread per handler mode! 
    591610            return RAW1394_ISO_AGAIN; 
    592611        } else { 
     
    612631    generateSilentPacketHeader(data, length, tag, sy, cycle, dropped_cycles, max_length); 
    613632    generateSilentPacketData(data, length, tag, sy, cycle, dropped_cycles, max_length); 
    614     return RAW1394_ISO_DEFER
     633    return RAW1394_ISO_OK
    615634} 
    616635 
     
    641660    // use the ts parameter. It specifies the time of the block's  
    642661    // last sample. 
    643     float srate = m_Parent.getDeviceManager().getStreamProcessorManager().getSyncSource().getTicksPerFrame(); 
     662    float srate = m_StreamProcessorManager.getSyncSource().getTicksPerFrame(); 
    644663    assert(srate != 0.0); 
    645664    int64_t this_block_length_in_ticks = (int64_t)(((float)nbframes) * srate); 
     
    827846    debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "init...\n"); 
    828847 
    829     if(!m_Parent.get1394Service().getIsoHandlerManager().registerStream(this)) { 
     848    if(!m_IsoHandlerManager.registerStream(this)) { 
    830849        debugOutput(DEBUG_LEVEL_VERBOSE,"Could not register stream processor with the Iso manager\n"); 
    831850        return false; 
    832851    } 
    833     if(!m_Parent.getDeviceManager().getStreamProcessorManager().registerProcessor(this)) { 
     852    if(!m_StreamProcessorManager.registerProcessor(this)) { 
    834853        debugOutput(DEBUG_LEVEL_VERBOSE,"Could not register stream processor with the SP manager\n"); 
    835854        return false; 
     
    847866 
    848867    // make the scratch buffer one period of frames long 
    849     m_scratch_buffer_size_bytes = m_Parent.getDeviceManager().getStreamProcessorManager().getPeriodSize() * getEventsPerFrame() * getEventSize(); 
     868    m_scratch_buffer_size_bytes = m_StreamProcessorManager.getPeriodSize() * getEventsPerFrame() * getEventSize(); 
    850869    debugOutput( DEBUG_LEVEL_VERBOSE, " Allocate scratch buffer of %d quadlets\n"); 
    851870    if(m_scratch_buffer) delete[] m_scratch_buffer; 
     
    863882    debugOutput( DEBUG_LEVEL_VERBOSE, "Prepared for:\n"); 
    864883    debugOutput( DEBUG_LEVEL_VERBOSE, " Samplerate: %d\n", 
    865              m_Parent.getDeviceManager().getStreamProcessorManager().getNominalRate()); 
     884             m_StreamProcessorManager.getNominalRate()); 
    866885    debugOutput( DEBUG_LEVEL_VERBOSE, " PeriodSize: %d, NbBuffers: %d\n", 
    867              m_Parent.getDeviceManager().getStreamProcessorManager().getPeriodSize(), m_Parent.getDeviceManager().getStreamProcessorManager().getNbBuffers()); 
     886             m_StreamProcessorManager.getPeriodSize(), m_StreamProcessorManager.getNbBuffers()); 
    868887    debugOutput( DEBUG_LEVEL_VERBOSE, " Port: %d, Channel: %d\n", 
    869              m_Parent.get1394Service().getPort(), m_channel); 
     888             m_1394service.getPort(), m_channel); 
    870889 
    871890    // initialization can be done without requesting it 
     
    904923    uint64_t tx; 
    905924    if (t < 0) { 
    906         tx = addTicks(m_Parent.get1394Service().getCycleTimerTicks(), 200 * TICKS_PER_CYCLE); 
     925        tx = addTicks(m_1394service.getCycleTimerTicks(), 200 * TICKS_PER_CYCLE); 
    907926    } else { 
    908927        tx = t; 
     
    911930 
    912931    debugOutput(DEBUG_LEVEL_VERBOSE,"for %s SP (%p)\n", ePTToString(getType()), this); 
    913     uint64_t now = m_Parent.get1394Service().getCycleTimerTicks(); 
     932    uint64_t now = m_1394service.getCycleTimerTicks(); 
    914933    debugOutput(DEBUG_LEVEL_VERBOSE,"  Now                   : %011llu (%03us %04uc %04ut)\n", 
    915934                          now, 
     
    923942                          (unsigned int)TICKS_TO_OFFSET(tx)); 
    924943    if (m_state == ePS_Stopped) { 
    925         if(!m_Parent.get1394Service().getIsoHandlerManager().startHandlerForStream( 
     944        if(!m_IsoHandlerManager.startHandlerForStream( 
    926945                                        this, TICKS_TO_CYCLES(start_handler_ticks))) { 
    927946            debugError("Could not start handler for SP %p\n", this); 
     
    940959    uint64_t tx; 
    941960    if (t < 0) { 
    942         tx = addTicks(m_Parent.get1394Service().getCycleTimerTicks(), 200 * TICKS_PER_CYCLE); 
     961        tx = addTicks(m_1394service.getCycleTimerTicks(), 200 * TICKS_PER_CYCLE); 
    943962    } else { 
    944963        tx = t; 
    945964    } 
    946965    debugOutput(DEBUG_LEVEL_VERBOSE,"for %s SP (%p)\n", ePTToString(getType()), this); 
    947     uint64_t now = m_Parent.get1394Service().getCycleTimerTicks(); 
     966    uint64_t now = m_1394service.getCycleTimerTicks(); 
    948967    debugOutput(DEBUG_LEVEL_VERBOSE,"  Now                   : %011llu (%03us %04uc %04ut)\n", 
    949968                          now, 
     
    962981    uint64_t tx; 
    963982    if (t < 0) { 
    964         tx = addTicks(m_Parent.get1394Service().getCycleTimerTicks(), 200 * TICKS_PER_CYCLE); 
     983        tx = addTicks(m_1394service.getCycleTimerTicks(), 200 * TICKS_PER_CYCLE); 
    965984    } else { 
    966985        tx = t; 
    967986    } 
    968987    debugOutput(DEBUG_LEVEL_VERBOSE,"for %s SP (%p)\n", ePTToString(getType()), this); 
    969     uint64_t now = m_Parent.get1394Service().getCycleTimerTicks(); 
     988    uint64_t now = m_1394service.getCycleTimerTicks(); 
    970989    debugOutput(DEBUG_LEVEL_VERBOSE,"  Now                   : %011llu (%03us %04uc %04ut)\n", 
    971990                          now, 
     
    9851004    uint64_t tx; 
    9861005    if (t < 0) { 
    987         tx = addTicks(m_Parent.get1394Service().getCycleTimerTicks(), 200 * TICKS_PER_CYCLE); 
     1006        tx = addTicks(m_1394service.getCycleTimerTicks(), 200 * TICKS_PER_CYCLE); 
    9881007    } else { 
    9891008        tx = t; 
    9901009    } 
    9911010    debugOutput(DEBUG_LEVEL_VERBOSE,"for %s SP (%p)\n", ePTToString(getType()), this); 
    992     uint64_t now = m_Parent.get1394Service().getCycleTimerTicks(); 
     1011    uint64_t now = m_1394service.getCycleTimerTicks(); 
    9931012    debugOutput(DEBUG_LEVEL_VERBOSE,"  Now                   : %011llu (%03us %04uc %04ut)\n", 
    9941013                          now, 
     
    10711090{ 
    10721091    float ticks_per_frame; 
    1073     unsigned int ringbuffer_size_frames = (m_Parent.getDeviceManager().getStreamProcessorManager().getNbBuffers() + 1) * m_Parent.getDeviceManager().getStreamProcessorManager().getPeriodSize(); 
     1092    unsigned int ringbuffer_size_frames = (m_StreamProcessorManager.getNbBuffers() + 1) * m_StreamProcessorManager.getPeriodSize(); 
    10741093 
    10751094    debugOutput(DEBUG_LEVEL_VERBOSE, "Enter from state: %s\n", ePSToString(m_state)); 
     
    10831102 
    10841103            // prepare the framerate estimate 
    1085             ticks_per_frame = (TICKS_PER_SECOND*1.0) / ((float)m_Parent.getDeviceManager().getStreamProcessorManager().getNominalRate()); 
     1104            ticks_per_frame = (TICKS_PER_SECOND*1.0) / ((float)m_StreamProcessorManager.getNominalRate()); 
    10861105            m_ticks_per_frame = ticks_per_frame; 
    10871106            debugOutput(DEBUG_LEVEL_VERBOSE,"Initializing remote ticks/frame to %f\n", ticks_per_frame); 
     
    10951114                result &= m_data_buffer->setUpdatePeriod( getNominalFramesPerPacket() ); 
    10961115            } else { 
    1097                 result &= m_data_buffer->setUpdatePeriod( m_Parent.getDeviceManager().getStreamProcessorManager().getPeriodSize() ); 
     1116                result &= m_data_buffer->setUpdatePeriod( m_StreamProcessorManager.getPeriodSize() ); 
    10981117            } 
    10991118            result &= m_data_buffer->setNominalRate(ticks_per_frame); 
     
    11091128            { 
    11101129                debugOutput(DEBUG_LEVEL_VERBOSE, "Setting up port %s\n",(*it)->getName().c_str()); 
    1111                 if(!(*it)->setBufferSize(m_Parent.getDeviceManager().getStreamProcessorManager().getPeriodSize())) { 
    1112                     debugFatal("Could not set buffer size to %d\n",m_Parent.getDeviceManager().getStreamProcessorManager().getPeriodSize()); 
     1130                if(!(*it)->setBufferSize(m_StreamProcessorManager.getPeriodSize())) { 
     1131                    debugFatal("Could not set buffer size to %d\n",m_StreamProcessorManager.getPeriodSize()); 
    11131132                    return false; 
    11141133                } 
     
    11641183            break; 
    11651184        case ePS_DryRunning: 
    1166             if(!m_Parent.get1394Service().getIsoHandlerManager().stopHandlerForStream(this)) { 
     1185            if(!m_IsoHandlerManager.stopHandlerForStream(this)) { 
    11671186                debugError("Could not stop handler for SP %p\n", this); 
    11681187                return false; 
     
    12931312            } 
    12941313            if (getType() == ePT_Transmit) { 
    1295                 ringbuffer_size_frames = m_Parent.getDeviceManager().getStreamProcessorManager().getNbBuffers() * m_Parent.getDeviceManager().getStreamProcessorManager().getPeriodSize(); 
     1314                ringbuffer_size_frames = m_StreamProcessorManager.getNbBuffers() * m_StreamProcessorManager.getPeriodSize(); 
    12961315                debugOutput(DEBUG_LEVEL_VERBOSE, "Prefill transmit SP %p with %u frames\n", this, ringbuffer_size_frames); 
    12971316                // prefill the buffer 
     
    15721591{ 
    15731592    debugOutputShort( DEBUG_LEVEL_NORMAL, " StreamProcessor %p information\n", this); 
    1574     debugOutputShort( DEBUG_LEVEL_NORMAL, "  Port, Channel  : %d, %d\n", m_Parent.get1394Service().getPort(), m_channel); 
     1593    debugOutputShort( DEBUG_LEVEL_NORMAL, "  Port, Channel  : %d, %d\n", m_1394service.getPort(), m_channel); 
    15751594    debugOutputShort( DEBUG_LEVEL_NORMAL, "  StreamProcessor info:\n"); 
    1576     uint64_t now = m_Parent.get1394Service().getCycleTimerTicks(); 
     1595    uint64_t now = m_1394service.getCycleTimerTicks(); 
    15771596    debugOutputShort( DEBUG_LEVEL_NORMAL, "  Now                   : %011llu (%03us %04uc %04ut)\n", 
    15781597                        now, 
     
    15851604    debugOutputShort( DEBUG_LEVEL_NORMAL, "    transition at       : %u\n", m_cycle_to_switch_state); 
    15861605    debugOutputShort( DEBUG_LEVEL_NORMAL, "  Buffer                : %p\n", m_data_buffer); 
    1587     debugOutputShort( DEBUG_LEVEL_NORMAL, "  Nominal framerate     : %u\n", m_Parent.getDeviceManager().getStreamProcessorManager().getNominalRate()); 
     1606    debugOutputShort( DEBUG_LEVEL_NORMAL, "  Nominal framerate     : %u\n", m_StreamProcessorManager.getNominalRate()); 
    15881607    debugOutputShort( DEBUG_LEVEL_NORMAL, "  Device framerate      : Sync: %f, Buffer %f\n", 
    1589         24576000.0/m_Parent.getDeviceManager().getStreamProcessorManager().getSyncSource().m_data_buffer->getRate(), 
     1608        24576000.0/m_StreamProcessorManager.getSyncSource().m_data_buffer->getRate(), 
    15901609        24576000.0/m_data_buffer->getRate() 
    15911610        ); 
  • trunk/libffado/src/libstreaming/generic/StreamProcessor.h

    r753 r766  
    3636 
    3737#include <pthread.h> 
     38 
     39class Ieee1394Service; 
     40class IsoHandlerManager; 
    3841 
    3942namespace Streaming { 
     
    5255                        public Util::OptionContainer 
    5356{ 
    54     friend class StreamProcessorManager; // FIXME: get rid of this 
    55  
    5657public: 
    5758    ///> the streamprocessor type 
     
    133134    virtual ~StreamProcessor(); 
    134135protected: 
    135     FFADODevice&    m_Parent; 
     136    FFADODevice&                m_Parent; 
     137    Ieee1394Service&            m_1394service; 
     138    IsoHandlerManager&          m_IsoHandlerManager; 
     139    StreamProcessorManager&     m_StreamProcessorManager; 
    136140 
    137141public: // the public receive/transmit functions 
     
    256260    bool transferSilence(unsigned int size); 
    257261 
     262public: 
    258263    // move to private? 
    259264    bool xrunOccurred() { return m_in_xrun; }; 
     
    265270        {m_channel = c; return true;}; 
    266271 
    267     virtual unsigned int getNbPacketsIsoXmitBuffer() 
    268         {return (getPacketsPerPeriod() * 750)/1000;}; 
     272    virtual unsigned int getNbPacketsIsoXmitBuffer(); 
    269273    virtual unsigned int getPacketsPerPeriod(); 
    270274    virtual unsigned int getMaxPacketSize() = 0; 
  • trunk/libffado/src/libstreaming/StreamProcessorManager.cpp

    r759 r766  
    712712    xrun_occurred = false; 
    713713    while (!ready_for_transfer && !xrun_occurred) { 
     714        // FIXME: can deadlock when the iso handlers die (e.g. unplug the device) 
    714715        ready_for_transfer = true; 
    715716        for ( StreamProcessorVectorIterator it = m_ReceiveProcessors.begin();