Changeset 5007 for pjproject/trunk
- Timestamp:
- Mar 21, 2015 4:23:07 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-videodev/android_opengl.c
r4978 r5007 282 282 } 283 283 284 if (stream->window) {285 ANativeWindow_release(stream->window);286 stream->window = NULL;287 }288 289 284 stream->display = EGL_NO_DISPLAY; 290 285 stream->surface = EGL_NO_SURFACE; … … 427 422 return PJMEDIA_EVID_BADFORMAT; 428 423 424 /* Re-init OpenGL */ 425 if (strm->window) 426 job_queue_post_job(strm->jq, deinit_opengl, strm, 0, NULL); 427 429 428 pjmedia_format_copy(&strm->param.fmt, fmt); 430 429 431 430 vfd = pjmedia_format_get_video_format_detail(fmt, PJ_TRUE); 432 431 pj_memcpy(&strm->vid_size, &vfd->size, sizeof(vfd->size)); 433 if (strm->param.disp_size.w == 0 || strm->param.disp_size.h == 0) 434 pj_memcpy(&strm->param.disp_size, &vfd->size, sizeof(vfd->size)); 432 pj_memcpy(&strm->param.disp_size, &vfd->size, sizeof(vfd->size)); 433 434 if (strm->window) 435 job_queue_post_job(strm->jq, init_opengl, strm, 0, NULL); 436 437 PJ_LOG(4, (THIS_FILE, "Re-initializing OpenGL due to format change")); 435 438 436 439 return PJ_SUCCESS; 437 440 } else if (cap == PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW) { 438 pj_bool_t is_running = strm->is_running;439 441 pj_status_t status = PJ_SUCCESS; 440 442 pjmedia_vid_dev_hwnd *wnd = (pjmedia_vid_dev_hwnd *)pval; … … 444 446 return PJ_SUCCESS; 445 447 446 /* Stop the stream and re-init OpenGL */ 447 andgl_stream_stop(s); 448 /* Re-init OpenGL */ 448 449 job_queue_post_job(strm->jq, deinit_opengl, strm, 0, NULL); 450 if (strm->window) 451 ANativeWindow_release(strm->window); 449 452 450 453 strm->window = strm->param.window.info.android.window = native_wnd; … … 453 456 } 454 457 455 PJ_LOG( 3, (THIS_FILE, "Re-initializing OpenGL with window %p: %s",458 PJ_LOG(4, (THIS_FILE, "Re-initializing OpenGL with window %p: %s", 456 459 strm->window, 457 460 (status == PJ_SUCCESS? "success": "failed"))); 458 461 459 if (is_running)460 andgl_stream_start(s);461 462 462 return status; 463 463 } else if (cap == PJMEDIA_VID_DEV_CAP_OUTPUT_RESIZE) { … … 526 526 job_queue_post_job(stream->jq, deinit_opengl, strm, 0, NULL); 527 527 528 if (stream->window) { 529 ANativeWindow_release(stream->window); 530 stream->window = NULL; 531 } 532 528 533 if (stream->jq) { 529 534 job_queue_destroy(stream->jq);
Note: See TracChangeset
for help on using the changeset viewer.