Changeset 60

Show
Ignore:
Timestamp:
02/10/05 14:53:35 (19 years ago)
Author:
wagi
Message:

Connection management implementation start.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/freebob/src/avdevice.cpp

    r58 r60  
    2727#include "avdeviceaudiosubunit.h" 
    2828#include "avdevicemusicsubunit.h" 
     29#include "cmhandler.h" 
    2930 
    3031#undef AVC1394_GET_RESPONSE_OPERAN 
     
    6566    case eScanAndCreate: 
    6667        if ( initialize() == eFBRC_Success ) { 
     68            // Initiate connection 
     69            asyncCall( CMHandler::instance(), 
     70                       &CMHandler::createConnection, 
     71                       this ); 
    6772            // Put ourself to sleep until a something happends 
    6873            sleepCall( this, &AvDevice::execute, eCheckState ); 
    6974        } else { 
     75            asyncCall( CMHandler::instance(), 
     76                       &CMHandler::destroyConnection, 
     77                       this ); 
    7078            asyncCall( this, &AvDevice::execute, eDestroy ); 
    7179        } 
  • trunk/freebob/src/avdevice.h

    r58 r60  
    101101    unsigned char m_iNbAsyncDestinationPlugs; 
    102102    unsigned char m_iNbAsyncSourcePlugs; 
    103     unsigned char m_iNbIsoDestinationPlugs; // iPCR 
    104     unsigned char m_iNbIsoSourcePlugs; // oPCR 
     103    unsigned char m_iNbIsoDestinationPlugs;   // iPCR 
     104    unsigned char m_iNbIsoSourcePlugs;        // oPCR 
    105105    unsigned char m_iNbExtDestinationPlugs; 
    106106    unsigned char m_iNbExtSourcePlugs; 
  • trunk/freebob/src/cmhandler.cpp

    r43 r60  
    2121#include "cmhandler.h" 
    2222#include "ieee1394service.h" 
     23#include "avdevice.h" 
    2324 
    2425CMHandler* CMHandler::m_pInstance = 0; 
     
    7273    return m_pInstance; 
    7374} 
     75 
     76FBReturnCodes 
     77CMHandler::createConnection( AvDevice* avDevice ) 
     78{ 
     79 
     80    // First start with the play direction. 
     81    unsigned int iNoOfIPCR = avDevice->getNbIsoDestinationPlugs(); 
     82 
     83    if ( iNoOfIPCR == 0 ) { 
     84        debugError( "No iPCR found\n" ); 
     85        return eFBRC_NoOfIPCRNotCorrect; 
     86    } 
     87 
     88    // BeBob devices have two iPCR 
     89    // iPCR 0: IsoStream/AudioInput 
     90    // iPCR 1: Synch/SynchInput 
     91 
     92    if ( iNoOfIPCR != 2 ) { 
     93        debugError( "Not correct number iPCR founds on target. " 
     94                    "Expected 2, found %d\n",  iNoOfIPCR ); 
     95        return eFBRC_NoOfIPCRNotCorrect; 
     96    } 
     97 
     98    // Create external connection 
     99 
     100 
     101 
     102    // Internal connection are not configureable on BeBob device... gladly 
     103 
     104 
     105 
     106    // Second configure record direction. 
     107    unsigned int iNoOfOPCR = avDevice->getNbIsoSourcePlugs(); 
     108 
     109    if ( iNoOfOPCR == 0 ) { 
     110        debugError( "No oPCR found\n" ); 
     111        return eFBRC_NoOfOPCRNotCorrect; 
     112    } 
     113 
     114    // BeBob devices have two iPCR 
     115    // oPCR 0: IsoStream/Output 
     116    // oPCR 1: Synch/SynchOut 
     117 
     118    if ( iNoOfOPCR != 2 ) { 
     119        debugError( "Not correct number oPCR founds on target. " 
     120                    "Expected 2, found %d\n",  iNoOfOPCR ); 
     121        return eFBRC_NoOfOPCRNotCorrect; 
     122    } 
     123 
     124 
     125    debugPrint( DEBUG_LEVEL_INFO, "Connection established\n" ); 
     126    return eFBRC_Success; 
     127} 
     128 
     129FBReturnCodes 
     130CMHandler::destroyConnection( AvDevice* avDevice ) 
     131{ 
     132 
     133    return eFBRC_Success; 
     134} 
  • trunk/freebob/src/cmhandler.h

    r43 r60  
    2626 
    2727class Ieee1394Service; 
     28class AvDevice; 
    2829 
    2930class CMHandler 
     
    3435 
    3536    static CMHandler* instance(); 
     37    FBReturnCodes createConnection( AvDevice* avDevice ); 
     38    FBReturnCodes destroyConnection( AvDevice* avDevice ); 
     39 
    3640private: 
    3741    CMHandler(); 
  • trunk/freebob/src/freebob.h

    r48 r60  
    3434  eFBRC_AvDeviceNotFound             =  -6, 
    3535  eFBRC_CreatingAvDeviceFailed       =  -7, 
     36  eFBRC_NoOfIPCRNotCorrect           =  -8, 
     37  eFBRC_NoOfOPCRNotCorrect           =  -9, 
    3638} FBReturnCodes; 
    3739