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