mmserv/voipaudioservices/VoIPServer/inc/VoIPServerThread.h
changeset 53 eabc8c503852
parent 38 9e9fc5ab059f
equal deleted inserted replaced
48:a493a607b5bf 53:eabc8c503852
    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 
   152     void BadLsfNextBuffer();
   152     void BadLsfNextBuffer();
   153 
   153 
   154     // For Jitter Buffer
   154     // For Jitter Buffer
   155     /**
   155     /**
   156      * ?description
   156      * ?description
   157      * @since S60 v5.0
   157      *
   158      * @param  none
   158      * @param  none
   159      * @return void
   159      * @return void
   160      */
   160      */
   161     void ConfigureJitterBufferL();
   161     void ConfigureJitterBufferL();
   162 
   162 
   163     /**
   163     /**
   164      * ?description
   164      * ?description
   165      * @since S60 v5.0
   165      *
   166      * @param none
   166      * @param none
   167      * @return void
   167      * @return void
   168      */
   168      */
   169     void ResetJitterBuffer();
   169     void ResetJitterBuffer();
   170 
   170 
   171     /**
   171     /**
   172      * ?description
   172      * ?description
   173      * @since S60 v5.0
   173      *
   174      * @param none
   174      * @param none
   175      * @return void
   175      * @return void
   176      */
   176      */
   177     void JBDelayDown();
   177     void JBDelayDown();
   178 
   178 
   179     /**
   179     /**
   180      * ?description
   180      * ?description
   181      * @since S60 v5.0
   181      *
   182      * @param none
   182      * @param none
   183      * @return void
   183      * @return void
   184      */
   184      */
   185     void JBDelayUp();
   185     void JBDelayUp();
   186 
   186 
   213     CMMFDataBuffer* iGetJBuffer;
   213     CMMFDataBuffer* iGetJBuffer;
   214 
   214 
   215 #ifdef _DEBUG
   215 #ifdef _DEBUG
   216     TInt iSamplesPlayedCount;
   216     TInt iSamplesPlayedCount;
   217 #endif
   217 #endif
   218 
       
   219     };
   218     };
   220 
   219 
   221 // -----------------------------------------------------------------------------
   220 // -----------------------------------------------------------------------------
   222 //  Class Name:  CVoIPUplinkThread
   221 //  Class Name:  CVoIPUplinkThread
   223 //
   222 //
   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