os/mm/devsoundextensions/mmfcustominterfaces/G729DecoderIntfc/G729DecoderIntfcMsgHdlr/src/G729DecoderIntfcMsgHdlr.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
sl@0
     3
* All rights reserved.
sl@0
     4
* This component and the accompanying materials are made available
sl@0
     5
* under the terms of "Eclipse Public License v1.0"
sl@0
     6
* which accompanies this distribution, and is available
sl@0
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
*
sl@0
     9
* Initial Contributors:
sl@0
    10
* Nokia Corporation - initial contribution.
sl@0
    11
*
sl@0
    12
* Contributors:
sl@0
    13
*
sl@0
    14
* Description:   Message handler for G729 decoder interface
sl@0
    15
*
sl@0
    16
*/
sl@0
    17
sl@0
    18
sl@0
    19
sl@0
    20
// INCLUDE FILES
sl@0
    21
#include    "G729DecoderIntfcMsgHdlr.h"
sl@0
    22
#include    "G729DecoderIntfcMsgs.h"
sl@0
    23
#include    <G729DecoderIntfc.h>
sl@0
    24
sl@0
    25
// EXTERNAL DATA STRUCTURES
sl@0
    26
sl@0
    27
// EXTERNAL FUNCTION PROTOTYPES  
sl@0
    28
sl@0
    29
// CONSTANTS
sl@0
    30
sl@0
    31
// MACROS
sl@0
    32
sl@0
    33
// LOCAL CONSTANTS AND MACROS
sl@0
    34
sl@0
    35
// MODULE DATA STRUCTURES
sl@0
    36
sl@0
    37
// LOCAL FUNCTION PROTOTYPES
sl@0
    38
sl@0
    39
// FORWARD DECLARATIONS
sl@0
    40
sl@0
    41
// ============================= LOCAL FUNCTIONS ===============================
sl@0
    42
sl@0
    43
// ============================ MEMBER FUNCTIONS ===============================
sl@0
    44
sl@0
    45
// -----------------------------------------------------------------------------
sl@0
    46
// CG729DecoderIntfcMsgHdlr::CG729DecoderIntfcMsgHdlr
sl@0
    47
// C++ default constructor can NOT contain any code, that
sl@0
    48
// might leave.
sl@0
    49
// -----------------------------------------------------------------------------
sl@0
    50
//
sl@0
    51
CG729DecoderIntfcMsgHdlr::CG729DecoderIntfcMsgHdlr(
sl@0
    52
                             CG729DecoderIntfc* aG729DecoderIntfcCI) :
sl@0
    53
	CMMFObject(KUidG729DecoderIntfc)
sl@0
    54
    {
sl@0
    55
    iG729DecoderIntfcCI = aG729DecoderIntfcCI;
sl@0
    56
    }
sl@0
    57
sl@0
    58
// -----------------------------------------------------------------------------
sl@0
    59
// CG729DecoderIntfcMsgHdlr::ConstructL
sl@0
    60
// Symbian 2nd phase constructor can leave.
sl@0
    61
// -----------------------------------------------------------------------------
sl@0
    62
//
sl@0
    63
void CG729DecoderIntfcMsgHdlr::ConstructL()
sl@0
    64
    {
sl@0
    65
    }
sl@0
    66
sl@0
    67
// -----------------------------------------------------------------------------
sl@0
    68
// CG729DecoderIntfcMsgHdlr::NewL
sl@0
    69
// Two-phased constructor.
sl@0
    70
// -----------------------------------------------------------------------------
sl@0
    71
//
sl@0
    72
EXPORT_C CG729DecoderIntfcMsgHdlr* CG729DecoderIntfcMsgHdlr::NewL(
sl@0
    73
                                                TAny*  aG729DecoderIntfcCI)
sl@0
    74
    {
sl@0
    75
    CG729DecoderIntfc* errorConcealmentIntfcCI = 
sl@0
    76
                              (CG729DecoderIntfc*)aG729DecoderIntfcCI;
sl@0
    77
    CG729DecoderIntfcMsgHdlr* self = 
sl@0
    78
            new (ELeave) CG729DecoderIntfcMsgHdlr(errorConcealmentIntfcCI);
sl@0
    79
    CleanupStack::PushL( self );
sl@0
    80
    self->ConstructL();
sl@0
    81
    CleanupStack::Pop( self );
sl@0
    82
sl@0
    83
    return self;
sl@0
    84
    }
sl@0
    85
sl@0
    86
// Destructor
sl@0
    87
EXPORT_C CG729DecoderIntfcMsgHdlr::~CG729DecoderIntfcMsgHdlr()
sl@0
    88
	{
sl@0
    89
	delete iG729DecoderIntfcCI;
sl@0
    90
	}
sl@0
    91
sl@0
    92
// ---------------------------------------------------------
sl@0
    93
// CG729DecoderIntfcMsgHdlr::HandleRequest
sl@0
    94
// Handles the messages from the proxy.
sl@0
    95
// Calls a subfunction which determines which custom interface to call.
sl@0
    96
// A subfunction is used to contain multiple leaving functions for a single
sl@0
    97
// trap.
sl@0
    98
// (other items were commented in a header).
sl@0
    99
// ---------------------------------------------------------
sl@0
   100
//
sl@0
   101
EXPORT_C void CG729DecoderIntfcMsgHdlr::HandleRequest(
sl@0
   102
                                                       TMMFMessage& aMessage)
sl@0
   103
	{
sl@0
   104
	ASSERT(aMessage.Destination().InterfaceId() == KUidG729DecoderIntfc);
sl@0
   105
	TRAPD(error,DoHandleRequestL(aMessage));
sl@0
   106
	if(error)
sl@0
   107
		{
sl@0
   108
		aMessage.Complete(error);
sl@0
   109
		}
sl@0
   110
	}
sl@0
   111
sl@0
   112
// ---------------------------------------------------------
sl@0
   113
// CG729DecoderIntfcMsgHdlr::DoHandleRequestL
sl@0
   114
// Determines which custom interface to call.
sl@0
   115
// (other items were commented in a header).
sl@0
   116
// ---------------------------------------------------------
sl@0
   117
//
sl@0
   118
void CG729DecoderIntfcMsgHdlr::DoHandleRequestL(TMMFMessage& aMessage)
sl@0
   119
	{
sl@0
   120
	switch(aMessage.Function())
sl@0
   121
		{
sl@0
   122
		case EG729dimBadLsfNextBuffer:
sl@0
   123
			{
sl@0
   124
    		DoBadLsfNextBufferL(aMessage);
sl@0
   125
			break;
sl@0
   126
			}
sl@0
   127
		default:
sl@0
   128
			{
sl@0
   129
			aMessage.Complete(KErrNotSupported);
sl@0
   130
			}
sl@0
   131
		}
sl@0
   132
	}
sl@0
   133
sl@0
   134
// ---------------------------------------------------------
sl@0
   135
// CG729DecoderIntfcMsgHdlr::DoBadLsfNextBufferL
sl@0
   136
// Handles the message from the proxy and calls the custom interface method.
sl@0
   137
// The data passed from the proxy is read from the message and passed to
sl@0
   138
// the custom interface.
sl@0
   139
// (other items were commented in a header).
sl@0
   140
// ---------------------------------------------------------
sl@0
   141
//
sl@0
   142
void CG729DecoderIntfcMsgHdlr::DoBadLsfNextBufferL(TMMFMessage& aMessage)
sl@0
   143
    {
sl@0
   144
	TInt status = iG729DecoderIntfcCI->BadLsfNextBuffer();
sl@0
   145
    aMessage.Complete(status);
sl@0
   146
    }
sl@0
   147
    
sl@0
   148
sl@0
   149
sl@0
   150
// End of File