gst_plugins_symbian/gst/devsound/devsoundsinkwrapper.cpp
branchRCL_3
changeset 30 7e817e7e631c
parent 29 567bb019e3e3
--- a/gst_plugins_symbian/gst/devsound/devsoundsinkwrapper.cpp	Tue Aug 31 15:30:33 2010 +0300
+++ b/gst_plugins_symbian/gst/devsound/devsoundsinkwrapper.cpp	Wed Sep 01 12:16:41 2010 +0100
@@ -42,7 +42,6 @@
     iIlbcDecoderIntfc = NULL;
     iCallbackError = KErrNone;
     iAudioOutput = NULL;
-    iIsBufferToBeFilledDone = TRUE;
     }
 
 /*********************************************************/
@@ -79,7 +78,6 @@
         {
         User::RequestComplete(stat, KErrNone);
         iCallbackError = KErrNone;
-        iIsBufferToBeFilledDone = FALSE;
         }
     else
         {
@@ -95,7 +93,7 @@
     {
     TRequestStatus* stat = &(AL->iStatus);
     User::RequestComplete(stat, aError);
-    iCallbackError = 0;
+    iCallbackError = aError;
     }
 /*******************************************************/
 void DevSoundWrapper::BufferToBeEmptied(CMMFBuffer* /*aBuffer*/)
@@ -246,48 +244,9 @@
 
 /************************************************************/
 
-int pause_devsound(GstDevsoundSink *ds)
-    {
-    TRACE_PRN_FN_ENT;
-    DevSoundWrapper* handle = (DevSoundWrapper*) ds->handle;
-    if(handle->dev_sound->IsResumeSupported())
-        {
-        handle->dev_sound->Pause();
-        }
-    else
-        {
-        handle->iSamplesPlayed = handle->dev_sound->SamplesPlayed();
-        handle->dev_sound->Stop();
-        }
-    TRACE_PRN_FN_EXT;
-    return 0;
-    }
-
-int resume_devsound(GstDevsoundSink *ds)
-    {
-    TRACE_PRN_FN_ENT;
-    DevSoundWrapper* handle = (DevSoundWrapper*) ds->handle;
-    if(handle->dev_sound->IsResumeSupported())
-        {
-        handle->dev_sound->Resume();
-        }
-    else
-        {
-        playinit(handle);
-        initproperties(ds);
-        }
-    TRACE_PRN_FN_EXT;
-    return 0;
-    }
-
-
 int close_devsound(GstDevsoundSink *ds)
     {
     TRACE_PRN_FN_ENT;
-    CMMFDevSound    *dev_sound = 0;
-    dev_sound = (STATIC_CAST(DevSoundWrapper*, ds->handle))->dev_sound;
-    dev_sound->Stop();
-    delete dev_sound;
 
     g_list_foreach(ds->fmt, (GFunc) g_free, NULL);
     g_list_free(ds->fmt);
@@ -601,37 +560,20 @@
     {
     return handle->iCallbackError;
     }
-
-#ifdef AV_SYNC
-gboolean  is_timeplayed_supported(DevSoundWrapper *handle)
-    {
-    gboolean retVal = FALSE;
-    if (handle->dev_sound && (handle->dev_sound)->IsGetTimePlayedSupported())
-        {
-        retVal = TRUE;
-        }
-    return retVal;
-    }
-#endif /*AV_SYNC*/
-
 /*******************************************************************/
 
 int playinit(DevSoundWrapper *handle)
     {
     TRACE_PRN_FN_ENT;
-    handle->iCallbackError = KErrNone;
-    if( handle->iIsBufferToBeFilledDone )
-    {
-        ((handle)->AL)->InitialiseActiveListener();
-        handle->eosReceived = false;
-    
+
+    ((handle)->AL)->InitialiseActiveListener();
+    handle->eosReceived = false;
+
         TRAP(handle->iCallbackError,(handle->dev_sound)->PlayInitL());
-        if (handle->iCallbackError == KErrNone)
-            {
-            ((handle)->AL)->StartActiveScheduler();
-            }    
-    }
-
+    if (handle->iCallbackError == KErrNone)
+        {
+        ((handle)->AL)->StartActiveScheduler();
+        }
 
     TRACE_PRN_IF_ERR(handle->iCallbackError);
     TRACE_PRN_FN_EXT;
@@ -689,7 +631,7 @@
     (handle->dev_sound)->PlayData();
 
     ((handle)->AL)->StartActiveScheduler();
-    handle->iIsBufferToBeFilledDone = TRUE;
+
     TRACE_PRN_FN_EXT;
     return KErrNone;
     }
@@ -773,19 +715,7 @@
     {
     TRACE_PRN_FN_ENT;
     DevSoundWrapper* dsPtr = STATIC_CAST(DevSoundWrapper*, ds->handle);
-#ifdef AV_SYNC
-    if (dsPtr->dev_sound->IsGetTimePlayedSupported())
-        {
-        TTimeIntervalMicroSeconds timePlayedInMS = 0;
-        (dsPtr->dev_sound)->GetTimePlayed(timePlayedInMS);
-        /* store value in nano seconds */
-        ds->time_or_samples_played = timePlayedInMS.Int64() * 1000;
-        }
-    else
-        {
-        ds->time_or_samples_played += (dsPtr->dev_sound)->SamplesPlayed();
-        }
-#endif /*AV_SYNC*/
+    ds->samplesplayed = (dsPtr->dev_sound)->SamplesPlayed();
     get_outputdevice(dsPtr,&ds->output);
     TRACE_PRN_FN_EXT;
     }
@@ -795,6 +725,9 @@
     TRACE_PRN_FN_ENT;
     DevSoundWrapper* dsPtr=  STATIC_CAST(DevSoundWrapper*, ds->handle);
     ds->maxvolume     = (dsPtr->dev_sound)->MaxVolume();
-    ds->volume        = (dsPtr->dev_sound)->Volume();    
+    ds->volume        = (dsPtr->dev_sound)->Volume();
+    framemode_rqrd_for_ec(dsPtr,&ds->framemodereq);   
+    get_cng(dsPtr,&ds->g711cng);
+    get_ilbccng(dsPtr,&ds->ilbccng);
     TRACE_PRN_FN_EXT;    
     }