- Timestamp:
- Mar 22, 2015 8:53:03 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/android/jni/pjsua_app_callback.cpp
r5005 r5014 30 30 static int restart_argc; 31 31 static char **restart_argv; 32 static pjsua_callback pjsua_cb_orig; 33 static jobject callVideoSurface; 32 34 33 35 extern const char *pjsua_app_def_argv[]; … … 42 44 } 43 45 46 static void on_call_media_state(pjsua_call_id call_id) 47 { 48 pjsua_call_info call_info; 49 unsigned mi; 50 pj_bool_t has_error = PJ_FALSE; 51 52 pjsua_call_get_info(call_id, &call_info); 53 54 for (mi=0; mi<call_info.media_cnt; ++mi) { 55 pjsua_call_media_info *med_info = &call_info.media[mi]; 56 if (med_info->type == PJMEDIA_TYPE_VIDEO && 57 med_info->status == PJSUA_CALL_MEDIA_ACTIVE && 58 med_info->stream.vid.win_in != PJSUA_INVALID_ID) 59 { 60 pjmedia_vid_dev_hwnd vhwnd; 61 62 /* Setup renderer surface */ 63 pj_bzero(&vhwnd, sizeof(vhwnd)); 64 vhwnd.type = PJMEDIA_VID_DEV_HWND_TYPE_ANDROID; 65 vhwnd.info.window = callVideoSurface; 66 pjsua_vid_win_set_win(med_info->stream.vid.win_in, &vhwnd); 67 break; 68 } 69 } 70 71 /* Forward to original callback */ 72 if (pjsua_cb_orig.on_call_media_state) 73 (*pjsua_cb_orig.on_call_media_state)(call_id); 74 } 44 75 45 76 /** Callback wrapper **/ 46 77 static void on_cli_config(pjsua_app_config *cfg) 47 78 { 79 pjsua_cb_orig = cfg->cfg.cb; 48 80 cfg->log_cfg.cb = &log_writer; 81 82 /* Override pjsua callback, e.g: to install renderer view */ 83 cfg->cfg.cb.on_call_media_state = &on_call_media_state; 49 84 } 50 85 … … 127 162 } 128 163 164 165 void setIncomingVideoRenderer(jobject surface) 166 { 167 callVideoSurface = surface; 168 } 169 129 170 #endif
Note: See TracChangeset
for help on using the changeset viewer.