Exemplo n.º 1
0
/**
 *
 * Method Name: ForwardSDESReport
 *
 *
 * Inputs:   IGetSrcDescription *piGetSrcDescription
 *                              - Interface for getting SDES Report Statistics
 *           IRTCPConnection  *piRTCPConnection
 *                              - Interface to RTCP Connection originating SDES
 *
 * Outputs:  None
 *
 * Returns:  None
 *
 * Description: The ForwardSDESReport() method shall enable the RTC Manager to
 *              pass interfaces to SDES Reports received from participating
 *              site while acting in the mode of a conference Mixer.  The
 *              Mixer's role in this situation is to transmit these reports
 *              unchanged to others participating within a conference.  The
 *              handoff of an SDES Report to the CRTCPRender will cause the
 *              report to be transmitted to a participating site using the
 *              associated Network Render object.
 *
 * Usage Notes: The interface for the local site's Source Description Report
 *              generator is passed as an argument at construction time.
 *
 *
 */
void CRTCPSession::ForwardSDESReport(IGetSrcDescription *piGetSrcDescription,
                                     IRTCPConnection    *piRTCPConnection)
{

    // Check the each entry of the connection list and forward this report to
    //  those not matching the originators SSRC
    CRTCPConnection *poRTCPConnection = GetFirstEntry();

    // Iterate through the list until all entries have been exhausted
    while(poRTCPConnection != NULL)
    {
        // Bump Reference Count of Connection Object
        poRTCPConnection->AddRef();

        // Get the SSRC ID of the connection to determine whether it is not
        //  from the originator
        if(poRTCPConnection->GetRemoteSSRC() !=
                                            piRTCPConnection->GetRemoteSSRC())
        {
            // Get Render Interface
            IRTCPRender *piRTCPRender = poRTCPConnection->GetRenderInterface();

#if RTCP_DEBUG /* [ */
            if(bPingtelDebug)
            {
                osPrintf("*** FORWARDING SDES REPORT ****\n");
                osPrintf("\t ON SESSION ==> %d\n", GetSessionID());
                osPrintf("\t FROM SSRC  ==> %u\n",
                                           piRTCPConnection->GetRemoteSSRC());
                osPrintf("\t TO SSRC    ==> %d\n",
                                           poRTCPConnection->GetRemoteSSRC());
            }
#endif /* RTCP_DEBUG ] */

            // Different connection.  Forward the SDES Report for delivery.
            ISDESReport *piSDESReport =
                                      piGetSrcDescription->GetSDESInterface();
            piRTCPRender->ForwardSDESReport(piSDESReport);

            // Release the reference to SDES Report interface
            piSDESReport->Release();

            // Release Render Interface
            piRTCPRender->Release();
        }

        // Release Reference to Connection Object
        poRTCPConnection->Release();

        // Get the next connection from the list
        poRTCPConnection = GetNextEntry();
    }

}
Exemplo n.º 2
0
/**
 *
 * Method Name: ~CRTCPSource() - Destructor
 *
 *
 * Inputs:      None
 *
 * Outputs:     None
 *
 * Returns:     None
 *
 * Description: Shall deallocated and/or release all resources which was
 *              acquired over the course of runtime.  In particular, the
 *              following shall occur:
 *    ==> The queue containing remote RTCP Source Description objects shall be
 *        drained with the reference to each object released.
 *    ==> The reference to the remote Source Report object shall be released
 *    ==> The reference to the remote Receiver Report object shall be released
 *
 * Usage Notes: This shall override the virtual destructor in the base class
 *              so that deallocation specific to the derived class will be
 *              done despite the destruction being performed in the base class
 *              as part of the release.
 *
 */
CRTCPSource::~CRTCPSource(void)
{

    // Declarations
    ISDESReport     *piSDESReport;
    IReceiverReport *piReceiverReport;

    // Release Sender object reference if it exists
    if(m_poSenderReport)
        ((ISenderReport *)m_poSenderReport)->Release();

    // Release Bye object reference if it exists
    if(m_poByeReport)
        ((IByeReport *)m_poByeReport)->Release();

    // Iterate through Source Description List and
    //  release all references to objects
    piSDESReport = (ISDESReport *)m_tSrcDescriptorList.RemoveFirstEntry();
    while(piSDESReport != NULL)
    {
        // Release Reference
        piSDESReport->Release();

        // Get Next Entry
        piSDESReport = (ISDESReport *)m_tSrcDescriptorList.RemoveNextEntry();

    }

    // Iterate through Source Description List and
    //  release all references to objects
    piReceiverReport =
                  (IReceiverReport *)m_tReceiverReportList.RemoveFirstEntry();
    while (piReceiverReport != NULL)
    {
        // Release Reference
        piReceiverReport->Release();

        // Get Next Entry
        piReceiverReport =
                   (IReceiverReport *)m_tReceiverReportList.RemoveNextEntry();
    }

    // Release other stored interfaces
    if(m_piRTCPNotify)
        m_piRTCPNotify->Release();
    if(m_piSetReceiverStatistics)
        m_piSetReceiverStatistics->Release();

}
Exemplo n.º 3
0
/**
 *
 * Method Name:  GetRTCPControl()
 *
 * Inputs:    None
 *
 * Outputs:   None
 *
 * Returns:   IRTCPControl *piRTCPControl  - Pointer to IRTCPControl Interface
 *
 * Description:  A static member function used ot obtain an RTCPControl
 *               interface.
 *
 * Usage Notes:  This method shall cause the RTCManager Singleton object to
 *               be created if it has not already been instantiated.
 *
 */
IRTCPControl *CRTCManager::getRTCPControl(void)
{

    // If the RTCManager does not yet exist or hasn't been started, then
    // acquire the lock to ensure that only one instance of the task is started
     // sLock.acquire();
    if (m_spoRTCManager == NULL)
    {
        ISDESReport *piSDESReport =
                            (ISDESReport *)CSourceDescription::GetLocalSDES();

        if((m_spoRTCManager = new CRTCManager(piSDESReport)) == NULL)
        {
            osPrintf("**** FAILURE **** CRTCManager::getRTCPControl() -"
                                      " RTCManager Object Creation Failed\n");
            piSDESReport->Release();
            return(NULL);
        }

        // Release Reference to SDES Report
        piSDESReport->Release();
    }

    // Check whether the RTCManager object has been initialized.
    // Initialize it if it has not yet been done.
    if(!m_spoRTCManager->IsInitialized())
    {
       if(!m_spoRTCManager->Initialize())
       {
           osPrintf("**** FAILURE **** CRTCManager::getRTCPControl() -"
                               " Unable to Initialize RTCManager object\n");
           m_spoRTCManager->Release();
           m_spoRTCManager = NULL;
           return(NULL);
       }

       return(m_spoRTCManager);
    }

     // sLock.release();
    // Bump the reference count to this object
    m_spoRTCManager->AddRef();

    return((IRTCPControl *)m_spoRTCManager);

}