Ignore:
Timestamp:
Jan 17, 2017 4:28:39 AM (8 years ago)
Author:
ming
Message:

Re #1945 (misc): Fixed occasional crash in pjsua Android sample app when initializing OpenGL renderer (crash in init_opengl()->ANativeWindow_setBuffersGeometry()). It doesn't happen in pjsua2 sample app.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/pjsua/android/jni/pjsua_app_callback.cpp

    r5030 r5525  
    3131static char **restart_argv; 
    3232static pjsua_callback pjsua_cb_orig; 
    33 static jobject callVideoSurface; 
     33static pjsua_vid_win_id winId = PJSUA_INVALID_ID; 
     34 
     35void setVideoWindow(const WindowHandle& win) 
     36{ 
     37    pjmedia_vid_dev_hwnd vhwnd; 
     38    
     39    vhwnd.info.window = win.window; 
     40    if (winId != PJSUA_INVALID_ID) 
     41        pjsua_vid_win_set_win(winId, &vhwnd); 
     42} 
    3443 
    3544extern const char *pjsua_app_def_argv[]; 
     
    5867            med_info->stream.vid.win_in != PJSUA_INVALID_ID) 
    5968        { 
    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); 
     69            winId = med_info->stream.vid.win_in; 
     70            registeredCallbackObject->onCallVideoStart(); 
    6771            break; 
    6872        } 
     
    163167} 
    164168 
    165  
    166 void setIncomingVideoRenderer(jobject surface) 
    167 { 
    168     callVideoSurface = surface; 
    169 } 
    170  
    171169#endif 
Note: See TracChangeset for help on using the changeset viewer.