- Timestamp:
- Oct 4, 2019 4:26:39 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-videodev/android_opengl.c
r5028 r6085 115 115 static pj_status_t andgl_stream_destroy(pjmedia_vid_dev_stream *strm); 116 116 117 static pj_status_t init_opengl(void * data); 118 static pj_status_t deinit_opengl(void * data); 119 117 120 /* Job queue prototypes */ 118 121 static pj_status_t job_queue_create(pj_pool_t *pool, job_queue **pjq); … … 155 158 { \ 156 159 PJ_LOG(3, (THIS_FILE, "Unable to %s %d", str, eglGetError())); \ 157 return PJMEDIA_EVID_SYSERR; \ 160 status = PJMEDIA_EVID_SYSERR; \ 161 goto on_return; \ 158 162 } 159 163 … … 173 177 EGLint width; 174 178 EGLint height; 179 pj_status_t status; 175 180 176 181 strm->display = eglGetDisplay(EGL_DEFAULT_DISPLAY); … … 220 225 221 226 /* Init GL buffers */ 222 return pjmedia_vid_dev_opengl_init_buffers(strm->gl_buf); 223 } 227 status = pjmedia_vid_dev_opengl_init_buffers(strm->gl_buf); 228 229 on_return: 230 if (status != PJ_SUCCESS) 231 deinit_opengl(strm); 232 233 return status; 234 } 235 236 #undef EGL_ERR 224 237 225 238 static pj_status_t render(void * data) … … 387 400 pjmedia_format *fmt = (pjmedia_format *)pval; 388 401 andgl_fmt_info *ifi; 402 pj_status_t status = PJ_SUCCESS; 389 403 390 404 if (!(ifi = get_andgl_format_info(fmt->id))) … … 407 421 408 422 if (strm->window) 409 job_queue_post_job(strm->jq, init_opengl, strm, 0, NULL);423 job_queue_post_job(strm->jq, init_opengl, strm, 0, &status); 410 424 411 PJ_LOG(4, (THIS_FILE, "Re-initializing OpenGL due to format change")); 412 413 return PJ_SUCCESS; 425 PJ_PERROR(4,(THIS_FILE, status, 426 "Re-initializing OpenGL due to format change")); 427 return status; 428 414 429 } else if (cap == PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW) { 415 430 pj_status_t status = PJ_SUCCESS; … … 430 445 } 431 446 432 PJ_LOG(4, (THIS_FILE, "Re-initializing OpenGL with native window" 433 " %p: %s", strm->window, 434 (status == PJ_SUCCESS? "success": "failed"))); 435 447 PJ_PERROR(4,(THIS_FILE, status, 448 "Re-initializing OpenGL with native window %p", 449 strm->window)); 436 450 return status; 437 451 }
Note: See TracChangeset
for help on using the changeset viewer.