- Timestamp:
- Jul 14, 2011 8:46:19 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/2.0-dev/pjmedia/src/test/test.c
r3633 r3643 20 20 #include "test.h" 21 21 22 #if defined(PJ_DARWINOS) && PJ_DARWINOS!=023 # include <CoreFoundation/CFRunLoop.h>24 #endif25 26 22 #define THIS_FILE "test.c" 27 23 … … 37 33 38 34 pj_pool_factory *mem; 39 pj_bool_t is_quit = PJ_FALSE; 40 pj_thread_t *thread; 41 pj_caching_pool caching_pool; 42 pj_pool_t *pool; 35 43 36 44 37 void app_perror(pj_status_t status, const char *msg) … … 51 44 } 52 45 53 static int test_func(void *data)46 int test_main(void) 54 47 { 55 48 int rc = 0; 49 pj_caching_pool caching_pool; 50 pj_pool_t *pool; 51 52 pj_init(); 53 pj_caching_pool_init(&caching_pool, &pj_pool_factory_default_policy, 0); 54 pool = pj_pool_create(&caching_pool.factory, "test", 1000, 512, NULL); 55 56 pj_log_set_decor(PJ_LOG_HAS_NEWLINE); 57 pj_log_set_level(3); 58 59 mem = &caching_pool.factory; 60 61 pjmedia_video_format_mgr_create(pool, 64, 0, NULL); 62 pjmedia_converter_mgr_create(pool, NULL); 63 pjmedia_vid_codec_mgr_create(pool, NULL); 56 64 57 65 #if HAS_VID_PORT_TEST … … 62 70 DO_TEST(vid_dev_test()); 63 71 #endif 64 72 65 73 #if HAS_VID_CODEC_TEST 66 74 DO_TEST(vid_codec_test()); 67 75 #endif 68 76 69 77 #if HAS_SDP_NEG_TEST 70 78 DO_TEST(sdp_neg_test()); … … 82 90 DO_TEST(codec_test_vectors()); 83 91 #endif 84 92 85 93 PJ_LOG(3,(THIS_FILE," ")); 86 94 87 95 on_return: 88 96 if (rc != 0) { … … 91 99 PJ_LOG(3,(THIS_FILE,"Looks like everything is okay!")); 92 100 } 93 94 is_quit = PJ_TRUE;95 return rc;96 }97 98 int test_main(void)99 {100 int rc = 0;101 102 pj_init();103 pj_caching_pool_init(&caching_pool, &pj_pool_factory_default_policy, 0);104 pool = pj_pool_create(&caching_pool.factory, "test", 1000, 512, NULL);105 106 pj_log_set_decor(PJ_LOG_HAS_NEWLINE);107 pj_log_set_level(3);108 109 mem = &caching_pool.factory;110 111 pjmedia_video_format_mgr_create(pool, 64, 0, NULL);112 pjmedia_converter_mgr_create(pool, NULL);113 pjmedia_vid_codec_mgr_create(pool, NULL);114 115 #if defined(PJ_DARWINOS) && PJ_DARWINOS!=0116 {117 if (pj_thread_create(pool, "test_func", test_func, NULL, 0, 0,118 &thread) == PJ_SUCCESS) {119 while (!is_quit) {120 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);121 }122 }123 return 0;124 }125 #else126 rc = test_func(NULL);127 #endif128 101 129 102 pjmedia_video_format_mgr_destroy(pjmedia_video_format_mgr_instance());
Note: See TracChangeset
for help on using the changeset viewer.