diff -r 5505e8908944 -r 71e347f905f2 gst_plugins_symbian/gst/devsound/devsoundsinkwrapper.cpp --- a/gst_plugins_symbian/gst/devsound/devsoundsinkwrapper.cpp Fri Jan 22 09:59:59 2010 +0200 +++ b/gst_plugins_symbian/gst/devsound/devsoundsinkwrapper.cpp Fri Mar 19 09:35:09 2010 +0200 @@ -93,7 +93,7 @@ { TRequestStatus* stat = &(AL->iStatus); User::RequestComplete(stat, aError); - iCallbackError = aError; + iCallbackError = 0; } /*******************************************************/ void DevSoundWrapper::BufferToBeEmptied(CMMFBuffer* /*aBuffer*/) @@ -244,6 +244,41 @@ /************************************************************/ +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; @@ -560,6 +595,19 @@ { 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) @@ -569,7 +617,7 @@ ((handle)->AL)->InitialiseActiveListener(); handle->eosReceived = false; - TRAP(handle->iCallbackError,(handle->dev_sound)->PlayInitL()); + TRAP(handle->iCallbackError,(handle->dev_sound)->PlayInitL()); if (handle->iCallbackError == KErrNone) { ((handle)->AL)->StartActiveScheduler(); @@ -715,7 +763,19 @@ { TRACE_PRN_FN_ENT; DevSoundWrapper* dsPtr = STATIC_CAST(DevSoundWrapper*, ds->handle); - ds->samplesplayed = (dsPtr->dev_sound)->SamplesPlayed(); +#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*/ get_outputdevice(dsPtr,&ds->output); TRACE_PRN_FN_EXT; } @@ -725,9 +785,6 @@ TRACE_PRN_FN_ENT; DevSoundWrapper* dsPtr= STATIC_CAST(DevSoundWrapper*, ds->handle); ds->maxvolume = (dsPtr->dev_sound)->MaxVolume(); - ds->volume = (dsPtr->dev_sound)->Volume(); - framemode_rqrd_for_ec(dsPtr,&ds->framemodereq); - get_cng(dsPtr,&ds->g711cng); - get_ilbccng(dsPtr,&ds->ilbccng); + ds->volume = (dsPtr->dev_sound)->Volume(); TRACE_PRN_FN_EXT; }