Changeset 747

Show
Ignore:
Timestamp:
11/29/07 13:56:38 (13 years ago)
Author:
ppalmers
Message:

- get rid of IsoStream? class since it's only overhead and doesn't really do anything specific. Most of it's functionality is going somewhere else anyway.

Files:

Legend:

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

    r742 r747  
    6161            return false; 
    6262    } 
    63  
    64     debugOutput( DEBUG_LEVEL_VERBOSE, "Prepared for:\n"); 
    65     debugOutput( DEBUG_LEVEL_VERBOSE, " Samplerate: %d, DBS: %d, SYT: %d\n", 
    66              m_manager->getNominalRate(), m_dimension, m_syt_interval); 
    67     debugOutput( DEBUG_LEVEL_VERBOSE, " PeriodSize: %d, NbBuffers: %d\n", 
    68              m_manager->getPeriodSize(), m_manager->getNbBuffers()); 
    69     debugOutput( DEBUG_LEVEL_VERBOSE, " Port: %d, Channel: %d\n", 
    70              m_port,m_channel); 
    71  
    7263    return true; 
    7364} 
     
    136127    #ifdef DEBUG 
    137128    if(isRunning()) { 
    138         debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"STMP: %lluticks | buff=%d, syt_interval=%d, tpf=%f\n", 
    139             m_last_timestamp, m_handler->getWakeupInterval(), m_syt_interval, getTicksPerFrame()); 
     129        debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"STMP: %lluticks | syt_interval=%d, tpf=%f\n", 
     130            m_last_timestamp, m_syt_interval, getTicksPerFrame()); 
    140131    } 
    141132    #endif 
  • trunk/libffado/src/libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp

    r742 r747  
    415415        } 
    416416    } 
    417  
    418     debugOutput ( DEBUG_LEVEL_VERBOSE, "Prepared for:\n" ); 
    419     debugOutput ( DEBUG_LEVEL_VERBOSE, " Samplerate: %d, FDF: %d, DBS: %d, SYT: %d\n", 
    420                 m_manager->getNominalRate(), m_fdf, m_dimension, m_syt_interval ); 
    421     debugOutput ( DEBUG_LEVEL_VERBOSE, " PeriodSize: %d, NbBuffers: %d\n", 
    422                 m_manager->getPeriodSize(), m_manager->getNbBuffers() ); 
    423     debugOutput ( DEBUG_LEVEL_VERBOSE, " Port: %d, Channel: %d\n", 
    424                 m_port,m_channel ); 
    425417    return true; 
    426418} 
  • trunk/libffado/src/libstreaming/generic/StreamProcessor.cpp

    r742 r747  
    3636 
    3737StreamProcessor::StreamProcessor(enum eProcessorType type, int port) 
    38     : IsoStream((type==ePT_Receive ? IsoStream::eST_Receive : IsoStream::eST_Transmit), port) 
    39     , m_processor_type ( type ) 
     38    : m_processor_type ( type ) 
     39    , m_channel( -1 ) 
     40    , m_port( port ) 
     41    , m_handler( NULL ) 
    4042    , m_state( ePS_Created ) 
    4143    , m_next_state( ePS_Invalid ) 
     
    8284    return nominal_packets; 
    8385} 
     86 
     87unsigned int 
     88StreamProcessor::getPacketsPerPeriod() 
     89{ 
     90    return getNominalPacketsNeeded(m_manager->getPeriodSize()); 
     91} 
     92 
    8493 
    8594/*********************************************** 
     
    820829        return false; 
    821830    } 
     831 
     832    debugOutput( DEBUG_LEVEL_VERBOSE, "Prepared for:\n"); 
     833    debugOutput( DEBUG_LEVEL_VERBOSE, " Samplerate: %d\n", 
     834             m_manager->getNominalRate()); 
     835    debugOutput( DEBUG_LEVEL_VERBOSE, " PeriodSize: %d, NbBuffers: %d\n", 
     836             m_manager->getPeriodSize(), m_manager->getNbBuffers()); 
     837    debugOutput( DEBUG_LEVEL_VERBOSE, " Port: %d, Channel: %d\n", 
     838             m_port,m_channel); 
    822839 
    823840    // initialization can be done without requesting it 
     
    15131530{ 
    15141531    debugOutputShort( DEBUG_LEVEL_NORMAL, " StreamProcessor %p information\n", this); 
    1515     debugOutputShort( DEBUG_LEVEL_NORMAL, "  Iso stream info:\n"); 
    1516  
    1517     IsoStream::dumpInfo(); 
     1532    debugOutputShort( DEBUG_LEVEL_NORMAL, "  Port, Channel  : %d, %d\n", m_port, m_channel); 
    15181533    debugOutputShort( DEBUG_LEVEL_NORMAL, "  StreamProcessor info:\n"); 
    15191534    if (m_handler) { 
     
    15421557StreamProcessor::setVerboseLevel(int l) { 
    15431558    setDebugLevel(l); 
    1544     IsoStream::setVerboseLevel(l); 
    15451559    PortManager::setVerboseLevel(l); 
    15461560    m_data_buffer->setVerboseLevel(l); 
  • trunk/libffado/src/libstreaming/generic/StreamProcessor.h

    r742 r747  
    2525#define __FFADO_STREAMPROCESSOR__ 
    2626 
    27 #include "IsoStream.h" 
    2827#include "PortManager.h" 
     28#include "../util/IsoHandler.h" 
    2929 
    3030#include "libutil/StreamStatistics.h" 
     
    4747 
    4848*/ 
    49 class StreamProcessor : public IsoStream, 
    50                         public PortManager, 
     49class StreamProcessor : public PortManager, 
    5150                        public Util::TimestampedBufferClient, 
    5251                        public Util::OptionContainer 
     
    251250    bool xrunOccurred() { return m_in_xrun; }; 
    252251 
     252// the ISO interface (can we get rid of this?) 
     253public: 
     254    int getChannel() {return m_channel;}; 
     255    bool setChannel(int c) 
     256        {m_channel = c; return true;}; 
     257    int getPort() {return m_port;}; 
     258    virtual unsigned int getPacketsPerPeriod(); 
     259    virtual unsigned int getMaxPacketSize() = 0; 
     260    // do we need the handler? 
     261    void setHandler( IsoHandler * h) {m_handler = h;}; 
     262    void clearHandler() {m_handler = NULL;}; 
     263 
     264private: 
     265    int m_channel; 
     266    int m_port; 
     267protected: 
     268    IsoHandler *m_handler; // needed for local id and cycle counter 
     269 
    253270protected: // FIXME: move to private 
    254271    uint64_t m_dropped; /// FIXME:debug 
  • trunk/libffado/src/libstreaming/motu/MotuReceiveStreamProcessor.cpp

    r742 r747  
    9191    // FIXME: not needed anymore? 
    9292    //m_ticks_per_frame = (TICKS_PER_SECOND*1.0) / ((float)m_manager->getNominalRate()); 
    93  
    94     debugOutput( DEBUG_LEVEL_VERBOSE, "Prepared for:\n"); 
    95     debugOutput( DEBUG_LEVEL_VERBOSE, " Samplerate: %d\n", 
    96              m_manager->getNominalRate()); 
    97     debugOutput( DEBUG_LEVEL_VERBOSE, " PeriodSize: %d, NbBuffers: %d\n", 
    98              m_manager->getPeriodSize(), m_manager->getNbBuffers()); 
    99     debugOutput( DEBUG_LEVEL_VERBOSE, " Port: %d, Channel: %d\n", 
    100              m_port, m_channel); 
    10193 
    10294    return true; 
  • trunk/libffado/src/libstreaming/motu/MotuTransmitStreamProcessor.cpp

    r742 r747  
    429429    } 
    430430#endif 
    431  
    432     debugOutput ( DEBUG_LEVEL_VERBOSE, "Prepared for:\n" ); 
    433     debugOutput ( DEBUG_LEVEL_VERBOSE, " Samplerate: %d\n", 
    434                 m_manager->getNominalRate() ); 
    435     debugOutput ( DEBUG_LEVEL_VERBOSE, " PeriodSize: %d, NbBuffers: %d\n", 
    436                 m_manager->getPeriodSize(), m_manager->getNbBuffers() ); 
    437     debugOutput ( DEBUG_LEVEL_VERBOSE, " Port: %d, Channel: %d\n", 
    438                 m_port, m_channel ); 
    439431    return true; 
    440432} 
  • trunk/libffado/src/libstreaming/util/IsoHandler.cpp

    r742 r747  
    2424#include "IsoHandler.h" 
    2525#include "cycletimer.h" 
    26 #include "../generic/IsoStream.h" 
     26#include "../generic/StreamProcessor.h" 
    2727 
    2828#include "libutil/TimeSource.h" 
     
    345345} 
    346346 
    347 bool IsoHandler::registerStream(IsoStream *stream) 
     347bool IsoHandler::registerStream(StreamProcessor *stream) 
    348348{ 
    349349    assert(stream); 
     
    354354            return false; 
    355355    } 
    356  
    357356    m_Client=stream; 
    358  
    359357    m_Client->setHandler(this); 
    360  
    361     return true; 
    362  
    363 
    364  
    365 bool IsoHandler::unregisterStream(IsoStream *stream) 
     358    return true; 
     359
     360 
     361bool IsoHandler::unregisterStream(StreamProcessor *stream) 
    366362{ 
    367363    assert(stream); 
     
    684680} 
    685681 
    686 // an recv handler can have multiple destination IsoStream
     682// an recv handler can have multiple destination StreamProcessor
    687683// NOTE: this implementation even allows for already registered 
    688684// streams to be registered again. 
  • trunk/libffado/src/libstreaming/util/IsoHandler.h

    r742 r747  
    3434{ 
    3535 
    36 class IsoStream
     36class StreamProcessor
    3737/*! 
    3838\brief The Base Class for ISO Handlers 
    3939 
    4040 These classes perform the actual ISO communication through libraw1394. 
    41  They are different from IsoStreams because one handler can provide multiple 
     41 They are different from StreamProcessors because one handler can provide multiple 
    4242 streams with packets in case of ISO multichannel receive. 
    4343 
     
    8888 
    8989        bool inUse() {return (m_Client != 0) ;}; 
    90         virtual bool isStreamRegistered(IsoStream *s) {return (m_Client == s);}; 
    91  
    92         virtual bool registerStream(IsoStream *); 
    93         virtual bool unregisterStream(IsoStream *); 
     90        virtual bool isStreamRegistered(StreamProcessor *s) {return (m_Client == s);}; 
     91 
     92        virtual bool registerStream(StreamProcessor *); 
     93        virtual bool unregisterStream(StreamProcessor *); 
    9494 
    9595        int getLocalNodeId() {return raw1394_get_local_id( m_handle );}; 
     
    112112        int m_dropped; 
    113113 
    114         IsoStream *m_Client; 
     114        StreamProcessor *m_Client; 
    115115 
    116116        virtual int handleBusReset(unsigned int generation); 
  • trunk/libffado/src/libstreaming/util/IsoHandlerManager.cpp

    r742 r747  
    2424#include "IsoHandlerManager.h" 
    2525#include "IsoHandler.h" 
    26 #include "../generic/IsoStream.h" 
     26#include "../generic/StreamProcessor.h" 
    2727 
    2828#include "libutil/PosixThread.h" 
     
    229229} 
    230230 
    231 void IsoHandlerManager::disablePolling(IsoStream *stream) { 
     231void IsoHandlerManager::disablePolling(StreamProcessor *stream) { 
    232232    int i=0; 
    233233 
     
    248248} 
    249249 
    250 void IsoHandlerManager::enablePolling(IsoStream *stream) { 
     250void IsoHandlerManager::enablePolling(StreamProcessor *stream) { 
    251251    int i=0; 
    252252 
     
    269269 
    270270/** 
    271  * Registers an IsoStream with the IsoHandlerManager. 
     271 * Registers an StreamProcessor with the IsoHandlerManager. 
    272272 * 
    273273 * If nescessary, an IsoHandler is created to handle this stream. 
    274  * Once an IsoStream is registered to the handler, it will be included 
     274 * Once an StreamProcessor is registered to the handler, it will be included 
    275275 * in the ISO streaming cycle (i.e. receive/transmit of it will occur). 
    276276 * 
     
    282282 *        multichannel receive 
    283283 */ 
    284 bool IsoHandlerManager::registerStream(IsoStream *stream) 
     284bool IsoHandlerManager::registerStream(StreamProcessor *stream) 
    285285{ 
    286286    debugOutput( DEBUG_LEVEL_VERBOSE, "Registering stream %p\n",stream); 
     
    303303 
    304304    // allocate a handler for this stream 
    305     if (stream->getStreamType()==IsoStream::eST_Receive) { 
     305    if (stream->getType()==StreamProcessor::ePT_Receive) { 
    306306        // setup the optimal parameters for the raw1394 ISO buffering 
    307307        unsigned int packets_per_period = stream->getPacketsPerPeriod(); 
     
    315315        //       per period for better latency. 
    316316        unsigned int max_packet_size=(MINIMUM_INTERRUPTS_PER_PERIOD * getpagesize()) / packets_per_period; 
     317 
    317318        if (max_packet_size < stream->getMaxPacketSize()) { 
    318319            debugWarning("calculated max packet size (%u) < stream max packet size (%u)\n", 
     
    400401    } 
    401402 
    402     if (stream->getStreamType()==IsoStream::eST_Transmit) { 
     403    if (stream->getType()==StreamProcessor::ePT_Transmit) { 
    403404        // setup the optimal parameters for the raw1394 ISO buffering 
    404405        unsigned int packets_per_period = stream->getPacketsPerPeriod(); 
     
    498499    } 
    499500 
    500     m_IsoStreams.push_back(stream); 
     501    m_StreamProcessors.push_back(stream); 
    501502    debugOutput( DEBUG_LEVEL_VERBOSE, " %d streams, %d handlers registered\n", 
    502                                       m_IsoStreams.size(), m_IsoHandlers.size()); 
     503                                      m_StreamProcessors.size(), m_IsoHandlers.size()); 
    503504 
    504505    return true; 
    505506} 
    506507 
    507 bool IsoHandlerManager::unregisterStream(IsoStream *stream) 
     508bool IsoHandlerManager::unregisterStream(StreamProcessor *stream) 
    508509{ 
    509510    debugOutput( DEBUG_LEVEL_VERBOSE, "Unregistering stream %p\n",stream); 
     
    529530 
    530531    // remove the stream from the registered streams list 
    531     for ( IsoStreamVectorIterator it = m_IsoStreams.begin(); 
    532       it != m_IsoStreams.end(); 
     532    for ( StreamProcessorVectorIterator it = m_StreamProcessors.begin(); 
     533      it != m_StreamProcessors.end(); 
    533534      ++it ) 
    534535    { 
    535536        if ( *it == stream ) { 
    536             m_IsoStreams.erase(it); 
     537            m_StreamProcessors.erase(it); 
    537538 
    538539            debugOutput( DEBUG_LEVEL_VERBOSE, " deleted stream (%p) from list...\n", *it); 
  • trunk/libffado/src/libstreaming/util/IsoHandlerManager.h

    r742 r747  
    4444{ 
    4545class IsoHandler; 
    46 class IsoStream
     46class StreamProcessor
    4747 
    4848typedef std::vector<IsoHandler *> IsoHandlerVector; 
    4949typedef std::vector<IsoHandler *>::iterator IsoHandlerVectorIterator; 
    5050 
    51 typedef std::vector<IsoStream *> IsoStreamVector; 
    52 typedef std::vector<IsoStream *>::iterator IsoStreamVectorIterator; 
     51typedef std::vector<StreamProcessor *> StreamProcessorVector; 
     52typedef std::vector<StreamProcessor *>::iterator StreamProcessorVectorIterator; 
    5353 
    5454 
     
    5757 
    5858 This class manages the use of ISO handlers by ISO streams. 
    59  You can register an IsoStream with an IsoHandlerManager. This 
     59 You can register an StreamProcessor with an IsoHandlerManager. This 
    6060 manager will assign an IsoHandler to the stream. If nescessary 
    6161 the manager allocates a new handler. If there is already a handler 
    62  that can handle the IsoStream (e.g. in case of multichannel receive), 
     62 that can handle the StreamProcessor (e.g. in case of multichannel receive), 
    6363 it can be assigned. 
    6464 
     
    8585        void dumpInfo(); ///< print some information about the manager to stdout/stderr 
    8686 
    87         bool registerStream(IsoStream *); ///< register an iso stream with the manager 
    88         bool unregisterStream(IsoStream *); ///< unregister an iso stream from the manager 
     87        bool registerStream(StreamProcessor *); ///< register an iso stream with the manager 
     88        bool unregisterStream(StreamProcessor *); ///< unregister an iso stream from the manager 
    8989 
    9090        bool startHandlers(); ///< start the managed ISO handlers 
     
    9898        bool init(); 
    9999 
    100         void disablePolling(IsoStream *); ///< disables polling on a stream 
    101         void enablePolling(IsoStream *); ///< enables polling on a stream 
     100        void disablePolling(StreamProcessor *); ///< disables polling on a stream 
     101        void enablePolling(StreamProcessor *); ///< enables polling on a stream 
    102102 
    103103    // RunnableInterface interface 
     
    139139 
    140140        // the collection of streams 
    141         IsoStreamVector m_IsoStreams; 
     141        StreamProcessorVector m_StreamProcessors; 
    142142 
    143143        // poll stuff 
  • trunk/libffado/src/SConscript

    r742 r747  
    6767        libstreaming/util/IsoHandlerManager.cpp \ 
    6868        libstreaming/generic/StreamProcessor.cpp \ 
    69         libstreaming/generic/IsoStream.cpp \ 
    7069        libstreaming/generic/Port.cpp \ 
    7170        libstreaming/generic/PortManager.cpp \ 
  • trunk/libffado/tests/SConscript

    r742 r747  
    4545        #"test-volume" : "test-volume.cpp", 
    4646        #"test-mixer" : "test-mixer.cpp", 
    47         "test-cycletimer" : "test-cycletimer.cpp", 
    4847        "test-timestampedbuffer" : "test-timestampedbuffer.cpp", 
    4948        "test-ieee1394service" : "test-ieee1394service.cpp", 
    5049        "test-streamdump" : "test-streamdump.cpp", 
    51         "test-sytmonitor" : "test-sytmonitor.cpp SytMonitor.cpp", 
    5250} 
    5351