multimediacommsengine/mmcesrv/mmcemediamanager/src/mcepreparingoffererstreams.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 "mcepreparingoffererstreams.h"
       
    22 #include "mcestartingoffererreceivestreams.h"
       
    23 #include "mcecomsession.h"
       
    24 #include "mcesdpsession.h"
       
    25 #include "mcemmlogs.h"
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // TMcePreparingOffererStreams::SetAsCurrentStateL
       
    29 // -----------------------------------------------------------------------------
       
    30 //
       
    31 void TMcePreparingOffererStreams::SetAsCurrentStateL( CMceComSession& aSession )
       
    32     {
       
    33     MCEMM_DEBUG("TMcePreparingOffererStreams::SetAsCurrentStateL() ");
       
    34     
       
    35     TMcePreparingOffererStreams*
       
    36         self = new (ELeave) TMcePreparingOffererStreams( aSession );
       
    37 
       
    38     CleanupStack::PushL( self );
       
    39     aSession.SetNegotiationStateL( self );
       
    40     CleanupStack::Pop( self );
       
    41     
       
    42     }
       
    43 
       
    44 // -----------------------------------------------------------------------------
       
    45 // TMcePreparingOffererStreams::TMcePreparingOffererStreams
       
    46 // -----------------------------------------------------------------------------
       
    47 //
       
    48 TMcePreparingOffererStreams::TMcePreparingOffererStreams ( 
       
    49                                             CMceComSession& aSession )
       
    50                                             
       
    51     : TMcePreparingStreams( aSession,
       
    52                             EMceRoleOfferer,
       
    53                             TMceSrvStreamIterator::EAny )
       
    54     {
       
    55     }
       
    56 
       
    57 
       
    58 
       
    59 // -----------------------------------------------------------------------------
       
    60 // TMcePreparingOffererStreams::EntryL
       
    61 // -----------------------------------------------------------------------------
       
    62 //
       
    63 void TMcePreparingOffererStreams::EntryL()
       
    64     {
       
    65     if ( !iSession.IsMerged() && iSession.iMccID == KMceNotAssigned )
       
    66         {
       
    67         iSession.SdpSession().Manager().CreateMccSessionL( iSession );
       
    68         }
       
    69         
       
    70 	if ( iSession.iClientCryptoSuites.Count() )
       
    71 		{
       
    72 		iSession.SecureSessionL();
       
    73 		}
       
    74         
       
    75     PrepareStreamsL();
       
    76     }
       
    77 
       
    78 // -----------------------------------------------------------------------------
       
    79 // TMcePreparingOffererStreams::StreamsPreparedL
       
    80 // -----------------------------------------------------------------------------
       
    81 //
       
    82 void TMcePreparingOffererStreams::StreamsPreparedL()
       
    83     {
       
    84     
       
    85     //set next state, this state will become unusable
       
    86     TMceStartingOffererReceiveStreams::SetAsCurrentStateL( iSession );
       
    87     
       
    88     }
       
    89 
       
    90 // -----------------------------------------------------------------------------
       
    91 // TMcePreparingOffererStreams::StreamsStartedL
       
    92 // -----------------------------------------------------------------------------
       
    93 //
       
    94 void TMcePreparingOffererStreams::StreamsStartedL()
       
    95     {
       
    96 
       
    97     User::Leave( KErrGeneral );
       
    98     
       
    99     }
       
   100