43 // Class Name: CVoIPThreadBase |
43 // Class Name: CVoIPThreadBase |
44 // |
44 // |
45 // Base abstract class for creating VoIP uplink and downlink threads. |
45 // Base abstract class for creating VoIP uplink and downlink threads. |
46 // ----------------------------------------------------------------------------- |
46 // ----------------------------------------------------------------------------- |
47 class CVoIPThreadBase : public CBase, |
47 class CVoIPThreadBase : public CBase, |
48 public MDevSoundObserver, |
48 public MDevSoundObserver, |
49 public MQueueHandlerObserverSrv |
49 public MQueueHandlerObserverSrv |
50 { |
50 { |
51 public: |
51 public: |
52 enum TStreamState |
52 enum TStreamState |
53 { |
53 { |
54 ENotReady, // not initialized |
54 ENotReady, // not initialized |
71 void InitDevSoundL(const TMMFState aDevSoundState, const TInt aPriority, |
71 void InitDevSoundL(const TMMFState aDevSoundState, const TInt aPriority, |
72 const TInt aPreference); |
72 const TInt aPreference); |
73 void InitMsgQueuesL(const TDesC& aBufferQ, const TDesC& aComQ); |
73 void InitMsgQueuesL(const TDesC& aBufferQ, const TDesC& aComQ); |
74 TInt DoChunk(const TDesC& aChunkName, const TInt aChunkLen, |
74 TInt DoChunk(const TDesC& aChunkName, const TInt aChunkLen, |
75 const TInt aChunkMaxLen); |
75 const TInt aChunkMaxLen); |
76 TInt DetermineMaxBufferLen(TVoIPCodecSettings::TG711FrameRate |
76 TInt DetermineMaxBufferLen( |
77 aG711FrameRate = TVoIPCodecSettings::E20MS); |
77 TVoIPCodecSettings::TG711FrameRate aG711FrameRate = |
|
78 TVoIPCodecSettings::E20MS); |
78 |
79 |
79 // From MDevSoundObserver |
80 // From MDevSoundObserver |
80 virtual void InitializeComplete(TInt aError) = 0; |
81 virtual void InitializeComplete(TInt aError) = 0; |
81 virtual void BufferToBeEmptied(CMMFBuffer* /*aBuffer*/) {} |
82 virtual void BufferToBeEmptied(CMMFBuffer* /*aBuffer*/) {} |
82 virtual void RecordError(TInt /*aError*/) {} |
83 virtual void RecordError(TInt /*aError*/) {} |
103 TInt iBufLen; |
104 TInt iBufLen; |
104 TInt iMaxBufLen; |
105 TInt iMaxBufLen; |
105 |
106 |
106 CVoIPFormatIntfc::TG711CodecMode iG711CodecMode; |
107 CVoIPFormatIntfc::TG711CodecMode iG711CodecMode; |
107 CVoIPFormatIntfc::TILBCCodecMode iILBCCodecMode; |
108 CVoIPFormatIntfc::TILBCCodecMode iILBCCodecMode; |
108 |
|
109 }; |
109 }; |
110 |
110 |
111 // ----------------------------------------------------------------------------- |
111 // ----------------------------------------------------------------------------- |
112 // Class Name: CVoIPDownlinkThread |
112 // Class Name: CVoIPDownlinkThread |
113 // |
113 // |
114 // Class handling VoIP downlink in a separate thread. |
114 // Class handling VoIP downlink in a separate thread. |
115 // ----------------------------------------------------------------------------- |
115 // ----------------------------------------------------------------------------- |
116 class CVoIPDownlinkThread : public CVoIPThreadBase, |
116 class CVoIPDownlinkThread : public CVoIPThreadBase, |
117 public MJitterBufferObserver |
117 public MJitterBufferObserver |
118 { |
118 { |
119 public: |
119 public: |
120 static TInt ThreadFunction(TAny* aData); |
120 static TInt ThreadFunction(TAny* aData); |
121 virtual ~CVoIPDownlinkThread(); |
121 virtual ~CVoIPDownlinkThread(); |
122 |
122 |
267 |
266 |
268 private: |
267 private: |
269 |
268 |
270 TSharedData& iShared; |
269 TSharedData& iShared; |
271 TBool iVad; |
270 TBool iVad; |
|
271 RArray<TUint> iBitrates; |
272 |
272 |
273 CSpeechEncoderConfig* iSpeechEncoderConfig; |
273 CSpeechEncoderConfig* iSpeechEncoderConfig; |
274 CG711EncoderIntfc* iG711EncoderIntfc; |
274 CG711EncoderIntfc* iG711EncoderIntfc; |
275 CG729EncoderIntfc* iG729EncoderIntfc; |
275 CG729EncoderIntfc* iG729EncoderIntfc; |
276 CIlbcEncoderIntfc* iIlbcEncoderIntfc; |
276 CIlbcEncoderIntfc* iIlbcEncoderIntfc; |
277 |
277 |
278 #ifdef _DEBUG |
278 #ifdef _DEBUG |
279 TInt iSamplesRecCount; |
279 TInt iSamplesRecCount; |
280 #endif |
280 #endif |
281 |
|
282 }; |
281 }; |
283 |
282 |
284 #endif // VOIPAUDIOSERVERTHREAD_H |
283 #endif // VOIPAUDIOSERVERTHREAD_H |
285 |
284 |
286 // End of file |
285 // End of file |