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