Changeset 331:cd96ea6c4f98 in verona


Ignore:
Timestamp:
Oct 13, 2011 7:34:57 PM (21 months ago)
Author:
laurent <laurent@…>
Branch:
default
Message:

add qos callback

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • phapi/phapi.c

    r328 r331  
    183183 
    184184static void ph_frame_display_cbk(void *ctx, void *event); 
     185static void ph_qos_info_cbk(void *ctx, void *info); 
    185186 
    186187static int ph_call_media_stop(phcall_t * ca); 
     
    946947} 
    947948 
     949void ph_qos_info_cbk(void *ctx, void * info) 
     950{ 
     951        phcall_t *ca = (phcall_t *)ctx; 
     952        phcb->qosEvent(ca->cid, (phQosInfo_t*)info); 
     953} 
     954 
    948955void ph_frame_display_cbk(void *ctx, void *event) 
    949956{ 
     
    52275234                s->dtmfCallback = ph_wegot_dtmf; 
    52285235                s->endCallback = ph_stream_ended; 
     5236                s->qosInfoCbk = ph_qos_info_cbk; 
    52295237 
    52305238                if (phcfg.vad & 0x80000000) 
  • phapi/phapi.h

    r283 r331  
    959959}; 
    960960typedef struct phPicture  phPicture_t; 
     961 
     962struct phQosInfo 
     963{ 
     964        int total_losses; 
     965        int loss_fraction; 
     966        int rtt; 
     967}; 
     968typedef struct phQosInfo phQosInfo_t; 
    961969         
    962970/** 
     
    10581066  void  (*errorNotify) (enum phErrors error); 
    10591067  void  (*soundFileStopped) (void *userdata , unsigned int _id, void *arg); 
     1068  void  (*qosEvent)(int cid, const phQosInfo_t * info); 
    10601069}; 
    10611070typedef struct phCallbacks phCallbacks_t; 
  • phapi/phms.h

    r328 r331  
    201201        void (*endCallback)(void  *info, int event); 
    202202        void (*frameDisplayCbk)(void *info, void *event); 
     203        void (*qosInfoCbk)(void* info, void *event); 
    203204 
    204205    /* 
  • phapi/phms_audiostream.c

    r291 r331  
    374374                        qos->data[newx].seqnum, qos->data[newx].total_losses, qos->data[newx].remote_jitter, 
    375375                        qos->data[newx].interval_losses, qos->data[newx].interval_packets, qos->data[newx].loss_fraction, qos->data[newx].rtt); 
     376         
     377        phQosInfo_t info; 
     378         
     379        info.total_losses = qos->data[newx].total_losses; 
     380        info.loss_fraction = qos->data[newx].loss_fraction; 
     381        info.rtt = qos->data[newx].rtt; 
     382         
     383         
     384        s->qosInfoCbk(s->cbkInfo, &info); 
    376385 
    377386} 
  • phcpp/phapipp.cpp

    r324 r331  
    489489void phapi::onSoundFileStopped(void *userdata , unsigned int _id, void *arg){} 
    490490         
     491void phapi::onQosEvent(int cid, const phQosInfo_t * info){} 
     492         
    491493void phapi::callProgress(int cid, const phCallStateInfo_t *info) 
    492494{ 
     
    574576} 
    575577         
     578void phapi::qosEvent(int cid, const phQosInfo_t * info) 
     579{ 
     580        if (uniqueobj) 
     581                uniqueobj->onQosEvent(cid, info); 
     582} 
     583 
    576584phCallbacks_t phapi::callbacks = { 
    577585                phapi::callProgress, 
     
    588596                phapi::phLogCsl, 
    589597#endif /*!HAVE_CSL*/ 
    590                 phapi::soundFileStopped 
     598                phapi::soundFileStopped, 
     599                phapi::qosEvent 
    591600}; 
    592601 
  • phcpp/phapipp.h

    r299 r331  
    211211        virtual void onPhLogCsl(const char *msg); 
    212212        virtual void onSoundFileStopped(void *userdata , unsigned int _id, void *arg); 
     213        virtual void onQosEvent(int cid, const phQosInfo_t * info); 
    213214 
    214215 
     
    229230        static void  phLogCsl(const char *msg); 
    230231        static void  soundFileStopped(void *userdata , unsigned int _id, void *arg); 
     232        static void  qosEvent(int cid, const phQosInfo_t * info); 
    231233#endif 
    232234 
Note: See TracChangeset for help on using the changeset viewer.