multimediacommsengine/tsrc/MCETestUI/MCETestUIEngine/src/CMCETestUIEngineVideoSink.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 // MCE API
       
    22 
       
    23 
       
    24 
       
    25 #include <MCESession.h>
       
    26 #include <MCEMediaStream.h>
       
    27 //#include <MCEOneWayStream.h>
       
    28 #include <MCEVideoStream.h>
       
    29 #include <MCEMediaSource.h>
       
    30 #include <MCEMicSource.h>
       
    31 
       
    32 #include <MCERtpSink.h>
       
    33 #include <MCEMediaSink.h>
       
    34 #include <MCESpeakerSink.h>
       
    35 
       
    36 
       
    37 
       
    38 #include "CMCETestUIEngine.h"
       
    39 #include "MCETestUIEngineConstants.h"
       
    40 #include "CMCETestUIEngineVideoSink.h"
       
    41 #include "TMCETestUIEngineCmdBase.h"
       
    42 #include "TMCETestUIEngineCmdEnableAudioSink.h"
       
    43 #include "TMCETestUIEngineCmdDisableAudioSink.h"
       
    44 // ============================ MEMBER FUNCTIONS ===============================
       
    45 
       
    46 // -----------------------------------------------------------------------------
       
    47 // CMCETestUIEngineVideoSink::NewL()
       
    48 // -----------------------------------------------------------------------------
       
    49 //
       
    50 CMCETestUIEngineVideoSink* CMCETestUIEngineVideoSink::NewL(
       
    51             CMCETestUIEngine& aEngine, 
       
    52             CMceMediaSink& aSink )
       
    53     {
       
    54 
       
    55     CMCETestUIEngineVideoSink* self = 
       
    56         new (ELeave) CMCETestUIEngineVideoSink( aEngine, 
       
    57                                                   aSink );
       
    58     CleanupStack::PushL( self );
       
    59     self->ConstructL();
       
    60     CleanupStack::Pop( self );
       
    61     return self;  
       
    62     }
       
    63 
       
    64 // -----------------------------------------------------------------------------
       
    65 // CMCETestUIEngineVideoSink::CMCETestUIEngineVideoSink
       
    66 // -----------------------------------------------------------------------------
       
    67 //
       
    68 CMCETestUIEngineVideoSink::CMCETestUIEngineVideoSink( 
       
    69                 CMCETestUIEngine& aEngine, 
       
    70             	CMceMediaSink& aSink )
       
    71     : iEngine( aEngine ),
       
    72       iSink( aSink )
       
    73     {
       
    74     }
       
    75 
       
    76 // -----------------------------------------------------------------------------
       
    77 // CMCETestUIEngineSink::ConstructL()
       
    78 // -----------------------------------------------------------------------------
       
    79 //
       
    80 void CMCETestUIEngineVideoSink::ConstructL()
       
    81     {
       
    82 	return; //solve direction function is availble in engineaudiostream.h 
       
    83     }
       
    84 
       
    85 // -----------------------------------------------------------------------------
       
    86 // CMCETestUIEngineSink::~CMCETestUIEngineSink
       
    87 // -----------------------------------------------------------------------------
       
    88 //
       
    89 EXPORT_C CMCETestUIEngineVideoSink::~CMCETestUIEngineVideoSink()
       
    90     {
       
    91     iCommands.ResetAndDestroy();
       
    92     }
       
    93 
       
    94 // -----------------------------------------------------------------------------
       
    95 // CMCETestUIEngineVideoSink::GetCommands
       
    96 // -----------------------------------------------------------------------------
       
    97 //
       
    98 const RPointerArray<TMCETestUIEngineCmdBase>& 
       
    99             CMCETestUIEngineVideoSink::GetCommandsL()
       
   100     {	
       
   101     iCommands.ResetAndDestroy();
       
   102     
       
   103     if ( iSink.IsEnabled() )
       
   104         {
       
   105         iCommands.Append( new (ELeave) TMCETestUIEngineCmdDisableVideoSink( 
       
   106                                 iEngine, *this ) );
       
   107         }
       
   108     else
       
   109         {
       
   110         iCommands.Append( new (ELeave) TMCETestUIEngineCmdEnableVideoSink( 
       
   111                                 iEngine, *this ) );
       
   112         }	  
       
   113         
       
   114     return iCommands; 
       
   115     }
       
   116 
       
   117 
       
   118 // -----------------------------------------------------------------------------
       
   119 // CMCETestUIEngineVideoSink::State
       
   120 // -----------------------------------------------------------------------------
       
   121 //
       
   122 EXPORT_C const TDesC16& CMCETestUIEngineVideoSink::State() const
       
   123     {
       
   124     if ( iSink.IsEnabled() )
       
   125         {
       
   126         return KSinkStateEnabled;
       
   127         }
       
   128     return KSinkStateDisabled;
       
   129     }
       
   130         
       
   131 
       
   132 // -----------------------------------------------------------------------------
       
   133 // CMCETestUIEngineVideoSink::AudioStream
       
   134 // -----------------------------------------------------------------------------
       
   135 //
       
   136 EXPORT_C CMceMediaSink& CMCETestUIEngineVideoSink::Sink()
       
   137     {        
       
   138     return iSink;
       
   139     }
       
   140 
       
   141 // -----------------------------------------------------------------------------
       
   142 // CMCETestUIEngineVideoSink::AudioStream
       
   143 // -----------------------------------------------------------------------------
       
   144 //
       
   145 
       
   146 EXPORT_C TMceSinkType CMCETestUIEngineVideoSink::Type()
       
   147 {
       
   148 	return iSink.Type();
       
   149 }
       
   150 
       
   151 // -----------------------------------------------------------------------------
       
   152 // CMCETestUIEngineVideoSink::AudioStream
       
   153 // -----------------------------------------------------------------------------
       
   154 //
       
   155 
       
   156 void CMCETestUIEngineVideoSink::EnableL() 
       
   157 {
       
   158 	iSink.EnableL();
       
   159 }
       
   160 
       
   161 // -----------------------------------------------------------------------------
       
   162 // CMCETestUIEngineVideoSink::AudioStream
       
   163 // -----------------------------------------------------------------------------
       
   164 //
       
   165 
       
   166 void CMCETestUIEngineVideoSink::DisableL() 
       
   167 {
       
   168 	iSink.DisableL();
       
   169 }