Changeset 3577
- Timestamp:
- May 30, 2011 8:35:42 AM (13 years ago)
- Location:
- pjproject/branches/projects/2.0-dev
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/2.0-dev/pjmedia/build/os-auto.mak.in
r3484 r3577 164 164 # Determine whether we should compile the obj-c version of a particular source code 165 165 # 166 ifeq ($(AC_PJMEDIA_VIDEO), mac_os)167 # Mac OS specific, use obj-c166 ifeq ($(AC_PJMEDIA_VIDEO),$(filter $(AC_PJMEDIA_VIDEO),mac_os iphone_os)) 167 # Mac and iPhone OS specific, use obj-c 168 168 export PJMEDIA_VIDEODEV_OBJS += sdl_dev_m.o 169 169 else -
pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/sdl_dev.c
r3537 r3577 33 33 # include "SDL_opengl.h" 34 34 # define OPENGL_DEV_IDX 1 35 #else 36 # define OPENGL_DEV_IDX -999 35 37 #endif 36 38 … … 55 57 { 56 58 #if PJ_IS_BIG_ENDIAN 57 {PJMEDIA_FORMAT_RGBA, 0, 0xFF000000, 0xFF0000, 0xFF00, 0xFF} , 58 {PJMEDIA_FORMAT_RGB24, 0, 0xFF0000, 0xFF00, 0xFF, 0} , 59 {PJMEDIA_FORMAT_BGRA, 0, 0xFF00, 0xFF0000, 0xFF000000, 0xFF} , 59 {PJMEDIA_FORMAT_RGBA, SDL_PIXELFORMAT_RGBA8888, 60 0xFF000000, 0xFF0000, 0xFF00, 0xFF} , 61 {PJMEDIA_FORMAT_RGB24, SDL_PIXELFORMAT_RGB24, 62 0xFF0000, 0xFF00, 0xFF, 0} , 63 {PJMEDIA_FORMAT_BGRA, SDL_PIXELFORMAT_BGRA8888, 64 0xFF00, 0xFF0000, 0xFF000000, 0xFF} , 60 65 #else 61 {PJMEDIA_FORMAT_RGBA, 0, 0xFF, 0xFF00, 0xFF0000, 0xFF000000} , 62 {PJMEDIA_FORMAT_RGB24, 0, 0xFF, 0xFF00, 0xFF0000, 0} , 63 {PJMEDIA_FORMAT_BGRA, 0, 0xFF0000, 0xFF00, 0xFF, 0xFF000000} , 64 #endif 65 66 {PJMEDIA_FORMAT_DIB , 0, 0xFF0000, 0xFF00, 0xFF, 0} , 66 {PJMEDIA_FORMAT_RGBA, SDL_PIXELFORMAT_ABGR8888, 67 0xFF, 0xFF00, 0xFF0000, 0xFF000000} , 68 {PJMEDIA_FORMAT_RGB24, SDL_PIXELFORMAT_BGR24, 69 0xFF, 0xFF00, 0xFF0000, 0} , 70 {PJMEDIA_FORMAT_BGRA, SDL_PIXELFORMAT_ARGB8888, 71 0xFF0000, 0xFF00, 0xFF, 0xFF000000} , 72 #endif 73 74 {PJMEDIA_FORMAT_DIB , SDL_PIXELFORMAT_RGB24, 75 0xFF0000, 0xFF00, 0xFF, 0} , 67 76 68 77 {PJMEDIA_FORMAT_YUY2, SDL_YUY2_OVERLAY, 0, 0, 0, 0} , … … 75 84 }; 76 85 86 #if defined(PJ_DARWINOS) && PJ_DARWINOS!=0 87 @interface SDLDelegate: NSObject 88 { 89 @public 90 struct sdl_stream *strm; 91 } 92 93 - (void)sdl_init; 94 - (void)sdl_quit; 95 - (void)detect_new_fmt; 96 - (int)sdl_create; 97 - (void)sdl_destroy; 98 - (int)handle_event; 99 - (pj_status_t)put_frame; 100 @end 101 #endif 102 77 103 /* sdl_ device info */ 78 104 struct sdl_dev_info … … 90 116 unsigned dev_count; 91 117 struct sdl_dev_info *dev_info; 118 #if defined(PJ_DARWINOS) && PJ_DARWINOS!=0 119 NSAutoreleasePool *apool; 120 SDLDelegate *delegate; 121 #endif 92 122 }; 93 94 #if defined(PJ_DARWINOS) && PJ_DARWINOS!=095 @interface SDLDelegate: NSObject96 {97 @public98 struct sdl_stream *strm;99 }100 101 - (int)sdl_thread;102 - (int)handle_event;103 - (pj_status_t)put_frame;104 @end105 #endif106 123 107 124 /* Video stream. */ … … 120 137 pj_bool_t render_exited; 121 138 pj_status_t status; 122 139 pjmedia_format *new_fmt; 140 141 #if SDL_VERSION_ATLEAST(1,3,0) 142 SDL_Window *window; /**< Display window. */ 143 SDL_Renderer *renderer; /**< Display renderer. */ 144 SDL_Texture *scr_tex; /**< Screen texture. */ 145 int pitch; /**< Pitch value. */ 146 #endif 123 147 SDL_Rect rect; /**< Display rectangle. */ 124 148 SDL_Surface *screen; /**< Display screen. */ … … 126 150 SDL_Overlay *overlay; /**< YUV overlay. */ 127 151 #if PJMEDIA_VIDEO_DEV_SDL_HAS_OPENGL 152 #if SDL_VERSION_ATLEAST(1,3,0) 153 SDL_GLContext *gl_context; 154 #endif 128 155 GLuint texture; 129 156 void *tex_buf; … … 231 258 struct sdl_factory *sf = (struct sdl_factory*)f; 232 259 struct sdl_dev_info *ddi; 233 unsigned i; 260 unsigned i, j; 261 262 #if defined(PJ_DARWINOS) && PJ_DARWINOS!=0 263 sf->apool = [[NSAutoreleasePool alloc] init]; 264 sf->delegate = [[SDLDelegate alloc] init]; 265 [sf->delegate performSelectorOnMainThread:@selector(sdl_init) 266 withObject:nil waitUntilDone:YES]; 267 #else 268 /* Initialize the SDL library */ 269 if (SDL_Init(SDL_INIT_VIDEO)) { 270 PJ_LOG(4, (THIS_FILE, "Cannot initialize SDL")); 271 return PJMEDIA_EVID_INIT; 272 } 273 #endif 234 274 235 275 sf->dev_count = 1; … … 245 285 strncpy(ddi->info.name, "SDL renderer", sizeof(ddi->info.name)); 246 286 ddi->info.name[sizeof(ddi->info.name)-1] = '\0'; 247 strncpy(ddi->info.driver, "SDL", sizeof(ddi->info.driver));248 ddi->info.driver[sizeof(ddi->info.driver)-1] = '\0';249 ddi->info.dir = PJMEDIA_DIR_RENDER;250 ddi->info.has_callback = PJ_FALSE;251 ddi->info.caps = PJMEDIA_VID_DEV_CAP_FORMAT |252 PJMEDIA_VID_DEV_CAP_OUTPUT_RESIZE;253 254 287 ddi->info.fmt_cnt = PJ_ARRAY_SIZE(sdl_fmts); 255 ddi->info.fmt = (pjmedia_format*)256 pj_pool_calloc(sf->pool, ddi->info.fmt_cnt,257 sizeof(pjmedia_format));258 for (i = 0; i < ddi->info.fmt_cnt; i++) {259 pjmedia_format *fmt = &ddi->info.fmt[i];260 pjmedia_format_init_video(fmt, sdl_fmts[i].fmt_id,261 DEFAULT_WIDTH, DEFAULT_HEIGHT,262 DEFAULT_FPS, 1);263 }264 288 265 289 #if PJMEDIA_VIDEO_DEV_SDL_HAS_OPENGL … … 268 292 strncpy(ddi->info.name, "SDL openGL renderer", sizeof(ddi->info.name)); 269 293 ddi->info.name[sizeof(ddi->info.name)-1] = '\0'; 270 strncpy(ddi->info.driver, "SDL", sizeof(ddi->info.driver));271 ddi->info.driver[sizeof(ddi->info.driver)-1] = '\0';272 ddi->info.dir = PJMEDIA_DIR_RENDER;273 ddi->info.has_callback = PJ_FALSE;274 ddi->info.caps = PJMEDIA_VID_DEV_CAP_FORMAT;275 276 ddi->info.fmt_cnt = PJ_ARRAY_SIZE(sdl_fmts);277 294 ddi->info.fmt_cnt = 1; 278 ddi->info.fmt = (pjmedia_format*) 279 pj_pool_calloc(sf->pool, ddi->info.fmt_cnt, 280 sizeof(pjmedia_format)); 281 for (i = 0; i < ddi->info.fmt_cnt; i++) { 282 pjmedia_format *fmt = &ddi->info.fmt[i]; 283 pjmedia_format_init_video(fmt, sdl_fmts[i].fmt_id, 284 DEFAULT_WIDTH, DEFAULT_HEIGHT, 285 DEFAULT_FPS, 1); 286 } 287 #endif 295 #endif 296 297 for (i = 0; i < sf->dev_count; i++) { 298 ddi = &sf->dev_info[i]; 299 strncpy(ddi->info.driver, "SDL", sizeof(ddi->info.driver)); 300 ddi->info.driver[sizeof(ddi->info.driver)-1] = '\0'; 301 ddi->info.dir = PJMEDIA_DIR_RENDER; 302 ddi->info.has_callback = PJ_FALSE; 303 ddi->info.caps = PJMEDIA_VID_DEV_CAP_FORMAT | 304 PJMEDIA_VID_DEV_CAP_OUTPUT_RESIZE; 305 #if SDL_VERSION_ATLEAST(1,3,0) 306 ddi->info.caps |= PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW; 307 #endif 308 309 ddi->info.fmt = (pjmedia_format*) 310 pj_pool_calloc(sf->pool, ddi->info.fmt_cnt, 311 sizeof(pjmedia_format)); 312 for (j = 0; j < ddi->info.fmt_cnt; j++) { 313 pjmedia_format *fmt = &ddi->info.fmt[j]; 314 pjmedia_format_init_video(fmt, sdl_fmts[j].fmt_id, 315 DEFAULT_WIDTH, DEFAULT_HEIGHT, 316 DEFAULT_FPS, 1); 317 } 318 } 288 319 289 320 PJ_LOG(4, (THIS_FILE, "SDL initialized")); … … 300 331 sf->pool = NULL; 301 332 pj_pool_release(pool); 333 334 #if defined(PJ_DARWINOS) && PJ_DARWINOS!=0 335 [sf->delegate performSelectorOnMainThread:@selector(sdl_quit) 336 withObject:nil waitUntilDone:YES]; 337 [sf->delegate release]; 338 [sf->apool release]; 339 #else 340 SDL_Quit(); 341 #endif 302 342 303 343 return PJ_SUCCESS; … … 378 418 } 379 419 380 static void destroy_sdl(struct sdl_stream *strm )420 static void destroy_sdl(struct sdl_stream *strm, pj_bool_t destroy_win) 381 421 { 382 422 if (strm->surf) { … … 393 433 strm->texture = 0; 394 434 } 435 #endif 436 #if SDL_VERSION_ATLEAST(1,3,0) 437 #if PJMEDIA_VIDEO_DEV_SDL_HAS_OPENGL 438 if (strm->gl_context) { 439 SDL_GL_DeleteContext(strm->gl_context); 440 strm->gl_context = NULL; 441 } 442 #endif 443 if (strm->scr_tex) { 444 SDL_DestroyTexture(strm->scr_tex); 445 strm->scr_tex = NULL; 446 } 447 if (strm->renderer) { 448 SDL_DestroyRenderer(strm->renderer); 449 strm->renderer = NULL; 450 } 451 #ifndef __IPHONEOS__ 452 if (destroy_win) { 453 if (strm->window && 454 !(strm->param.flags & PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW)) 455 { 456 SDL_DestroyWindow(strm->window); 457 } 458 strm->window = NULL; 459 } 460 #endif 395 461 #endif 396 462 } … … 417 483 strm->rect.h = (Uint16)vfd->size.h; 418 484 485 destroy_sdl(strm, PJ_FALSE); 486 487 #if SDL_VERSION_ATLEAST(1,3,0) 488 if (!strm->window) { 489 Uint32 flags = SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE; 490 491 if (strm->param.rend_id == OPENGL_DEV_IDX) 492 flags |= SDL_WINDOW_OPENGL; 493 494 if (strm->param.flags & PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW) { 495 /* Use the window supplied by the application. */ 496 strm->window = SDL_CreateWindowFrom(strm->param.window); 497 } else { 498 /* Create the window where we will draw. */ 499 strm->window = SDL_CreateWindow("pjmedia-SDL video", 500 SDL_WINDOWPOS_CENTERED, 501 SDL_WINDOWPOS_CENTERED, 502 strm->rect.w, strm->rect.h, 503 flags); 504 } 505 if (!strm->window) 506 return PJMEDIA_EVID_SYSERR; 507 } 508 509 SDL_SetWindowSize(strm->window, strm->rect.w, strm->rect.h); 510 511 /** 512 * We must call SDL_CreateRenderer in order for draw calls to 513 * affect this window. 514 */ 515 strm->renderer = SDL_CreateRenderer(strm->window, -1, 0); 516 if (!strm->renderer) 517 return PJMEDIA_EVID_SYSERR; 518 519 #if PJMEDIA_VIDEO_DEV_SDL_HAS_OPENGL 520 if (strm->param.rend_id == OPENGL_DEV_IDX) { 521 strm->gl_context = SDL_GL_CreateContext(strm->window); 522 if (!strm->gl_context) 523 return PJMEDIA_EVID_SYSERR; 524 SDL_GL_MakeCurrent(strm->window, strm->gl_context); 525 } 526 #endif 527 528 strm->screen = SDL_GetWindowSurface(strm->window); 529 530 #else 531 419 532 /* Initialize the display */ 420 533 strm->screen = SDL_SetVideoMode(strm->rect.w, strm->rect.h, 0, ( 421 534 #if PJMEDIA_VIDEO_DEV_SDL_HAS_OPENGL 422 535 strm->param.rend_id == OPENGL_DEV_IDX? 423 SDL_OPENGL :536 SDL_OPENGL | SDL_RESIZABLE: 424 537 #endif 425 538 SDL_RESIZABLE | SDL_SWSURFACE)); … … 429 542 SDL_WM_SetCaption("pjmedia-SDL video", NULL); 430 543 431 destroy_sdl(strm); 544 #endif 432 545 433 546 #if PJMEDIA_VIDEO_DEV_SDL_HAS_OPENGL … … 453 566 glGenTextures(1, &strm->texture); 454 567 568 if (!strm->texture) 569 return PJMEDIA_EVID_SYSERR; 570 455 571 #if defined(PJ_WIN32) && PJ_WIN32 != 0 456 572 /** … … 466 582 } else 467 583 #endif 584 #if SDL_VERSION_ATLEAST(1,3,0) 585 { 586 strm->scr_tex = SDL_CreateTexture(strm->renderer, sdl_info->sdl_format, 587 SDL_TEXTUREACCESS_STREAMING, 588 strm->rect.w, strm->rect.h); 589 if (strm->scr_tex == NULL) 590 return PJMEDIA_EVID_SYSERR; 591 592 strm->pitch = strm->rect.w * SDL_BYTESPERPIXEL(sdl_info->sdl_format); 593 } 594 #else 468 595 if (vfi->color_model == PJMEDIA_COLOR_MODEL_RGB) { 469 596 strm->surf = SDL_CreateRGBSurface(SDL_SWSURFACE, … … 483 610 return PJMEDIA_EVID_SYSERR; 484 611 } 612 #endif 485 613 486 614 return PJ_SUCCESS; 487 615 } 488 616 617 static void detect_fmt_change(struct sdl_stream *strm) 618 { 619 if (strm->new_fmt) { 620 /* Stop the stream */ 621 sdl_stream_stop((pjmedia_vid_dev_stream *)strm); 622 623 /* Re-initialize SDL */ 624 strm->status = init_sdl(strm, strm->new_fmt); 625 626 if (strm->status == PJ_SUCCESS) { 627 pjmedia_format_copy(&strm->param.fmt, strm->new_fmt); 628 /* Restart the stream */ 629 sdl_stream_start((pjmedia_vid_dev_stream *)strm); 630 } 631 strm->new_fmt = NULL; 632 } 633 } 634 489 635 #if defined(PJ_DARWINOS) && PJ_DARWINOS!=0 490 636 @implementation SDLDelegate 491 - (int)sdl_thread 637 - (void)sdl_init 638 { 639 if (SDL_Init(SDL_INIT_VIDEO)) { 640 PJ_LOG(4, (THIS_FILE, "Cannot initialize SDL")); 641 } 642 } 643 644 - (void)sdl_quit 645 { 646 SDL_Quit(); 647 } 648 649 - (void)detect_new_fmt 650 { 651 detect_fmt_change(strm); 652 } 653 654 - (int)sdl_create 492 655 { 493 656 #else … … 496 659 struct sdl_stream *strm = (struct sdl_stream*)data; 497 660 #endif 498 499 /* Initialize the SDL library */500 if (SDL_Init(SDL_INIT_VIDEO)) {501 PJ_LOG(4, (THIS_FILE, "Cannot initialize SDL"));502 strm->status = PJMEDIA_EVID_INIT;503 goto on_return;504 }505 661 506 662 #if PJMEDIA_VIDEO_DEV_SDL_HAS_OPENGL … … 517 673 on_return: 518 674 if (strm->status != PJ_SUCCESS) { 519 destroy_sdl(strm); 520 SDL_Quit(); 675 destroy_sdl(strm, PJ_TRUE); 521 676 strm->screen = NULL; 522 677 } … … 524 679 return strm->status; 525 680 } 681 682 - (void)sdl_destroy 683 { 684 destroy_sdl(strm, PJ_TRUE); 685 } 526 686 527 687 - (int)handle_event … … 547 707 #endif 548 708 #endif 709 710 detect_fmt_change(strm); 711 549 712 /** 550 713 * The event polling must be placed in the same thread that … … 556 719 557 720 switch(sevent.type) { 558 case SDL_USEREVENT:559 {560 pjmedia_format *fmt;561 562 if (sevent.user.code == PJMEDIA_EVENT_NONE) {563 strm->is_quitting = PJ_TRUE;564 goto on_return;565 }566 567 pj_assert(sevent.user.code == PJMEDIA_VID_DEV_CAP_FORMAT);568 569 fmt = (pjmedia_format *)sevent.user.data1;570 571 /* Stop the stream */572 sdl_stream_stop((pjmedia_vid_dev_stream *)strm);573 574 /* Re-initialize SDL */575 strm->status = init_sdl(strm, fmt);576 577 if (strm->status == PJ_SUCCESS) {578 pjmedia_format_copy(&strm->param.fmt, fmt);579 /* Restart the stream */580 sdl_stream_start((pjmedia_vid_dev_stream *)strm);581 }582 583 break;584 }585 586 721 case SDL_MOUSEBUTTONDOWN: 587 722 pevent.event_type = PJMEDIA_EVENT_MOUSEBUTTONDOWN; … … 670 805 #endif 671 806 on_return: 672 destroy_sdl(strm); 673 SDL_Quit(); 807 destroy_sdl(strm, PJ_TRUE); 674 808 strm->screen = NULL; 675 809 … … 693 827 glTexCoord2f(1, 1); glVertex2i(stream->rect.w, stream->rect.h); 694 828 glEnd(); 829 #if SDL_VERSION_ATLEAST(1,3,0) 830 SDL_GL_SwapWindow(stream->window); 831 #else 695 832 SDL_GL_SwapBuffers(); 833 #endif 696 834 } 697 835 } … … 736 874 } 737 875 SDL_BlitSurface(stream->surf, NULL, stream->screen, NULL); 738 SDL_UpdateRect(stream->screen, 0, 0, 0, 0); 876 #if SDL_VERSION_ATLEAST(1,3,0) 877 SDL_UpdateWindowSurface(stream->window); 878 #else 879 SDL_UpdateRect(stream->screen, 0, 0, 0, 0); 880 #endif 739 881 } else if (stream->overlay) { 740 882 int i, sz, offset; … … 756 898 SDL_DisplayYUVOverlay(stream->overlay, &stream->rect); 757 899 } 900 #if SDL_VERSION_ATLEAST(1,3,0) 901 else if (stream->scr_tex) { 902 SDL_UpdateTexture(stream->scr_tex, NULL, frame->buf, stream->pitch); 903 SDL_RenderClear(stream->renderer); 904 SDL_RenderCopy(stream->renderer, stream->scr_tex, NULL, NULL); 905 SDL_RenderPresent(stream->renderer); 906 } 907 #endif 758 908 #if PJMEDIA_VIDEO_DEV_SDL_HAS_OPENGL 759 909 else if (stream->param.rend_id == OPENGL_DEV_IDX) { … … 778 928 stream->frame = frame; 779 929 [stream->delegate performSelectorOnMainThread:@selector(put_frame) 780 930 withObject:nil waitUntilDone:YES]; 781 931 782 932 return PJ_SUCCESS; … … 828 978 strm->status = PJ_SUCCESS; 829 979 #if defined(PJ_DARWINOS) && PJ_DARWINOS!=0 830 pj_assert(![NSThread isMainThread]);831 980 strm->apool = [[NSAutoreleasePool alloc] init]; 832 981 strm->delegate = [[SDLDelegate alloc]init]; 833 982 strm->delegate->strm = strm; 834 /* On Mac OS X, we need to call SDL functions in the main thread */835 [strm->delegate performSelectorOnMainThread:@selector(sdl_ thread)983 /* On Darwin OS, we need to call SDL functions in the main thread */ 984 [strm->delegate performSelectorOnMainThread:@selector(sdl_create) 836 985 withObject:nil waitUntilDone:YES]; 837 986 if ((status = strm->status) != PJ_SUCCESS) { … … 847 996 848 997 while(strm->status == PJ_SUCCESS && !strm->surf && !strm->overlay 998 #if SDL_VERSION_ATLEAST(1,3,0) 999 && !strm->scr_tex 1000 #endif 849 1001 #if PJMEDIA_VIDEO_DEV_SDL_HAS_OPENGL 850 1002 && !strm->texture … … 939 1091 return PJ_SUCCESS; 940 1092 } else if (cap == PJMEDIA_VID_DEV_CAP_FORMAT) { 941 SDL_Event sevent; 942 943 strm->status = PJ_TRUE; 944 sevent.type = SDL_USEREVENT; 945 sevent.user.code = PJMEDIA_VID_DEV_CAP_FORMAT; 946 sevent.user.data1 = (void *)pval; 947 SDL_PushEvent(&sevent); 948 949 while (strm->status == PJ_TRUE) 1093 strm->new_fmt = (pjmedia_format *)pval; 1094 #if defined(PJ_DARWINOS) && PJ_DARWINOS!=0 1095 [strm->delegate performSelectorOnMainThread:@selector(detect_new_fmt) 1096 withObject:nil waitUntilDone:YES]; 1097 #endif 1098 while (strm->new_fmt) 950 1099 pj_thread_sleep(10); 951 1100 … … 957 1106 * to its original format. 958 1107 */ 959 strm->status = PJ_TRUE; 960 sevent.user.data1 = &strm->param.fmt; 961 SDL_PushEvent(&sevent); 962 963 while (strm->status == PJ_TRUE) 1108 strm->new_fmt = &strm->param.fmt; 1109 #if defined(PJ_DARWINOS) && PJ_DARWINOS!=0 1110 [strm->delegate performSelectorOnMainThread:@selector(detect_new_fmt) 1111 withObject:nil waitUntilDone:YES]; 1112 #endif 1113 while (strm->new_fmt) 964 1114 pj_thread_sleep(10); 965 1115 … … 1004 1154 /* Wait for renderer put_frame() to finish */ 1005 1155 stream->is_running = PJ_FALSE; 1006 for (i=0; !stream->render_exited && i<100; ++i) 1156 #if defined(PJ_DARWINOS) && PJ_DARWINOS!=0 1157 if (![NSThread isMainThread]) 1158 #endif 1159 for (i=0; !stream->render_exited && i<50; ++i) 1007 1160 pj_thread_sleep(10); 1008 1161 … … 1015 1168 { 1016 1169 struct sdl_stream *stream = (struct sdl_stream*)strm; 1017 SDL_Event sevent;1018 1170 1019 1171 PJ_ASSERT_RETURN(stream != NULL, PJ_EINVAL); … … 1022 1174 1023 1175 if (!stream->is_quitting) { 1024 sevent.type = SDL_USEREVENT; 1025 sevent.user.code = PJMEDIA_EVENT_NONE; 1026 SDL_PushEvent(&sevent); 1176 stream->is_quitting = PJ_TRUE; 1027 1177 if (stream->sdl_thread) 1028 1178 pj_thread_join(stream->sdl_thread); … … 1030 1180 1031 1181 #if defined(PJ_DARWINOS) && PJ_DARWINOS!=0 1032 if (stream->delegate) 1182 if (stream->delegate) { 1183 [stream->delegate performSelectorOnMainThread:@selector(sdl_destroy) 1184 withObject:nil waitUntilDone:YES]; 1033 1185 [stream->delegate release]; 1034 if (stream->apool) 1186 stream->delegate = NULL; 1187 } 1188 if (stream->apool) { 1035 1189 [stream->apool release]; 1190 stream->apool = NULL; 1191 } 1036 1192 #endif 1037 1193 pj_pool_release(stream->pool); -
pjproject/branches/projects/2.0-dev/pjsip-apps/src/ipjsua/config.cfg
r3175 r3577 1 --auto-answer=200 2 --video 1 3 --clock-rate=8000 -
pjproject/branches/projects/2.0-dev/pjsip-apps/src/ipjsua/ipjsua.xcodeproj/project.pbxproj
r3312 r3577 19 19 3A0D7ECD123DD46C009D5030 /* MainWindow-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3A0D7ECC123DD46C009D5030 /* MainWindow-iPad.xib */; }; 20 20 3A0D7F20123F2254009D5030 /* SecondView-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3A0D7F1F123F2254009D5030 /* SecondView-iPad.xib */; }; 21 3AE06674138E6C25008EE71A /* libpjmedia-videodev-arm-apple-darwin9.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AE06673138E6C25008EE71A /* libpjmedia-videodev-arm-apple-darwin9.a */; }; 22 3AE06681138E6F88008EE71A /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AE06680138E6F88008EE71A /* AVFoundation.framework */; }; 23 3AE06683138E6FBB008EE71A /* libSDL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AE06682138E6FBB008EE71A /* libSDL.a */; }; 24 3AE06693138E7056008EE71A /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AE06692138E7056008EE71A /* OpenGLES.framework */; }; 25 3AE06695138E70B9008EE71A /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AE06694138E70B9008EE71A /* libz.dylib */; }; 26 3AE06699138E70F0008EE71A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AE06696138E70F0008EE71A /* CoreGraphics.framework */; }; 27 3AE0669A138E70F0008EE71A /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AE06697138E70F0008EE71A /* CoreMedia.framework */; }; 28 3AE0669B138E70F0008EE71A /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AE06698138E70F0008EE71A /* CoreVideo.framework */; }; 29 3AE0669D138E710C008EE71A /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AE0669C138E710C008EE71A /* QuartzCore.framework */; }; 30 3AE066A5138E72A4008EE71A /* libavcodec.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AE0669E138E72A4008EE71A /* libavcodec.a */; }; 31 3AE066A6138E72A4008EE71A /* libavcore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AE0669F138E72A4008EE71A /* libavcore.a */; }; 32 3AE066A7138E72A4008EE71A /* libavdevice.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AE066A0138E72A4008EE71A /* libavdevice.a */; }; 33 3AE066A8138E72A4008EE71A /* libavfilter.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AE066A1138E72A4008EE71A /* libavfilter.a */; }; 34 3AE066A9138E72A4008EE71A /* libavformat.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AE066A2138E72A4008EE71A /* libavformat.a */; }; 35 3AE066AA138E72A4008EE71A /* libavutil.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AE066A3138E72A4008EE71A /* libavutil.a */; }; 36 3AE066AB138E72A4008EE71A /* libswscale.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AE066A4138E72A4008EE71A /* libswscale.a */; }; 21 37 3AE9099D11587BB900FAEAA5 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AE9099C11587BB900FAEAA5 /* AudioToolbox.framework */; }; 22 38 3AE90A2D1158B52500FAEAA5 /* pjsua_app.c in Sources */ = {isa = PBXBuildFile; fileRef = 3AE90A2C1158B52500FAEAA5 /* pjsua_app.c */; }; … … 60 76 3A0D7ECC123DD46C009D5030 /* MainWindow-iPad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "MainWindow-iPad.xib"; path = "Resources-iPad/MainWindow-iPad.xib"; sourceTree = "<group>"; }; 61 77 3A0D7F1F123F2254009D5030 /* SecondView-iPad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "SecondView-iPad.xib"; path = "Resources-iPad/SecondView-iPad.xib"; sourceTree = "<group>"; }; 78 3AE06673138E6C25008EE71A /* libpjmedia-videodev-arm-apple-darwin9.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libpjmedia-videodev-arm-apple-darwin9.a"; path = "../../../pjmedia/lib/libpjmedia-videodev-arm-apple-darwin9.a"; sourceTree = "<group>"; }; 79 3AE06680138E6F88008EE71A /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; 80 3AE06682138E6FBB008EE71A /* libSDL.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libSDL.a; path = "../../../../../Library/Developer/Xcode/DerivedData/SDLiPhoneOS-fyjdxvchuwlpnghehmebkvasdrke/Build/Products/Debug-iphoneos/libSDL.a"; sourceTree = "<group>"; }; 81 3AE06692138E7056008EE71A /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; 82 3AE06694138E70B9008EE71A /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; 83 3AE06696138E70F0008EE71A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 84 3AE06697138E70F0008EE71A /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; 85 3AE06698138E70F0008EE71A /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; 86 3AE0669C138E710C008EE71A /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 87 3AE0669E138E72A4008EE71A /* libavcodec.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libavcodec.a; path = "../../../../video/ffmpeg-iphone/lib/libavcodec.a"; sourceTree = "<group>"; }; 88 3AE0669F138E72A4008EE71A /* libavcore.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libavcore.a; path = "../../../../video/ffmpeg-iphone/lib/libavcore.a"; sourceTree = "<group>"; }; 89 3AE066A0138E72A4008EE71A /* libavdevice.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libavdevice.a; path = "../../../../video/ffmpeg-iphone/lib/libavdevice.a"; sourceTree = "<group>"; }; 90 3AE066A1138E72A4008EE71A /* libavfilter.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libavfilter.a; path = "../../../../video/ffmpeg-iphone/lib/libavfilter.a"; sourceTree = "<group>"; }; 91 3AE066A2138E72A4008EE71A /* libavformat.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libavformat.a; path = "../../../../video/ffmpeg-iphone/lib/libavformat.a"; sourceTree = "<group>"; }; 92 3AE066A3138E72A4008EE71A /* libavutil.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libavutil.a; path = "../../../../video/ffmpeg-iphone/lib/libavutil.a"; sourceTree = "<group>"; }; 93 3AE066A4138E72A4008EE71A /* libswscale.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libswscale.a; path = "../../../../video/ffmpeg-iphone/lib/libswscale.a"; sourceTree = "<group>"; }; 62 94 3AE9099C11587BB900FAEAA5 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; 63 95 3AE90A2C1158B52500FAEAA5 /* pjsua_app.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pjsua_app.c; path = ../pjsua/pjsua_app.c; sourceTree = SOURCE_ROOT; }; … … 117 149 3AE90EBC115F7BCE00FAEAA5 /* libsrtp-arm-apple-darwin9.a in Frameworks */, 118 150 3A0D789F121E324E009D5030 /* CFNetwork.framework in Frameworks */, 151 3AE06674138E6C25008EE71A /* libpjmedia-videodev-arm-apple-darwin9.a in Frameworks */, 152 3AE06681138E6F88008EE71A /* AVFoundation.framework in Frameworks */, 153 3AE06683138E6FBB008EE71A /* libSDL.a in Frameworks */, 154 3AE06693138E7056008EE71A /* OpenGLES.framework in Frameworks */, 155 3AE06695138E70B9008EE71A /* libz.dylib in Frameworks */, 156 3AE06699138E70F0008EE71A /* CoreGraphics.framework in Frameworks */, 157 3AE0669A138E70F0008EE71A /* CoreMedia.framework in Frameworks */, 158 3AE0669B138E70F0008EE71A /* CoreVideo.framework in Frameworks */, 159 3AE0669D138E710C008EE71A /* QuartzCore.framework in Frameworks */, 160 3AE066A5138E72A4008EE71A /* libavcodec.a in Frameworks */, 161 3AE066A6138E72A4008EE71A /* libavcore.a in Frameworks */, 162 3AE066A7138E72A4008EE71A /* libavdevice.a in Frameworks */, 163 3AE066A8138E72A4008EE71A /* libavfilter.a in Frameworks */, 164 3AE066A9138E72A4008EE71A /* libavformat.a in Frameworks */, 165 3AE066AA138E72A4008EE71A /* libavutil.a in Frameworks */, 166 3AE066AB138E72A4008EE71A /* libswscale.a in Frameworks */, 119 167 ); 120 168 runOnlyForDeploymentPostprocessing = 0; … … 185 233 isa = PBXGroup; 186 234 children = ( 235 3AE06694138E70B9008EE71A /* libz.dylib */, 236 3AE0669C138E710C008EE71A /* QuartzCore.framework */, 237 3AE06696138E70F0008EE71A /* CoreGraphics.framework */, 238 3AE06697138E70F0008EE71A /* CoreMedia.framework */, 239 3AE06698138E70F0008EE71A /* CoreVideo.framework */, 240 3AE06692138E7056008EE71A /* OpenGLES.framework */, 241 3AE06680138E6F88008EE71A /* AVFoundation.framework */, 187 242 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, 188 243 1D30AB110D05D00D00671497 /* Foundation.framework */, … … 206 261 isa = PBXGroup; 207 262 children = ( 263 3AE0669E138E72A4008EE71A /* libavcodec.a */, 264 3AE0669F138E72A4008EE71A /* libavcore.a */, 265 3AE066A0138E72A4008EE71A /* libavdevice.a */, 266 3AE066A1138E72A4008EE71A /* libavfilter.a */, 267 3AE066A2138E72A4008EE71A /* libavformat.a */, 268 3AE066A3138E72A4008EE71A /* libavutil.a */, 269 3AE066A4138E72A4008EE71A /* libswscale.a */, 270 3AE06682138E6FBB008EE71A /* libSDL.a */, 208 271 3AE90EB1115F7BCE00FAEAA5 /* libg7221codec-arm-apple-darwin9.a */, 209 272 3AE90EB2115F7BCE00FAEAA5 /* libilbccodec-arm-apple-darwin9.a */, … … 218 281 3AE90A711158C6B400FAEAA5 /* libpjmedia-audiodev-arm-apple-darwin9.a */, 219 282 3AE90A731158C6B400FAEAA5 /* libpjmedia-codec-arm-apple-darwin9.a */, 283 3AE06673138E6C25008EE71A /* libpjmedia-videodev-arm-apple-darwin9.a */, 220 284 3AE90A751158C6B400FAEAA5 /* libpjnath-arm-apple-darwin9.a */, 221 285 3AE90A771158C6B400FAEAA5 /* libpjsip-arm-apple-darwin9.a */, … … 258 322 buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ipjsua" */; 259 323 compatibilityVersion = "Xcode 3.1"; 324 developmentRegion = English; 260 325 hasScannedForEncodings = 1; 326 knownRegions = ( 327 en, 328 ); 261 329 mainGroup = 29B97314FDCFA39411CA2CEA /* ipjsua */; 262 330 projectDirPath = ""; … … 320 388 "\"$(SRCROOT)/../../../pjnath/lib\"", 321 389 "\"$(SRCROOT)/../../../pjsip/lib\"", 390 "\"$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks/AVFoundation.framework\"", 391 "\"$(SRCROOT)/../../../../../Library/Developer/Xcode/DerivedData/SDLiPhoneOS-fyjdxvchuwlpnghehmebkvasdrke/Build/Products/Debug-iphoneos\"", 392 "\"$(SRCROOT)/../../../../video/ffmpeg-iphone/lib\"", 322 393 ); 394 ONLY_ACTIVE_ARCH = YES; 323 395 PRODUCT_NAME = ipjsua; 324 SDKROOT = iphoneos 3.2;396 SDKROOT = iphoneos; 325 397 TARGETED_DEVICE_FAMILY = "1,2"; 326 398 }; … … 345 417 "\"$(SRCROOT)/../../../pjnath/lib\"", 346 418 "\"$(SRCROOT)/../../../pjsip/lib\"", 419 "\"$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks/AVFoundation.framework\"", 420 "\"$(SRCROOT)/../../../../../Library/Developer/Xcode/DerivedData/SDLiPhoneOS-fyjdxvchuwlpnghehmebkvasdrke/Build/Products/Debug-iphoneos\"", 421 "\"$(SRCROOT)/../../../../video/ffmpeg-iphone/lib\"", 347 422 ); 423 ONLY_ACTIVE_ARCH = YES; 348 424 PRODUCT_NAME = ipjsua; 349 SDKROOT = iphoneos 3.2;425 SDKROOT = iphoneos; 350 426 TARGETED_DEVICE_FAMILY = "1,2"; 351 427 }; … … 376 452 ../../../third_party/lib, 377 453 ); 454 ONLY_ACTIVE_ARCH = NO; 378 455 OTHER_CFLAGS = ""; 379 456 PREBINDING = NO; 380 SDKROOT = iphoneos 3.2;457 SDKROOT = iphoneos; 381 458 }; 382 459 name = Debug; … … 406 483 ../../../third_party/lib, 407 484 ); 485 ONLY_ACTIVE_ARCH = NO; 408 486 OTHER_CFLAGS = ""; 409 487 PREBINDING = NO; 410 SDKROOT = iphoneos 3.2;488 SDKROOT = iphoneos; 411 489 }; 412 490 name = Release;
Note: See TracChangeset
for help on using the changeset viewer.