mmserv/tms/tmsimpl/src/tmsclientsourcebodyimpl.cpp
branchRCL_3
changeset 9 f5c5c82a163e
parent 3 4f62049db6ac
child 12 2eb3b066cc7d
equal deleted inserted replaced
8:03a293c97d5c 9:f5c5c82a163e
   109 // Option 2 is to have overloaded function with another parameter.
   109 // Option 2 is to have overloaded function with another parameter.
   110 gint TMSClientSourceBodyImpl::BufferFilled(TMSBuffer& buffer)
   110 gint TMSClientSourceBodyImpl::BufferFilled(TMSBuffer& buffer)
   111     {
   111     {
   112     // TODO send stream attributes here
   112     // TODO send stream attributes here
   113     gint ret(TMS_RESULT_SUCCESS);
   113     gint ret(TMS_RESULT_SUCCESS);
   114     ret = iProxy->BufferFilled(TMS_CALL_IP,
   114     ret = iProxy->BufferFilled(TMS_CALL_IP, TMS_STREAM_DOWNLINK, iStreamId,
   115                                TMS_STREAM_DOWNLINK,
   115             buffer);
   116                                iStreamId,
       
   117                                buffer);
       
   118     return ret;
   116     return ret;
   119     }
   117     }
   120 
   118 
   121 // Push mode
   119 // Push mode
   122 gint TMSClientSourceBodyImpl::ProcessBuffer(TMSBuffer* /*buffer*/)
   120 gint TMSClientSourceBodyImpl::ProcessBuffer(TMSBuffer* /*buffer*/)
   159 void TMSClientSourceBodyImpl::SetProxy(TMSCallProxy* aProxy, gint strmid,
   157 void TMSClientSourceBodyImpl::SetProxy(TMSCallProxy* aProxy, gint strmid,
   160         gpointer queuehandler)
   158         gpointer queuehandler)
   161     {
   159     {
   162     iProxy = aProxy;
   160     iProxy = aProxy;
   163     iStreamId = strmid;
   161     iStreamId = strmid;
   164     ((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_SOURCE_CLIENT);
   162     static_cast<TMSQueueHandler*>(queuehandler)->AddObserver(*this,
       
   163             TMS_SOURCE_CLIENT);
   165     }
   164     }
   166 
   165 
   167 void TMSClientSourceBodyImpl::QueueEvent(TInt aEventType, TInt aError,
   166 void TMSClientSourceBodyImpl::QueueEvent(TInt aEventType, TInt aError,
   168         void* user_data)
   167         void* user_data)
   169     {
   168     {
   170     if (iObserver)
   169     if (iObserver)
   171         {
   170         {
   172         switch (aEventType)
   171         switch (aEventType)
   173             {
   172             {
   174             case TMS_EVENT_SOURCE_FILL_BUFFER:
   173             case TMS_EVENT_SOURCE_FILL_BUFFER:
   175                 iObserver->FillBuffer(*((TMSBuffer*) user_data));
   174                 iObserver->FillBuffer(*(static_cast<TMSBuffer*>(user_data)));
   176                 break;
   175                 break;
   177             case TMS_EVENT_SOURCE_PROCESSED_BUFFER:
   176             case TMS_EVENT_SOURCE_PROCESSED_BUFFER:
   178                 iObserver->BufferProcessed((TMSBuffer*) user_data, aError);
   177                 iObserver->BufferProcessed(static_cast<TMSBuffer*>(user_data),
       
   178                         aError);
   179                 break;
   179                 break;
   180             default:
   180             default:
   181                 break;
   181                 break;
   182             }
   182             }
   183         }
   183         }