multimediacommscontroller/tsrc/rtpsourcesinkstub/src/MccRtpDataSink_STUB.cpp
changeset 0 1bce908db942
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 Datasink
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include <mmf/common/mmfcontroller.h> 
       
    23 #include "rtpheader.h"
       
    24 #include "mccrtpdatasink.h"
       
    25 #include "mmccevents.h"
       
    26 #include "mccinternaldef.h"
       
    27 #include "mccrtpdefs.h"
       
    28 #include "mmccinterfacedef.h"
       
    29 
       
    30 // MACROS
       
    31 
       
    32 // EXTERNAL DATA STRUCTURES
       
    33 
       
    34 // EXTERNAL FUNCTION PROTOTYPES  
       
    35 
       
    36 // CONSTANTS
       
    37 
       
    38 // MACROS
       
    39 #define MCC_RTPSINK_ENDPOINT_ID MCC_ENDPOINT_ID( static_cast<MDataSink*>( this ) )
       
    40 
       
    41 // LOCAL CONSTANTS AND MACROS
       
    42 
       
    43 // MODULE DATA STRUCTURES
       
    44 
       
    45 // LOCAL FUNCTION PROTOTYPES
       
    46 
       
    47 // FORWARD DECLARATIONS
       
    48 
       
    49 // ============================= LOCAL FUNCTIONS ===============================
       
    50 
       
    51 // ============================ MEMBER FUNCTIONS ===============================
       
    52 
       
    53 // -----------------------------------------------------------------------------
       
    54 // CMccRtpDataSink::CMccRtpDataSink
       
    55 // C++ default constructor can NOT contain any code, that
       
    56 // might leave.
       
    57 // -----------------------------------------------------------------------------
       
    58 //
       
    59 CMccRtpDataSink::CMccRtpDataSink() :
       
    60     CMccDataSink( KMccRtpSinkUid ),
       
    61     MMccRtpInterface(), iRtpStreamId( KNullId )
       
    62     {
       
    63     }
       
    64 
       
    65 // -----------------------------------------------------------------------------
       
    66 // CMccRtpDataSink::NewSinkL
       
    67 // Static constructor.
       
    68 // -----------------------------------------------------------------------------
       
    69 //
       
    70 MDataSink* CMccRtpDataSink::NewSinkL( TUid /*aImplementationUid*/, 
       
    71                                       const TDesC8& /*aInitData*/ )
       
    72     {
       
    73     TRACE_RTP_SINK_PRINT( "CMccRtpDataSink::NewSinkL()" )
       
    74        
       
    75     CMccRtpDataSink* self = new ( ELeave ) CMccRtpDataSink();
       
    76     return static_cast<MDataSink*>( self ); 
       
    77     }
       
    78 
       
    79 // -----------------------------------------------------------------------------
       
    80 // CMccRtpDataSink::ConstructSinkL
       
    81 // class MDataSink inherited 2nd phase construction
       
    82 // -----------------------------------------------------------------------------
       
    83 //
       
    84 void CMccRtpDataSink::ConstructSinkL( const TDesC8& /*aInitData*/ )
       
    85     {
       
    86     TRACE_RTP_SINK_PRINT( "CMccRtpDataSink::ConstructSinkL" )
       
    87     }
       
    88 
       
    89 // -----------------------------------------------------------------------------
       
    90 // CMccRtpDataSink::~CMccRtpDataSink
       
    91 // Destructor
       
    92 // -----------------------------------------------------------------------------
       
    93 //
       
    94 CMccRtpDataSink::~CMccRtpDataSink()
       
    95     {
       
    96     TRACE_RTP_SINK_PRINT2( "CMccRtpDataSink::~CMccRtpDataSink 0x%x", this )
       
    97     }
       
    98 
       
    99 // -----------------------------------------------------------------------------
       
   100 // CMccRtpDataSink::SetCurrentUser
       
   101 // -----------------------------------------------------------------------------
       
   102 //
       
   103 void CMccRtpDataSink::Mute( TBool aMuteOn, TUint8 aExceptionPt )
       
   104     {
       
   105     TRACE_RTP_SINK_PRINT3( "CMccRtpDataSink::Mute, STATE: %d, PT: %u", 
       
   106         aMuteOn, aExceptionPt )
       
   107     
       
   108     iMuteOn = aMuteOn;
       
   109     iExceptionPt = aExceptionPt;
       
   110     }
       
   111 
       
   112 // -----------------------------------------------------------------------------
       
   113 // CMccRtpDataSink::SetCurrentUser
       
   114 // -----------------------------------------------------------------------------
       
   115 //
       
   116 void CMccRtpDataSink::SetCurrentUser( MAsyncEventHandler* /*aEventHandler*/ )
       
   117     {
       
   118 //    iEventHandler = aEventHandler;
       
   119     }
       
   120     
       
   121 // -----------------------------------------------------------------------------
       
   122 // CMccRtpDataSink::SinkThreadLogon
       
   123 //
       
   124 // Method to 'logon' the data sink to the same thread that sink will be consuming
       
   125 // data in. Thread specific initialisation is done here.
       
   126 // -----------------------------------------------------------------------------
       
   127 //
       
   128 TInt CMccRtpDataSink::SinkThreadLogon( MAsyncEventHandler& /*aEventHandler*/ ) 
       
   129     {
       
   130     TRACE_RTP_SINK_PRINT ( "CMccRtpDataSink::SinkThreadLogon" )
       
   131     return KErrNone;
       
   132     }
       
   133 
       
   134 // -----------------------------------------------------------------------------
       
   135 // CMccRtpDataSink::SinkThreadLogoff
       
   136 //
       
   137 // Method to 'logoff' the data sink from the same thread that sink consumes 
       
   138 // data in. Thread specific releasing of resources is done here.
       
   139 // -----------------------------------------------------------------------------
       
   140 //
       
   141 void CMccRtpDataSink::SinkThreadLogoff() 
       
   142     {
       
   143     TRACE_RTP_SINK_PRINT( "CMccRtpDataSink::SinkThreadLogoff" )
       
   144     }
       
   145 
       
   146 // -----------------------------------------------------------------------------
       
   147 // CMccRtpDataSink::SetSinkDataTypeCode
       
   148 // Sets the datatype code ( codec )
       
   149 // ----------------------------------------------------------------------------- 
       
   150 //
       
   151 TInt CMccRtpDataSink::SetSinkDataTypeCode( TFourCC /*aCodec*/, TMediaId /*aMedia*/ )
       
   152     {
       
   153     return KErrNone;
       
   154     }
       
   155 
       
   156 // -----------------------------------------------------------------------------
       
   157 // CMccRtpDataSink::SinkDataTypeCode
       
   158 // Returns the datatype code ( codec )
       
   159 // -----------------------------------------------------------------------------
       
   160 //
       
   161 TFourCC CMccRtpDataSink::SinkDataTypeCode( TMediaId aMediaId )
       
   162     {
       
   163     if ( KUidMediaTypeAudio == aMediaId.iMediaType )
       
   164         {
       
   165         return iCodecInfo.iFourCC;
       
   166         }
       
   167     else
       
   168         {
       
   169         // Initializes to KMMFFourCCCodeNULL so the caller cannot see
       
   170         // if this sink really has some media type currently registered
       
   171         return TFourCC();
       
   172         }
       
   173     }
       
   174 
       
   175 // -----------------------------------------------------------------------------
       
   176 // CMccRtpDataSink::EmptyBufferL
       
   177 // NOT SUPPORTED. MDataSink pure virtual function must be implemented.
       
   178 // -----------------------------------------------------------------------------
       
   179 //
       
   180 void CMccRtpDataSink::EmptyBufferL( CMMFBuffer* /*aBuffer*/, 
       
   181                                     MDataSource* /*aSupplier*/, 
       
   182                                     TMediaId /*aMediaId*/ )
       
   183     {
       
   184     }
       
   185 
       
   186 // -----------------------------------------------------------------------------
       
   187 // CMccRtpDataSink::EmptyBufferL
       
   188 // Overload to class MDataSink pure virtual function implementation.
       
   189 // Take RTP packet in the buffer and send it.
       
   190 // -----------------------------------------------------------------------------
       
   191 //
       
   192 void CMccRtpDataSink::EmptyBufferL( CMMFBuffer* aBuffer,
       
   193                                     MDataSource* aSupplier,
       
   194                                     TMediaId /*aMediaId*/,
       
   195                                     TRtpSendHeader& /*aHeaderInfo*/ )
       
   196     {
       
   197     __ASSERT_ALWAYS( aBuffer, User::Leave( KErrArgument ) );
       
   198     __ASSERT_ALWAYS( aSupplier, User::Leave( KErrArgument ) );
       
   199     }
       
   200 
       
   201 // -----------------------------------------------------------------------------
       
   202 // CMccRtpDataSink::BufferFilledL
       
   203 // NOT SUPPORTED. MDataSink pure virtual function must be implemented.
       
   204 // -----------------------------------------------------------------------------
       
   205 //
       
   206 void CMccRtpDataSink::BufferFilledL( CMMFBuffer* /*aBuffer*/ )
       
   207     {
       
   208     User::Leave( KErrNotSupported );
       
   209     }
       
   210 
       
   211 // -----------------------------------------------------------------------------
       
   212 // CMccRtpDataSink::CanCreateSinkBuffer
       
   213 // NOT SUPPORTED. MDataSink pure virtual function must be implemented.
       
   214 // -----------------------------------------------------------------------------
       
   215 //
       
   216 TBool CMccRtpDataSink::CanCreateSinkBuffer()
       
   217     {
       
   218     return EFalse;
       
   219     }
       
   220 
       
   221 // -----------------------------------------------------------------------------
       
   222 // CMccRtpDataSink::CreateSinkBufferL
       
   223 // NOT SUPPORTED. MDataSink pure virtual function must be implemented.
       
   224 // -----------------------------------------------------------------------------
       
   225 //
       
   226 CMMFBuffer* CMccRtpDataSink::CreateSinkBufferL( TMediaId /*aMediaId*/,
       
   227                                                 TBool& /*aReference*/ )
       
   228     {
       
   229     User::Leave( KErrNotSupported ); 
       
   230     return NULL;
       
   231     }
       
   232 
       
   233 // -----------------------------------------------------------------------------
       
   234 // CMccRtpDataSink::SinkPrimeL
       
   235 // Prime the sink. 
       
   236 // -----------------------------------------------------------------------------
       
   237 //
       
   238 void CMccRtpDataSink::SinkPrimeL()
       
   239     { 
       
   240     TRACE_RTP_SINK_PRINT( "CMccRtpDataSink::SinkPrimeL" )
       
   241     }
       
   242 
       
   243 // -----------------------------------------------------------------------------
       
   244 // CMccRtpDataSink::SinkPlayL
       
   245 // Start the playout operation.
       
   246 // -----------------------------------------------------------------------------
       
   247 //
       
   248 void CMccRtpDataSink::SinkPlayL()
       
   249     {
       
   250     TRACE_RTP_SINK_PRINT( "CMccRtpDataSink::SinkPlayL IN" )
       
   251     }
       
   252 
       
   253 // -----------------------------------------------------------------------------
       
   254 // CMccRtpDataSink::SinkPauseL
       
   255 // Pauses the playout operation.
       
   256 // -----------------------------------------------------------------------------
       
   257 //
       
   258 void CMccRtpDataSink::SinkPauseL()
       
   259     {
       
   260     TRACE_RTP_SINK_PRINT( "CMccRtpDataSink::SinkPauseL" )
       
   261     }
       
   262 
       
   263 // -----------------------------------------------------------------------------
       
   264 // CMccRtpDataSink::SinkStopL
       
   265 // Stop the playout operation. 
       
   266 // -----------------------------------------------------------------------------
       
   267 //
       
   268 void CMccRtpDataSink::SinkStopL()
       
   269     {
       
   270     TRACE_RTP_SINK_PRINT( "CMccRtpDataSink::SinkStopL" )
       
   271     }
       
   272 
       
   273 // -----------------------------------------------------------------------------
       
   274 // CMccRtpDataSink::SendMediaSignallingL()
       
   275 // Sends media level signalling
       
   276 // -----------------------------------------------------------------------------
       
   277 //
       
   278 void CMccRtpDataSink::SendMediaSignallingL( const TMccEvent& /*aEvent*/ )
       
   279     {
       
   280     TRACE_RTP_SINK_PRINT( "CMccRtpDataSink::SendMediaSignallingL" )
       
   281     }
       
   282 
       
   283 // -----------------------------------------------------------------------------
       
   284 // CMccRtpDataSink::DoCreateStreamL
       
   285 // Creates a transmit stream.
       
   286 // -----------------------------------------------------------------------------
       
   287 //
       
   288 void CMccRtpDataSink::DoCreateStreamL()
       
   289     {
       
   290     TRACE_RTP_SINK_PRINT( "CMccRtpDataSink::DoCreateStreamL" )
       
   291     
       
   292     iRtpStreamId = 1;
       
   293     }
       
   294 
       
   295 
       
   296 // ---------------------------------------------------------------------------
       
   297 // CMccRtpDataSink::SinkCustomCommand()
       
   298 // 
       
   299 // ---------------------------------------------------------------------------
       
   300 //
       
   301 void CMccRtpDataSink::SinkCustomCommand( TMMFMessage& /*aMessage*/ )
       
   302     {
       
   303     TRACE_RTP_SINK_PRINT( "CMccRtpDataSink::SinkCustomCommand" )
       
   304     }
       
   305 
       
   306 // ---------------------------------------------------------------------------
       
   307 // CMccRtpDataSink::SendRTCPData()
       
   308 // Sends Non-RTCP data
       
   309 // ---------------------------------------------------------------------------
       
   310 //    
       
   311 void CMccRtpDataSink::SendRTCPDataL( const TDesC8& /*aData*/ )
       
   312     {
       
   313     }
       
   314     
       
   315 // -----------------------------------------------------------------------------
       
   316 // CMccRtpDataSink::HandleBySsrc
       
   317 // -----------------------------------------------------------------------------
       
   318 //   
       
   319 TBool CMccRtpDataSink::HandleBySsrc( const TRtpSSRC& /*aSsrc*/ )
       
   320     {
       
   321     return ETrue;
       
   322     }
       
   323     
       
   324 // -----------------------------------------------------------------------------
       
   325 // CMccRtpDataSink::RtpStreamId
       
   326 // -----------------------------------------------------------------------------
       
   327 //    
       
   328 TRtpId CMccRtpDataSink::RtpStreamId()
       
   329     {
       
   330     return iRtpStreamId;
       
   331     }
       
   332     
       
   333 // -----------------------------------------------------------------------------
       
   334 // CMccRtpDataSink::DoCreateSrtpStreamL
       
   335 // -----------------------------------------------------------------------------
       
   336 // 
       
   337 void CMccRtpDataSink::DoCreateSrtpStreamL()
       
   338     {
       
   339     }
       
   340     
       
   341 // -----------------------------------------------------------------------------
       
   342 // CMccRtpDataSink::IsSink
       
   343 // -----------------------------------------------------------------------------
       
   344 //
       
   345 TBool CMccRtpDataSink::IsSink() const
       
   346     {
       
   347     return ETrue;
       
   348     }
       
   349 
       
   350 // -----------------------------------------------------------------------------
       
   351 // CMccRtpDataSink::IsSending
       
   352 // -----------------------------------------------------------------------------
       
   353 //        
       
   354 TBool CMccRtpDataSink::IsSending() const
       
   355     {
       
   356     return ETrue;
       
   357     }
       
   358     
       
   359 // -----------------------------------------------------------------------------
       
   360 // CMccRtpDataSink::AddUserL
       
   361 // -----------------------------------------------------------------------------
       
   362 //
       
   363 void CMccRtpDataSink::AddUserL( TUint32 /*aStreamId*/ )
       
   364     {
       
   365     
       
   366     }
       
   367 
       
   368 // -----------------------------------------------------------------------------
       
   369 // CMccRtpDataSink::SendStreamEventToClient()
       
   370 // -----------------------------------------------------------------------------
       
   371 //	
       
   372 void CMccRtpDataSink::SendStreamEventToClient( 
       
   373     TMccEventType /*aEventType*/,
       
   374     TInt /*aError*/ )
       
   375     {
       
   376     TRACE_RTP_SOURCE_PRINT( "CMccRtpDataSink::SendStreamEventToClient" )
       
   377     }
       
   378     
       
   379 // ---------------------------------------------------------------------------
       
   380 // CMccRtpDataSink::SetMediaClock
       
   381 // ---------------------------------------------------------------------------
       
   382 //    
       
   383 void CMccRtpDataSink::SetMediaClock( CMccRtpMediaClock& /*aRtpMediaClock*/ )
       
   384     {
       
   385     TRACE_RTP_SINK_PRINT( "CMccRtpDataSink::SetMediaClock" )
       
   386     
       
   387     //iRtpMediaClock = &aRtpMediaClock;   
       
   388     }    
       
   389     
       
   390 // ---------------------------------------------------------------------------
       
   391 // FROM SRTP API
       
   392 // This function is called by SRTP Stream initiated with 
       
   393 // MSRTPReKeyingObserver when a master key is stale and needs 
       
   394 // to be refreshed.  
       
   395 // ---------------------------------------------------------------------------
       
   396 //
       
   397 void CMccRtpDataSink::SRTPMasterKeyStaleEvent( const CSRTPStream& /*aStream*/ )
       
   398     {
       
   399     }
       
   400 
       
   401 // ---------------------------------------------------------------------------
       
   402 // FROM SRTP API
       
   403 // This function is called by SRTP Stream initiated with 
       
   404 // CSRTPSession  when a master key is stale and
       
   405 // needs to be refreshed.  
       
   406 // ---------------------------------------------------------------------------
       
   407 void CMccRtpDataSink::SRTPMasterKeyStaleEvent(const CSRTPSession& /*aSession*/ )
       
   408     {
       
   409     } 
       
   410     
       
   411 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   412 
       
   413 //  End of File  
       
   414