• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* ------------------------------------------------------------------
2  * Copyright (C) 1998-2009 PacketVideo
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13  * express or implied.
14  * See the License for the specific language governing permissions
15  * and limitations under the License.
16  * -------------------------------------------------------------------
17  */
18 #include "tsc_h324m_config.h"
19 #include "oscl_mem.h"
20 #include "pv_interface_cmd_message.h"
21 #include "pvlogger.h"
22 
23 enum PVH234MessageType
24 {
25     PVT_H324_COMMAND_QUERY_INTERFACE,
26     PVT_H324_COMMAND_SET_H223_LEVEL,
27     PVT_H324_COMMAND_SET_MAX_SDU_SIZE,
28     PVT_H324_COMMAND_SET_MAX_SDU_SIZE_R,
29     PVT_H324_COMMAND_SEND_RME,
30     PVT_H324_COMMAND_SET_AL2_SEQ_NUM,
31     PVT_H324_COMMAND_SET_CONTROL_FIELD_OCTETS,
32     PVT_H324_COMMAND_SET_MAX_PDU_SIZE,
33     PVT_H324_COMMAND_SET_TERMINAL_TYPE,
34     PVT_H324_COMMAND_SET_MAX_MUX_PDU_SIZE,
35     PVT_H324_COMMAND_SET_MAX_MUX_CCSRL_SDU_SIZE,
36     PVT_H324_COMMAND_SEND_RTD,
37     PVT_H324_COMMAND_SET_VENDOR_ID,
38     PVT_H324_COMMAND_SEND_VENDOR_ID,
39     PVT_H324_COMMAND_SEND_END_SESSION,
40     PVT_H324_COMMAND_SET_END_SESSION_TIMEOUT,
41     PVT_H324_COMMAND_SET_AL_CONFIGURATION,
42     PVT_H324_COMMAND_SET_TIMER_COUNTER,
43     PVT_H324_COMMAND_SET_VIDEO_RESOLUTIONS,
44     PVT_H324_COMMAND_SEND_VIDEO_SPATIAL_TEMPORAL_TRADEOFF_COMMAND,
45     PVT_H324_COMMAND_SEND_VIDEO_SPATIAL_TEMPORAL_TRADEOFF_INDICATION,
46     PVT_H324_COMMAND_SEND_SKEW_INDICATION,
47     PVT_H324_COMMAND_SET_FAST_CSUP_OPTIONS,
48     PVT_H324_COMMAND_SET_LOGICAL_CHANNEL_BUFFERING_MS,
49     PVT_H324_COMMAND_SEND_USER_INPUT,
50     PVT_H324_COMMAND_SET_WNSRP
51 };
52 
53 class CPVH324InterfaceCmdMessage : public CPVCmnInterfaceCmdMessage
54 {
55     public:
CPVH324InterfaceCmdMessage(TPVCmnCommandType aType,OsclAny * aContextData,TPVCmnCommandId aId)56         CPVH324InterfaceCmdMessage(TPVCmnCommandType aType,
57                                    OsclAny* aContextData,
58                                    TPVCmnCommandId aId)
59                 : CPVCmnInterfaceCmdMessage(aType, aContextData)
60         {
61             SetId(aId);
62         }
GetResponse(PVMFCommandId aId,const OsclAny * aContext,PVMFStatus aStatus,OsclAny * aEventData=NULL)63         PVMFCmdResp GetResponse(PVMFCommandId aId,
64                                 const OsclAny* aContext,
65                                 PVMFStatus aStatus,
66                                 OsclAny* aEventData = NULL)
67         {
68             return PVMFCmdResp(aId, aContext, aStatus, aEventData);
69         }
70     private:
71         //PVMFCmdResp iResp;
72 };
73 
74 class PVH324MessageQueryInterface : public CPVH324InterfaceCmdMessage
75 {
76     public:
PVH324MessageQueryInterface(const PVUuid & aUuid,PVInterface * & aInterfacePtr,OsclAny * aContextData,TPVCmnCommandId aId)77         PVH324MessageQueryInterface(const PVUuid& aUuid,
78                                     PVInterface*& aInterfacePtr,
79                                     OsclAny* aContextData,
80                                     TPVCmnCommandId aId)
81                 : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_QUERY_INTERFACE, aContextData, aId),
82                 iUuid(aUuid),
83                 iInterfacePtr(aInterfacePtr)
84         {
85             somenumber = 101;
86         }
87         int somenumber;
88         PVUuid iUuid;
89         PVInterface*& iInterfacePtr;
90 };
91 
92 class PVH324MessageSetH223Level : public CPVH324InterfaceCmdMessage
93 {
94     public:
PVH324MessageSetH223Level(TPVH223Level aLevel,OsclAny * aContextData,TPVCmnCommandId aId)95         PVH324MessageSetH223Level(TPVH223Level aLevel,
96                                   OsclAny* aContextData,
97                                   TPVCmnCommandId aId)
98                 : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SET_H223_LEVEL, aContextData, aId)
99                 , iH223Level(aLevel)
100         {}
101 
102         TPVH223Level iH223Level;
103 };
104 
105 class PVH324MessageSetMaxSduSize : public CPVH324InterfaceCmdMessage
106 {
107     public:
PVH324MessageSetMaxSduSize(TPVAdaptationLayer aAl,uint32 aSize,OsclAny * aContextData,TPVCmnCommandId aId)108         PVH324MessageSetMaxSduSize(TPVAdaptationLayer aAl,
109                                    uint32 aSize,
110                                    OsclAny* aContextData,
111                                    TPVCmnCommandId aId)
112                 : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SET_MAX_SDU_SIZE, aContextData, aId)
113                 , iAl(aAl)
114                 , iSize(aSize)
115         {}
116 
117         TPVAdaptationLayer iAl;
118         uint32 iSize;
119 };
120 
121 class PVH324MessageSetMaxSduSizeR : public CPVH324InterfaceCmdMessage
122 {
123     public:
PVH324MessageSetMaxSduSizeR(TPVAdaptationLayer aAl,uint32 aSize,OsclAny * aContextData,TPVCmnCommandId aId)124         PVH324MessageSetMaxSduSizeR(TPVAdaptationLayer aAl,
125                                     uint32 aSize,
126                                     OsclAny* aContextData,
127                                     TPVCmnCommandId aId)
128                 : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SET_MAX_SDU_SIZE_R, aContextData, aId)
129                 , iAl(aAl)
130                 , iSize(aSize)
131         {}
132 
133         TPVAdaptationLayer iAl;
134         uint32 iSize;
135 };
136 
137 class PVH324MessageSendRme : public CPVH324InterfaceCmdMessage
138 {
139     public:
PVH324MessageSendRme(OsclAny * aContextData,TPVCmnCommandId aId)140         PVH324MessageSendRme(OsclAny* aContextData,
141                              TPVCmnCommandId aId)
142                 : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SEND_RME, aContextData, aId)
143         {}
144 };
145 
146 class PVH324MessageSetAl2SequenceNumbers : public CPVH324InterfaceCmdMessage
147 {
148     public:
PVH324MessageSetAl2SequenceNumbers(int32 aSeqNumWidth,OsclAny * aContextData,TPVCmnCommandId aId)149         PVH324MessageSetAl2SequenceNumbers(int32 aSeqNumWidth,
150                                            OsclAny* aContextData,
151                                            TPVCmnCommandId aId)
152                 : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SET_AL2_SEQ_NUM, aContextData, aId)
153                 , iSeqNumWidth(aSeqNumWidth)
154         {}
155 
156         int32 iSeqNumWidth;
157 };
158 
159 class PVH324MessageSetAl3ControlFieldOctets : public CPVH324InterfaceCmdMessage
160 {
161     public:
PVH324MessageSetAl3ControlFieldOctets(int32 aCfo,OsclAny * aContextData,TPVCmnCommandId aId)162         PVH324MessageSetAl3ControlFieldOctets(int32 aCfo,
163                                               OsclAny* aContextData,
164                                               TPVCmnCommandId aId)
165                 : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SET_CONTROL_FIELD_OCTETS, aContextData, aId)
166                 , iCfo(aCfo)
167         {}
168 
169         int32 iCfo;
170 };
171 
172 class PVH324MessageSetMaxPduSize : public CPVH324InterfaceCmdMessage
173 {
174     public:
PVH324MessageSetMaxPduSize(int32 aMaxPduSize,OsclAny * aContextData,TPVCmnCommandId aId)175         PVH324MessageSetMaxPduSize(int32 aMaxPduSize,
176                                    OsclAny* aContextData,
177                                    TPVCmnCommandId aId)
178                 : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SET_MAX_PDU_SIZE, aContextData, aId)
179                 , iMaxPduSize(aMaxPduSize)
180         {}
181 
182         int32 iMaxPduSize;
183 };
184 
185 class PVH324MessageSetTerminalType : public CPVH324InterfaceCmdMessage
186 {
187     public:
PVH324MessageSetTerminalType(uint8 aTerminalType,OsclAny * aContextData,TPVCmnCommandId aId)188         PVH324MessageSetTerminalType(uint8 aTerminalType,
189                                      OsclAny* aContextData,
190                                      TPVCmnCommandId aId)
191                 : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SET_TERMINAL_TYPE, aContextData, aId)
192                 , iTerminalType(aTerminalType)
193         {}
194 
195         uint8 iTerminalType;
196 };
197 
198 class PVH324MessageSetMaxMuxPduSize : public CPVH324InterfaceCmdMessage
199 {
200     public:
PVH324MessageSetMaxMuxPduSize(int32 aMaxMuxPduSize,OsclAny * aContextData,TPVCmnCommandId aId)201         PVH324MessageSetMaxMuxPduSize(int32 aMaxMuxPduSize,
202                                       OsclAny* aContextData,
203                                       TPVCmnCommandId aId)
204                 : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SET_MAX_MUX_PDU_SIZE, aContextData, aId)
205                 , iMaxMuxPduSize(aMaxMuxPduSize)
206         {}
207 
208         int32 iMaxMuxPduSize;
209 };
210 
211 class PVH324MessageSetMaxMuxCcsrlSduSize : public CPVH324InterfaceCmdMessage
212 {
213     public:
PVH324MessageSetMaxMuxCcsrlSduSize(int32 aMaxMuxCcsrlSduSize,OsclAny * aContextData,TPVCmnCommandId aId)214         PVH324MessageSetMaxMuxCcsrlSduSize(int32 aMaxMuxCcsrlSduSize,
215                                            OsclAny* aContextData,
216                                            TPVCmnCommandId aId)
217                 : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SET_MAX_MUX_CCSRL_SDU_SIZE, aContextData, aId)
218                 , iMaxMuxCcsrlSduSize(aMaxMuxCcsrlSduSize)
219         {}
220 
221         int32 iMaxMuxCcsrlSduSize;
222 };
223 
224 class PVH324MessageSendRtd : public CPVH324InterfaceCmdMessage
225 {
226     public:
PVH324MessageSendRtd(OsclAny * aContextData,TPVCmnCommandId aId)227         PVH324MessageSendRtd(OsclAny* aContextData,
228                              TPVCmnCommandId aId)
229                 : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SEND_RTD, aContextData, aId)
230         {}
231 };
232 
233 class PVH324MessageSetVendorId : public CPVH324InterfaceCmdMessage
234 {
235     public:
PVH324MessageSetVendorId(uint8 cc,uint8 ext,uint32 mc,OsclAny * aContextData,TPVCmnCommandId aId)236         PVH324MessageSetVendorId(uint8 cc, uint8 ext, uint32 mc,
237                                  OsclAny* aContextData,
238                                  TPVCmnCommandId aId)
239                 : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SET_VENDOR_ID, aContextData, aId),
240                 iCc(cc), iExt(ext), iMc(mc),
241                 iProduct(NULL), iProductLen(0), iVersion(NULL), iVersionLen(0)
242         {}
~PVH324MessageSetVendorId()243         ~PVH324MessageSetVendorId()
244         {
245             if (iProduct)
246                 OSCL_DEFAULT_FREE(iProduct);
247             if (iVersion)
248                 OSCL_DEFAULT_FREE(iVersion);
249         }
250 
SetProduct(const uint8 * product,uint16 product_len)251         bool SetProduct(const uint8* product, uint16 product_len)
252         {
253             if (iProduct) OSCL_DEFAULT_FREE(iProduct);
254             iProduct = NULL;
255             iProductLen = 0;
256             iProduct = (uint8*)OSCL_DEFAULT_MALLOC(product_len);
257             if (iProduct)
258             {
259                 iProductLen = product_len;
260                 oscl_memcpy(iProduct, product, iProductLen);
261             }
262             return (iProduct) ? true : false;
263         }
SetVersion(const uint8 * version,uint16 version_len)264         bool SetVersion(const uint8* version, uint16 version_len)
265         {
266             if (iVersion) OSCL_DEFAULT_FREE(iVersion);
267             iVersion = NULL;
268             iVersionLen = 0;
269             iVersion = (uint8*)OSCL_DEFAULT_MALLOC(version_len);
270             if (iVersion)
271             {
272                 iVersionLen = version_len;
273                 oscl_memcpy(iVersion, version, iVersionLen);
274             }
275             return (iVersion) ? true : false;
276         }
277         uint8 iCc;
278         uint8 iExt;
279         uint32 iMc;
280         uint8* iProduct;
281         uint16 iProductLen;
282         uint8* iVersion;
283         uint16 iVersionLen;
284 };
285 
286 class PVH324MessageSendVendorId : public CPVH324InterfaceCmdMessage
287 {
288     public:
PVH324MessageSendVendorId(OsclAny * aContextData,TPVCmnCommandId aId)289         PVH324MessageSendVendorId(OsclAny* aContextData, TPVCmnCommandId aId)
290                 : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SEND_VENDOR_ID, aContextData, aId)
291         {}
292 };
293 
294 class PVH324MessageEndSession : public CPVH324InterfaceCmdMessage
295 {
296     public:
PVH324MessageEndSession(OsclAny * aContextData,TPVCmnCommandId aId)297         PVH324MessageEndSession(OsclAny* aContextData, TPVCmnCommandId aId)
298                 : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SEND_END_SESSION, aContextData, aId)
299         {}
300 };
301 
302 class PVH324MessageSetEndSessionTimeout : public CPVH324InterfaceCmdMessage
303 {
304     public:
PVH324MessageSetEndSessionTimeout(uint32 timeout,OsclAny * aContextData,TPVCmnCommandId aId)305         PVH324MessageSetEndSessionTimeout(uint32 timeout,
306                                           OsclAny* aContextData,
307                                           TPVCmnCommandId aId)
308                 : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SET_END_SESSION_TIMEOUT, aContextData, aId),
309                 iTimeout(timeout)
310         {}
311         uint32 iTimeout;
312 };
313 
314 class PVH324MessageSetALConfiguration : public CPVH324InterfaceCmdMessage
315 {
316     public:
PVH324MessageSetALConfiguration(TPVMediaType_t aMediaType,TPVAdaptationLayer aLayer,bool aAllow,OsclAny * aContextData,TPVCmnCommandId aId)317         PVH324MessageSetALConfiguration(TPVMediaType_t aMediaType,
318                                         TPVAdaptationLayer aLayer,
319                                         bool aAllow,
320                                         OsclAny* aContextData,
321                                         TPVCmnCommandId aId)
322                 : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SET_AL_CONFIGURATION, aContextData, aId),
323                 iMediaType(aMediaType),
324                 iLayer(aLayer),
325                 iAllow(aAllow)
326         {}
327         TPVMediaType_t iMediaType;
328         TPVAdaptationLayer iLayer;
329         bool iAllow;
330 };
331 
332 class PVH324MessageSetTimerCounter: public CPVH324InterfaceCmdMessage
333 {
334     public:
PVH324MessageSetTimerCounter(TPVH324TimerCounter aTimerCounter,uint8 aSeries,uint32 aSeriesOffset,uint32 aValue,OsclAny * aContextData,TPVCmnCommandId aId)335         PVH324MessageSetTimerCounter(TPVH324TimerCounter aTimerCounter,
336                                      uint8 aSeries,
337                                      uint32 aSeriesOffset,
338                                      uint32 aValue,
339                                      OsclAny* aContextData,
340                                      TPVCmnCommandId aId)
341                 : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SET_TIMER_COUNTER, aContextData, aId),
342                 iTimerCounter(aTimerCounter),
343                 iSeries(aSeries),
344                 iSeriesOffset(aSeriesOffset),
345                 iValue(aValue)
346         {}
347         TPVH324TimerCounter iTimerCounter;
348         uint8 iSeries;
349         uint32 iSeriesOffset;
350         uint32 iValue;
351 };
352 
353 class PVH324MessageSetVideoResolutions : public CPVH324InterfaceCmdMessage
354 {
355     public:
PVH324MessageSetVideoResolutions(TPVDirection aDirection,Oscl_Vector<PVMFVideoResolutionRange,OsclMemAllocator> & aResolutions,OsclAny * aContextData,TPVCmnCommandId aId)356         PVH324MessageSetVideoResolutions(TPVDirection aDirection,
357                                          Oscl_Vector<PVMFVideoResolutionRange, OsclMemAllocator>& aResolutions,
358                                          OsclAny* aContextData,
359                                          TPVCmnCommandId aId)
360                 : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SET_VIDEO_RESOLUTIONS, aContextData, aId),
361                 iDirection(aDirection),
362                 iResolutions(aResolutions)
363         {}
364         TPVDirection iDirection;
365         Oscl_Vector<PVMFVideoResolutionRange, OsclMemAllocator> iResolutions;
366 };
367 
368 class PVH324MessageSendVideoSpatialTemporalTradeoffCommand : public CPVH324InterfaceCmdMessage
369 {
370     public:
PVH324MessageSendVideoSpatialTemporalTradeoffCommand(TPVChannelId aLogicalChannel,uint8 aTradeoff,OsclAny * aContextData,TPVCmnCommandId aId)371         PVH324MessageSendVideoSpatialTemporalTradeoffCommand(TPVChannelId aLogicalChannel,
372                 uint8 aTradeoff,
373                 OsclAny* aContextData,
374                 TPVCmnCommandId aId)
375                 : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SEND_VIDEO_SPATIAL_TEMPORAL_TRADEOFF_COMMAND, aContextData, aId),
376                 iLogicalChannel(aLogicalChannel),
377                 iTradeoff(aTradeoff)
378         {}
379         TPVChannelId iLogicalChannel;
380         uint8 iTradeoff;
381 };
382 
383 class PVH324MessageSendVideoSpatialTemporalTradeoffIndication : public CPVH324InterfaceCmdMessage
384 {
385     public:
PVH324MessageSendVideoSpatialTemporalTradeoffIndication(TPVChannelId aLogicalChannel,uint8 aTradeoff,OsclAny * aContextData,TPVCmnCommandId aId)386         PVH324MessageSendVideoSpatialTemporalTradeoffIndication(TPVChannelId aLogicalChannel,
387                 uint8 aTradeoff,
388                 OsclAny* aContextData,
389                 TPVCmnCommandId aId)
390                 : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SEND_VIDEO_SPATIAL_TEMPORAL_TRADEOFF_INDICATION, aContextData, aId),
391                 iLogicalChannel(aLogicalChannel),
392                 iTradeoff(aTradeoff)
393         {}
394         TPVChannelId iLogicalChannel;
395         uint8 iTradeoff;
396 };
397 
398 class PVH324MessageSendSkewIndication : public CPVH324InterfaceCmdMessage
399 {
400     public:
PVH324MessageSendSkewIndication(TPVChannelId aLogicalChannel1,TPVChannelId aLogicalChannel2,uint16 aSkew,OsclAny * aContextData,TPVCmnCommandId aId)401         PVH324MessageSendSkewIndication(TPVChannelId aLogicalChannel1,
402                                         TPVChannelId aLogicalChannel2,
403                                         uint16 aSkew,
404                                         OsclAny* aContextData,
405                                         TPVCmnCommandId aId)
406                 : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SEND_SKEW_INDICATION, aContextData, aId),
407                 iLogicalChannel1(aLogicalChannel1),
408                 iLogicalChannel2(aLogicalChannel2),
409                 iSkew(aSkew)
410         {}
411         TPVChannelId iLogicalChannel1;
412         TPVChannelId iLogicalChannel2;
413         uint16 iSkew;
414 };
415 
416 class PVH324MessageSetLogicalChannelBufferingMs : public CPVCmnInterfaceCmdMessage
417 {
418     public:
PVH324MessageSetLogicalChannelBufferingMs(uint32 aInBufferingMs,uint32 aOutBufferingMs,OsclAny * aContextData,TPVCmnCommandId aId)419         PVH324MessageSetLogicalChannelBufferingMs(uint32 aInBufferingMs,
420                 uint32 aOutBufferingMs,
421                 OsclAny* aContextData,
422                 TPVCmnCommandId aId)
423                 : CPVCmnInterfaceCmdMessage(PVT_H324_COMMAND_SET_LOGICAL_CHANNEL_BUFFERING_MS, aContextData),
424                 iInLogicalChannelBufferingMs(aInBufferingMs),
425                 iOutLogicalChannelBufferingMs(aOutBufferingMs)
426         {
427             OSCL_UNUSED_ARG(aId);
428         }
429         uint32 iInLogicalChannelBufferingMs;
430         uint32 iOutLogicalChannelBufferingMs;
431 };
432 
433 class PVH324MessageSendUserInput: public CPVCmnInterfaceCmdMessage
434 {
435     public:
PVH324MessageSendUserInput(OsclAny * aContextData,TPVCmnCommandId aId)436         PVH324MessageSendUserInput(OsclAny* aContextData,
437                                    TPVCmnCommandId aId)
438                 : CPVCmnInterfaceCmdMessage(PVT_H324_COMMAND_SEND_USER_INPUT, aContextData),
439                 iUserInput(NULL)
440         {
441             OSCL_UNUSED_ARG(aId);
442         }
~PVH324MessageSendUserInput()443         ~PVH324MessageSendUserInput()
444         {
445             SetUserInput(NULL);
446         }
SetUserInput(CPVUserInput * input)447         void SetUserInput(CPVUserInput* input)
448         {
449             if (iUserInput)
450             {
451                 delete iUserInput;
452                 iUserInput = NULL;
453             }
454             if (input)
455             {
456                 iUserInput = input->Copy();
457             }
458         }
459         CPVUserInput* iUserInput;
460 };
461 
462 class PVH324MessageSetWnsrp : public CPVH324InterfaceCmdMessage
463 {
464     public:
PVH324MessageSetWnsrp(bool wnsrp,OsclAny * aContextData,TPVCmnCommandId aId)465         PVH324MessageSetWnsrp(bool wnsrp,
466                               OsclAny* aContextData,
467                               TPVCmnCommandId aId)
468                 : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SET_WNSRP, aContextData, aId),
469                 iWnsrp(wnsrp)
470         {}
471         bool iWnsrp;
472 };
473 
474 class PVH324MessageUtils
475 {
476     public:
DestroyMessage(CPVCmnInterfaceCmdMessage * aCmd)477         static void DestroyMessage(CPVCmnInterfaceCmdMessage *aCmd)
478         {
479             switch (aCmd->GetType())
480             {
481                 case PVT_H324_COMMAND_QUERY_INTERFACE:
482                     OSCL_DELETE((PVH324MessageQueryInterface*)aCmd);
483                     break;
484                 case PVT_H324_COMMAND_SET_H223_LEVEL:
485                     OSCL_DELETE((PVH324MessageSetH223Level*)aCmd);
486                     break;
487                 case PVT_H324_COMMAND_SET_MAX_SDU_SIZE:
488                     OSCL_DELETE((PVH324MessageSetMaxSduSize*)aCmd);
489                     break;
490                 case PVT_H324_COMMAND_SET_MAX_SDU_SIZE_R:
491                     OSCL_DELETE((PVH324MessageSetMaxSduSizeR*)aCmd);
492                     break;
493                 case PVT_H324_COMMAND_SEND_RME:
494                     OSCL_DELETE((PVH324MessageSendRme*)aCmd);
495                     break;
496                 case PVT_H324_COMMAND_SET_AL2_SEQ_NUM:
497                     OSCL_DELETE((PVH324MessageSetAl2SequenceNumbers*)aCmd);
498                     break;
499                 case PVT_H324_COMMAND_SET_CONTROL_FIELD_OCTETS:
500                     OSCL_DELETE((PVH324MessageSetAl3ControlFieldOctets*)aCmd);
501                     break;
502                 case PVT_H324_COMMAND_SET_MAX_PDU_SIZE:
503                     OSCL_DELETE((PVH324MessageSetMaxPduSize*)aCmd);
504                     break;
505                 case PVT_H324_COMMAND_SET_TERMINAL_TYPE:
506                     OSCL_DELETE((PVH324MessageSetTerminalType*)aCmd);
507                     break;
508                 case PVT_H324_COMMAND_SET_MAX_MUX_PDU_SIZE:
509                     OSCL_DELETE((PVH324MessageSetMaxMuxPduSize*)aCmd);
510                     break;
511                 case PVT_H324_COMMAND_SET_MAX_MUX_CCSRL_SDU_SIZE:
512                     OSCL_DELETE((PVH324MessageSetMaxMuxCcsrlSduSize*)aCmd);
513                     break;
514                 case PVT_H324_COMMAND_SEND_RTD:
515                     OSCL_DELETE((PVH324MessageSendRtd*)aCmd);
516                     break;
517                 case PVT_H324_COMMAND_SET_VENDOR_ID:
518                     OSCL_DELETE((PVH324MessageSetVendorId*)aCmd);
519                     break;
520                 case PVT_H324_COMMAND_SEND_VENDOR_ID:
521                     OSCL_DELETE((PVH324MessageSendVendorId*)aCmd);
522                     break;
523                 case PVT_H324_COMMAND_SEND_END_SESSION:
524                     OSCL_DELETE((PVH324MessageEndSession*)aCmd);
525                     break;
526                 case PVT_H324_COMMAND_SET_END_SESSION_TIMEOUT:
527                     OSCL_DELETE((PVH324MessageSetEndSessionTimeout*)aCmd);
528                     break;
529                 case PVT_H324_COMMAND_SET_AL_CONFIGURATION:
530                     OSCL_DELETE((PVH324MessageSetALConfiguration*)aCmd);
531                     break;
532                 case PVT_H324_COMMAND_SET_TIMER_COUNTER:
533                     OSCL_DELETE((PVH324MessageSetTimerCounter*)aCmd);
534                     break;
535                 case PVT_H324_COMMAND_SET_VIDEO_RESOLUTIONS:
536                     OSCL_DELETE((PVH324MessageSetVideoResolutions*)aCmd);
537                     break;
538                 case PVT_H324_COMMAND_SEND_VIDEO_SPATIAL_TEMPORAL_TRADEOFF_COMMAND:
539                     OSCL_DELETE((PVH324MessageSendVideoSpatialTemporalTradeoffCommand*)aCmd);
540                     break;
541                 case PVT_H324_COMMAND_SEND_VIDEO_SPATIAL_TEMPORAL_TRADEOFF_INDICATION:
542                     OSCL_DELETE((PVH324MessageSendVideoSpatialTemporalTradeoffIndication*)aCmd);
543                     break;
544                 case PVT_H324_COMMAND_SEND_SKEW_INDICATION:
545                     OSCL_DELETE((PVH324MessageSendSkewIndication*)aCmd);
546                     break;
547                 case PVT_H324_COMMAND_SET_LOGICAL_CHANNEL_BUFFERING_MS:
548                     OSCL_DELETE((PVH324MessageSetLogicalChannelBufferingMs*)aCmd);
549                     break;
550                 case PVT_H324_COMMAND_SEND_USER_INPUT:
551                     OSCL_DELETE((PVH324MessageSendUserInput*)aCmd);
552                     break;
553                 case PVT_H324_COMMAND_SET_WNSRP:
554                     OSCL_DELETE((PVH324MessageSetWnsrp*)aCmd);
555                     break;
556                 default:
557                     break;
558             }
559         }
560 };
561 
562 
563 /////////////////////////////////////////////////
564 // H324MConfig
565 /////////////////////////////////////////////////
H324MConfig(TSC_324m * aH324M,bool aUseAO)566 H324MConfig::H324MConfig(TSC_324m *aH324M, bool aUseAO) :
567         OsclActiveObject(OsclActiveObject::EPriorityNominal, "H324MConfig"),
568         iH324M(aH324M),
569         iReferenceCount(0),
570         iLogger(NULL),
571         iCommandId(1),
572         iObserver(NULL),
573         iUseAO(aUseAO)
574 {
575     iLogger = PVLogger::GetLoggerObject("3g324m.h324mconfig");
576     addRef();
577     iH324M->SetTSC_324mObserver((TSC_324mObserver*)this);
578 }
579 
~H324MConfig()580 H324MConfig::~H324MConfig()
581 {
582     // Gkl
583     iH324M->SetTSC_324mObserver(NULL);
584 }
585 
SetObserver(H324MConfigObserver * aObserver)586 void H324MConfig::SetObserver(H324MConfigObserver* aObserver)
587 {
588     iObserver = aObserver;
589 }
590 
Run()591 void H324MConfig::Run()
592 {
593     unsigned i = 0;
594     for (i = 0; i < iPendingResponses.size(); i++)
595     {
596         iObserver->H324MConfigCommandCompletedL(iPendingResponses[i]);
597     }
598     iPendingResponses.clear();
599 
600     for (i = 0; i < iPendingEvents.size(); i++)
601     {
602         iObserver->H324MConfigHandleInformationalEventL(iPendingEvents[i]);
603     }
604     iPendingEvents.clear();
605 }
606 
SetMultiplexLevel(TPVH223Level aLevel,OsclAny * aContextData)607 PVMFCommandId H324MConfig::SetMultiplexLevel(TPVH223Level aLevel, OsclAny* aContextData)
608 {
609     OSCL_UNUSED_ARG(aContextData);
610     iH324M->SetMultiplexLevel(aLevel);
611     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
612     return iCommandId++;
613 };
614 
SetMaxSduSize(TPVAdaptationLayer aLayer,int32 aSize,OsclAny * aContextData)615 PVMFCommandId H324MConfig::SetMaxSduSize(TPVAdaptationLayer aLayer, int32 aSize, OsclAny* aContextData)
616 {
617     OSCL_UNUSED_ARG(aContextData);
618     iH324M->SetSduSize(OUTGOING, (uint16)aSize, aLayer);
619     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
620     return iCommandId++;
621 };
622 
SetMaxSduSizeR(TPVAdaptationLayer aLayer,int32 aSize,OsclAny * aContextData)623 PVMFCommandId H324MConfig::SetMaxSduSizeR(TPVAdaptationLayer aLayer, int32 aSize, OsclAny* aContextData)
624 {
625     OSCL_UNUSED_ARG(aContextData);
626     iH324M->SetSduSize(INCOMING, (uint16)aSize, aLayer);
627     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
628     return iCommandId++;
629 };
630 
SetAl2SequenceNumbers(int32 aSeqNumWidth,OsclAny * aContextData)631 PVMFCommandId H324MConfig::SetAl2SequenceNumbers(int32 aSeqNumWidth, OsclAny* aContextData)
632 {
633     OSCL_UNUSED_ARG(aContextData);
634     iH324M->SetAl2Sn(aSeqNumWidth);
635     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
636     return iCommandId++;
637 };
638 
SetAl3ControlFieldOctets(int32 aCfo,OsclAny * aContextData)639 PVMFCommandId H324MConfig::SetAl3ControlFieldOctets(int32 aCfo, OsclAny* aContextData)
640 {
641     OSCL_UNUSED_ARG(aContextData);
642     iH324M->SetAl3ControlFieldOctets(aCfo);
643     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
644     return iCommandId++;
645 };
646 
SetOutoingPduType(TPVH223MuxPduType aOutgoingPduType,OsclAny * aContextData)647 PVMFCommandId H324MConfig::SetOutoingPduType(TPVH223MuxPduType aOutgoingPduType, OsclAny* aContextData)
648 {
649     OSCL_UNUSED_ARG(aContextData);
650     iH324M->SetMaxOutgoingPduSize((uint16)aOutgoingPduType);
651     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
652     return iCommandId++;
653 };
654 
SetMaxPduSize(int32 aMaxPduSize,OsclAny * aContextData)655 PVMFCommandId H324MConfig::SetMaxPduSize(int32 aMaxPduSize, OsclAny* aContextData)
656 {
657     OSCL_UNUSED_ARG(aContextData);
658     iH324M->SetMaxMuxPduSize((uint16)aMaxPduSize);
659     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
660     return iCommandId++;
661 };
662 
SetTerminalType(uint8 aTerminalType,OsclAny * aContextData)663 PVMFCommandId H324MConfig::SetTerminalType(uint8 aTerminalType, OsclAny* aContextData)
664 {
665     OSCL_UNUSED_ARG(aContextData);
666     iH324M->SetTerminalType(aTerminalType);
667     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
668     return iCommandId++;
669 };
670 
SetALConfiguration(TPVMediaType_t aMediaType,TPVAdaptationLayer aLayer,bool aAllow,OsclAny * aContextData)671 PVMFCommandId H324MConfig::SetALConfiguration(TPVMediaType_t aMediaType, TPVAdaptationLayer aLayer,
672         bool aAllow, OsclAny* aContextData)
673 {
674     OSCL_UNUSED_ARG(aContextData);
675     iH324M->SetAlConfig(aMediaType, aLayer, aAllow);
676     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
677     return iCommandId++;
678 };
679 
SendRme(OsclAny * aContextData)680 PVMFCommandId H324MConfig::SendRme(OsclAny* aContextData)
681 {
682     OSCL_UNUSED_ARG(aContextData);
683     iH324M->RmeSendReq();
684     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
685     return iCommandId++;
686 };
687 
688 
SetMaxMuxPduSize(int32 aRequestMaxMuxPduSize,OsclAny * aContextData)689 PVMFCommandId H324MConfig::SetMaxMuxPduSize(int32 aRequestMaxMuxPduSize, OsclAny* aContextData)
690 {
691     OSCL_UNUSED_ARG(aContextData);
692     iH324M->SetMaxMuxPduSize((uint16)aRequestMaxMuxPduSize);
693     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
694     return iCommandId++;
695 };
696 
SetMaxMuxCcsrlSduSize(int32 aMaxCcsrlSduSize,OsclAny * aContextData)697 PVMFCommandId H324MConfig::SetMaxMuxCcsrlSduSize(int32 aMaxCcsrlSduSize, OsclAny* aContextData)
698 {
699     OSCL_UNUSED_ARG(aContextData);
700     iH324M->SetMaxCcsrlSduSize(aMaxCcsrlSduSize);
701     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
702     return iCommandId++;
703 };
704 
FastUpdate(PVMFNodeInterface & aTrack,OsclAny * aContextData)705 PVMFCommandId H324MConfig::FastUpdate(PVMFNodeInterface& aTrack, OsclAny* aContextData)
706 {
707     OSCL_UNUSED_ARG(aTrack);
708     OSCL_UNUSED_ARG(aContextData);
709     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
710     return iCommandId++;
711 };
712 
SendRtd(OsclAny * aContextData)713 PVMFCommandId H324MConfig::SendRtd(OsclAny* aContextData)
714 {
715     OSCL_UNUSED_ARG(aContextData);
716     iH324M->RtdTrfReq();
717     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
718     return iCommandId++;
719 };
720 
SetVendor(uint8 aCc,uint8 aExt,uint32 aMc,const uint8 * aProduct,uint16 aProductLen,const uint8 * aVersion,uint16 aVersionLen,OsclAny * aContextData)721 PVMFCommandId H324MConfig::SetVendor(uint8 aCc, uint8 aExt, uint32 aMc,
722                                      const uint8* aProduct, uint16 aProductLen,
723                                      const uint8* aVersion, uint16 aVersionLen,
724                                      OsclAny* aContextData)
725 {
726     OSCL_UNUSED_ARG(aContextData);
727 
728     TPVH245Vendor* h245vendor = new TPVVendorH221NonStandard(aCc, aExt, aMc);
729     iH324M->SetVendorIdInfo(h245vendor,
730                             aProduct, aProductLen,
731                             aVersion, aVersionLen);
732     delete h245vendor;
733     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
734     return iCommandId++;
735 };
736 
SendEndSession(OsclAny * aContextData)737 PVMFCommandId H324MConfig::SendEndSession(OsclAny* aContextData)
738 {
739     OSCL_UNUSED_ARG(aContextData);
740     iH324M->EndSessionCommand();
741     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
742     return iCommandId++;
743 };
744 
SetEndSessionTimeout(uint32 aTimeout,OsclAny * aContextData)745 PVMFCommandId H324MConfig::SetEndSessionTimeout(uint32 aTimeout, OsclAny* aContextData)
746 {
747     OSCL_UNUSED_ARG(aContextData);
748     iH324M->SetEndSessionTimeout(aTimeout);
749     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
750     return iCommandId++;
751 }
752 
SetTimerCounter(TPVH324TimerCounter aTimerCounter,uint8 aSeries,uint32 aSeriesOffset,uint32 aValue,OsclAny * aContextData)753 PVMFCommandId H324MConfig::SetTimerCounter(TPVH324TimerCounter aTimerCounter,
754         uint8 aSeries, uint32 aSeriesOffset,
755         uint32 aValue,
756         OsclAny* aContextData)
757 {
758     OSCL_UNUSED_ARG(aContextData);
759     iH324M->SetTimerCounter(aTimerCounter, aSeries, aSeriesOffset, aValue);
760     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
761     return iCommandId++;
762 };
763 
SetVideoResolutions(TPVDirection aDirection,Oscl_Vector<PVMFVideoResolutionRange,OsclMemAllocator> & aResolutions,OsclAny * aContextData)764 PVMFCommandId H324MConfig::SetVideoResolutions(TPVDirection aDirection,
765         Oscl_Vector<PVMFVideoResolutionRange, OsclMemAllocator>& aResolutions,
766         OsclAny* aContextData)
767 {
768     OSCL_UNUSED_ARG(aContextData);
769     iH324M->SetVideoResolutions(aDirection, aResolutions);
770     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
771     return iCommandId++;
772 };
773 
SendVendorId(OsclAny * aContextData)774 PVMFCommandId H324MConfig::SendVendorId(OsclAny* aContextData)
775 {
776     OSCL_UNUSED_ARG(aContextData);
777     iH324M->Tsc_IdcVi();
778     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
779     return iCommandId++;
780 };
781 
SendVideoTemporalSpatialTradeoffCommand(TPVChannelId aLogicalChannel,uint8 aTradeoff,OsclAny * aContextData)782 PVMFCommandId H324MConfig::SendVideoTemporalSpatialTradeoffCommand(TPVChannelId aLogicalChannel, uint8 aTradeoff,
783         OsclAny* aContextData)
784 {
785     OSCL_UNUSED_ARG(aContextData);
786     iH324M->SendVideoTemporalSpatialTradeoffCommand(aLogicalChannel, aTradeoff);
787     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
788     return iCommandId++;
789 }
790 
SendVideoTemporalSpatialTradeoffIndication(TPVChannelId aLogicalChannel,uint8 aTradeoff,OsclAny * aContextData)791 PVMFCommandId H324MConfig::SendVideoTemporalSpatialTradeoffIndication(TPVChannelId aLogicalChannel, uint8 aTradeoff,
792         OsclAny* aContextData)
793 {
794     OSCL_UNUSED_ARG(aContextData);
795     iH324M->SendVideoTemporalSpatialTradeoffIndication(aLogicalChannel, aTradeoff);
796     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
797     return iCommandId++;
798 }
799 
SendSkewIndication(TPVChannelId aLogicalChannel1,TPVChannelId aLogicalChannel2,uint16 aSkew,OsclAny * aContextData)800 PVMFCommandId H324MConfig::SendSkewIndication(TPVChannelId aLogicalChannel1, TPVChannelId aLogicalChannel2, uint16 aSkew,
801         OsclAny* aContextData)
802 {
803     OSCL_UNUSED_ARG(aContextData);
804     iH324M->SendSkewIndication(aLogicalChannel1, aLogicalChannel2, aSkew);
805     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
806     return iCommandId++;
807 }
808 
809 
810 PVMFCommandId
SetLogicalChannelBufferingMs(uint32 aInBufferingMs,uint32 aOutBufferingMs,OsclAny * aContextData)811 H324MConfig::SetLogicalChannelBufferingMs(uint32 aInBufferingMs,
812         uint32 aOutBufferingMs,
813         OsclAny* aContextData)
814 {
815     OSCL_UNUSED_ARG(aContextData);
816     iH324M->SetLogicalChannelBufferingMs(aInBufferingMs, aOutBufferingMs);
817     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
818     return iCommandId++;
819 }
820 
821 PVMFCommandId
SendUserInput(CPVUserInput * aUserInput,OsclAny * aContextData)822 H324MConfig::SendUserInput(CPVUserInput* aUserInput,
823                            OsclAny* aContextData)
824 {
825     OSCL_UNUSED_ARG(aContextData);
826     switch (aUserInput->GetType())
827     {
828         case EAlphanumeric:
829             CPVUserInputAlphanumeric *alpha;
830 
831             alpha = (CPVUserInputAlphanumeric *) aUserInput;
832 
833             if ((alpha->GetInput() == NULL) || (alpha->GetLength() == 0))
834             {
835                 PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR,
836                                 (0, "H324MConfig::SendUserInput invalid alphanumeric string, ptr %x, len %d!\n",
837                                  alpha->GetInput(), alpha->GetLength()));
838                 OSCL_LEAVE(PVMFErrArgument);
839             }
840             iH324M->Tsc_UII_Alphanumeric(alpha->GetInput(), alpha->GetLength());
841             break;
842 
843         case EDtmf:
844             CPVUserInputDtmf *dtmf;
845             dtmf = (CPVUserInputDtmf *) aUserInput;
846             iH324M->Tsc_UII_DTMF(dtmf->GetInput(), dtmf->GetDuration());
847             break;
848 
849         default:
850             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR,
851                             (0, "H324MConfig::SendUserInput invalid user input type!\n"));
852             OSCL_LEAVE(PVMFErrArgument);
853             break;
854     }
855     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
856     return iCommandId++;
857 }
858 
SetWnsrp(const bool aEnableWnsrp,OsclAny * aContextData)859 PVMFCommandId H324MConfig::SetWnsrp(const bool aEnableWnsrp,
860                                     OsclAny* aContextData)
861 {
862     OSCL_UNUSED_ARG(aContextData);
863     iH324M->SetWnsrp(aEnableWnsrp);
864     SendCmdResponse(iCommandId, aContextData, PVMFSuccess);
865     return iCommandId++;
866 }
867 
868 ////////////////////////////////////
869 // PVInterface virtuals
870 ////////////////////////////////////
addRef()871 void H324MConfig::addRef()
872 {
873     if (iReferenceCount == 0 && iUseAO)
874         AddToScheduler();
875     iReferenceCount++;
876 }
877 
removeRef()878 void H324MConfig::removeRef()
879 {
880     if (--iReferenceCount == 0)
881     {
882         OSCL_DELETE(this);
883     }
884 }
885 
queryInterface(const PVUuid & aUuid,PVInterface * & aInterfacePtr)886 bool H324MConfig::queryInterface(const PVUuid& aUuid, PVInterface*& aInterfacePtr)
887 {
888     aInterfacePtr = NULL;
889 
890     if (aUuid == PVUidProxiedInterface)
891     {
892         H324MProxiedInterface* proxied_interface_ptr = NULL;
893         proxied_interface_ptr = OSCL_NEW(H324MProxiedInterface, ());
894         proxied_interface_ptr->SetH324M(iH324M);
895         aInterfacePtr = proxied_interface_ptr;
896         return true;
897     }
898     else
899     {
900         // could have several interfaces we may be looking for here.
901         //here add way to get the component interface.
902         // do in steps.  First- you know what you want.
903         if (iH324M->QueryInterface(0, aUuid, aInterfacePtr))
904             return true;
905     }
906 
907     return false;
908 }
909 
SendCmdResponse(PVMFCommandId id,OsclAny * context,PVMFStatus status)910 void H324MConfig::SendCmdResponse(PVMFCommandId id, OsclAny* context, PVMFStatus status)
911 {
912     PVMFCmdResp resp(id, context, status);
913     if (iUseAO)
914     {
915         iPendingResponses.push_back(resp);
916         RunIfNotReady();
917     }
918     else
919     {
920         iObserver->H324MConfigCommandCompletedL(resp);
921     }
922 }
923 
SendAsyncEvent(PVMFAsyncEvent & event)924 void H324MConfig::SendAsyncEvent(PVMFAsyncEvent& event)
925 {
926     if (iUseAO)
927     {
928         iPendingEvents.push_back(event);
929         RunIfNotReady();
930     }
931     else
932     {
933         iObserver->H324MConfigHandleInformationalEventL(event);
934     }
935 }
936 
IncomingVendorId(TPVH245Vendor * vendor,const uint8 * pn,uint16 pn_len,const uint8 * vn,uint16 vn_len)937 void H324MConfig::IncomingVendorId(TPVH245Vendor* vendor,
938                                    const uint8* pn, uint16 pn_len,
939                                    const uint8* vn, uint16 vn_len)
940 {
941     OSCL_UNUSED_ARG(vendor);
942     OSCL_UNUSED_ARG(pn);
943     OSCL_UNUSED_ARG(pn_len);
944     OSCL_UNUSED_ARG(vn);
945     OSCL_UNUSED_ARG(vn_len);
946 }
947 
UserInputReceived(CPVUserInput * aUI)948 void H324MConfig::UserInputReceived(CPVUserInput* aUI)
949 {
950     OSCL_UNUSED_ARG(aUI);
951 }
952 
UserInputCapability(int formats)953 void H324MConfig::UserInputCapability(int formats)
954 {
955     PVMFAsyncEvent event(PVMFInfoEvent, PV_INDICATION_USER_INPUT_CAPABILITY, NULL, NULL);
956     oscl_memset(event.GetLocalBuffer(), 0, PVMF_ASYNC_EVENT_LOCAL_BUF_SIZE);
957     event.GetLocalBuffer()[0] = (uint8)(formats & 0xFF);
958     SendAsyncEvent(event);
959 }
960 
VideoSpatialTemporalTradeoffCommandReceived(TPVChannelId id,uint8 tradeoff)961 void H324MConfig::VideoSpatialTemporalTradeoffCommandReceived(TPVChannelId id, uint8 tradeoff)
962 {
963     PVMFAsyncEvent event(PVMFInfoEvent, PV_INDICATION_VIDEO_SPATIAL_TEMPORAL_TRADEOFF_COMMAND, NULL, NULL);
964     oscl_memset(event.GetLocalBuffer(), 0, PVMF_ASYNC_EVENT_LOCAL_BUF_SIZE);
965     event.GetLocalBuffer()[0] = (uint8)((id >> 8) & 0xFF);
966     event.GetLocalBuffer()[1] = (uint8)(id & 0xFF);
967     event.GetLocalBuffer()[2] = (uint8) tradeoff;
968     SendAsyncEvent(event);
969 }
970 
VideoSpatialTemporalTradeoffIndicationReceived(TPVChannelId id,uint8 tradeoff)971 void H324MConfig::VideoSpatialTemporalTradeoffIndicationReceived(TPVChannelId id, uint8 tradeoff)
972 {
973     PVMFAsyncEvent event(PVMFInfoEvent, PV_INDICATION_VIDEO_SPATIAL_TEMPORAL_TRADEOFF_INDICATION, NULL, NULL);
974     oscl_memset(event.GetLocalBuffer(), 0, PVMF_ASYNC_EVENT_LOCAL_BUF_SIZE);
975     event.GetLocalBuffer()[0] = (uint8)((id >> 8) & 0xFF);
976     event.GetLocalBuffer()[1] = (uint8)(id & 0xFF);
977     event.GetLocalBuffer()[2] = (uint8) tradeoff;
978     SendAsyncEvent(event);
979 }
980 
SkewIndicationReceived(TPVChannelId lcn1,TPVChannelId lcn2,uint16 skew)981 void H324MConfig::SkewIndicationReceived(TPVChannelId lcn1, TPVChannelId lcn2, uint16 skew)
982 {
983     PVMFAsyncEvent event(PVMFInfoEvent, PV_INDICATION_SKEW, NULL, NULL);
984     oscl_memset(event.GetLocalBuffer(), 0, PVMF_ASYNC_EVENT_LOCAL_BUF_SIZE);
985     event.GetLocalBuffer()[0] = (uint8)((lcn1 >> 8) & 0xFF);
986     event.GetLocalBuffer()[1] = (uint8)(lcn1 & 0xFF);
987     event.GetLocalBuffer()[2] = (uint8)((lcn2 >> 8) & 0xFF);
988     event.GetLocalBuffer()[3] = (uint8)(lcn2 & 0xFF);
989     event.GetLocalBuffer()[4] = (uint8)((skew >> 8) & 0xFF);
990     event.GetLocalBuffer()[5] = (uint8)(skew & 0xFF);
991     SendAsyncEvent(event);
992 }
993 
994 ///////////////////////////////////////
995 // H324MConfigProxied
996 ///////////////////////////////////////
H324MConfigProxied(H324MConfigInterface * aH324MConfigIF,PVMainProxy * aMainProxy)997 H324MConfigProxied::H324MConfigProxied(H324MConfigInterface *aH324MConfigIF, PVMainProxy *aMainProxy) :
998         iH324MConfigIF(aH324MConfigIF),
999         iMainProxy(aMainProxy),
1000         iLoggerClient(NULL),
1001         iLoggerServer(NULL),
1002         iReferenceCount(1),
1003         iProxyId(0),
1004         iCommandId(1),
1005         iObserver(NULL)
1006 {
1007     iProxyId = iMainProxy->RegisterProxiedInterface(*this, *this);
1008     iH324MConfigIF->addRef();
1009     iH324MConfigIF->SetObserver(this);
1010     iLoggerServer = PVLogger::GetLoggerObject("3g324m.h324mconfig.proxied.server");
1011 }
1012 
~H324MConfigProxied()1013 H324MConfigProxied::~H324MConfigProxied()
1014 {
1015     iMainProxy->UnregisterProxiedInterface(iProxyId);
1016     Oscl_Map<PVMFCommandId, CPVCmnInterfaceCmdMessage*, OsclMemAllocator>::iterator it = iPendingCmds.begin();
1017     while (it != iPendingCmds.end())
1018     {
1019         CPVCmnInterfaceCmdMessage* msg = (*it++).second;
1020         if (msg)PVH324MessageUtils::DestroyMessage(msg);
1021     }
1022     iPendingCmds.clear();
1023     iH324MConfigIF->removeRef();
1024 }
1025 
addRef()1026 void H324MConfigProxied::addRef()
1027 {
1028     iReferenceCount++;
1029 }
1030 
removeRef()1031 void H324MConfigProxied::removeRef()
1032 {
1033     if (--iReferenceCount <= 0)
1034     {
1035         OSCL_DELETE(this);
1036     }
1037 }
1038 
queryInterface(const PVUuid & aUuid,PVInterface * & aInterfacePtr)1039 bool H324MConfigProxied::queryInterface(const PVUuid& aUuid, PVInterface*& aInterfacePtr)
1040 {
1041     aInterfacePtr = NULL;
1042 
1043     iH324MConfigIF->queryInterface(aUuid, aInterfacePtr);
1044 
1045     if (aInterfacePtr)
1046         return true;
1047     return false;
1048 
1049 }
1050 
SetObserver(H324MConfigObserver * aObserver)1051 void H324MConfigProxied::SetObserver(H324MConfigObserver* aObserver)
1052 {
1053     iObserver = aObserver;
1054 }
1055 
H324MConfigCommandCompletedL(PVMFCmdResp & aResponse)1056 void H324MConfigProxied::H324MConfigCommandCompletedL(PVMFCmdResp& aResponse)
1057 {
1058     CPVCmnInterfaceCmdMessage* cmdMsg = iPendingCmds[aResponse.GetCmdId()];
1059     if (cmdMsg == NULL)
1060         return;
1061     CPVH324InterfaceCmdMessage* h324CmdMsg = OSCL_STATIC_CAST(CPVH324InterfaceCmdMessage*, cmdMsg);
1062 
1063     PVMFCmdResp *response = OSCL_NEW(PVMFCmdResp, (h324CmdMsg->GetResponse(aResponse.GetCmdId(),
1064                                      (OsclAny*)aResponse.GetContext(),
1065                                      aResponse.GetCmdStatus(),
1066                                      aResponse.GetEventData())));
1067     iMainProxy->SendNotification(iProxyId, response);
1068 }
1069 
H324MConfigHandleInformationalEventL(PVMFAsyncEvent & aNotification)1070 void H324MConfigProxied::H324MConfigHandleInformationalEventL(PVMFAsyncEvent& aNotification)
1071 {
1072     PVMFAsyncEvent* event = NULL;
1073     event = OSCL_NEW(PVMFAsyncEvent, (aNotification));
1074     iMainProxy->SendNotification(iProxyId, event);
1075 }
1076 
SetMultiplexLevel(TPVH223Level aLevel,OsclAny * aContextData)1077 PVMFCommandId H324MConfigProxied::SetMultiplexLevel(TPVH223Level aLevel, OsclAny* aContextData)
1078 {
1079     PVH324MessageSetH223Level *cmd = NULL;
1080     cmd = OSCL_NEW(PVH324MessageSetH223Level, (aLevel, aContextData, iCommandId));
1081     int32 error = 0;
1082     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1083     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1084     return iCommandId++;
1085 }
1086 
SetMaxSduSize(TPVAdaptationLayer aLayer,int32 aSize,OsclAny * aContextData)1087 PVMFCommandId H324MConfigProxied::SetMaxSduSize(TPVAdaptationLayer aLayer, int32 aSize, OsclAny* aContextData)
1088 {
1089     PVH324MessageSetMaxSduSize *cmd = NULL;
1090     cmd = OSCL_NEW(PVH324MessageSetMaxSduSize, (aLayer, aSize, aContextData, iCommandId));
1091     int32 error = 0;
1092     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1093     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1094     return iCommandId++;
1095 }
1096 
SetMaxSduSizeR(TPVAdaptationLayer aLayer,int32 aSize,OsclAny * aContextData)1097 PVMFCommandId H324MConfigProxied::SetMaxSduSizeR(TPVAdaptationLayer aLayer, int32 aSize, OsclAny* aContextData)
1098 {
1099     PVH324MessageSetMaxSduSizeR *cmd = NULL;
1100     cmd = OSCL_NEW(PVH324MessageSetMaxSduSizeR, (aLayer, aSize, aContextData, iCommandId));
1101     int32 error = 0;
1102     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1103     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1104     return iCommandId++;
1105 }
1106 
SetAl2SequenceNumbers(int32 aSeqNumWidth,OsclAny * aContextData)1107 PVMFCommandId H324MConfigProxied::SetAl2SequenceNumbers(int32 aSeqNumWidth, OsclAny* aContextData)
1108 {
1109     PVH324MessageSetAl2SequenceNumbers *cmd = NULL;
1110     cmd = OSCL_NEW(PVH324MessageSetAl2SequenceNumbers, (aSeqNumWidth, aContextData, iCommandId));
1111     int32 error = 0;
1112     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1113     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1114     return iCommandId++;
1115 }
1116 
SetAl3ControlFieldOctets(int32 aCfo,OsclAny * aContextData)1117 PVMFCommandId H324MConfigProxied::SetAl3ControlFieldOctets(int32 aCfo, OsclAny* aContextData)
1118 {
1119     PVH324MessageSetAl3ControlFieldOctets *cmd = NULL;
1120     cmd = OSCL_NEW(PVH324MessageSetAl3ControlFieldOctets, (aCfo, aContextData, iCommandId));
1121     int32 error = 0;
1122     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1123     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1124     return iCommandId++;
1125 }
1126 
SetMaxPduSize(int32 aMaxPduSize,OsclAny * aContextData)1127 PVMFCommandId H324MConfigProxied::SetMaxPduSize(int32 aMaxPduSize, OsclAny* aContextData)
1128 {
1129     PVH324MessageSetMaxPduSize *cmd = NULL;
1130     cmd = OSCL_NEW(PVH324MessageSetMaxPduSize, (aMaxPduSize, aContextData, iCommandId));
1131     int32 error = 0;
1132     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1133     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1134     return iCommandId++;
1135 }
1136 
SetTerminalType(uint8 aTerminalType,OsclAny * aContextData)1137 PVMFCommandId H324MConfigProxied::SetTerminalType(uint8 aTerminalType, OsclAny* aContextData)
1138 {
1139     PVH324MessageSetTerminalType *cmd = NULL;
1140     cmd = OSCL_NEW(PVH324MessageSetTerminalType, (aTerminalType, aContextData, iCommandId));
1141     int32 error = 0;
1142     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1143     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1144     return iCommandId++;
1145 }
1146 
SetALConfiguration(TPVMediaType_t aMediaType,TPVAdaptationLayer aLayer,bool aAllow,OsclAny * aContextData)1147 PVMFCommandId H324MConfigProxied::SetALConfiguration(TPVMediaType_t aMediaType, TPVAdaptationLayer aLayer,
1148         bool aAllow, OsclAny* aContextData)
1149 {
1150     PVH324MessageSetALConfiguration *cmd = NULL;
1151     cmd = OSCL_NEW(PVH324MessageSetALConfiguration, (aMediaType, aLayer, aAllow, aContextData, iCommandId));
1152     int32 error = 0;
1153     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1154     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1155     return iCommandId++;
1156 }
1157 
SendRme(OsclAny * aContextData)1158 PVMFCommandId H324MConfigProxied::SendRme(OsclAny* aContextData)
1159 {
1160     PVH324MessageSendRme *cmd = NULL;
1161     cmd = OSCL_NEW(PVH324MessageSendRme, (aContextData, iCommandId));
1162     int32 error = 0;
1163     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1164     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1165     return iCommandId++;
1166 }
1167 
SetMaxMuxPduSize(int32 aRequestMaxMuxPduSize,OsclAny * aContextData)1168 PVMFCommandId H324MConfigProxied::SetMaxMuxPduSize(int32 aRequestMaxMuxPduSize, OsclAny* aContextData)
1169 {
1170     PVH324MessageSetMaxMuxPduSize *cmd = NULL;
1171     cmd = OSCL_NEW(PVH324MessageSetMaxMuxPduSize, (aRequestMaxMuxPduSize, aContextData, iCommandId));
1172     int32 error = 0;
1173     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1174     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1175     return iCommandId++;
1176 }
1177 
SetMaxMuxCcsrlSduSize(int32 aMaxCcsrlSduSize,OsclAny * aContextData)1178 PVMFCommandId H324MConfigProxied::SetMaxMuxCcsrlSduSize(int32 aMaxCcsrlSduSize, OsclAny* aContextData)
1179 {
1180     PVH324MessageSetMaxMuxCcsrlSduSize *cmd = NULL;
1181     cmd = OSCL_NEW(PVH324MessageSetMaxMuxCcsrlSduSize, (aMaxCcsrlSduSize, aContextData, iCommandId));
1182     int32 error = 0;
1183     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1184     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1185     return iCommandId++;
1186 }
1187 
FastUpdate(PVMFNodeInterface & aTrack,OsclAny * aContextData)1188 PVMFCommandId H324MConfigProxied::FastUpdate(PVMFNodeInterface& aTrack, OsclAny* aContextData)
1189 {
1190     OSCL_UNUSED_ARG(aTrack);
1191     OSCL_UNUSED_ARG(aContextData);
1192     return iCommandId++;
1193 }
1194 
SendRtd(OsclAny * aContextData)1195 PVMFCommandId H324MConfigProxied::SendRtd(OsclAny* aContextData)
1196 {
1197     PVH324MessageSendRtd *cmd = NULL;
1198     cmd = OSCL_NEW(PVH324MessageSendRtd, (aContextData, iCommandId));
1199     int32 error = 0;
1200     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1201     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1202     return iCommandId++;
1203 }
1204 
SetVendor(uint8 aCc,uint8 aExt,uint32 aMc,const uint8 * aProduct,uint16 aProductLen,const uint8 * aVersion,uint16 aVersionLen,OsclAny * aContextData)1205 PVMFCommandId H324MConfigProxied::SetVendor(uint8 aCc, uint8 aExt, uint32 aMc,
1206         const uint8* aProduct, uint16 aProductLen,
1207         const uint8* aVersion, uint16 aVersionLen,
1208         OsclAny* aContextData)
1209 {
1210     PVH324MessageSetVendorId *cmd = NULL;
1211     cmd = OSCL_NEW(PVH324MessageSetVendorId, (aCc, aExt, aMc, aContextData, iCommandId));
1212     cmd->SetProduct(aProduct, aProductLen);
1213     cmd->SetVersion(aVersion, aVersionLen);
1214     int32 error = 0;
1215     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1216     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1217     return iCommandId++;
1218 };
1219 
SendEndSession(OsclAny * aContextData)1220 PVMFCommandId H324MConfigProxied::SendEndSession(OsclAny* aContextData)
1221 {
1222     PVH324MessageEndSession *cmd = NULL;
1223     cmd = OSCL_NEW(PVH324MessageEndSession, (aContextData, iCommandId));
1224     int32 error = 0;
1225     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1226     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1227     return iCommandId++;
1228 };
1229 
SetEndSessionTimeout(uint32 aTimeout,OsclAny * aContextData)1230 PVMFCommandId H324MConfigProxied::SetEndSessionTimeout(uint32 aTimeout, OsclAny* aContextData)
1231 {
1232     PVH324MessageSetEndSessionTimeout *cmd = NULL;
1233     cmd = OSCL_NEW(PVH324MessageSetEndSessionTimeout, (aTimeout, aContextData, iCommandId));
1234     int32 error = 0;
1235     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1236     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1237     return iCommandId++;
1238 };
1239 
SetTimerCounter(TPVH324TimerCounter aTimerCounter,uint8 aSeries,uint32 aSeriesOffset,uint32 aValue,OsclAny * aContextData)1240 PVMFCommandId H324MConfigProxied::SetTimerCounter(TPVH324TimerCounter aTimerCounter,
1241         uint8 aSeries, uint32 aSeriesOffset,
1242         uint32 aValue,
1243         OsclAny* aContextData)
1244 {
1245     PVH324MessageSetTimerCounter *cmd = NULL;
1246     cmd = OSCL_NEW(PVH324MessageSetTimerCounter, (aTimerCounter, aSeries, aSeriesOffset, aValue, aContextData, iCommandId));
1247     int32 error = 0;
1248     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1249     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1250     return iCommandId++;
1251 };
1252 
SetVideoResolutions(TPVDirection aDirection,Oscl_Vector<PVMFVideoResolutionRange,OsclMemAllocator> & aResolutions,OsclAny * aContextData)1253 PVMFCommandId H324MConfigProxied::SetVideoResolutions(TPVDirection aDirection,
1254         Oscl_Vector<PVMFVideoResolutionRange, OsclMemAllocator>& aResolutions,
1255         OsclAny* aContextData)
1256 {
1257     PVH324MessageSetVideoResolutions *cmd = NULL;
1258     cmd = OSCL_NEW(PVH324MessageSetVideoResolutions, (aDirection, aResolutions, aContextData, iCommandId));
1259     int32 error = 0;
1260     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1261     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1262     return iCommandId++;
1263 };
1264 
SendVendorId(OsclAny * aContextData)1265 PVMFCommandId H324MConfigProxied::SendVendorId(OsclAny* aContextData)
1266 {
1267     PVH324MessageSendVendorId *cmd = NULL;
1268     cmd = OSCL_NEW(PVH324MessageSendVendorId, (aContextData, iCommandId));
1269     int32 error = 0;
1270     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1271     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1272     return iCommandId++;
1273 };
1274 
SendVideoTemporalSpatialTradeoffCommand(TPVChannelId aLogicalChannel,uint8 aTradeoff,OsclAny * aContextData)1275 PVMFCommandId H324MConfigProxied::SendVideoTemporalSpatialTradeoffCommand(TPVChannelId aLogicalChannel, uint8 aTradeoff,
1276         OsclAny* aContextData)
1277 {
1278     PVH324MessageSendVideoSpatialTemporalTradeoffCommand *cmd = NULL;
1279     cmd = OSCL_NEW(PVH324MessageSendVideoSpatialTemporalTradeoffCommand, (aLogicalChannel, aTradeoff, aContextData, iCommandId));
1280     int32 error = 0;
1281     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1282     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1283     return iCommandId++;
1284 }
1285 
SendVideoTemporalSpatialTradeoffIndication(TPVChannelId aLogicalChannel,uint8 aTradeoff,OsclAny * aContextData)1286 PVMFCommandId H324MConfigProxied::SendVideoTemporalSpatialTradeoffIndication(TPVChannelId aLogicalChannel, uint8 aTradeoff,
1287         OsclAny* aContextData)
1288 {
1289     PVH324MessageSendVideoSpatialTemporalTradeoffIndication *cmd = NULL;
1290     cmd = OSCL_NEW(PVH324MessageSendVideoSpatialTemporalTradeoffIndication, (aLogicalChannel, aTradeoff, aContextData, iCommandId));
1291     int32 error = 0;
1292     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1293     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1294     return iCommandId++;
1295 }
1296 
SendSkewIndication(TPVChannelId aLogicalChannel1,TPVChannelId aLogicalChannel2,uint16 aSkew,OsclAny * aContextData)1297 PVMFCommandId H324MConfigProxied::SendSkewIndication(TPVChannelId aLogicalChannel1, TPVChannelId aLogicalChannel2, uint16 aSkew,
1298         OsclAny* aContextData)
1299 {
1300     PVH324MessageSendSkewIndication *cmd = NULL;
1301     cmd = OSCL_NEW(PVH324MessageSendSkewIndication, (aLogicalChannel1, aLogicalChannel2, aSkew, aContextData, iCommandId));
1302     int32 error = 0;
1303     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1304     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1305     return iCommandId++;
1306 }
1307 
1308 PVMFCommandId
SetLogicalChannelBufferingMs(uint32 aInBufferingMs,uint32 aOutBufferingMs,OsclAny * aContextData)1309 H324MConfigProxied::SetLogicalChannelBufferingMs(uint32 aInBufferingMs,
1310         uint32 aOutBufferingMs,
1311         OsclAny* aContextData)
1312 {
1313     PVH324MessageSetLogicalChannelBufferingMs*cmd = NULL;
1314     cmd = OSCL_NEW(PVH324MessageSetLogicalChannelBufferingMs, (aInBufferingMs, aOutBufferingMs, aContextData, iCommandId));
1315     int32 error = 0;
1316     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1317     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1318     return iCommandId++;
1319 }
1320 
1321 PVMFCommandId
SendUserInput(CPVUserInput * aUserInput,OsclAny * aContextData)1322 H324MConfigProxied::SendUserInput(CPVUserInput* aUserInput,
1323                                   OsclAny* aContextData)
1324 {
1325     PVH324MessageSendUserInput*cmd = NULL;
1326     cmd = OSCL_NEW(PVH324MessageSendUserInput, (aContextData, iCommandId));
1327     cmd->SetUserInput(aUserInput);
1328     int32 error = 0;
1329     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1330     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1331     return iCommandId++;
1332 }
1333 
1334 PVMFCommandId
SetWnsrp(const bool aEnableWnsrp,OsclAny * aContextData)1335 H324MConfigProxied::SetWnsrp(const bool aEnableWnsrp,
1336                              OsclAny* aContextData)
1337 {
1338     PVH324MessageSetWnsrp *cmd = NULL;
1339     cmd = OSCL_NEW(PVH324MessageSetWnsrp, (aEnableWnsrp, aContextData, iCommandId));
1340     int32 error = 0;
1341     OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd));
1342     OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd););
1343     return iCommandId++;
1344 }
1345 
CleanupNotification(TPVProxyMsgId aId,OsclAny * aMsg)1346 void H324MConfigProxied::CleanupNotification(TPVProxyMsgId aId, OsclAny *aMsg)
1347 {
1348     OSCL_UNUSED_ARG(aId);
1349     PVMFEventBase* event = OSCL_STATIC_CAST(PVMFEventBase*, aMsg);
1350     if (event)
1351         delete event;
1352 }
1353 
HandleCommand(TPVProxyMsgId aMsgId,OsclAny * aMsg)1354 void H324MConfigProxied::HandleCommand(TPVProxyMsgId aMsgId, OsclAny *aMsg)
1355 {
1356     OSCL_UNUSED_ARG(aMsgId);
1357     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1358                     (0, "H324MConfigProxied::HandleCommand"));
1359     PVMFCommandId commandId = 0;
1360 
1361     switch (((CPVCmnInterfaceCmdMessage*)aMsg)->GetType())
1362     {
1363         case PVT_H324_COMMAND_QUERY_INTERFACE:
1364             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1365                             (0, "H324MConfigProxied::HandleCommand - Query Interface"));
1366             {
1367                 PVH324MessageQueryInterface* query_msg = OSCL_STATIC_CAST(PVH324MessageQueryInterface*, aMsg);
1368                 if (query_msg)
1369                 {
1370                     commandId = iH324MConfigIF->queryInterface(query_msg->iUuid,
1371                                 query_msg->iInterfacePtr);
1372                 }
1373                 else
1374                 {
1375                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1376                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1377                 }
1378             }
1379             break;
1380             //
1381         case PVT_H324_COMMAND_SET_H223_LEVEL :
1382             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1383                             (0, "H324MConfigProxied::HandleCommand - Set H223 Level"));
1384             {
1385                 PVH324MessageSetH223Level* set_level_msg = OSCL_STATIC_CAST(PVH324MessageSetH223Level*, aMsg);
1386                 if (set_level_msg)
1387                 {
1388                     commandId = iH324MConfigIF->SetMultiplexLevel(set_level_msg->iH223Level,
1389                                 (CPVCmnInterfaceCmdMessage*)aMsg);
1390                 }
1391                 else
1392                 {
1393                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1394                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1395                 }
1396             }
1397             break;
1398         case PVT_H324_COMMAND_SET_MAX_SDU_SIZE:
1399             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1400                             (0, "H324MConfigProxied::HandleCommand - Set Max Sdu Size"));
1401             {
1402                 PVH324MessageSetMaxSduSize* msg = OSCL_STATIC_CAST(PVH324MessageSetMaxSduSize*, aMsg);
1403                 if (msg)
1404                 {
1405                     commandId = iH324MConfigIF->SetMaxSduSize(msg->iAl, msg->iSize,
1406                                 (CPVCmnInterfaceCmdMessage*)aMsg);
1407                 }
1408                 else
1409                 {
1410                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1411                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1412                 }
1413             }
1414             break;
1415         case PVT_H324_COMMAND_SET_MAX_SDU_SIZE_R:
1416             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1417                             (0, "H324MConfigProxied::HandleCommand - Set Max Sdu Size Remote"));
1418             {
1419                 PVH324MessageSetMaxSduSizeR* msg = OSCL_STATIC_CAST(PVH324MessageSetMaxSduSizeR*, aMsg);
1420                 if (msg)
1421                 {
1422                     commandId = iH324MConfigIF->SetMaxSduSizeR(msg->iAl, msg->iSize,
1423                                 (CPVCmnInterfaceCmdMessage*)aMsg);
1424                 }
1425                 else
1426                 {
1427                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1428                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1429                 }
1430             }
1431             break;
1432         case PVT_H324_COMMAND_SEND_RME:
1433             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1434                             (0, "H324MConfigProxied::HandleCommand - Send RME"));
1435             {
1436                 PVH324MessageSendRme* msg = OSCL_STATIC_CAST(PVH324MessageSendRme*, aMsg);
1437                 if (msg)
1438                 {
1439                     commandId = iH324MConfigIF->SendRme((CPVCmnInterfaceCmdMessage*)aMsg);
1440                 }
1441                 else
1442                 {
1443                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1444                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1445                 }
1446             }
1447             break;
1448         case PVT_H324_COMMAND_SET_AL2_SEQ_NUM:
1449             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1450                             (0, "H324MConfigProxied::HandleCommand - Set AL2 Sequence Numbers"));
1451             {
1452                 PVH324MessageSetAl2SequenceNumbers* msg = OSCL_STATIC_CAST(PVH324MessageSetAl2SequenceNumbers*,
1453                         aMsg);
1454                 if (msg)
1455                 {
1456                     commandId = iH324MConfigIF->SetAl2SequenceNumbers(msg->iSeqNumWidth,
1457                                 (CPVCmnInterfaceCmdMessage*)aMsg);
1458                 }
1459                 else
1460                 {
1461                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1462                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1463                 }
1464             }
1465             break;
1466         case PVT_H324_COMMAND_SET_CONTROL_FIELD_OCTETS:
1467             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1468                             (0, "H324MConfigProxied::HandleCommand - Set AL3 Control Field Octets"));
1469             {
1470                 PVH324MessageSetAl3ControlFieldOctets* msg = OSCL_STATIC_CAST(PVH324MessageSetAl3ControlFieldOctets*, aMsg);
1471                 if (msg)
1472                 {
1473                     commandId = iH324MConfigIF->SetAl3ControlFieldOctets(msg->iCfo,
1474                                 (CPVCmnInterfaceCmdMessage*)aMsg);
1475                 }
1476                 else
1477                 {
1478                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1479                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1480                 }
1481             }
1482             break;
1483         case PVT_H324_COMMAND_SET_MAX_PDU_SIZE:
1484             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1485                             (0, "H324MConfigProxied::HandleCommand - Set Max Pdu Size"));
1486             {
1487                 PVH324MessageSetMaxPduSize* msg = OSCL_STATIC_CAST(PVH324MessageSetMaxPduSize*, aMsg);
1488                 if (msg)
1489                 {
1490                     commandId = iH324MConfigIF->SetMaxMuxPduSize(msg->iMaxPduSize,
1491                                 (CPVCmnInterfaceCmdMessage*)aMsg);
1492                 }
1493                 else
1494                 {
1495                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1496                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1497                 }
1498             }
1499             break;
1500         case PVT_H324_COMMAND_SET_MAX_MUX_PDU_SIZE:
1501             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1502                             (0, "H324MConfigProxied::HandleCommand - Set Max Mux Pdu Size"));
1503             {
1504                 PVH324MessageSetMaxMuxPduSize* msg = OSCL_STATIC_CAST(PVH324MessageSetMaxMuxPduSize*, aMsg);
1505                 if (msg)
1506                 {
1507                     commandId = iH324MConfigIF->SetMaxMuxPduSize(msg->iMaxMuxPduSize,
1508                                 (CPVCmnInterfaceCmdMessage*)aMsg);
1509                 }
1510                 else
1511                 {
1512                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1513                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1514                 }
1515             }
1516             break;
1517         case PVT_H324_COMMAND_SET_MAX_MUX_CCSRL_SDU_SIZE:
1518             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1519                             (0, "H324MConfigProxied::HandleCommand - Set Max CCSRL Sdu Size"));
1520             {
1521                 PVH324MessageSetMaxMuxCcsrlSduSize* msg = OSCL_STATIC_CAST(PVH324MessageSetMaxMuxCcsrlSduSize*,
1522                         aMsg);
1523                 if (msg)
1524                 {
1525                     commandId = iH324MConfigIF->SetMaxMuxCcsrlSduSize(msg->iMaxMuxCcsrlSduSize,
1526                                 (CPVCmnInterfaceCmdMessage*)aMsg);
1527                 }
1528                 else
1529                 {
1530                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1531                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1532                 }
1533             }
1534             break;
1535         case PVT_H324_COMMAND_SEND_RTD:
1536             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1537                             (0, "H324MConfigProxied::HandleCommand - Send RTD"));
1538             {
1539                 PVH324MessageSendRtd* msg = OSCL_STATIC_CAST(PVH324MessageSendRtd*, aMsg);
1540                 if (msg)
1541                 {
1542                     commandId = iH324MConfigIF->SendRtd((CPVCmnInterfaceCmdMessage*)aMsg);
1543                 }
1544                 else
1545                 {
1546                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1547                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1548                 }
1549             }
1550             break;
1551         case PVT_H324_COMMAND_SET_VENDOR_ID:
1552             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1553                             (0, "H324MConfigProxied::HandleCommand - Set Vendor ID"));
1554             {
1555                 PVH324MessageSetVendorId* msg = OSCL_STATIC_CAST(PVH324MessageSetVendorId*, aMsg);
1556                 if (msg)
1557                 {
1558                     commandId = iH324MConfigIF->SetVendor(msg->iCc, msg->iExt, msg->iMc,
1559                                                           msg->iProduct, msg->iProductLen,
1560                                                           msg->iVersion, msg->iVersionLen,
1561                                                           (CPVCmnInterfaceCmdMessage*)aMsg);
1562                 }
1563                 else
1564                 {
1565                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1566                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1567                 }
1568             }
1569             break;
1570         case PVT_H324_COMMAND_SEND_END_SESSION:
1571             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1572                             (0, "H324MConfigProxied::HandleCommand - Send End Session"));
1573             {
1574                 PVH324MessageEndSession* msg = OSCL_STATIC_CAST(PVH324MessageEndSession*, aMsg);
1575                 if (msg)
1576                 {
1577                     commandId = iH324MConfigIF->SendEndSession((CPVCmnInterfaceCmdMessage*)aMsg);
1578                 }
1579                 else
1580                 {
1581                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1582                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1583                 }
1584             }
1585             break;
1586         case PVT_H324_COMMAND_SET_END_SESSION_TIMEOUT:
1587             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1588                             (0, "H324MConfigProxied::HandleCommand - Set End Session Timeout"));
1589             {
1590                 PVH324MessageSetEndSessionTimeout* msg = OSCL_STATIC_CAST(PVH324MessageSetEndSessionTimeout*, aMsg);
1591                 if (msg)
1592                 {
1593                     commandId = iH324MConfigIF->SetEndSessionTimeout(msg->iTimeout,
1594                                 (CPVCmnInterfaceCmdMessage*)aMsg);
1595                 }
1596                 else
1597                 {
1598                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1599                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1600                 }
1601             }
1602             break;
1603         case PVT_H324_COMMAND_SET_AL_CONFIGURATION:
1604             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1605                             (0, "H324MConfigProxied::HandleCommand - Set Adaptation Layer Config"));
1606             {
1607                 PVH324MessageSetALConfiguration* msg = OSCL_STATIC_CAST(PVH324MessageSetALConfiguration*, aMsg);
1608                 if (msg)
1609                 {
1610                     commandId = iH324MConfigIF->SetALConfiguration(msg->iMediaType, msg->iLayer,
1611                                 msg->iAllow, (CPVCmnInterfaceCmdMessage*)aMsg);
1612                 }
1613                 else
1614                 {
1615                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1616                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1617                 }
1618             }
1619             break;
1620         case PVT_H324_COMMAND_SET_TIMER_COUNTER:
1621             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1622                             (0, "H324MConfigProxied::HandleCommand - Set Timer Counter"));
1623             {
1624                 PVH324MessageSetTimerCounter* msg = OSCL_STATIC_CAST(PVH324MessageSetTimerCounter*, aMsg);
1625                 if (msg)
1626                 {
1627                     commandId = iH324MConfigIF->SetTimerCounter(msg->iTimerCounter,
1628                                 msg->iSeries, msg->iSeriesOffset, msg->iValue, (CPVCmnInterfaceCmdMessage*)aMsg);
1629                 }
1630                 else
1631                 {
1632                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1633                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1634                 }
1635             }
1636             break;
1637         case PVT_H324_COMMAND_SET_VIDEO_RESOLUTIONS:
1638             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1639                             (0, "H324MConfigProxied::HandleCommand - Set Video Resolutions"));
1640             {
1641                 PVH324MessageSetVideoResolutions* msg = OSCL_STATIC_CAST(PVH324MessageSetVideoResolutions*, aMsg);
1642                 if (msg)
1643                 {
1644                     commandId = iH324MConfigIF->SetVideoResolutions(msg->iDirection, msg->iResolutions,
1645                                 (CPVCmnInterfaceCmdMessage*)aMsg);
1646                 }
1647                 else
1648                 {
1649                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1650                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1651                 }
1652             }
1653             break;
1654         case PVT_H324_COMMAND_SEND_VIDEO_SPATIAL_TEMPORAL_TRADEOFF_COMMAND:
1655             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1656                             (0, "H324MConfigProxied::HandleCommand - Spatial temporal tradeoff command"));
1657             {
1658                 PVH324MessageSendVideoSpatialTemporalTradeoffCommand* msg = OSCL_STATIC_CAST(PVH324MessageSendVideoSpatialTemporalTradeoffCommand*, aMsg);
1659                 if (msg)
1660                 {
1661                     commandId = iH324MConfigIF->SendVideoTemporalSpatialTradeoffCommand(msg->iLogicalChannel, msg->iTradeoff, (CPVCmnInterfaceCmdMessage*)aMsg);
1662                 }
1663                 else
1664                 {
1665                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1666                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1667                 }
1668             }
1669             break;
1670         case PVT_H324_COMMAND_SEND_VIDEO_SPATIAL_TEMPORAL_TRADEOFF_INDICATION:
1671             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1672                             (0, "H324MConfigProxied::HandleCommand - Spatial temporal tradeoff indication"));
1673             {
1674                 PVH324MessageSendVideoSpatialTemporalTradeoffIndication* msg =
1675                     OSCL_STATIC_CAST(PVH324MessageSendVideoSpatialTemporalTradeoffIndication*, aMsg);
1676                 if (msg)
1677                 {
1678                     commandId = iH324MConfigIF->SendVideoTemporalSpatialTradeoffIndication(msg->iLogicalChannel, msg->iTradeoff, (CPVCmnInterfaceCmdMessage*)aMsg);
1679                 }
1680                 else
1681                 {
1682                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1683                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1684                 }
1685             }
1686             break;
1687         case PVT_H324_COMMAND_SEND_VENDOR_ID:
1688             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1689                             (0, "H324MConfigProxied::HandleCommand - Send vendor id"));
1690             {
1691                 PVH324MessageSendVendorId* msg = OSCL_STATIC_CAST(PVH324MessageSendVendorId*, aMsg);
1692                 if (msg)
1693                 {
1694                     commandId = iH324MConfigIF->SendVendorId((CPVCmnInterfaceCmdMessage*)aMsg);
1695                 }
1696                 else
1697                 {
1698                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1699                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1700                 }
1701             }
1702             break;
1703         case PVT_H324_COMMAND_SEND_SKEW_INDICATION:
1704             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1705                             (0, "H324MConfigProxied::HandleCommand - Send skew indication"));
1706             {
1707                 PVH324MessageSendSkewIndication* msg = OSCL_STATIC_CAST(PVH324MessageSendSkewIndication*, aMsg);
1708                 if (msg)
1709                 {
1710                     commandId = iH324MConfigIF->SendSkewIndication(msg->iLogicalChannel1,
1711                                 msg->iLogicalChannel2, msg->iSkew, (CPVCmnInterfaceCmdMessage*)aMsg);
1712                 }
1713                 else
1714                 {
1715                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1716                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1717                 }
1718             }
1719             break;
1720         case PVT_H324_COMMAND_SET_LOGICAL_CHANNEL_BUFFERING_MS:
1721             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1722                             (0, "H324MConfigProxied::HandleCommand - Set Logical Channel Buffering"));
1723             {
1724                 PVH324MessageSetLogicalChannelBufferingMs* msg = OSCL_STATIC_CAST(PVH324MessageSetLogicalChannelBufferingMs*, aMsg);
1725                 if (msg)
1726                 {
1727                     commandId = iH324MConfigIF->SetLogicalChannelBufferingMs(msg->iInLogicalChannelBufferingMs,
1728                                 msg->iOutLogicalChannelBufferingMs, (CPVCmnInterfaceCmdMessage*)aMsg);
1729                 }
1730                 else
1731                 {
1732                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1733                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1734                 }
1735             }
1736             break;
1737         case PVT_H324_COMMAND_SEND_USER_INPUT:
1738             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1739                             (0, "H324MConfigProxied::HandleCommand - Send user input"));
1740             {
1741                 PVH324MessageSendUserInput* msg = OSCL_STATIC_CAST(PVH324MessageSendUserInput*, aMsg);
1742                 if (msg)
1743                 {
1744                     commandId = iH324MConfigIF->SendUserInput(msg->iUserInput,
1745                                 (CPVCmnInterfaceCmdMessage*)aMsg);
1746                 }
1747                 else
1748                 {
1749                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1750                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1751                 }
1752             }
1753             break;
1754         case PVT_H324_COMMAND_SET_WNSRP:
1755             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1756                             (0, "H324MConfigProxied::HandleCommand - Set WNSRP"));
1757             {
1758                 PVH324MessageSetWnsrp* msg = OSCL_STATIC_CAST(PVH324MessageSetWnsrp*, aMsg);
1759                 if (msg)
1760                 {
1761                     commandId = iH324MConfigIF->SetWnsrp(msg->iWnsrp,
1762                                                          (CPVCmnInterfaceCmdMessage*)aMsg);
1763                 }
1764                 else
1765                 {
1766                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1767                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1768                 }
1769             }
1770             break;
1771         case PVT_H324_COMMAND_SET_TERMINAL_TYPE :
1772             PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1773                             (0, "H324MConfigProxied::HandleCommand - Set Terminal Type"));
1774             {
1775                 PVH324MessageSetTerminalType* msg = OSCL_STATIC_CAST(PVH324MessageSetTerminalType*, aMsg);
1776                 if (msg)
1777                 {
1778                     commandId = iH324MConfigIF->SetTerminalType(msg->iTerminalType,
1779                                 (CPVCmnInterfaceCmdMessage*)aMsg);
1780                 }
1781                 else
1782                 {
1783                     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1784                                     (0, "H324MConfigProxied::HandleCommand - Failed to cast"));
1785                 }
1786             }
1787             break;
1788         default:
1789             PVH324MessageUtils::DestroyMessage((CPVCmnInterfaceCmdMessage*)aMsg);
1790             return;
1791     }
1792     // Store command id and msg
1793     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1794                     (0, "H324MConfigProxied::HandleCommand Adding command id=%d to pending queue", commandId));
1795     iPendingCmds[commandId] = (CPVCmnInterfaceCmdMessage*)aMsg;
1796 }
1797 
HandleNotification(TPVProxyMsgId aId,OsclAny * aMsg)1798 void H324MConfigProxied::HandleNotification(TPVProxyMsgId aId, OsclAny *aMsg)
1799 {
1800     OSCL_UNUSED_ARG(aId);
1801     PVMFEventBase* event = OSCL_STATIC_CAST(PVMFEventBase*, aMsg);
1802     PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1803                     (0, "H324MConfigProxied::HandleNotification Event type=%d", event->IsA()));
1804 
1805     if (event->IsA() == PVMFCmdRespEvent)
1806     {
1807         PVMFCmdResp* cmdResp = OSCL_STATIC_CAST(PVMFCmdResp*, event);
1808         PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE,
1809                         (0, "H324MConfigProxied::HandleNotification Event Command completioin received for command id=%d",
1810                          cmdResp->GetCmdId()));
1811         CPVCmnInterfaceCmdMessage* cmdMsg = iPendingCmds[cmdResp->GetCmdId()];
1812         if (cmdMsg)
1813         {
1814             PVMFCmdResp response(cmdMsg->GetCommandId(), cmdMsg->GetContextData(),
1815                                  cmdResp->GetCmdStatus());
1816             if (iObserver)
1817             {
1818                 iObserver->H324MConfigCommandCompletedL(response);
1819             }
1820             iPendingCmds.erase(cmdResp->GetCmdId());
1821             PVH324MessageUtils::DestroyMessage(cmdMsg);
1822         }
1823         OSCL_DELETE((PVMFAsyncEvent*)event);
1824     }
1825     else if (event->IsA() == PVMFInfoEvent)
1826     {
1827         PVMFAsyncEvent* async_event = OSCL_STATIC_CAST(PVMFAsyncEvent*, event);
1828         if (iObserver)
1829         {
1830             iObserver->H324MConfigHandleInformationalEventL(*async_event);
1831         }
1832         OSCL_DELETE(async_event);
1833     }
1834     else if (event->IsA() == PVMFErrorEvent)
1835     {
1836         OSCL_DELETE((PVMFAsyncEvent*)event);
1837     }
1838 }
1839 
CleanupCommand(TPVProxyMsgId aId,OsclAny * aMsg)1840 void H324MConfigProxied::CleanupCommand(TPVProxyMsgId aId, OsclAny *aMsg)
1841 {
1842     OSCL_UNUSED_ARG(aId);
1843     PVMFEventBase* event = OSCL_STATIC_CAST(PVMFEventBase*, aMsg);
1844     if (event->IsA() == PVMFCmdRespEvent)
1845     {
1846         PVMFCmdResp* cmdResp = OSCL_STATIC_CAST(PVMFCmdResp*, event);
1847         CPVCmnInterfaceCmdMessage* cmdMsg = iPendingCmds[cmdResp->GetCmdId()];
1848         if (cmdMsg)
1849         {
1850             OSCL_DELETE(cmdMsg);
1851             iPendingCmds.erase(cmdResp->GetCmdId());
1852         }
1853     }
1854     else if (event->IsA() == PVMFInfoEvent)
1855     {
1856         OSCL_DELETE((PVMFAsyncEvent*)event);
1857     }
1858     else if (event->IsA() == PVMFErrorEvent)
1859     {
1860         OSCL_DELETE((PVMFAsyncEvent*)event);
1861     }
1862 }
1863 
1864 
1865 
1866 ///////////////////////////////////////
1867 // H324MProxiedInterface
1868 ///////////////////////////////////////
H324MProxiedInterface()1869 H324MProxiedInterface::H324MProxiedInterface() : iH324M(NULL), iMainProxy(NULL), iReferenceCount(0) {}
~H324MProxiedInterface()1870 H324MProxiedInterface::~H324MProxiedInterface() {}
1871 
QueryProxiedInterface(const TPVProxyUUID & aUuid,PVInterface * & aInterfacePtr)1872 void H324MProxiedInterface::QueryProxiedInterface(const TPVProxyUUID &aUuid,
1873         PVInterface *&aInterfacePtr)
1874 {
1875     if (aUuid == PVH324MConfigUuid)
1876     {
1877         H324MConfig *h324mconfig = NULL;
1878         h324mconfig = OSCL_NEW(H324MConfig, (iH324M, true));
1879         aInterfacePtr = OSCL_NEW(H324MConfigProxied, (h324mconfig, iMainProxy));
1880         h324mconfig->removeRef();
1881     }
1882 }
SetMainProxy(PVMainProxy * aMainProxy)1883 void H324MProxiedInterface::SetMainProxy(PVMainProxy * aMainProxy)
1884 {
1885     iMainProxy = aMainProxy;
1886 }
1887 
addRef()1888 void H324MProxiedInterface::addRef()
1889 {
1890     iReferenceCount++;
1891 }
1892 
removeRef()1893 void H324MProxiedInterface::removeRef()
1894 {
1895     if (--iReferenceCount <= 0)
1896         OSCL_DELETE(this);
1897 }
queryInterface(const PVUuid &,PVInterface * &)1898 bool H324MProxiedInterface::queryInterface(const PVUuid&, PVInterface*&)
1899 {
1900     return false;
1901 }
SetH324M(TSC_324m * aH324M)1902 void H324MProxiedInterface::SetH324M(TSC_324m *aH324M)
1903 {
1904     iH324M = aH324M;
1905 }
1906 
1907 
1908 
1909 
1910