mmserv/tms/tmscallserver/src/tmscsdownlink.cpp
branchRCL_3
changeset 19 095bea5f582e
parent 17 60e492b28869
child 20 0ac9a5310753
equal deleted inserted replaced
18:a36789189b53 19:095bea5f582e
    14  * Description: Telephony Multimedia Service
    14  * Description: Telephony Multimedia Service
    15  *
    15  *
    16  */
    16  */
    17 
    17 
    18 #include <AudioPreference.h>
    18 #include <AudioPreference.h>
       
    19 #include "tmsutility.h"
    19 #include "tmscsdownlink.h"
    20 #include "tmscsdownlink.h"
    20 #include "tmscsdevsoundobserver.h"
    21 #include "tmscsdevsoundobserver.h"
    21 
    22 
    22 using namespace TMS;
    23 using namespace TMS;
    23 
    24 
    35 
    36 
    36 // -----------------------------------------------------------------------------
    37 // -----------------------------------------------------------------------------
    37 // Second phase constructor
    38 // Second phase constructor
    38 // -----------------------------------------------------------------------------
    39 // -----------------------------------------------------------------------------
    39 //
    40 //
    40 void TMSCSDownlink::ConstructL()
    41 void TMSCSDownlink::ConstructL(const gint retrytime)
    41     {
    42     {
    42     TMSCSDevSound::ConstructL(TMS_STREAM_DOWNLINK);
    43     TMSCSDevSound::ConstructL(TMS_STREAM_DOWNLINK, retrytime);
    43 
    44 
    44     if (iDevSound)
    45     if (iDevSound)
    45         {
    46         {
    46         iDevSound->SetVolume(KDefaultVolume);
    47         iDevSound->SetVolume(KDefaultVolume);
    47         }
    48         }
    49 
    50 
    50 // -----------------------------------------------------------------------------
    51 // -----------------------------------------------------------------------------
    51 // Static constructor
    52 // Static constructor
    52 // -----------------------------------------------------------------------------
    53 // -----------------------------------------------------------------------------
    53 //
    54 //
    54 TMSCSDownlink* TMSCSDownlink::NewL(TMSCSDevSoundObserver& observer)
    55 TMSCSDownlink* TMSCSDownlink::NewL(TMSCSDevSoundObserver& observer,
       
    56         const gint retrytime)
    55     {
    57     {
    56     TMSCSDownlink* self = new (ELeave) TMSCSDownlink(observer);
    58     TMSCSDownlink* self = new (ELeave) TMSCSDownlink(observer);
    57     CleanupStack::PushL(self);
    59     CleanupStack::PushL(self);
    58     self->ConstructL();
    60     self->ConstructL(retrytime);
    59     CleanupStack::Pop(self);
    61     CleanupStack::Pop(self);
    60     return self;
    62     return self;
    61     }
    63     }
    62 
    64 
    63 // -----------------------------------------------------------------------------
    65 // -----------------------------------------------------------------------------
   116 // Downlink stream has been activated successfully.
   118 // Downlink stream has been activated successfully.
   117 // -----------------------------------------------------------------------------
   119 // -----------------------------------------------------------------------------
   118 //
   120 //
   119 void TMSCSDownlink::BufferToBeFilled(CMMFBuffer* /*aBuffer*/)
   121 void TMSCSDownlink::BufferToBeFilled(CMMFBuffer* /*aBuffer*/)
   120     {
   122     {
   121     //TRACE_PRN_N(_L("TMSCSDownlink::BufferToBeFilled"));
   123     TRACE_PRN_N(_L("TMSCSDownlink::BufferToBeFilled"));
   122 
   124 
   123     // We dont react to devsound messages unless we are activating.
   125     // We dont react to devsound messages unless we are activating.
   124     if (iActivationOngoing)
   126     if (iActivationOngoing)
   125         {
   127         {
   126         iActive = ETrue;
   128         iActive = ETrue;
   134 // Downlink stream activation failed
   136 // Downlink stream activation failed
   135 // -----------------------------------------------------------------------------
   137 // -----------------------------------------------------------------------------
   136 //
   138 //
   137 void TMSCSDownlink::PlayError(TInt aError)
   139 void TMSCSDownlink::PlayError(TInt aError)
   138     {
   140     {
   139     //TRACE_PRN_N1(_L("TMSCSDownlink::PlayError[%d]"), aError);
   141     TRACE_PRN_N1(_L("TMSCSDownlink::PlayError[%d]"), aError);
   140 
   142 
   141     // We don't react to devsound errors unless we are activating.
   143     // We don't react to devsound errors unless we are activating.
   142     if (iActivationOngoing && aError == KErrAccessDenied)
   144     if (iActivationOngoing && (aError == KErrAccessDenied ||
       
   145             aError == KErrInUse))
   143         {
   146         {
   144         iActivationOngoing = EFalse;
   147         if (iStartRetryTime != 0)
   145         iObserver.DownlinkActivationCompleted(aError);
   148             {
       
   149             StartTimer();
       
   150             }
       
   151         else
       
   152             {
       
   153             CancelTimer();
       
   154             iActivationOngoing = EFalse;
       
   155             iObserver.DownlinkActivationCompleted(aError);
       
   156             }
   146         }
   157         }
   147     }
   158     }
   148 
   159 
   149 // -----------------------------------------------------------------------------
   160 // -----------------------------------------------------------------------------
   150 // From class TMSCSDevSound
   161 // From class TMSCSDevSound