Re #1790: Misc fixes:

* Fixed crash when trying to set NULL surface
* Fixed race condition between setting surface and rendering
* Fixed crash due to GC of VideoWindow



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5016 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
Sauw Ming 2015-03-22 09:39:31 +00:00
parent b4225a2b48
commit c52460741a
3 changed files with 4 additions and 4 deletions

View File

@ -229,7 +229,7 @@ static pj_status_t render(void * data)
{
struct andgl_stream *stream = (struct andgl_stream *)data;
if (!stream->window || stream->err_rend == 0)
if (stream->display == EGL_NO_DISPLAY || stream->err_rend == 0)
return PJ_SUCCESS;
pjmedia_vid_dev_opengl_draw(stream->gl_buf, stream->vid_size.w,
@ -481,7 +481,7 @@ static pj_status_t andgl_stream_put_frame(pjmedia_vid_dev_stream *strm,
struct andgl_stream *stream = (struct andgl_stream*)strm;
pj_status_t status;
if (!stream->is_running || !stream->window)
if (!stream->is_running || stream->display == EGL_NO_DISPLAY)
return PJ_EINVALIDOP;
stream->frame = frame;

View File

@ -95,7 +95,7 @@ class MyCall extends Call {
cmi.getStatus() == pjsua_call_media_status.PJSUA_CALL_MEDIA_ACTIVE &&
cmi.getVideoIncomingWindowId() != pjsua2.INVALID_ID)
{
vidWin = cmi.getVideoWindow();
vidWin = new VideoWindow(cmi.getVideoIncomingWindowId());
}
}

View File

@ -107,7 +107,7 @@ using namespace pj;
%ignore pj::WindowHandle::display;
%ignore pj::WindowHandle::window;
%typemap(in) jobject surface {
$1 = (jobject)ANativeWindow_fromSurface(jenv, $input);
$1 = ($input? (jobject)ANativeWindow_fromSurface(jenv, $input): NULL);
}
%extend pj::WindowHandle {
void setWindow(jobject surface) { $self->window = surface; }