multimediacommsengine/mmcesrv/mmcemediamanager/src/mceansweringmedia.cpp
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #include "mceansweringmedia.h"
       
    22 #include "mcemediamanager.h"
       
    23 #include "mcepreparinganswererstreams.h"
       
    24 #include "mcecomsession.h"
       
    25 #include "mcesdpsession.h"
       
    26 #include "mcemmlogs.h"
       
    27 
       
    28 
       
    29 // -----------------------------------------------------------------------------
       
    30 // TMceAnsweringMedia::SetAsCurrentStateL
       
    31 // -----------------------------------------------------------------------------
       
    32 //
       
    33 void TMceAnsweringMedia::SetAsCurrentStateL( CMceComSession& aSession )
       
    34     {
       
    35     MCEMM_DEBUG("TMceAnsweringMedia::SetAsCurrentStateL() ");
       
    36     
       
    37     TMceAnsweringMedia*
       
    38         self = new (ELeave) TMceAnsweringMedia( aSession );
       
    39 
       
    40     CleanupStack::PushL( self );
       
    41     aSession.SetNegotiationStateL( self );
       
    42     CleanupStack::Pop( self );
       
    43     
       
    44     }
       
    45 
       
    46 
       
    47 // -----------------------------------------------------------------------------
       
    48 // TMceAnsweringMedia::TMceAnsweringMedia
       
    49 // -----------------------------------------------------------------------------
       
    50 //
       
    51 TMceAnsweringMedia::TMceAnsweringMedia ( CMceComSession& aSession )
       
    52     : TMceMediaState( aSession )
       
    53     {
       
    54     SetRole( EMceRoleAnswerer );
       
    55     }
       
    56 
       
    57 
       
    58 
       
    59 // -----------------------------------------------------------------------------
       
    60 // TMceAnsweringMedia::UpdateL
       
    61 // -----------------------------------------------------------------------------
       
    62 //
       
    63 
       
    64 
       
    65 void TMceAnsweringMedia::UpdateL()
       
    66     {
       
    67 
       
    68     MCEMM_DEBUG("TMceAnsweringMedia::UpdateL(), Entry ");
       
    69 
       
    70     //(re-)create mcc streams
       
    71     iSession.PrepareL( iSession.SdpSession().Manager() );
       
    72     
       
    73     //do validation
       
    74     TMceSrvStreamIterator streams( iSession.MccStreams() );
       
    75     CMceSrvStream* stream = NULL;
       
    76     while( streams.Next( stream ) )
       
    77         {
       
    78         iSession.SdpSession().Manager().ValidateMccStreamL( *stream );
       
    79         MCEMM_DEBUG_STREAM( "TMceAnsweringMedia::UpdateL(): validated stream", *stream );
       
    80         
       
    81         }
       
    82     
       
    83     //set next state, this state will become unusable
       
    84     TMcePreparingAnswererStreams::SetAsCurrentStateL( iSession );
       
    85     
       
    86     MCEMM_DEBUG("TMceAnsweringMedia::UpdateL(), Exit ");
       
    87     
       
    88     }
       
    89 
       
    90