multimediacommscontroller/mmccmsrpsourcesink/src/mccmsrpsink.cpp
author vnuitven <>
Mon, 06 Sep 2010 18:50:40 +0530
branchrcs
changeset 50 1d8943dd8be6
parent 49 64c62431ac08
permissions -rw-r--r--
changed copy right year to 2010 for all newly added files
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
49
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
     1
/*
50
1d8943dd8be6 changed copy right year to 2010 for all newly added files
vnuitven <>
parents: 49
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
49
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
     3
* All rights reserved.
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
     8
*
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
     9
* Initial Contributors:
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    11
*
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    12
* Contributors:
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    13
*
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    14
* Description:    Provides a comfort noise generator class
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    15
*
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    16
*/
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    17
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    18
        
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    19
// INCLUDE FILES
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    20
#include "mccmsrpsink.h"
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    21
#include "mmccinterfacedef.h"
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    22
#include "mccmsrpsourcesinklogs.h"
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    23
#include "mccinternalevents.h"
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    24
#include "mccinternaldef.h"
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    25
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    26
// CONSTANTS
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    27
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    28
// ============================ MEMBER FUNCTIONS ===============================
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    29
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    30
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    31
// CMccMsrpSink::NewSinkL
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    32
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    33
//
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    34
MDataSink* CMccMsrpSink::NewSinkL( TUid /*aImplementationUid*/, 
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    35
                                   const TDesC8& /*aInitData*/ )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    36
    {
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    37
    __MSRPSOURCESINK_CONTROLL( "CMccMsrpSink::NewSinkL" )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    38
    
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    39
    CMccMsrpSink* self = new ( ELeave ) CMccMsrpSink();
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    40
    return static_cast<MDataSink*>( self );
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    41
    }
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    42
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    43
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    44
// CMccMsrpSink::ConstructSinkL
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    45
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    46
//
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    47
void CMccMsrpSink::ConstructSinkL( const TDesC8& /*aInitData*/ )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    48
    {
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    49
    __MSRPSOURCESINK_CONTROLL( "CMccMsrpSink::ConstructSinkL" )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    50
    iDataSender = CMccMsrpDataSender::NewL();
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    51
    }
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    52
    
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    53
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    54
// CMccMsrpSink::CMccMsrpSink
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    55
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    56
//
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    57
CMccMsrpSink::CMccMsrpSink() : CMccDataSink( KMccMsrpSinkUid )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    58
    {
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    59
    }
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    60
        
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    61
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    62
// CMccMsrpSink::~CMccMsrpSink
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    63
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    64
//
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    65
CMccMsrpSink::~CMccMsrpSink()
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    66
    {
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    67
    __MSRPSOURCESINK_CONTROLL( "CMccMsrpSink::~CMccMsrpSink" )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    68
    delete iDataSender;
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    69
    }
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    70
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    71
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    72
// CMccMsrpSink::SinkPrimeL
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    73
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    74
//
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    75
void CMccMsrpSink::SinkPrimeL()
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    76
	{
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    77
	__MSRPSOURCESINK_CONTROLL( "CMccMsrpSink::SinkPrimeL" )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    78
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    79
	SendStreamEventToClient( KMccStreamPrepared );		
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    80
	}
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    81
	
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    82
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    83
// CMccMsrpSink::SinkPlayL()
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    84
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    85
//
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    86
void CMccMsrpSink::SinkPlayL()
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    87
    {
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    88
    __MSRPSOURCESINK_CONTROLL( "CMccMsrpSink::SinkPlayL" )  
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    89
    
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    90
	if ( iPaused )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    91
        {
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    92
        SendStreamEventToClient( KMccStreamResumed );
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    93
        }
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    94
    else
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    95
        {
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    96
    	SendStreamEventToClient( KMccStreamStarted );	
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    97
        }
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    98
		
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
    99
    iPaused = EFalse;
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   100
    }
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   101
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   102
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   103
// CMccMsrpSink::SinkPauseL()
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   104
// 
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   105
// Pauses streaming by cancelling timers
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   106
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   107
//
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   108
void CMccMsrpSink::SinkPauseL()
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   109
    {
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   110
    __MSRPSOURCESINK_CONTROLL( "CMccMsrpSink::SinkPauseL" )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   111
    
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   112
    iPaused = ETrue;
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   113
	
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   114
	SendStreamEventToClient( KMccStreamPaused );	
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   115
	}
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   116
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   117
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   118
// CMccMsrpSink::SinkStopL()
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   119
// 
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   120
// Stops streaming
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   121
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   122
//
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   123
void CMccMsrpSink::SinkStopL()
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   124
    {
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   125
    __MSRPSOURCESINK_CONTROLL( "CMccMsrpSink::SinkStopL" )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   126
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   127
	SendStreamEventToClient( KMccStreamStopped );		
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   128
    }
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   129
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   130
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   131
// CMccMsrpSink::SinkDataTypeCode
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   132
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   133
//
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   134
TFourCC CMccMsrpSink::SinkDataTypeCode( TMediaId /*aMediaId*/ )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   135
	{
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   136
    __MSRPSOURCESINK_CONTROLL( "CMccMsrpSink::SinkDataTypeCode" )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   137
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   138
    return iFourCC;
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   139
	}
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   140
	
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   141
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   142
// CMccMsrpSink::SetSinkDataTypeCode
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   143
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   144
//
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   145
TInt CMccMsrpSink::SetSinkDataTypeCode( TFourCC aCodec, 
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   146
                            TMediaId /*aMediaId*/ )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   147
	{
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   148
    __MSRPSOURCESINK_CONTROLL( "CMccMsrpSink::SetSinkDataTypeCode" )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   149
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   150
    iFourCC = aCodec;
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   151
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   152
	return KErrNone;
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   153
	}	
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   154
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   155
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   156
// CMccMsrpSink::BufferEmptiedL
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   157
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   158
//
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   159
void CMccMsrpSink::BufferEmptiedL( CMMFBuffer* /*aBuffer*/ )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   160
	{
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   161
    __MSRPSOURCESINK_CONTROLL( "CMccMsrpSink::BufferEmptiedL" )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   162
    
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   163
    User::Leave( KErrNotSupported );
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   164
	}
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   165
	
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   166
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   167
// CMccMsrpSink::CanCreateSinkBuffer
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   168
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   169
//
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   170
TBool CMccMsrpSink::CanCreateSinkBuffer()
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   171
	{
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   172
    __MSRPSOURCESINK_CONTROLL( "CMccMsrpSink::CanCreateSinkBuffer" )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   173
    
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   174
	return EFalse;
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   175
	}	
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   176
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   177
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   178
// CMccMsrpSink::CreateSinkBufferL
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   179
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   180
//
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   181
CMMFBuffer* CMccMsrpSink::CreateSinkBufferL( 
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   182
	TMediaId /*aMediaId*/, 
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   183
    TBool& /*aReference*/ )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   184
	{
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   185
	__MSRPSOURCESINK_CONTROLL( "CMccMsrpSink::CreateSinkBufferL" )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   186
	
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   187
	User::Leave( KErrNotSupported );
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   188
		
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   189
	return NULL;	
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   190
	}
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   191
	
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   192
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   193
// CMccMsrpSink::SinkThreadLogon
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   194
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   195
//
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   196
TInt CMccMsrpSink::SinkThreadLogon( MAsyncEventHandler& aEventHandler )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   197
	{
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   198
	__MSRPSOURCESINK_CONTROLL( "CMccMsrpSink::SinkThreadLogon" )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   199
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   200
	iAsyncEventHandler = &aEventHandler;
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   201
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   202
	return KErrNone;	
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   203
	}
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   204
	
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   205
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   206
// CMccMsrpSink::SinkThreadLogoff
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   207
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   208
//
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   209
void CMccMsrpSink::SinkThreadLogoff()
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   210
	{
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   211
	__MSRPSOURCESINK_CONTROLL( "CMccMsrpSink::SinkThreadLogoff" )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   212
    iAsyncEventHandler = NULL;		
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   213
	}
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   214
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   215
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   216
// CMccMsrpSink::EmptyBufferL
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   217
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   218
//
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   219
void CMccMsrpSink::EmptyBufferL( CMMFBuffer* aBuffer,
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   220
                  MDataSource* aProvider,
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   221
                  TMediaId /*aMediaId*/ )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   222
	{
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   223
	__MSRPSOURCESINK_CONTROLL( "CMccMsrpSink::EmptyBufferL" )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   224
    __ASSERT_ALWAYS( aBuffer, User::Leave( KErrArgument ) );
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   225
	__ASSERT_ALWAYS( aProvider, User::Leave( KErrArgument ) );
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   226
	
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   227
    CMMFDataBuffer* dataBuffer = static_cast<CMMFDataBuffer*>( aBuffer );
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   228
	const TDesC8& data = dataBuffer->Data();	
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   229
    iDataSender->SendL( data, iMsrpSession );
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   230
    aProvider->BufferEmptiedL( aBuffer ); 
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   231
	}	
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   232
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   233
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   234
// CMccMsrpSink::BufferFilledL
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   235
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   236
//
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   237
void CMccMsrpSink::BufferFilledL( CMMFBuffer* /*aBuffer*/ )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   238
	{
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   239
	__MSRPSOURCESINK_CONTROLL( "CMccMsrpSink::BufferFilledL" )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   240
	
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   241
	User::Leave( KErrNotSupported );
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   242
	}	
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   243
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   244
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   245
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   246
// CMccMsrpSink::BufferFilledL
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   247
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   248
//
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   249
void CMccMsrpSink::SetSessionParamsL( const TMccMsrpSessionParams& aParams )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   250
    {
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   251
    __MSRPSOURCESINK_CONTROLL( "CMccMsrpSink::SetSessionParamsL IN" )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   252
    
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   253
    User::LeaveIfNull( aParams.iMsrp );
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   254
    User::LeaveIfNull( aParams.iMsrpSession );
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   255
    
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   256
    iMsrp = aParams.iMsrp;
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   257
    iMsrpSession = aParams.iMsrpSession;
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   258
    
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   259
    __MSRPSOURCESINK_CONTROLL( "CMccMsrpSink::SetSessionParamsL OUT" )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   260
    }
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   261
	
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   262
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   263
// CMccMsrpSink::SendStreamEventToClient
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   264
// -----------------------------------------------------------------------------
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   265
//	
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   266
void CMccMsrpSink::SendStreamEventToClient( 
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   267
    const TMccEventType& aEventType, 
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   268
    TInt aError )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   269
	{
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   270
	__MSRPSOURCESINK_CONTROLL( "CMccMsrpSink::SendStreamEventToClient" )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   271
	
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   272
	if ( iAsyncEventHandler )
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   273
	    {
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   274
        TMccEvent event( 0, 
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   275
                         0, 
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   276
                         0, 
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   277
                         MCC_ENDPOINT_ID( static_cast<MDataSink*>( this ) ), 
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   278
                         KMccEventCategoryStream, 
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   279
                         aEventType, 
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   280
                         aError, 
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   281
                         KNullDesC8 );
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   282
                     
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   283
        TMccInternalEvent internalEvent( KMccMsrpSinkUid, 
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   284
		                                 EMccInternalEventNone,
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   285
		                                 event );
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   286
		                         
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   287
		iAsyncEventHandler->SendEventToClient( internalEvent );
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   288
	    }
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   289
	}
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   290
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   291
// End of file
64c62431ac08 RCS feature support in MCE/MCC.
vnuitven <>
parents:
diff changeset
   292