mmserv/tms/tmscallserver/inc/tmsipcallstream.h
changeset 31 8dfd592727cb
parent 14 80975da52420
child 53 eabc8c503852
--- a/mmserv/tms/tmscallserver/inc/tmsipcallstream.h	Thu May 27 13:20:50 2010 +0300
+++ b/mmserv/tms/tmscallserver/inc/tmsipcallstream.h	Wed Jun 23 18:47:10 2010 +0300
@@ -56,6 +56,19 @@
 
 namespace TMS {
 
+/**
+ *  TMSIPDevSoundObserver
+  * An observer interface providing TMSIPCallStreamBase event notifications.
+ */
+class TMSIPDevSoundObserver
+    {
+public:
+    virtual void DownlinkInitCompleted(gint status) = 0;
+    virtual void UplinkInitCompleted(gint status) = 0;
+    virtual void UplinkStarted(gint status) = 0;
+    virtual void DownlinkStarted(gint status) = 0;
+    };
+
 // -----------------------------------------------------------------------------
 //  Class Name:  TMSIPCallStreamBase
 //
@@ -78,7 +91,7 @@
 public:
     virtual ~TMSIPCallStreamBase();
 
-    virtual void Start() = 0;
+    virtual void Start(const gint retrytime) = 0;
     virtual void Stop() = 0;
     virtual gint SetCodecCi() = 0;
 
@@ -91,6 +104,8 @@
     gint ConfigureMedia(const guint32 aCodecID);
 
 protected:
+    TMSIPCallStreamBase(TMSIPDevSoundObserver& observer);
+
 #ifndef __USE_GSTREAMER__
     // From MDevSoundObserver
     virtual void InitializeComplete(TInt aError) = 0;
@@ -105,7 +120,7 @@
 #endif //__USE_GSTREAMER__
 
 protected:
-
+    TMSIPDevSoundObserver& iObserver;
     CActiveScheduler* iActiveScheduler;
     TStreamState iStatus;
 
@@ -145,14 +160,13 @@
     static void cb_raw_playback_handoff(GstElement* appsrc, guint size);
     static gboolean bus_call(GstBus* bus, GstMessage* msg, gpointer data);
 #endif //__USE_GSTREAMER__
-    static TMSIPDownlink* NewL(const guint32 codecID,
-            const TMMFPrioritySettings priority);
-    TMSIPDownlink();
-    void ConstructL(const guint32 codecID,
-            const TMMFPrioritySettings priority);
+
+    static TMSIPDownlink* NewL(TMSIPDevSoundObserver& observer,
+            const guint32 codecID, const TMMFPrioritySettings priority,
+            const gint retrytime);
 
     gint SetCodecCi();
-    void Start();
+    void Start(const gint retrytime);
     void Stop();
     void BufferFilled(const guint buflen);
     gint SetVolume(const guint volume);
@@ -178,6 +192,11 @@
     void SetAudioDeviceL(TMSAudioOutput output);
     void GetAudioDeviceL(TMSAudioOutput& output);
 
+protected:
+    TMSIPDownlink(TMSIPDevSoundObserver& observer);
+    void ConstructL(const guint32 codecID,
+            const TMMFPrioritySettings priority, const gint retrytime);
+
 private:
     void SetCodecCiL();
 
@@ -214,9 +233,6 @@
     GstElement* iSink;
     GstBus* iBusPlay;
 #endif //__USE_GSTREAMER__
-#ifdef _DEBUG
-    gint iSamplesPlayedCount;
-#endif
 
 #ifdef __PLAY_WAV_FROM_FILE__
     RFile iFile;
@@ -242,14 +258,13 @@
     static void cb_record_raw_handoff(GstElement *sink);
     static gboolean bus_call(GstBus* bus, GstMessage* msg, gpointer data);
 #endif //__USE_GSTREAMER__
-    static TMSIPUplink* NewL(const guint32 codecID,
-            const TMMFPrioritySettings priority);
-    TMSIPUplink();
-    void ConstructL(const guint32 codecID,
-            const TMMFPrioritySettings priority);
+
+    static TMSIPUplink* NewL(TMSIPDevSoundObserver& observer,
+            const guint32 codecID, const TMMFPrioritySettings priority,
+            const gint retrytime);
 
     gint SetCodecCi();
-    void Start();
+    void Start(const gint retrytime);
     void Stop();
     void BufferEmptied();
     gint SetGain(const guint gain);
@@ -268,6 +283,11 @@
     gint SetVad(const TMSFormatType fmttype, const gboolean vad);
     gint GetVad(const TMSFormatType fmttype, gboolean& vad);
 
+protected:
+    TMSIPUplink(TMSIPDevSoundObserver& observer);
+    void ConstructL(const guint32 codecID,
+            const TMMFPrioritySettings priority, const gint retrytime);
+
 private:
     void SetCodecCiL();
 
@@ -300,9 +320,6 @@
     GstElement* iAppSink;
     GstBus* iBusRec;
 #endif //__USE_GSTREAMER__
-#ifdef _DEBUG
-    gint iSamplesRecCount;
-#endif
     };
 
 } //namespace TMS