Show
Ignore:
Timestamp:
02/22/07 08:49:35 (17 years ago)
Author:
pieterpalmers
Message:

- added some documentation
- added a lock()/unlock() to IAvDevice (see header)
- reimplemented test-freebob to the new C++ api
- started with support for AddressRangeMapping?, i.e. response

to reads/writes of the 1394 memory space on the host

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/streaming-rework/src/bebob/bebob_avdevice.cpp

    r408 r412  
    949949    m_id=id; 
    950950        return true; 
     951} 
     952 
     953bool 
     954AvDevice::lock() { 
     955 
     956    return true; 
     957} 
     958 
     959 
     960bool 
     961AvDevice::unlock() { 
     962 
     963    return true; 
    951964} 
    952965 
  • branches/streaming-rework/src/bebob/bebob_avdevice.h

    r407 r412  
    7373 
    7474    virtual bool prepare(); 
     75    bool lock(); 
     76    bool unlock(); 
    7577 
    7678    virtual int startStreamByIndex(int i); 
  • branches/streaming-rework/src/bounce/bounce_avdevice.cpp

    r407 r412  
    185185} 
    186186 
     187bool 
     188BounceDevice::lock() { 
     189 
     190    return true; 
     191} 
     192 
     193 
     194bool 
     195BounceDevice::unlock() { 
     196 
     197    return true; 
     198} 
     199 
    187200void 
    188201BounceDevice::showDevice() const 
  • branches/streaming-rework/src/bounce/bounce_avdevice.h

    r407 r412  
    6666     
    6767        virtual bool prepare(); 
     68    bool lock(); 
     69    bool unlock(); 
    6870         
    6971        virtual int getStreamCount(); 
  • branches/streaming-rework/src/dice/dice_avdevice.cpp

    r407 r412  
    2121 
    2222#include "dice/dice_avdevice.h" 
     23#include "dice/dice_defines.h" 
     24 
    2325#include "configrom.h" 
    24  
    2526#include "libfreebobavc/ieee1394service.h" 
    26 #include "libfreebobavc/avc_definitions.h" 
     27#include "libstreaming/AmdtpStreamProcessor.h" 
    2728 
    2829#include "debugmodule/debugmodule.h" 
     
    3233#include <assert.h> 
    3334#include <netinet/in.h> 
    34  
    3535#include <libraw1394/csr.h> 
    3636 
    37 #include "libstreaming/AmdtpStreamProcessor.h" 
    3837 
    3938namespace Dice { 
    4039 
    41 IMPL_DEBUG_MODULE( DiceAvDevice, DiceAvDevice, DEBUG_LEVEL_NORMAL ); 
     40IMPL_DEBUG_MODULE( DiceAvDevice, DiceAvDevice, DEBUG_LEVEL_VERBOSE ); 
    4241 
    4342// to define the supported devices 
     
    5958    , m_iso_recv_channel ( -1 ) 
    6059    , m_iso_send_channel ( -1 ) 
    61      
    6260{ 
    6361    setDebugLevel( verboseLevel ); 
     
    159157} 
    160158 
     159bool 
     160DiceAvDevice::lock() { 
     161 
     162    return true; 
     163} 
     164 
     165 
     166bool 
     167DiceAvDevice::unlock() { 
     168 
     169    return true; 
     170} 
     171 
    161172int  
    162173DiceAvDevice::getStreamCount() { 
  • branches/streaming-rework/src/dice/dice_avdevice.h

    r407 r412  
    1 /* mh_avdevice.h 
     1/* dice_avdevice.h 
    22 * Copyright (C) 2007 by Pieter Palmers 
    33 * 
     
    4848                  int nodeId, 
    4949                  int verboseLevel ); 
    50     virtual ~DiceAvDevice(); 
     50    ~DiceAvDevice(); 
    5151 
    5252    static bool probe( ConfigRom& configRom ); 
    53     virtual bool discover(); 
    54     virtual ConfigRom& getConfigRom() const; 
     53    bool discover(); 
     54    ConfigRom& getConfigRom() const; 
    5555 
    5656    // obsolete, will be removed soon, unused 
    57     virtual bool addXmlDescription( xmlNodePtr deviceNode ) {return true;}; 
     57    bool addXmlDescription( xmlNodePtr deviceNode ) {return true;}; 
    5858 
    59     virtual void showDevice() const; 
     59    void showDevice() const; 
    6060 
    61     virtual bool setSamplingFrequency( ESamplingFrequency samplingFrequency ); 
    62     virtual int getSamplingFrequency( ); 
     61    bool setSamplingFrequency( ESamplingFrequency samplingFrequency ); 
     62    int getSamplingFrequency( ); 
    6363 
    64     virtual bool setId(unsigned int id); 
     64    bool setId(unsigned int id); 
    6565 
    66     virtual int getStreamCount(); 
    67     virtual FreebobStreaming::StreamProcessor *getStreamProcessorByIndex(int i); 
     66    int getStreamCount(); 
     67    FreebobStreaming::StreamProcessor *getStreamProcessorByIndex(int i); 
    6868 
    69     virtual bool prepare(); 
    70  
    71     virtual int startStreamByIndex(int i); 
    72     virtual int stopStreamByIndex(int i); 
     69    bool prepare(); 
     70     
     71    bool lock(); 
     72    bool unlock(); 
     73     
     74    int startStreamByIndex(int i); 
     75    int stopStreamByIndex(int i); 
    7376 
    7477    signed int getIsoRecvChannel(void); 
  • branches/streaming-rework/src/freebob_streaming.cpp

    r407 r412  
    125125            assert(device); 
    126126 
     127            debugOutput(DEBUG_LEVEL_VERBOSE, "Locking device (%p)\n", device); 
     128             
     129            if (!device->lock()) { 
     130                debugWarning("Could not lock device, skipping device (%p)!\n", device); 
     131                continue; 
     132            } 
     133             
    127134            debugOutput(DEBUG_LEVEL_VERBOSE, "Setting samplerate to %d for (%p)\n",  
    128135                        dev->options.sample_rate, device); 
     
    181188 
    182189void freebob_streaming_finish(freebob_device_t *dev) { 
    183  
    184         assert(dev); 
    185  
    186         delete dev->processorManager; 
    187         delete dev->m_deviceManager; 
    188         delete dev; 
    189  
    190         return; 
     190    unsigned int i=0; 
     191     
     192    assert(dev); 
     193     
     194    // iterate over the found devices 
     195    for(i=0;i<dev->m_deviceManager->getAvDeviceCount();i++) { 
     196        IAvDevice *device=dev->m_deviceManager->getAvDeviceByIndex(i); 
     197        assert(device); 
     198 
     199        debugOutput(DEBUG_LEVEL_VERBOSE, "Unlocking device (%p)\n", device); 
     200 
     201        if (!device->unlock()) { 
     202            debugWarning("Could not unlock device (%p)!\n", device); 
     203        } 
     204    } 
     205     
     206    delete dev->processorManager; 
     207    delete dev->m_deviceManager; 
     208    delete dev; 
     209 
     210    return; 
    191211} 
    192212 
  • branches/streaming-rework/src/iavdevice.h

    r336 r412  
    3434\brief Interface that is to be implemented to support a device. 
    3535 
    36  This interface should be used to implement freebob support for a specific device. 
     36 This interface should be used to implement freebob support  
     37 for a specific device. 
    3738 
    3839*/ 
     
    4546         
    4647        /** 
    47          * This is called by the probe function to discover & configure the device 
    48          * 
     48         * @brief This is called by the DeviceManager to discover & configure the device 
    4949         *  
    5050         * @return true if the device was discovered successfully 
     
    5353         
    5454        /** 
    55          * Set the samping frequency 
     55         * @brief Set the samping frequency 
    5656         * @param samplingFrequency  
    5757         * @return true if successfull 
     
    5959        virtual bool setSamplingFrequency( ESamplingFrequency samplingFrequency ) = 0; 
    6060        /** 
    61          * get the samplingfrequency as an integer 
     61         * @brief get the samplingfrequency as an integer 
    6262         * @return the sampling frequency as integer 
    6363         */ 
     
    6565         
    6666    /** 
    67      * This is called by the device manager to give the device 
    68      * a unique ID. 
     67     * @brief This is called by the device manager to give the device a unique ID. 
    6968     * 
    7069     * The purpose of this is to allow for unique port naming 
     
    9695         
    9796        /** 
    98          * Constructs an XML description of the device [obsolete] 
     97         * @brief Constructs an XML description of the device [obsolete] 
    9998         * 
    10099         * this is a leftover from v1.0 and isn't used 
     
    108107         
    109108        /** 
    110          * Outputs the device configuration to stderr/stdout [debug helper] 
     109         * @brief Outputs the device configuration to stderr/stdout [debug helper] 
    111110         * 
    112111         * This function prints out a (detailed) description of the  
     
    114113         */ 
    115114        virtual void showDevice() const = 0; 
    116          
    117         /**  
    118          * Prepare the device 
    119          *  \todo when exactly is this called? and what should it do? 
     115 
     116        /**  
     117         * @brief Lock the device 
     118         * 
     119         * This is called by the streaming layer before we start manipulating 
     120         * and/or using the device. 
     121         * 
     122         * It should implement the mechanisms provided by the device to  
     123         * make sure that no other controller claims control of the device. 
     124         * 
     125         */ 
     126        virtual bool lock() = 0; 
     127         
     128        /**  
     129         * @brief Unlock the device 
     130         * 
     131         * This is called by the streaming layer after we finish manipulating 
     132         * and/or using the device. 
     133         * 
     134         * It should implement the mechanisms provided by the device to  
     135         * give up exclusive control of the device. 
     136         * 
     137         */ 
     138        virtual bool unlock() = 0; 
     139 
     140        /**  
     141         * @brief Prepare the device 
     142         * 
     143         * This is called by the streaming layer after the configuration  
     144         * parameters (e.g. sample rate) are set, and before  
     145         * getStreamProcessor[*] functions are called. 
     146         * 
     147         * It should be used to prepare the device's streamprocessors 
     148         * based upon the device's current configuration. Normally 
     149         * the streaming layer will not change the device's configuration 
     150         * after calling this function. 
     151         * 
    120152         */ 
    121153        virtual bool prepare() = 0; 
    122154         
    123         ///  
    124         /** 
    125          * Returns the number of ISO streams implemented/used by this device 
     155        /** 
     156         * @brief Returns the number of ISO streams implemented/used by this device 
    126157         * 
    127158         * Most likely this is 2 streams, i.e. one transmit stream and one 
     
    135166         *       getStreamProcessorByIndex(i) should return a valid StreamProcessor 
    136167         *       for i=0 to i=getStreamCount()-1 
    137          * \note 
    138168         * 
    139169         * @return  
     
    142172         
    143173        /**  
    144          * Returns the StreamProcessor object for the stream with index i 
     174         * @brief Returns the StreamProcessor object for the stream with index i 
     175         * 
    145176         * \note a streamprocessor returned by getStreamProcessorByIndex(i) 
    146177         *       cannot be the same object as one returned by 
    147178         *       getStreamProcessorByIndex(j) if i isn't equal to j 
    148          * \note you could have two streamprocessors handling the same ISO 
    149          *       channel if that's needed 
     179         * \note you cannot have two streamprocessors handling the same ISO 
     180         *       channel (on the same port) 
     181         * 
    150182         * \param i : Stream index 
    151183         * \pre \ref i smaller than getStreamCount() 
     
    155187         
    156188        /**  
    157          * starts the stream with index i 
     189         * @brief starts the stream with index i 
    158190         * 
    159191         * This function is called by the streaming layer when this stream should 
     
    162194         * 
    163195         * It returns the channel number that was assigned for this stream. 
    164          *  
    165          * For BeBoB's this implements the IEC61883 connection management procedure (CMP). 
    166          * This CMP is a way to negotiate the channel that should be used, the bandwidth  
    167          * consumed and to start the device's streaming mode. 
    168          * 
    169          * Note that this IEC61883 CMP is nescessary to allow multiple ISO devices on the bus, 
    170          * because otherwise there is no way to know what ISO channels are already in use. 
    171          * or is there? 
    172          * \note I wouldn't know how to assign channels for devices that don't implement 
    173          *       IEC61883 CMP (like the Motu?). As long as there is only one device on the 
    174          *       bus this is no problem and can be solved with static assignments.  
     196         * Channel allocation should be done using the allocation functions provided by the 
     197         * Ieee1394Service object that is passed in the constructor. 
    175198         * 
    176199         * \param i : Stream index 
     
    181204         
    182205        /**  
    183          * stops the stream with index \ref i 
     206         * @brief stops the stream with index \ref i 
    184207         * 
    185208         * \param i : Stream index 
  • branches/streaming-rework/src/libfreebobavc/ieee1394service.cpp

    r411 r412  
    2828#include <netinet/in.h> 
    2929 
    30 #include "string.h" 
     30#include <string.h> 
    3131 
    3232#include <iostream> 
     
    5757    stopRHThread(); 
    5858 
     59    for ( arm_mapping_vec_t::iterator it = m_arm_mappings.begin(); 
     60          it != m_arm_mappings.end(); 
     61          ++it ) 
     62    { 
     63        debugOutput(DEBUG_LEVEL_VERBOSE, "Unregistering ARM handler for 0x%016llX\n", (*it)->start); 
     64        int err=raw1394_arm_unregister(m_resetHandle, (*it)->start); 
     65        if (err) { 
     66            debugError(" Failed to unregister ARM handler for 0x%016llX\n", (*it)->start); 
     67            debugError(" Error: %s\n", strerror(errno)); 
     68        } else { 
     69            delete *it; 
     70        } 
     71    } 
     72 
    5973    if ( m_handle ) { 
    6074        raw1394_destroy_handle( m_handle ); 
    6175    } 
     76     
    6277    if ( m_resetHandle ) { 
    6378        raw1394_destroy_handle( m_resetHandle ); 
     
    7590            debugFatal("libraw1394 not compatible\n"); 
    7691        } else { 
    77             debugFatal("Ieee1394Service::initialize: Could not get 1394 handle: %s", 
     92            debugFatal("Ieee1394Service::initialize: Could not get 1394 handle: %s\n", 
    7893                strerror(errno) ); 
    7994            debugFatal("Is ieee1394 and raw1394 driver loaded?\n"); 
     
    100115    raw1394_set_bus_reset_handler( m_resetHandle, 
    101116                                   this->resetHandlerLowLevel ); 
     117 
     118    m_default_arm_handler = raw1394_set_arm_tag_handler( m_resetHandle, 
     119                                   this->armHandlerLowLevel ); 
    102120    startRHThread(); 
    103121 
     
    296314} 
    297315 
     316bool Ieee1394Service::registerARMrange(nodeaddr_t start, 
     317                     size_t length, byte_t *initial_value, 
     318                     arm_options_t access_rights, 
     319                     arm_options_t notification_options, 
     320                     arm_options_t client_transactions, 
     321                     Functor* functor) { 
     322    debugOutput(DEBUG_LEVEL_VERBOSE, "Registering ARM handler for 0x%016llX, length %u\n", start,length); 
     323                      
     324    arm_mapping_t *new_mapping=NULL; 
     325    new_mapping = new arm_mapping_t; 
     326     
     327    new_mapping->start=start; 
     328    new_mapping->length=length; 
     329    new_mapping->access_rights=access_rights; 
     330    new_mapping->notification_options=notification_options; 
     331    new_mapping->client_transactions=client_transactions; 
     332    new_mapping->functor=functor; 
     333     
     334    int err=raw1394_arm_register(m_resetHandle, start,  
     335                         length, initial_value, (octlet_t)new_mapping, 
     336                         access_rights, 
     337                         notification_options, 
     338                         client_transactions); 
     339    if (err) { 
     340        debugError("Failed to register ARM handler for 0x%016llX\n", start); 
     341        debugError(" Error: %s\n", strerror(errno)); 
     342        delete new_mapping; 
     343        return false; 
     344    } 
     345     
     346    m_arm_mappings.push_back( new_mapping ); 
     347 
     348    return true; 
     349} 
     350 
     351bool Ieee1394Service::unregisterARMrange( nodeaddr_t start ) { 
     352    debugOutput(DEBUG_LEVEL_VERBOSE, "Unregistering ARM handler for 0x%016llX\n", start); 
     353     
     354    for ( arm_mapping_vec_t::iterator it = m_arm_mappings.begin(); 
     355          it != m_arm_mappings.end(); 
     356          ++it ) 
     357    { 
     358        if((*it)->start == start) { 
     359            int err=raw1394_arm_unregister(m_resetHandle, start); 
     360            if (err) { 
     361                debugError("Failed to unregister ARM handler for 0x%016llX\n", start); 
     362                debugError(" Error: %s\n", strerror(errno)); 
     363            } else { 
     364                m_arm_mappings.erase(it); 
     365                delete *it; 
     366                return true; 
     367            } 
     368        } 
     369    } 
     370    debugOutput(DEBUG_LEVEL_VERBOSE, " no handler found!\n"); 
     371     
     372    return false; 
     373} 
     374     
     375int  
     376Ieee1394Service::armHandlerLowLevel(raw1394handle_t handle,  
     377                     unsigned long arm_tag, 
     378                     byte_t request_type, unsigned int requested_length, 
     379                     void *data) 
     380{ 
     381    Ieee1394Service* instance 
     382        = (Ieee1394Service*) raw1394_get_userdata( handle ); 
     383    instance->armHandler( arm_tag, request_type, requested_length, data ); 
     384 
     385    return 0; 
     386} 
     387 
     388bool 
     389Ieee1394Service::armHandler(  unsigned long arm_tag, 
     390                     byte_t request_type, unsigned int requested_length, 
     391                     void *data) 
     392{ 
     393    for ( arm_mapping_vec_t::iterator it = m_arm_mappings.begin(); 
     394          it != m_arm_mappings.end(); 
     395          ++it ) 
     396    { 
     397        if((*it) == (arm_mapping_t *)arm_tag) { 
     398            debugOutput(DEBUG_LEVEL_VERBOSE,"ARM handler for address 0x%016llX called\n", (*it)->start); 
     399            Functor* func = (*it)->functor; 
     400            ( *func )(); 
     401            return true; 
     402        } 
     403    } 
     404 
     405    debugOutput(DEBUG_LEVEL_VERBOSE,"default ARM handler called\n"); 
     406 
     407    m_default_arm_handler(m_resetHandle, arm_tag, request_type, requested_length, data ); 
     408    return true; 
     409} 
     410 
    298411bool 
    299412Ieee1394Service::startRHThread() 
     
    344457Ieee1394Service::addBusResetHandler( Functor* functor ) 
    345458{ 
     459    debugOutput(DEBUG_LEVEL_VERBOSE, "Adding busreset handler (%p)\n", functor); 
    346460    m_busResetHandlers.push_back( functor ); 
    347461    return true; 
     
    351465Ieee1394Service::remBusResetHandler( Functor* functor ) 
    352466{ 
     467    debugOutput(DEBUG_LEVEL_VERBOSE, "Removing busreset handler (%p)\n", functor); 
     468     
    353469    for ( reset_handler_vec_t::iterator it = m_busResetHandlers.begin(); 
    354470          it != m_busResetHandlers.end(); 
     
    356472    { 
    357473        if ( *it == functor ) { 
     474            debugOutput(DEBUG_LEVEL_VERBOSE, " found\n"); 
    358475            m_busResetHandlers.erase( it ); 
    359476            return true; 
    360477        } 
    361478    } 
     479    debugOutput(DEBUG_LEVEL_VERBOSE, " not found\n"); 
    362480    return false; 
    363481} 
  • branches/streaming-rework/src/libfreebobavc/ieee1394service.h

    r408 r412  
    125125    bool addBusResetHandler( Functor* functor ); 
    126126    bool remBusResetHandler( Functor* functor ); 
     127     
     128    /** 
     129     * @brief register an AddressRangeMapping 
     130     * 
     131     * @param start          identifies addressrange 
     132     * @param length         identifies addressrange length 
     133     * @param initial_value  pointer to buffer containing (if necessary) initial value 
     134     *                    NULL means undefined 
     135     * @param access_rights access-rights for registered addressrange handled  
     136     *                    by kernel-part. Value is one or more binary or of the  
     137     *                    following flags - ARM_READ, ARM_WRITE, ARM_LOCK 
     138     * @param notification_options identifies for which type of request you want 
     139     *                    to be notified. Value is one or more binary or of the  
     140     *                    following flags - ARM_READ, ARM_WRITE, ARM_LOCK 
     141     * @param client_transactions identifies for which type of request you want 
     142     *                    to handle the request by the client application. 
     143     *                    for those requests no response will be generated, but 
     144     *                    has to be generated by the application. 
     145     *                    Value is one or more binary or of the  
     146     *                    following flags - ARM_READ, ARM_WRITE, ARM_LOCK 
     147     *                    For each bit set here, notification_options and 
     148     *                    access_rights will be ignored. 
     149     * @param functor the function to call when this range is written to 
     150     * 
     151     * @return true on success or false on failure 
     152     **/ 
     153 
     154    bool registerARMrange(nodeaddr_t start, 
     155                         size_t length, byte_t *initial_value, 
     156                         arm_options_t access_rights, 
     157                         arm_options_t notification_options, 
     158                         arm_options_t client_transactions, 
     159                         Functor* functor); 
     160 
     161    /** 
     162     * @brief unregister ARM range 
     163     * @param start identifies addressrange 
     164     * @return true if successful, false otherwise 
     165     */ 
     166    bool unregisterARMrange( nodeaddr_t start ); 
    127167 
    128168// ISO channel stuff 
     
    166206 
    167207    static int resetHandlerLowLevel( raw1394handle_t handle, 
    168                                     unsigned int generation ); 
     208                    unsigned int generation ); 
    169209    bool resetHandler( unsigned int generation ); 
     210     
     211    static int armHandlerLowLevel(raw1394handle_t handle, unsigned long arm_tag, 
     212                     byte_t request_type, unsigned int requested_length, 
     213                     void *data);  
     214    bool armHandler(  unsigned long arm_tag, 
     215                     byte_t request_type, unsigned int requested_length, 
     216                     void *data); 
    170217 
    171218    raw1394handle_t m_handle; 
     
    181228    reset_handler_vec_t m_busResetHandlers; 
    182229     
     230    // ARM stuff 
     231    arm_tag_handler_t m_default_arm_handler; 
     232     
     233    typedef struct arm_mapping { 
     234        nodeaddr_t start; 
     235        size_t length; 
     236        arm_options_t access_rights; 
     237        arm_options_t notification_options; 
     238        arm_options_t client_transactions; 
     239        Functor* functor; 
     240    } arm_mapping_t; 
     241     
     242    typedef std::vector< arm_mapping_t* > arm_mapping_vec_t; 
     243    arm_mapping_vec_t m_arm_mappings; 
     244     
    183245    DECLARE_DEBUG_MODULE; 
    184246}; 
  • branches/streaming-rework/src/maudio/maudio_avdevice.cpp

    r407 r412  
    136136} 
    137137 
     138bool 
     139AvDevice::lock() { 
     140 
     141    return true; 
     142} 
     143 
     144 
     145bool 
     146AvDevice::unlock() { 
     147 
     148    return true; 
     149} 
    138150 
    139151void 
  • branches/streaming-rework/src/maudio/maudio_avdevice.h

    r407 r412  
    6161 
    6262    virtual bool prepare(); 
     63    bool lock(); 
     64    bool unlock(); 
     65     
    6366 
    6467    virtual int startStreamByIndex(int i); 
  • branches/streaming-rework/src/metrichalo/mh_avdevice.cpp

    r407 r412  
    144144} 
    145145 
     146bool 
     147MHAvDevice::lock() { 
     148 
     149    return true; 
     150} 
     151 
     152 
     153bool 
     154MHAvDevice::unlock() { 
     155 
     156    return true; 
     157} 
     158 
    146159void 
    147160MHAvDevice::showDevice() const 
  • branches/streaming-rework/src/metrichalo/mh_avdevice.h

    r407 r412  
    6969 
    7070    virtual bool prepare(); 
     71    bool lock(); 
     72    bool unlock(); 
    7173 
    7274    virtual int startStreamByIndex(int i); 
  • branches/streaming-rework/src/motu/motu_avdevice.cpp

    r409 r412  
    308308} 
    309309 
     310bool 
     311MotuDevice::lock() { 
     312 
     313    return true; 
     314} 
     315 
     316 
     317bool 
     318MotuDevice::unlock() { 
     319 
     320    return true; 
     321} 
     322 
    310323void 
    311324MotuDevice::showDevice() const 
  • branches/streaming-rework/src/motu/motu_avdevice.h

    r407 r412  
    116116 
    117117    virtual bool prepare(); 
    118  
     118    bool lock(); 
     119    bool unlock(); 
     120     
    119121    virtual int startStreamByIndex(int i); 
    120122    virtual int stopStreamByIndex(int i); 
  • branches/streaming-rework/src/rme/rme_avdevice.cpp

    r408 r412  
    169169} 
    170170 
     171bool 
     172RmeDevice::lock() { 
     173 
     174    return true; 
     175} 
     176 
     177 
     178bool 
     179RmeDevice::unlock() { 
     180 
     181    return true; 
     182} 
     183 
    171184void 
    172185RmeDevice::showDevice() const 
  • branches/streaming-rework/src/rme/rme_avdevice.h

    r407 r412  
    7070 
    7171    virtual bool prepare(); 
     72    bool lock(); 
     73    bool unlock(); 
    7274 
    7375    virtual int startStreamByIndex(int i); 
  • branches/streaming-rework/src/threads.h

    r336 r412  
    4141public: 
    4242    MemberFunctor0( const CalleePtr& pCallee,  
    43                    MemFunPtr pMemFun,  
    44                    bool bDelete = true ) 
     43            MemFunPtr pMemFun,  
     44            bool bDelete = true ) 
    4545        : m_pCallee( pCallee ) 
    4646        , m_pMemFun( pMemFun ) 
    47        , m_pSem( 0 ) 
    48        , m_bDelete( bDelete ) 
     47        , m_pSem( 0 ) 
     48        , m_bDelete( bDelete ) 
    4949        {} 
    5050 
    5151    MemberFunctor0( const CalleePtr& pCallee,  
    52                    MemFunPtr pMemFun,  
    53                    sem_t* pSem, 
    54                    bool bDelete = true ) 
     52            MemFunPtr pMemFun,  
     53            sem_t* pSem, 
     54            bool bDelete = true ) 
    5555        : m_pCallee( pCallee ) 
    5656        , m_pMemFun( pMemFun ) 
    57        , m_pSem( pSem ) 
    58        , m_bDelete( bDelete ) 
     57        , m_pSem( pSem ) 
     58        , m_bDelete( bDelete ) 
    5959        {} 
    6060 
     
    6363 
    6464    virtual void operator() () 
    65         {  
    66            ( ( *m_pCallee ).*m_pMemFun )();  
    67            if ( m_pSem ) { 
    68                sem_post( m_pSem); 
    69            } 
    70            if (m_bDelete) { 
    71                delete this; 
    72            } 
    73        
     65        { 
     66            ( ( *m_pCallee ).*m_pMemFun )();  
     67            if ( m_pSem ) { 
     68                sem_post( m_pSem); 
     69            } 
     70            if (m_bDelete) { 
     71            delete this; 
     72        } 
     73   
    7474 
    7575private: 
     
    8686public: 
    8787    MemberFunctor1( const CalleePtr& pCallee,  
    88                    MemFunPtr pMemFun,  
    89                    Parm0 parm0, 
    90                    bool bDelete = true) 
     88            MemFunPtr pMemFun,  
     89            Parm0 parm0, 
     90            bool bDelete = true) 
    9191        : m_pCallee( pCallee ) 
    9292        , m_pMemFun( pMemFun ) 
    93        , m_parm0( parm0 ) 
    94        , m_pSem( 0 ) 
    95        , m_bDelete( bDelete )  
     93        , m_parm0( parm0 ) 
     94        , m_pSem( 0 ) 
     95        , m_bDelete( bDelete )         
    9696        {} 
    9797 
    9898    MemberFunctor1( const CalleePtr& pCallee,  
    99                    MemFunPtr pMemFun,  
    100                    Parm0 parm0, 
    101                    sem_t* pSem, 
    102                    bool bDelete = true ) 
     99            MemFunPtr pMemFun,  
     100            Parm0 parm0, 
     101            sem_t* pSem, 
     102            bool bDelete = true ) 
    103103        : m_pCallee( pCallee ) 
    104104        , m_pMemFun( pMemFun ) 
    105        , m_parm0( parm0 ) 
    106        , m_pSem( 0 ) 
    107        , m_bDelete( bDelete ) 
     105        , m_parm0( parm0 ) 
     106        , m_pSem( 0 ) 
     107        , m_bDelete( bDelete ) 
    108108        {} 
    109109    virtual ~MemberFunctor1() 
    110         {} 
     110    {} 
    111111 
    112112    virtual void operator() () 
    113         {  
    114            ( ( *m_pCallee ).*m_pMemFun )( m_parm0 );  
    115            if ( m_pSem ) { 
    116                sem_post( m_pSem); 
    117            } 
    118            if (m_bDelete) { 
    119                delete this; 
    120            } 
    121        
     113    { 
     114            ( ( *m_pCallee ).*m_pMemFun )( m_parm0 );  
     115            if ( m_pSem ) { 
     116                sem_post( m_pSem); 
     117            } 
     118            if (m_bDelete) { 
     119                delete this; 
     120            } 
     121   
    122122 
    123123private: