mmserv/voipaudioservices/VoIPIntfc/src/VoIPUtilityFactory.cpp
changeset 53 eabc8c503852
parent 0 71ca22bcf22a
equal deleted inserted replaced
48:a493a607b5bf 53:eabc8c503852
     1 /*
     1 /*
     2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3  * All rights reserved.
     4 * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5  * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     8  *
     9 * Initial Contributors:
     9  * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10  * Nokia Corporation - initial contribution.
    11 *
    11  *
    12 * Contributors:
    12  * Contributors:
    13 *
    13  *
    14 * Description:  VOIP Audio Services
    14  * Description:  VOIP Audio Services
    15 *
    15  *
    16 */
    16  */
    17 
       
    18 
    17 
    19 #include <e32base.h>
    18 #include <e32base.h>
    20 #include <voipdownlinkstream.h>
    19 #include <voipdownlinkstream.h>
    21 #include <voipdtmftoneplayer.h>
    20 #include <voipdtmftoneplayer.h>
    22 #include <voipuplinkstream.h>
    21 #include <voipuplinkstream.h>
    23 #include <voiputilityfactory.h>
    22 #include <voiputilityfactory.h>
    24 #include "VoIPAudioSession.h"
    23 #include "VoIPAudioSession.h"
    25 #include "VoIPQueueHandler.h"
    24 #include "VoIPQueueHandler.h"
    26 #include "VoIPUtilityFactoryImpl.h"
    25 #include "VoIPUtilityFactoryImpl.h"
    27 
    26 
    28 
       
    29 // ---------------------------------------------------------------------------
    27 // ---------------------------------------------------------------------------
    30 // CVoIPUtilityFactory::CreateFactory
    28 // CVoIPUtilityFactory::CreateFactory
    31 // ---------------------------------------------------------------------------
    29 // ---------------------------------------------------------------------------
    32 //
    30 //
    33 EXPORT_C TInt CVoIPUtilityFactory::CreateFactory(
    31 EXPORT_C TInt CVoIPUtilityFactory::CreateFactory(
    34                                    CVoIPUtilityFactory*& aFactory)
    32         CVoIPUtilityFactory*& aFactory)
    35     {
    33     {
    36     TInt err = KErrNone;
    34     TInt err = KErrNone;
    37     CVoIPUtilityFactory* factory = NULL;
    35     CVoIPUtilityFactory* factory = NULL;
    38     factory = new CVoIPUtilityFactory;
    36     factory = new CVoIPUtilityFactory;
    39 
    37 
    81 // ---------------------------------------------------------------------------
    79 // ---------------------------------------------------------------------------
    82 // CVoIPUtilityFactory::CreateDownlinkStream
    80 // CVoIPUtilityFactory::CreateDownlinkStream
    83 // ---------------------------------------------------------------------------
    81 // ---------------------------------------------------------------------------
    84 //
    82 //
    85 EXPORT_C TInt CVoIPUtilityFactory::CreateDownlinkStream(
    83 EXPORT_C TInt CVoIPUtilityFactory::CreateDownlinkStream(
    86                                    const TVersion aVersion,
    84         const TVersion aVersion, const TVoIPCallType aCallType,
    87                                    const TVoIPCallType aCallType,
    85         CVoIPAudioDownlinkStream*& aDnLink)
    88                                    CVoIPAudioDownlinkStream*& aDnLink)
       
    89     {
    86     {
    90     // Push Over Cellular (PoC) implementation will be added in the future.
    87     // Push Over Cellular (PoC) implementation will be added in the future.
    91 
    88     TRAPD(err, iVoIPUtilityFactoryImpl->CreateDownlinkStreamL(aVersion,
    92     TRAPD(err,
    89             aCallType, aDnLink));
    93     iVoIPUtilityFactoryImpl->CreateDownlinkStreamL(aVersion, aCallType, aDnLink));
       
    94     return err;
    90     return err;
    95     }
    91     }
    96 
    92 
    97 // ---------------------------------------------------------------------------
    93 // ---------------------------------------------------------------------------
    98 // CVoIPUtilityFactory::CreateDownlinkStream
    94 // CVoIPUtilityFactory::CreateDownlinkStream
    99 // ---------------------------------------------------------------------------
    95 // ---------------------------------------------------------------------------
   100 //
    96 //
   101 EXPORT_C TInt CVoIPUtilityFactory::CreateDownlinkStream(
    97 EXPORT_C TInt CVoIPUtilityFactory::CreateDownlinkStream(
   102                                    const TVersion aVersion,
    98         const TVersion aVersion, CVoIPJitterBufferIntfc*& aJBIntfc,
   103                                    CVoIPJitterBufferIntfc*& aJBIntfc,
    99         CVoIPAudioDownlinkStream*& aDnLink)
   104                                    CVoIPAudioDownlinkStream*& aDnLink)
       
   105     {
   100     {
   106     TRAPD(err,
   101     TRAPD(err, iVoIPUtilityFactoryImpl->CreateDownlinkStreamL(aVersion,
   107     iVoIPUtilityFactoryImpl->CreateDownlinkStreamL(aVersion, aJBIntfc, aDnLink));
   102             aJBIntfc, aDnLink));
   108     return err;
   103     return err;
   109     }
   104     }
   110 
   105 
   111 // ---------------------------------------------------------------------------
   106 // ---------------------------------------------------------------------------
   112 // CVoIPUtilityFactory::CreateUplinkStream
   107 // CVoIPUtilityFactory::CreateUplinkStream
   113 // ---------------------------------------------------------------------------
   108 // ---------------------------------------------------------------------------
   114 //
   109 //
   115 EXPORT_C TInt CVoIPUtilityFactory::CreateUplinkStream(
   110 EXPORT_C TInt CVoIPUtilityFactory::CreateUplinkStream(
   116                                    const TVersion aVersion,
   111         const TVersion aVersion, const TVoIPCallType aCallType,
   117                                    const TVoIPCallType aCallType,
   112         CVoIPAudioUplinkStream*& aUpLink)
   118                                    CVoIPAudioUplinkStream*& aUpLink)
       
   119     {
   113     {
   120     //TODO: What should we do different for PoC call here?
   114     //TODO: What should we do different for PoC call here?
   121 
   115     TRAPD(err, iVoIPUtilityFactoryImpl->CreateUplinkStreamL(aVersion,
   122     TRAPD(err,
   116             aCallType, aUpLink));
   123     iVoIPUtilityFactoryImpl->CreateUplinkStreamL(aVersion, aCallType, aUpLink));
       
   124     return err;
   117     return err;
   125     }
   118     }
   126 
   119 
   127 // ---------------------------------------------------------------------------
   120 // ---------------------------------------------------------------------------
   128 // CVoIPUtilityFactory::CreateDTMFTonePlayer
   121 // CVoIPUtilityFactory::CreateDTMFTonePlayer
   129 // ---------------------------------------------------------------------------
   122 // ---------------------------------------------------------------------------
   130 //
   123 //
   131 EXPORT_C TInt CVoIPUtilityFactory::CreateDTMFTonePlayer(
   124 EXPORT_C TInt CVoIPUtilityFactory::CreateDTMFTonePlayer(
   132                                    CDTMFTonePlayer*& aDtmfPlayer)
   125         CDTMFTonePlayer*& aDtmfPlayer)
   133     {
   126     {
   134     TRAPD(err, iVoIPUtilityFactoryImpl->CreateDTMFTonePlayerL(aDtmfPlayer));
   127     TRAPD(err, iVoIPUtilityFactoryImpl->CreateDTMFTonePlayerL(aDtmfPlayer));
   135     return err;
   128     return err;
   136     }
   129     }
   137 
   130 
   138 // ---------------------------------------------------------------------------
   131 // ---------------------------------------------------------------------------
   139 // CVoIPUtilityFactory::CreateBuffer
   132 // CVoIPUtilityFactory::CreateBuffer
   140 // ---------------------------------------------------------------------------
   133 // ---------------------------------------------------------------------------
   141 //
   134 //
   142 EXPORT_C TInt CVoIPUtilityFactory::CreateBuffer(
   135 EXPORT_C TInt CVoIPUtilityFactory::CreateBuffer(CVoIPDataBuffer*& aBuffer,
   143                                    CVoIPDataBuffer*& aBuffer,
   136         const CVoIPDataBuffer::TVoIPBufferType aType,
   144                                    const CVoIPDataBuffer::TVoIPBufferType aType,
   137         const TVoIPCodecFormat aCodecFormat)
   145                                    const TVoIPCodecFormat aCodecFormat)
       
   146     {
   138     {
   147     TRAPD(err,
   139     TRAPD(err, iVoIPUtilityFactoryImpl->CreateBufferL(aBuffer, aType,
   148     iVoIPUtilityFactoryImpl->CreateBufferL(aBuffer, aType, aCodecFormat));
   140             aCodecFormat));
   149     return err;
   141     return err;
   150     }
   142     }
   151 
   143 
   152 // ---------------------------------------------------------------------------
   144 // ---------------------------------------------------------------------------
   153 // CVoIPUtilityFactory::GetSupportedDownlinkFormats
   145 // CVoIPUtilityFactory::GetSupportedDownlinkFormats
   154 // ---------------------------------------------------------------------------
   146 // ---------------------------------------------------------------------------
   155 //
   147 //
   156 EXPORT_C TInt CVoIPUtilityFactory::GetSupportedDownlinkFormats(
   148 EXPORT_C TInt CVoIPUtilityFactory::GetSupportedDownlinkFormats(
   157                                    RArray<TVoIPCodecFormat>& aFormats)
   149         RArray<TVoIPCodecFormat>& aFormats)
   158     {
   150     {
   159     TInt err = iVoIPUtilityFactoryImpl->GetSupportedDownlinkFormats(aFormats);
   151     TInt err = iVoIPUtilityFactoryImpl->GetSupportedDownlinkFormats(aFormats);
   160     return err;
   152     return err;
   161     }
   153     }
   162 
   154 
   163 // ---------------------------------------------------------------------------
   155 // ---------------------------------------------------------------------------
   164 // CVoIPUtilityFactory::GetSupportedUplinkFormats
   156 // CVoIPUtilityFactory::GetSupportedUplinkFormats
   165 // ---------------------------------------------------------------------------
   157 // ---------------------------------------------------------------------------
   166 //
   158 //
   167 EXPORT_C TInt CVoIPUtilityFactory::GetSupportedUplinkFormats(
   159 EXPORT_C TInt CVoIPUtilityFactory::GetSupportedUplinkFormats(
   168                                    RArray<TVoIPCodecFormat>& aFormats)
   160         RArray<TVoIPCodecFormat>& aFormats)
   169     {
   161     {
   170     TInt err = iVoIPUtilityFactoryImpl->GetSupportedUplinkFormats(aFormats);
   162     TInt err = iVoIPUtilityFactoryImpl->GetSupportedUplinkFormats(aFormats);
   171     return err;
   163     return err;
   172     }
   164     }
   173 
   165 
   174 
       
   175 // End of file
   166 // End of file