|
1 /* |
|
2 * Copyright (c) 2007-2008 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: VOIP Audio Services |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <voipdownlinkstream.h> |
|
21 #include <voipdtmftoneplayer.h> |
|
22 #include <voipuplinkstream.h> |
|
23 #include <voiputilityfactory.h> |
|
24 #include "VoIPAudioSession.h" |
|
25 #include "VoIPQueueHandler.h" |
|
26 #include "VoIPUtilityFactoryImpl.h" |
|
27 |
|
28 |
|
29 // --------------------------------------------------------------------------- |
|
30 // CVoIPUtilityFactory::CreateFactory |
|
31 // --------------------------------------------------------------------------- |
|
32 // |
|
33 EXPORT_C TInt CVoIPUtilityFactory::CreateFactory( |
|
34 CVoIPUtilityFactory*& aFactory) |
|
35 { |
|
36 TInt err = KErrNone; |
|
37 CVoIPUtilityFactory* factory = NULL; |
|
38 factory = new CVoIPUtilityFactory; |
|
39 |
|
40 if (factory) |
|
41 { |
|
42 TRAP(err, factory->ConstructL()); |
|
43 if (err != KErrNone) |
|
44 { |
|
45 delete factory; |
|
46 factory = NULL; |
|
47 } |
|
48 } |
|
49 |
|
50 aFactory = factory; |
|
51 return err; |
|
52 } |
|
53 |
|
54 // --------------------------------------------------------------------------- |
|
55 // CVoIPUtilityFactory::~CVoIPUtilityFactory |
|
56 // --------------------------------------------------------------------------- |
|
57 // |
|
58 EXPORT_C CVoIPUtilityFactory::~CVoIPUtilityFactory() |
|
59 { |
|
60 delete iVoIPUtilityFactoryImpl; |
|
61 } |
|
62 |
|
63 // --------------------------------------------------------------------------- |
|
64 // CVoIPUtilityFactory::CVoIPUtilityFactory |
|
65 // --------------------------------------------------------------------------- |
|
66 // |
|
67 CVoIPUtilityFactory::CVoIPUtilityFactory() |
|
68 { |
|
69 } |
|
70 |
|
71 // --------------------------------------------------------------------------- |
|
72 // CVoIPUtilityFactory::ConstructL |
|
73 // --------------------------------------------------------------------------- |
|
74 // |
|
75 void CVoIPUtilityFactory::ConstructL() |
|
76 { |
|
77 iVoIPUtilityFactoryImpl = NULL; |
|
78 iVoIPUtilityFactoryImpl = CVoIPUtilityFactoryImpl::NewL(); |
|
79 } |
|
80 |
|
81 // --------------------------------------------------------------------------- |
|
82 // CVoIPUtilityFactory::CreateDownlinkStream |
|
83 // --------------------------------------------------------------------------- |
|
84 // |
|
85 EXPORT_C TInt CVoIPUtilityFactory::CreateDownlinkStream( |
|
86 const TVersion aVersion, |
|
87 const TVoIPCallType aCallType, |
|
88 CVoIPAudioDownlinkStream*& aDnLink) |
|
89 { |
|
90 // Push Over Cellular (PoC) implementation will be added in the future. |
|
91 |
|
92 TRAPD(err, |
|
93 iVoIPUtilityFactoryImpl->CreateDownlinkStreamL(aVersion, aCallType, aDnLink)); |
|
94 return err; |
|
95 } |
|
96 |
|
97 // --------------------------------------------------------------------------- |
|
98 // CVoIPUtilityFactory::CreateDownlinkStream |
|
99 // --------------------------------------------------------------------------- |
|
100 // |
|
101 EXPORT_C TInt CVoIPUtilityFactory::CreateDownlinkStream( |
|
102 const TVersion aVersion, |
|
103 CVoIPJitterBufferIntfc*& aJBIntfc, |
|
104 CVoIPAudioDownlinkStream*& aDnLink) |
|
105 { |
|
106 TRAPD(err, |
|
107 iVoIPUtilityFactoryImpl->CreateDownlinkStreamL(aVersion, aJBIntfc, aDnLink)); |
|
108 return err; |
|
109 } |
|
110 |
|
111 // --------------------------------------------------------------------------- |
|
112 // CVoIPUtilityFactory::CreateUplinkStream |
|
113 // --------------------------------------------------------------------------- |
|
114 // |
|
115 EXPORT_C TInt CVoIPUtilityFactory::CreateUplinkStream( |
|
116 const TVersion aVersion, |
|
117 const TVoIPCallType aCallType, |
|
118 CVoIPAudioUplinkStream*& aUpLink) |
|
119 { |
|
120 //TODO: What should we do different for PoC call here? |
|
121 |
|
122 TRAPD(err, |
|
123 iVoIPUtilityFactoryImpl->CreateUplinkStreamL(aVersion, aCallType, aUpLink)); |
|
124 return err; |
|
125 } |
|
126 |
|
127 // --------------------------------------------------------------------------- |
|
128 // CVoIPUtilityFactory::CreateDTMFTonePlayer |
|
129 // --------------------------------------------------------------------------- |
|
130 // |
|
131 EXPORT_C TInt CVoIPUtilityFactory::CreateDTMFTonePlayer( |
|
132 CDTMFTonePlayer*& aDtmfPlayer) |
|
133 { |
|
134 TRAPD(err, iVoIPUtilityFactoryImpl->CreateDTMFTonePlayerL(aDtmfPlayer)); |
|
135 return err; |
|
136 } |
|
137 |
|
138 // --------------------------------------------------------------------------- |
|
139 // CVoIPUtilityFactory::CreateBuffer |
|
140 // --------------------------------------------------------------------------- |
|
141 // |
|
142 EXPORT_C TInt CVoIPUtilityFactory::CreateBuffer( |
|
143 CVoIPDataBuffer*& aBuffer, |
|
144 const CVoIPDataBuffer::TVoIPBufferType aType, |
|
145 const TVoIPCodecFormat aCodecFormat) |
|
146 { |
|
147 TRAPD(err, |
|
148 iVoIPUtilityFactoryImpl->CreateBufferL(aBuffer, aType, aCodecFormat)); |
|
149 return err; |
|
150 } |
|
151 |
|
152 // --------------------------------------------------------------------------- |
|
153 // CVoIPUtilityFactory::GetSupportedDownlinkFormats |
|
154 // --------------------------------------------------------------------------- |
|
155 // |
|
156 EXPORT_C TInt CVoIPUtilityFactory::GetSupportedDownlinkFormats( |
|
157 RArray<TVoIPCodecFormat>& aFormats) |
|
158 { |
|
159 TInt err = iVoIPUtilityFactoryImpl->GetSupportedDownlinkFormats(aFormats); |
|
160 return err; |
|
161 } |
|
162 |
|
163 // --------------------------------------------------------------------------- |
|
164 // CVoIPUtilityFactory::GetSupportedUplinkFormats |
|
165 // --------------------------------------------------------------------------- |
|
166 // |
|
167 EXPORT_C TInt CVoIPUtilityFactory::GetSupportedUplinkFormats( |
|
168 RArray<TVoIPCodecFormat>& aFormats) |
|
169 { |
|
170 TInt err = iVoIPUtilityFactoryImpl->GetSupportedUplinkFormats(aFormats); |
|
171 return err; |
|
172 } |
|
173 |
|
174 |
|
175 // End of file |