Ignore:
Timestamp:
Jul 17, 2013 8:20:50 PM (9 years ago)
Author:
nanang
Message:

JNI projects:

  • More work on callbacks wrapper, i.e: pj_timer_heap_callback for pjsua_schedule_timer() and pjsua_logging_config::cb.
  • Map pjsua_call_dump() output buffer.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/jni/pjsip-apps/src/jni/callbacks.c.template

    r4549 r4566  
    33#include "callbacks.h" 
    44 
     5/* 
     6 * Wrapper of pjsua_logging_config callback 
     7 */ 
     8static PjsuaLoggingConfigCallback *pjsua_logging_config_cb = NULL; 
     9 
     10void pjsua_logging_config_callback_proxy(int level, const char *data, int len) 
     11{ 
     12  PJ_UNUSED_ARG(len); 
     13  pjsua_logging_config_cb->on_log(level, data); 
     14} 
     15 
     16void setPjsuaLoggingConfigCallback(PjsuaLoggingConfigCallback *callback) 
     17{ 
     18  pjsua_logging_config_cb = callback; 
     19} 
     20 
     21 
     22/* 
     23 * Wrapper of pj_timer_heap_callback 
     24 */ 
     25void pj_timer_heap_callback_proxy(pj_timer_heap_t *timer_heap, struct pj_timer_entry *entry) 
     26{ 
     27  PjTimerHeapCallback *cb = (PjTimerHeapCallback*)entry->user_data; 
     28  pj_assert(cb); 
     29  cb->on_timer(timer_heap, entry); 
     30} 
     31 
     32void setPjTimerHeapCallback(pj_timer_entry *entry, PjTimerHeapCallback *callback) 
     33{ 
     34  entry->user_data = callback; 
     35} 
     36 
     37 
     38/* 
     39 * Wrapper of pjsua_callback 
     40 */ 
    541static PjsuaCallback* cb = NULL; 
    642 
     
    1551}; 
    1652 
    17 pjsua_callback* PJSUA_CALLBACK_PROXY = &my_cb_proxy; 
     53pjsua_callback* pjsua_callback_proxy = &my_cb_proxy; 
Note: See TracChangeset for help on using the changeset viewer.