Changeset 5525
- Timestamp:
- Jan 17, 2017 4:28:39 AM (8 years ago)
- Location:
- pjproject/trunk/pjsip-apps/src/pjsua/android
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/android/app/src/main/java/MainActivity.java
r5508 r5525 139 139 } 140 140 } 141 142 @Override 143 public void onCallVideoStart() { 144 MainActivity ma = ((MyHandler)ui_handler.get()).mTarget.get(); 145 SurfaceView surfaceView = (SurfaceView) 146 ma.findViewById(R.id.surfaceViewIncomingCall); 147 148 WindowHandle wh = new WindowHandle(); 149 wh.setWindow(surfaceView.getHolder().getSurface()); 150 pjsua.setVideoWindow(wh); 151 } 141 152 } 142 153 … … 262 273 public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) 263 274 { 264 pjsua.setIncomingVideoRenderer(holder.getSurface()); 275 WindowHandle wh = new WindowHandle(); 276 wh.setWindow(holder.getSurface()); 277 pjsua.setVideoWindow(wh); 265 278 } 266 279 267 280 public void surfaceCreated(SurfaceHolder holder) 268 281 { 269 pjsua.setIncomingVideoRenderer(holder.getSurface()); 282 270 283 } 271 284 272 285 public void surfaceDestroyed(SurfaceHolder holder) 273 286 { 274 pjsua.setIncomingVideoRenderer(null); 287 WindowHandle wh = new WindowHandle(); 288 wh.setWindow(null); 289 pjsua.setVideoWindow(wh); 275 290 } 276 291 -
pjproject/trunk/pjsip-apps/src/pjsua/android/app/src/main/java/org/pjsip/pjsua
- Property svn:ignore
-
old new 1 1 Pjsua*.java 2 2 pjsua*.java 3 SWIG*.java 4 WindowHandle.java 5
-
- Property svn:ignore
-
pjproject/trunk/pjsip-apps/src/pjsua/android/jni/pjsua.i
r5506 r5525 15 15 %feature("director") PjsuaAppCallback; 16 16 17 /* Convert Surface object to ANativeWindow for setIncomingVideoRenderer()*/17 /* Convert Surface object to ANativeWindow */ 18 18 %typemap(in) jobject surface { 19 19 $1 = $input? (jobject)ANativeWindow_fromSurface(jenv, $input) : NULL; 20 20 } 21 21 22 %extend WindowHandle { 23 void setWindow(jobject surface) { $self->window = surface; } 24 } 25 22 26 %include "pjsua_app_callback.h" -
pjproject/trunk/pjsip-apps/src/pjsua/android/jni/pjsua_app_callback.cpp
r5030 r5525 31 31 static char **restart_argv; 32 32 static pjsua_callback pjsua_cb_orig; 33 static jobject callVideoSurface; 33 static pjsua_vid_win_id winId = PJSUA_INVALID_ID; 34 35 void 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 } 34 43 35 44 extern const char *pjsua_app_def_argv[]; … … 58 67 med_info->stream.vid.win_in != PJSUA_INVALID_ID) 59 68 { 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(); 67 71 break; 68 72 } … … 163 167 } 164 168 165 166 void setIncomingVideoRenderer(jobject surface)167 {168 callVideoSurface = surface;169 }170 171 169 #endif -
pjproject/trunk/pjsip-apps/src/pjsua/android/jni/pjsua_app_callback.h
r5014 r5525 20 20 #define __PJSUA_APP_CALLBACK_H__ 21 21 22 #include <jni.h>23 24 22 class PjsuaAppCallback { 25 23 public: … … 27 25 virtual void onStarted(const char *msg) {} 28 26 virtual void onStopped(int restart) {} 27 virtual void onCallVideoStart() {} 29 28 }; 29 30 typedef struct WindowHandle { 31 void *window; 32 } WindowHandle; 33 34 void setVideoWindow(const WindowHandle& win); 30 35 31 36 extern "C" { … … 34 39 int pjsuaRestart(); 35 40 void setCallbackObject(PjsuaAppCallback* callback); 36 void setIncomingVideoRenderer(jobject surface);37 41 } 38 42
Note: See TracChangeset
for help on using the changeset viewer.