multimediacommscontroller/tsrc/rtpsourcesinkstub/src/MccRtpDataSource_STUB.cpp
changeset 0 1bce908db942
child 32 f2ed1fc4c163
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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:    RTP Datasource
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include <in_sock.h>
       
    23 #include <mmf/common/mmfcontroller.h>
       
    24 #include <mmf/server/mmfvideoframebuffer.h>
       
    25 #include <mmf/server/mmfdatabuffer.h>
       
    26 #include "rtpapi.h"
       
    27 #include "mccrtpdatasource.h"
       
    28 #include "mccinternalevents.h"
       
    29 #include "formatstatemachine.h"
       
    30 #include "mccrtpdefs.h"
       
    31 #include "mmccinterfacedef.h"
       
    32 #include "mccinternaldef.h"
       
    33 
       
    34 // MACROS
       
    35 #define MCC_RTPSOURCE_ENDPOINT_ID reinterpret_cast<TUint32>( static_cast<MDataSource*>( this ) )
       
    36 
       
    37 
       
    38 // ============================= LOCAL FUNCTIONS ===============================
       
    39 
       
    40 // ============================ MEMBER FUNCTIONS ===============================
       
    41 
       
    42 // -----------------------------------------------------------------------------
       
    43 // CMccRtpDataSource::CMccRtpDataSource
       
    44 // C++ default constructor can NOT contain any code, that
       
    45 // might leave.
       
    46 // -----------------------------------------------------------------------------
       
    47 //
       
    48 CMccRtpDataSource::CMccRtpDataSource() : 
       
    49     CMccDataSource( KMccRtpSourceUid ),
       
    50     MMccRtpInterface(),
       
    51     iStandByTimerValue( KRtpStandByTimer ),
       
    52     iRtpStreamId( KNullId )
       
    53     {
       
    54     iCurRecvPayloadType = KMccPTNotDefined;
       
    55     }
       
    56 
       
    57 // -----------------------------------------------------------------------------
       
    58 // CMccRtpDataSource::ConstructSourceL
       
    59 // Symbian 2nd phase constructor can leave.
       
    60 // -----------------------------------------------------------------------------
       
    61 //
       
    62 void CMccRtpDataSource::ConstructSourceL( const TDesC8& /*aInitData*/ )
       
    63     {
       
    64     TRACE_RTP_SOURCE_PRINT ( "CMccRtpDataSource::ConstructSourceL" )
       
    65     }
       
    66 
       
    67 // -----------------------------------------------------------------------------
       
    68 // CMccRtpDataSource::NewSourceL
       
    69 // Static constructor.
       
    70 // -----------------------------------------------------------------------------
       
    71 //
       
    72 MDataSource* CMccRtpDataSource::NewSourceL( TUid /*aImplementationUid*/, 
       
    73                                             const TDesC8& /*aInitData*/ )
       
    74     {
       
    75     TRACE_RTP_SOURCE_PRINT( "CMccRtpDataSource::NewSourceL" )
       
    76 
       
    77     CMccRtpDataSource* self = new ( ELeave ) CMccRtpDataSource();
       
    78     return static_cast<MDataSource*>( self );
       
    79     }
       
    80 
       
    81 
       
    82 // -----------------------------------------------------------------------------
       
    83 // CMccRtpDataSource::~CMccRtpDataSource()
       
    84 // Destructor.
       
    85 // -----------------------------------------------------------------------------
       
    86 //
       
    87 CMccRtpDataSource::~CMccRtpDataSource()
       
    88     {
       
    89     TRACE_RTP_SOURCE_PRINT2( "CMccRtpDataSource::~CMccRtpDataSource 0x%x", this )
       
    90     TRACE_RTP_SOURCE_PRINT( "CMccRtpDataSource::~CMccRtpDataSource RTCP DELETE" )
       
    91     TRACE_RTP_SOURCE_PRINT( "CMccRtpDataSource::~CMccRtpDataSource BUFFER DELETE" )
       
    92     if ( iReference )
       
    93         {
       
    94         delete iBuffer;
       
    95         }
       
    96     }
       
    97 
       
    98 // -----------------------------------------------------------------------------
       
    99 // CMccRtpDataSource::FillBufferL
       
   100 // FillBufferL works synchronously.
       
   101 // -----------------------------------------------------------------------------
       
   102 //
       
   103 void CMccRtpDataSource::FillBufferL( CMMFBuffer* aBuffer, 
       
   104                                      MDataSink*  aConsumer, 
       
   105                                      TMediaId    /*aMediaId*/ )
       
   106     {    
       
   107     TRACE_RTP_SOURCE_PRINT ( "CMccRtpDataSource::FillBufferL" )
       
   108     
       
   109     __ASSERT_ALWAYS ( aConsumer, User::Leave( KErrArgument ) );
       
   110     
       
   111     if ( aBuffer )
       
   112         {
       
   113         __ASSERT_ALWAYS ( KUidMmfDataBuffer == aBuffer->Type( ), 
       
   114             User::Leave( KErrNotSupported ) );
       
   115         }
       
   116         
       
   117     iBufferToFill = static_cast<CMMFDataBuffer*>( aBuffer );
       
   118     iFillBufferRequester = aConsumer;
       
   119     }
       
   120 
       
   121 // -----------------------------------------------------------------------------
       
   122 // CMccRtpDataSource::CanCreateSourceBuffer
       
   123 // NOT SUPPORTED. MDataSource pure virtual function must to be implemented.
       
   124 // -----------------------------------------------------------------------------
       
   125 //
       
   126 TBool CMccRtpDataSource::CanCreateSourceBuffer()
       
   127     {
       
   128     return iCanCreateSourceBuffer;
       
   129     }
       
   130 
       
   131 // -----------------------------------------------------------------------------
       
   132 // CMccRtpDataSource::CreateSourceBufferL
       
   133 // NOT SUPPORTED. MDataSource pure virtual function must to be implemented.
       
   134 // -----------------------------------------------------------------------------
       
   135 //
       
   136 CMMFBuffer* CMccRtpDataSource::CreateSourceBufferL( TMediaId /*aMediaId*/,
       
   137                                                     TBool& aReference )
       
   138     {
       
   139     TRACE_RTP_SOURCE_PRINT ( "CMccRtpDataSource::CreateSourceBufferL KErrNotSupported" )
       
   140     
       
   141     if ( !iCanCreateSourceBuffer )
       
   142         {
       
   143         User::Leave( KErrNotSupported );
       
   144         }
       
   145     aReference = iReference;
       
   146     if ( iReference )
       
   147         {
       
   148         delete iBuffer;
       
   149         }
       
   150     iBuffer = NULL;
       
   151     if ( iWrongBufferType )
       
   152         {
       
   153         iBuffer = CMMFYUVBuffer::NewL();
       
   154         }
       
   155     else
       
   156         {
       
   157         iBuffer = CMMFDataBuffer::NewL( 100 );
       
   158         }
       
   159     return iBuffer;
       
   160     }
       
   161 
       
   162 // -----------------------------------------------------------------------------
       
   163 // CMccRtpDataSource::RtpPacketReceived
       
   164 // RTP stack callback function for received RTP packet.
       
   165 // -----------------------------------------------------------------------------
       
   166 //
       
   167 void CMccRtpDataSource::RtpPacketReceived( TRtpId /*aStreamId*/, 
       
   168                                            const TRtpRecvHeader& /*aHeaderInfo*/, 
       
   169                                            const TDesC8& /*aPayloadData*/ )
       
   170 	{
       
   171 
       
   172 	}
       
   173 
       
   174 // -----------------------------------------------------------------------------
       
   175 // CMccRtpDataSource::RtpPacketReceivedL
       
   176 // RTP stack callback function for received RTP packet.
       
   177 // -----------------------------------------------------------------------------
       
   178 //
       
   179 void CMccRtpDataSource::RtpPacketReceivedL( TRtpId /*aStreamId*/, 
       
   180                                            const TRtpRecvHeader& /*aHeaderInfo*/, 
       
   181                                            const TDesC8& /*aPayloadData*/ )
       
   182     {
       
   183     TRACE_RTP_SOURCE_PRINT( "CMccRtpDataSource::RtpPacketReceived" )
       
   184     }
       
   185 
       
   186 // -----------------------------------------------------------------------------
       
   187 // CMccRtpDataSource::SetSourceDataTypeCode
       
   188 // Sets the sources datatype code ( Codec )
       
   189 // -----------------------------------------------------------------------------
       
   190 //
       
   191 TInt CMccRtpDataSource::SetSourceDataTypeCode( TFourCC /*aCodec*/, TMediaId /*aMedia*/ )
       
   192     {
       
   193     return KErrNone;
       
   194     }
       
   195 
       
   196 // -----------------------------------------------------------------------------
       
   197 // CMccRtpDataSource::SourceDataTypeCode()
       
   198 // Sets the datatype code ( codec )
       
   199 // -----------------------------------------------------------------------------
       
   200 //
       
   201 TFourCC CMccRtpDataSource::SourceDataTypeCode( TMediaId /*aMediaId*/ )
       
   202     {
       
   203     return TFourCC();
       
   204     }
       
   205 
       
   206 // -----------------------------------------------------------------------------
       
   207 // CMccRtpDataSource::BufferEmptiedL
       
   208 // CMccRtpDataSource supports only passive mode of operation. 
       
   209 // Thus, Datapath->EmptyBufferL isn't called.
       
   210 // -----------------------------------------------------------------------------
       
   211 //
       
   212 void CMccRtpDataSource::BufferEmptiedL( CMMFBuffer* /*aBuffer*/ )
       
   213     {
       
   214     TRACE_RTP_SOURCE_PRINT( "CMccRtpDataSource::BufferEmptiedL KErrNotSupported" )
       
   215     
       
   216     User::Leave( KErrNotSupported );
       
   217     }
       
   218 
       
   219 // -----------------------------------------------------------------------------
       
   220 // CMccRtpDataSource::SourceThreadLogon
       
   221 //
       
   222 // Method to 'logon' the data source to the same thread that source will be 
       
   223 // consuming data in. Thread specific initialisation is done here.
       
   224 // -----------------------------------------------------------------------------
       
   225 //
       
   226 TInt CMccRtpDataSource::SourceThreadLogon( MAsyncEventHandler& /*aEventHandler*/ )
       
   227     {
       
   228     TRACE_RTP_SOURCE_PRINT( "CMccRtpDataSource::SourceThreadLogon" )
       
   229     return KErrNone;
       
   230     }
       
   231 
       
   232 // -----------------------------------------------------------------------------
       
   233 // CMccRtpDataSource::SourceThreadLogoff
       
   234 //
       
   235 // Method to 'logoff' the data source from the same thread that source consumes 
       
   236 // data in. Thread specific releasing of resources is done here.
       
   237 // -----------------------------------------------------------------------------
       
   238 //
       
   239 void CMccRtpDataSource::SourceThreadLogoff()
       
   240     {
       
   241     TRACE_RTP_SOURCE_PRINT( "CMccRtpDataSource::SourceThreadLogoff" )
       
   242     }
       
   243 
       
   244 // ---------------------------------------------------------------------------
       
   245 // CMccRtpDataSource::SourcePrimeL
       
   246 // Source must be primed before playing.
       
   247 // -----------------------------------------------------------------------------
       
   248 //
       
   249 void CMccRtpDataSource::SourcePrimeL()
       
   250     {
       
   251     TRACE_RTP_SOURCE_PRINT( "CMccRtpDataSource::SourcePrimeL" )
       
   252     }
       
   253 
       
   254 // -----------------------------------------------------------------------------
       
   255 // CMccRtpDataSource::SourcePlayL
       
   256 // Start receiving RTP packets.
       
   257 // -----------------------------------------------------------------------------
       
   258 //
       
   259 void CMccRtpDataSource::SourcePlayL()
       
   260     {
       
   261     TRACE_RTP_SOURCE_PRINT( "CMccRtpDataSource::SourcePlayL" )
       
   262     }
       
   263 
       
   264 // -----------------------------------------------------------------------------
       
   265 // CMccRtpDataSource::SourcePauseL
       
   266 // Pause RTP packet receiving.
       
   267 // -----------------------------------------------------------------------------
       
   268 //
       
   269 void CMccRtpDataSource::SourcePauseL()
       
   270     {
       
   271     TRACE_RTP_SOURCE_PRINT( "CMccRtpDataSource::SourcePauseL" )
       
   272     }
       
   273 
       
   274 // -----------------------------------------------------------------------------
       
   275 // CMccRtpDataSource::SourceStopL
       
   276 // Stop RTP packet receiving.
       
   277 // -----------------------------------------------------------------------------
       
   278 //
       
   279 void CMccRtpDataSource::SourceStopL()
       
   280     {
       
   281     TRACE_RTP_SOURCE_PRINT( "CMccRtpDataSource::SourceStopL" )
       
   282     }
       
   283 
       
   284 // -----------------------------------------------------------------------------
       
   285 // CMccRtpDataSource::PlayoutRtpPacketL
       
   286 // Pass filled buffer to the data sink of RTP data source.
       
   287 // -----------------------------------------------------------------------------
       
   288 //
       
   289 void CMccRtpDataSource::PlayoutRtpPacketL( const TRtpRecvHeader& /*aHeaderInfo*/, 
       
   290         const TDesC8& /*aPayloadData*/ )
       
   291     {
       
   292     TRACE_RTP_SOURCE_PRINT( "CMccRtpDataSource::PlayoutRtpPacketL" )
       
   293     __ASSERT_ALWAYS( iBufferToFill, User::Leave( KErrNotReady ) );
       
   294     __ASSERT_ALWAYS( iFillBufferRequester, User::Leave( KErrNotReady ) );
       
   295     }
       
   296 
       
   297 
       
   298 // -----------------------------------------------------------------------------
       
   299 // CMccRtpDataSource::DoCreateStreamL
       
   300 // Creates a receive stream.
       
   301 // -----------------------------------------------------------------------------
       
   302 //
       
   303 void CMccRtpDataSource::DoCreateStreamL()
       
   304     {
       
   305     TRACE_RTP_SOURCE_PRINT( "CMccRtpDataSource::DoCreateStreamL IN !!!!" )
       
   306     
       
   307     iRtpStreamId = 2;
       
   308     }
       
   309 
       
   310 // -----------------------------------------------------------------------------
       
   311 // CMccRtpDataSource::NegotiateSourceL
       
   312 // Derived from MDataSource
       
   313 // -----------------------------------------------------------------------------
       
   314 //
       
   315 void CMccRtpDataSource::NegotiateSourceL( MDataSink& aDataSink )
       
   316     {
       
   317     iFillBufferRequester = &aDataSink;
       
   318     }
       
   319 
       
   320 // -----------------------------------------------------------------------------
       
   321 // CMccRtpDataSource::SendMediaSignallingL
       
   322 // Derived from CRtpInterface
       
   323 // -----------------------------------------------------------------------------
       
   324 //
       
   325 void CMccRtpDataSource::SendMediaSignallingL( const TMccEvent& /*aEvent*/ )
       
   326     {
       
   327     TRACE_RTP_SOURCE_PRINT( "CMccRtpDataSource::SendMediaSignallingL" )
       
   328     }
       
   329 
       
   330 // -----------------------------------------------------------------------------
       
   331 // CMccRtpDataSource::StartInactivityTimer
       
   332 // Starts inactivity timer for a stream 
       
   333 // -----------------------------------------------------------------------------
       
   334 //
       
   335 void CMccRtpDataSource::StartInactivityTimerL( TUint32 /*aTimeoutTime*/ )
       
   336     {
       
   337     TRACE_RTP_SOURCE_PRINT ( "CMccRtpDataSource::StartInactivityTimerL" )
       
   338     }
       
   339 
       
   340 
       
   341 
       
   342 // -----------------------------------------------------------------------------
       
   343 // CMccRtpDataSource::StopInactivityTimer
       
   344 // Stops inactivity timer for a stream
       
   345 // -----------------------------------------------------------------------------
       
   346 //
       
   347 void CMccRtpDataSource::StopInactivityTimerL( )
       
   348     {
       
   349     TRACE_RTP_SOURCE_PRINT( "CMccRtpDataSource::StopInactivityTimerL" )
       
   350     }
       
   351     
       
   352     
       
   353 // -----------------------------------------------------------------------------
       
   354 // CMccRtpDataSource::StandBy
       
   355 // Stops inactivity timer for a stream
       
   356 // -----------------------------------------------------------------------------
       
   357 //
       
   358 TInt CMccRtpDataSource::StandBy( TMccStandbyActionType /*aActionType*/, TUint /*aPayloadType*/ )
       
   359     {
       
   360     TRACE_RTP_SOURCE_PRINT( "CMccRtpDataSource::StandBy" )
       
   361     return KErrNone;
       
   362     }
       
   363 
       
   364 // -----------------------------------------------------------------------------
       
   365 // CMccRtpDataSource::StartRtpStandByTimerL
       
   366 // Starts rtp StandBy timer 
       
   367 // -----------------------------------------------------------------------------
       
   368 //
       
   369 void CMccRtpDataSource::StartRtpStandByTimerL( TMccRtpUser* /*aUser*/ )
       
   370 	{
       
   371 	TRACE_RTP_SOURCE_PRINT ( "CMccRtpDataSource::StartRtpStandByTimerL" )
       
   372 	}
       
   373 	
       
   374 // -----------------------------------------------------------------------------
       
   375 // CMccRtpDataSource::StopRtpStandByTimers
       
   376 // Stop rtp StandBy timer 
       
   377 // -----------------------------------------------------------------------------
       
   378 //
       
   379 void CMccRtpDataSource::StopRtpStandByTimers()
       
   380 	{
       
   381 	TRACE_RTP_SOURCE_PRINT ( "CMccRtpDataSource::StopRtpStandByTimers" )
       
   382 	}
       
   383 
       
   384 // -----------------------------------------------------------------------------
       
   385 // CMccRtpDataSource::HandleStandByL
       
   386 // -----------------------------------------------------------------------------
       
   387 //	
       
   388 void CMccRtpDataSource::HandleStandByL( TMccRtpUser* /*aUser*/ )    
       
   389 	{
       
   390 	}
       
   391 
       
   392 // -----------------------------------------------------------------------------
       
   393 // CMccRtpDataSource::ResetStandBy
       
   394 // -----------------------------------------------------------------------------
       
   395 //
       
   396 void CMccRtpDataSource::ResetStandBy()
       
   397     {
       
   398     }
       
   399 
       
   400 // -----------------------------------------------------------------------------
       
   401 // CMccRtpDataSource::DoStandByDecision
       
   402 // -----------------------------------------------------------------------------
       
   403 //   	
       
   404 void CMccRtpDataSource::DoStandByDecision( TMccRtpUser* /*aUser*/ )
       
   405     {
       
   406     }
       
   407  
       
   408 // -----------------------------------------------------------------------------
       
   409 // CMccRtpDataSource::FindUserEntryByPayloadType
       
   410 // -----------------------------------------------------------------------------
       
   411 //   
       
   412 TMccRtpUser* CMccRtpDataSource::FindUserEntryByPayloadType( TUint /*aPayloadType*/ )
       
   413     {
       
   414     return NULL;
       
   415     }
       
   416 
       
   417 // -----------------------------------------------------------------------------
       
   418 // CMccRtpDataSource::FindUserEntryByTimerId
       
   419 // -----------------------------------------------------------------------------
       
   420 //    	
       
   421 TMccRtpUser* CMccRtpDataSource::FindUserEntryByTimerId( TMccTimerId /*aTimerId*/ )
       
   422     {
       
   423     return NULL;
       
   424     }
       
   425 
       
   426 // -----------------------------------------------------------------------------
       
   427 // CMccRtpDataSource::FindUserEntryIndex
       
   428 // -----------------------------------------------------------------------------
       
   429 //
       
   430 TInt CMccRtpDataSource::FindUserEntryIndex( TMccRtpUser* /*aUser*/ )
       
   431     {
       
   432     return KErrNotFound;
       
   433     }
       
   434  
       
   435 // -----------------------------------------------------------------------------
       
   436 // CMccRtpDataSource::RtpUserMatch
       
   437 // -----------------------------------------------------------------------------
       
   438 //  	
       
   439 TBool CMccRtpDataSource::RtpUserMatch( const TMccRtpUser& /*aUser1*/, 
       
   440     	            const TMccRtpUser& /*aUser2*/ )
       
   441     {
       
   442     return EFalse;
       
   443     }
       
   444 
       
   445 // -----------------------------------------------------------------------------
       
   446 // CMccRtpDataSource::RtpStreamId
       
   447 // -----------------------------------------------------------------------------
       
   448 //    
       
   449 TRtpId CMccRtpDataSource::RtpStreamId()
       
   450     {
       
   451     return iRtpStreamId;
       
   452     }
       
   453 
       
   454 // -----------------------------------------------------------------------------
       
   455 // CMccRtpDataSource::DoCreateSrtpStreamL
       
   456 // -----------------------------------------------------------------------------
       
   457 // 
       
   458 void CMccRtpDataSource::DoCreateSrtpStreamL()
       
   459     {
       
   460     }
       
   461     
       
   462 // -----------------------------------------------------------------------------
       
   463 // CMccRtpDataSource::RegisterPayloadTypesL
       
   464 // -----------------------------------------------------------------------------
       
   465 //
       
   466 void CMccRtpDataSource::RegisterPayloadTypesL( const RArray<TUint>& /*aPayloadTypes*/ )
       
   467     {
       
   468     TRACE_RTP_SOURCE_PRINT( "CMccRtpDataSource::RegisterPayloadTypesL" );
       
   469     }
       
   470             
       
   471 // -----------------------------------------------------------------------------
       
   472 // CMccRtpDataSource::UnRegisterPayloadTypes
       
   473 // Unregisters payload types to accept.
       
   474 // -----------------------------------------------------------------------------
       
   475 //
       
   476 void CMccRtpDataSource::UnRegisterPayloadTypes( const RArray<TUint>& /*aPayloadTypes*/ )
       
   477     {
       
   478 
       
   479     }
       
   480 
       
   481 // -----------------------------------------------------------------------------
       
   482 // CMccRtpDataSource::ValidatePacketL
       
   483 // Validates the received RTP packet and it's header
       
   484 // -----------------------------------------------------------------------------
       
   485 //
       
   486 TMccRtpUser* CMccRtpDataSource::ValidatePacketL( const TRtpId /*aStreamId*/, 
       
   487         const TRtpRecvHeader& /*aHeader*/, const TDesC8& /*aData*/ )
       
   488     {
       
   489     TRACE_RTP_SOURCE_PRINT( "CMccRtpDataSource::ValidatePacket" )
       
   490     return NULL;
       
   491     }
       
   492 
       
   493 // -----------------------------------------------------------------------------
       
   494 // CMccRtpDataSource::AddUserL
       
   495 // -----------------------------------------------------------------------------
       
   496 //
       
   497 void CMccRtpDataSource::AddUserL( TUint32 /*aStreamId*/ )
       
   498     {
       
   499 
       
   500     }
       
   501     
       
   502 // -----------------------------------------------------------------------------
       
   503 // CMccRtpDataSource::SendStreamEventToClient()
       
   504 // -----------------------------------------------------------------------------
       
   505 //	
       
   506 void CMccRtpDataSource::SendStreamEventToClient( 
       
   507     TMccEventType /*aEventType*/,
       
   508     TInt /*aError*/,
       
   509     TUint32 /*aTargetPayloadType*/ )
       
   510     {
       
   511     TRACE_RTP_SOURCE_PRINT( "CMccRtpDataSource::SendStreamEventToClient" )
       
   512 
       
   513     }
       
   514 
       
   515 // -----------------------------------------------------------------------------
       
   516 // CMccRtpDataSource::SendJitterEvent()
       
   517 // -----------------------------------------------------------------------------
       
   518 //	
       
   519 void CMccRtpDataSource::SendJitterEvent( TMccRtpEventData /*aEvent*/, TInt /*aError*/ )
       
   520     {
       
   521 
       
   522     }
       
   523 
       
   524 // -----------------------------------------------------------------------------
       
   525 // CMccRtpDataSource::SourceCustomCommand()
       
   526 // 
       
   527 // -----------------------------------------------------------------------------
       
   528 //
       
   529 void CMccRtpDataSource::SourceCustomCommand( TMMFMessage& /*aMessage*/ )
       
   530     {
       
   531 
       
   532     }
       
   533 
       
   534 // -----------------------------------------------------------------------------
       
   535 // CMccRtpDataSource::SourceCustomCommandL()
       
   536 // Worker function for TRAP'ping possible leaves that custom commands may have
       
   537 // -----------------------------------------------------------------------------
       
   538 //    
       
   539 void CMccRtpDataSource::SourceCustomCommandL( TMMFMessage& /*aMessage*/ )
       
   540     {
       
   541 
       
   542     }
       
   543 
       
   544 // ---------------------------------------------------------------------------
       
   545 // FROM SRTP API
       
   546 // This function is called by SRTP Stream initiated with 
       
   547 // MSRTPReKeyingObserver when a master key is stale and needs 
       
   548 // to be refreshed.  
       
   549 // ---------------------------------------------------------------------------
       
   550 //
       
   551 void CMccRtpDataSource::SRTPMasterKeyStaleEvent( const CSRTPStream& /*aStream*/ )
       
   552     {
       
   553     TRACE_RTP_INTERFACE_PRINT( "CMccRtpStream::SRTPMasterKeyStaleEvent" )
       
   554     }
       
   555 
       
   556 // ---------------------------------------------------------------------------
       
   557 // FROM SRTP API
       
   558 // This function is called by SRTP Stream initiated with 
       
   559 // CSRTPSession  when a master key is stale and
       
   560 // needs to be refreshed.  
       
   561 // ---------------------------------------------------------------------------
       
   562 void CMccRtpDataSource::SRTPMasterKeyStaleEvent(const CSRTPSession& /*aSession*/ )
       
   563     {
       
   564     TRACE_RTP_INTERFACE_PRINT( "CMccRtpStream::SRTPMasterKeyStaleEvent" )
       
   565     }
       
   566 
       
   567 // -----------------------------------------------------------------------------
       
   568 // CMccRtpDataSource::TimerExpiredL
       
   569 // From MMccExpirationHandler
       
   570 // -----------------------------------------------------------------------------
       
   571 //
       
   572 void CMccRtpDataSource::TimerExpiredL( TMccTimerId /*aTimerId*/, TAny* /*aTimerParam*/ )
       
   573     {
       
   574     }
       
   575 
       
   576 // -----------------------------------------------------------------------------
       
   577 // CMccRtpDataSource::RateAdaptationRequest
       
   578 // -----------------------------------------------------------------------------
       
   579 //     
       
   580 TInt CMccRtpDataSource::RateAdaptationRequest( const TMccEvent& aInputData, TMccEvent& aOutputData )
       
   581     {
       
   582     TInt error = 0;
       
   583     #ifdef RATECONTROL    
       
   584     TMccRateAdaptationEventDataPackage inputdatapkg;
       
   585 	inputdatapkg.Copy(aInputData.iEventData);
       
   586 	TMccRateAdaptationEventData inputdata = inputdatapkg();
       
   587     TMccRateAdaptationEventData outputdata =TMccRateAdaptationEventData();
       
   588     if ( ETrue)
       
   589     	{
       
   590     	TInt bitrate = 127000;
       
   591     	TReal frameRate = 15;
       
   592 		outputdata.iBitrateOriginal = bitrate;			
       
   593 		 __TRACE_MCC_QOS_CONTROLLER3("CMccRtpDataSource_STUB::RateAdaptationRequest originalBitrate=" , bitrate);
       
   594 		TInt mbitrate = TInt( inputdata.iRateAdaptationAdvice * TReal( bitrate ) );		
       
   595 		if ( mbitrate > 128000 )
       
   596 			{
       
   597 			mbitrate = 128000;
       
   598 			}
       
   599 		outputdata.iBitrateModified = mbitrate;
       
   600 		__TRACE_MCC_QOS_CONTROLLER3("CMccRtpDataSource_STUB::RateAdaptationRequest modifiedBitrate=" , mbitrate);
       
   601 		#ifdef FRAMERATECONTROL 	
       
   602 		if ( bitrate > KIPULFrameRate10Limit )
       
   603 			{
       
   604 		    __TRACE_MCC_QOS_CONTROLLER3("CMccRtpDataSource_STUB::RateAdaptationRequest frameRate=" , frameRate);
       
   605 			frameRate = iFrameRate;
       
   606 			}
       
   607 		else if (bitrate < KIPULFrameRate5Limit )
       
   608 			{
       
   609 			__TRACE_MCC_QOS_CONTROLLER3("CMccRtpDataSource_STUB::RateAdaptationRequest frameRate=" , frameRate);
       
   610 			frameRate = Min( 5.0, iFrameRate );
       
   611 			}
       
   612 		else 
       
   613 			{
       
   614 			__TRACE_MCC_QOS_CONTROLLER3("CMccRtpDataSource_STUB::RateAdaptationRequest frameRate=" , frameRate);
       
   615 			frameRate = Min( 10.0, iFrameRate );
       
   616 			}
       
   617 	
       
   618 		#else //FRAMERATECONTROL 
       
   619 		error = 0;
       
   620 		#endif //FRAMERATECONTROL 
       
   621 			
       
   622 		TMccRateAdaptationEventDataPackage temp( outputdata );
       
   623 		aOutputData.iEventData.Copy( temp );
       
   624 		__TRACE_MCC_QOS_CONTROLLER1("CMccRtpDataSource_STUB::RateAdaptationRequest end");
       
   625 		return KErrNone;		
       
   626     	}
       
   627 #else //RATECONTROL
       
   628 	error = aInputData.iErrorCode; //remove warning
       
   629     error = aOutputData.iErrorCode;
       
   630 #endif //RATECONTROL
       
   631     return KErrNotSupported;
       
   632     }
       
   633         
       
   634 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   635 
       
   636 //  End of File