multimediacommsengine/tsrc/MCETestUI/MCETestUIEngine/src/CMCETestUIEngineVideoCodec.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 //#include <MCEManager.h>
       
    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 #include <MCEMediaSink.h>
       
    32 #include <MCERtpSink.h>
       
    33 #include <MCERtpSource.h>
       
    34 #include <MCESpeakerSink.h>
       
    35 #include <MCEcodec.h>
       
    36 #include <MCEvideocodec.h>
       
    37 
       
    38 
       
    39 #include "CMCETestUIEngine.h"
       
    40 #include "MCETestUIEngineConstants.h"
       
    41 #include "CMCETestUIEngineVideoCodec.h"
       
    42 
       
    43 //#include "TMCETestUIEngineCmdBase.h"
       
    44 #include "TMCETestUIEngineCmdDeleteAudioCodec.h"
       
    45 
       
    46 // ============================ MEMBER FUNCTIONS ===============================
       
    47 
       
    48 // -----------------------------------------------------------------------------
       
    49 // CMCETestUIEngineVideoCodec::NewL()
       
    50 // -----------------------------------------------------------------------------
       
    51 //
       
    52 CMCETestUIEngineVideoCodec* CMCETestUIEngineVideoCodec::NewL(
       
    53             CMCETestUIEngine& aEngine, 
       
    54             CMceVideoCodec& aCodec )
       
    55     {
       
    56 
       
    57     CMCETestUIEngineVideoCodec* self = 
       
    58         new (ELeave) CMCETestUIEngineVideoCodec( aEngine, 
       
    59                                                   aCodec );
       
    60     CleanupStack::PushL( self );
       
    61     self->ConstructL();
       
    62     CleanupStack::Pop( self );
       
    63     return self;  
       
    64     }
       
    65 
       
    66 // -----------------------------------------------------------------------------
       
    67 // CMCETestUIEngineVideoCodec::CMCETestUIEngineVideoCodec
       
    68 // -----------------------------------------------------------------------------
       
    69 //
       
    70 CMCETestUIEngineVideoCodec::CMCETestUIEngineVideoCodec( 
       
    71                 CMCETestUIEngine& aEngine, 
       
    72             	CMceVideoCodec& aCodec  )
       
    73     : iEngine( aEngine ),
       
    74       iCodec( aCodec )
       
    75     {
       
    76     }
       
    77 
       
    78 // -----------------------------------------------------------------------------
       
    79 // CMCETestUIEngineVideoCodec::ConstructL()
       
    80 // -----------------------------------------------------------------------------
       
    81 //
       
    82 void CMCETestUIEngineVideoCodec::ConstructL()
       
    83     {
       
    84       return;
       
    85     }
       
    86 
       
    87 // -----------------------------------------------------------------------------
       
    88 // CMCETestUIEngineVideoCodec::~CMCETestUIEngineVideoCodec
       
    89 // -----------------------------------------------------------------------------
       
    90 //
       
    91 EXPORT_C CMCETestUIEngineVideoCodec::~CMCETestUIEngineVideoCodec()
       
    92     {
       
    93     iCommands.ResetAndDestroy();
       
    94     }
       
    95 
       
    96 // -----------------------------------------------------------------------------
       
    97 // CMCETestUIEngineCodec::GetCommands
       
    98 // -----------------------------------------------------------------------------
       
    99 //
       
   100 const RPointerArray<TMCETestUIEngineCmdBase>& 
       
   101             CMCETestUIEngineVideoCodec::GetCommandsL()
       
   102     {	
       
   103     iCommands.ResetAndDestroy();
       
   104     if ( iCodec.State() == CMceCodec::EDisabled )
       
   105         {
       
   106         iCommands.Append( new (ELeave) TMCETestUIEngineCmdEnableVideoCodec( 
       
   107                                 iEngine, *this ) );
       
   108         iCommands.Append( new (ELeave) TMCETestUIEngineCmdStandByVideoCodec( 
       
   109                                 iEngine, *this ) );
       
   110         }
       
   111     else if(iCodec.State() == CMceCodec::EEnabled)
       
   112         {
       
   113         iCommands.Append( new (ELeave) TMCETestUIEngineCmdDisableVideoCodec( 
       
   114                                 iEngine, *this ) );
       
   115         iCommands.Append( new (ELeave) TMCETestUIEngineCmdStandByVideoCodec( 
       
   116                                 iEngine, *this ) );
       
   117         }
       
   118     else if(iCodec.State() == CMceCodec::EStandby)
       
   119     	{
       
   120         iCommands.Append( new (ELeave) TMCETestUIEngineCmdEnableVideoCodec( 
       
   121                                 iEngine, *this ) );
       
   122         iCommands.Append( new (ELeave) TMCETestUIEngineCmdDisableVideoCodec( 
       
   123                                 iEngine, *this ) );
       
   124         }  
       
   125         
       
   126     iCommands.Append( new (ELeave) TMCETestUIEngineCmdDeleteVideoCodec( 
       
   127                                 iEngine, *this ) );
       
   128     return iCommands; 
       
   129     }
       
   130 // -----------------------------------------------------------------------------
       
   131 // CMCETestUIEngineVideoCodec::Codec
       
   132 // -----------------------------------------------------------------------------
       
   133 //
       
   134 EXPORT_C CMceVideoCodec& CMCETestUIEngineVideoCodec::Codec()
       
   135 	{
       
   136       return iCodec;
       
   137     }
       
   138 // -----------------------------------------------------------------------------
       
   139 // CMCETestUIEngineVideoSink::State
       
   140 // -----------------------------------------------------------------------------
       
   141 //
       
   142 EXPORT_C const TDesC16& CMCETestUIEngineVideoCodec::State() const
       
   143     {
       
   144     if(iCodec.State() == CMceCodec::EEnabled) 
       
   145         {
       
   146         return KCodecStateEnabled;
       
   147         }
       
   148     else if(iCodec.State() == CMceCodec::EDisabled) 
       
   149         {
       
   150         return KCodecStateDisabled;
       
   151         }
       
   152     return KCodecStateStandBy;
       
   153     }
       
   154         
       
   155 
       
   156 
       
   157 // -----------------------------------------------------------------------------
       
   158 // CMCETestUIEngineVideoSink::AudioStream
       
   159 // -----------------------------------------------------------------------------
       
   160 //
       
   161 
       
   162 EXPORT_C TMceCodecType CMCETestUIEngineVideoCodec::Type()
       
   163 {
       
   164 	return iCodec.Type();
       
   165 }
       
   166 
       
   167