mmserv/tms/tmsimpl/src/tmsclientsinkbodyimpl.cpp
branchRCL_3
changeset 17 60e492b28869
parent 12 2eb3b066cc7d
equal deleted inserted replaced
15:ab526b8cacfb 17:60e492b28869
    16  */
    16  */
    17 
    17 
    18 #include <tms.h>
    18 #include <tms.h>
    19 #include <tmsclientsinkobsrvr.h>
    19 #include <tmsclientsinkobsrvr.h>
    20 #include "tmscallproxy.h"
    20 #include "tmscallproxy.h"
       
    21 #include "tmsglobalcontext.h"
    21 #include "tmsmembuffer.h"
    22 #include "tmsmembuffer.h"
    22 #include "tmsqueuehandler.h"
    23 #include "tmsqueuehandler.h"
    23 #include "tmsclientsinkbodyimpl.h"
    24 #include "tmsclientsinkbodyimpl.h"
    24 
    25 
    25 using namespace TMS;
    26 using namespace TMS;
    88     }
    89     }
    89 
    90 
    90 // Push mode
    91 // Push mode
    91 gint TMSClientSinkBodyImpl::BufferProcessed(TMSBuffer* buffer)
    92 gint TMSClientSinkBodyImpl::BufferProcessed(TMSBuffer* buffer)
    92     {
    93     {
    93     // TODO send stream attributes here
       
    94     gint ret(TMS_RESULT_SUCCESS);
    94     gint ret(TMS_RESULT_SUCCESS);
    95 
       
    96     if (iProxy)
    95     if (iProxy)
    97         {
    96         {
    98         //TODO: must use strm_id instead of 1
    97         ret = iProxy->BufferEmptied(iContext->CallType, iContext->StreamType,
    99         ret = iProxy->BufferEmptied(TMS_CALL_IP, TMS_STREAM_UPLINK, 1,
    98                 iContext->StreamId, *buffer);
   100 		        *buffer);
       
   101         }
    99         }
   102     else
   100     else
   103         {
   101         {
   104         ret = TMS_RESULT_UNINITIALIZED_OBJECT;
   102         ret = TMS_RESULT_UNINITIALIZED_OBJECT;
   105         }
   103         }
   111     gint ret(TMS_RESULT_SUCCESS);
   109     gint ret(TMS_RESULT_SUCCESS);
   112     sinktype = TMS_SINK_CLIENT;
   110     sinktype = TMS_SINK_CLIENT;
   113     return ret;
   111     return ret;
   114     }
   112     }
   115 
   113 
   116 void TMSClientSinkBodyImpl::SetProxy(TMSCallProxy* aProxy,
   114 void TMSClientSinkBodyImpl::SetProxy(TMSGlobalContext* context,
   117         gpointer queuehandler)
   115         gpointer queuehandler)
   118     {
   116     {
   119     iProxy = aProxy;
   117     iProxy = context->CallProxy;
       
   118     iContext = context;
   120     if (queuehandler)
   119     if (queuehandler)
   121         {
   120         {
   122         static_cast<TMSQueueHandler*>(queuehandler)->AddObserver(*this,
   121         static_cast<TMSQueueHandler*> (queuehandler)->AddObserver(*this,
   123                 TMS_SINK_CLIENT);
   122                 TMS_SINK_CLIENT);
   124         }
   123         }
   125     }
   124     }
   126 
   125 
   127 void TMSClientSinkBodyImpl::QueueEvent(TInt aEventType, TInt /*aError*/,
   126 void TMSClientSinkBodyImpl::QueueEvent(TInt aEventType, TInt /*aError*/,
   130     if (iObserver)
   129     if (iObserver)
   131         {
   130         {
   132         switch (aEventType)
   131         switch (aEventType)
   133             {
   132             {
   134             case TMS_EVENT_SINK_PROCESS_BUFFER:
   133             case TMS_EVENT_SINK_PROCESS_BUFFER:
   135                 iObserver->ProcessBuffer(static_cast<TMSBuffer*>(user_data));
   134                 iObserver->ProcessBuffer(static_cast<TMSBuffer*> (user_data));
   136                 break;
   135                 break;
   137             default:
   136             default:
   138                 break;
   137                 break;
   139             }
   138             }
   140         }
   139         }