multimediacommsengine/mmcesrv/mmcemediamanager/src/mcesrvsource.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 "mcesrvsource.h"
       
    22 #include "mcesrvstream.h"
       
    23 #include "mcecommediasource.h"
       
    24 #include "mceevent.h"
       
    25 #include "mcesrvstreamiterator.h"
       
    26 #include "mcesdpsession.h"
       
    27 #include "mcemediamanager.h"
       
    28 
       
    29 #define _MEDIA_SOURCE static_cast<CMceComMediaSource*>( &Data() )
       
    30 
       
    31 // ============================ MEMBER FUNCTIONS ===============================
       
    32 
       
    33 
       
    34     
       
    35 // -----------------------------------------------------------------------------
       
    36 // CMceSrvSource::CMceSrvSource
       
    37 // -----------------------------------------------------------------------------
       
    38 //
       
    39 CMceSrvSource::CMceSrvSource( CMceMediaManager& aManager,
       
    40                               CMceComMediaSource& aData )
       
    41     : CMceSrvEndpoint( aManager, aData )
       
    42     {
       
    43     }       
       
    44     
       
    45 // -----------------------------------------------------------------------------
       
    46 // CMceSrvSource::~CMceSrvSource
       
    47 // -----------------------------------------------------------------------------
       
    48 //
       
    49 CMceSrvSource::~CMceSrvSource()
       
    50     {
       
    51     //NOP
       
    52     }
       
    53 
       
    54 // -----------------------------------------------------------------------------
       
    55 // CMceSrvSource::Endpoint
       
    56 // -----------------------------------------------------------------------------
       
    57 //
       
    58 CMceSrvEndpoint& CMceSrvSource::Endpoint( CMceSrvStream& aStream )
       
    59     {
       
    60     return aStream.Source();
       
    61     }
       
    62  
       
    63 // -----------------------------------------------------------------------------
       
    64 // CMceSrvSink::HandleSecureEventReceivedL
       
    65 // -----------------------------------------------------------------------------
       
    66 //
       
    67 void CMceSrvSource::HandleSecureEventReceivedL( )
       
    68     {
       
    69 	TMceSrvStreamIterator streams( Data().MediaStream()->Session()->MccStreams(), 
       
    70                                    Data() );
       
    71     CMceSrvStream* stream = NULL;
       
    72     while ( streams.Next( stream )  )
       
    73         {
       
    74         if ( stream->Codec().iIsEnabled &&
       
    75              Endpoint( *stream ).State() > CMceSrvStream::EPrepared &&
       
    76              Endpoint( *stream ).State() != CMceSrvStream::EPaused )
       
    77             {
       
    78             Data().MediaStream()->Session()->SdpSession().Manager().PauseL(  *(_MEDIA_SOURCE) );
       
    79             }
       
    80         }
       
    81     
       
    82     }
       
    83     
       
    84 // End of file
       
    85