Changeset 1895
- Timestamp:
- Mar 26, 2008 4:18:17 PM (17 years ago)
- Location:
- pjproject/trunk/pjmedia
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/build/pjmedia.dsw
r176 r1895 4 4 ############################################################################### 5 5 6 Project: "pjaut"=.\pjaut.dsp - Package Owner=<4> 6 Project: "libportaudio"="..\..\third_party\build\portaudio\libportaudio.dsp" - Package Owner=<4> 7 8 Package=<5> 9 {{{ 10 }}} 11 12 Package=<4> 13 {{{ 14 }}} 15 16 ############################################################################### 17 18 Project: "libsrtp"="..\..\third_party\build\srtp\libsrtp.dsp" - Package Owner=<4> 19 20 Package=<5> 21 {{{ 22 }}} 23 24 Package=<4> 25 {{{ 26 }}} 27 28 ############################################################################### 29 30 Project: "pjaut"=".\pjaut.dsp" - Package Owner=<4> 7 31 8 32 Package=<5> … … 22 46 ############################################################################### 23 47 24 Project: "pjlib"= ..\..\pjlib\build\pjlib.dsp- Package Owner=<4>48 Project: "pjlib"="..\..\pjlib\build\pjlib.dsp" - Package Owner=<4> 25 49 26 50 Package=<5> … … 46 70 ############################################################################### 47 71 48 Project: "pjmedia"= .\pjmedia.dsp- Package Owner=<4>72 Project: "pjmedia"=".\pjmedia.dsp" - Package Owner=<4> 49 73 50 74 Package=<5> … … 61 85 ############################################################################### 62 86 63 Project: "pjmedia_codec"= .\pjmedia_codec.dsp- Package Owner=<4>87 Project: "pjmedia_codec"=".\pjmedia_codec.dsp" - Package Owner=<4> 64 88 65 89 Package=<5> … … 73 97 ############################################################################### 74 98 75 Project: "pjmedia_test"= .\pjmedia_test.dsp- Package Owner=<4>99 Project: "pjmedia_test"=".\pjmedia_test.dsp" - Package Owner=<4> 76 100 77 101 Package=<5> … … 93 117 Project_Dep_Name pjlib_util 94 118 End Project Dependency 119 Begin Project Dependency 120 Project_Dep_Name libportaudio 121 End Project Dependency 122 Begin Project Dependency 123 Project_Dep_Name libsrtp 124 End Project Dependency 95 125 }}} 96 126 -
pjproject/trunk/pjmedia/build/pjmedia_test.dsp
r458 r1895 43 43 # PROP Target_Dir "" 44 44 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 45 # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../pjlib/include" /I "../include" / D "NDEBUG" /D PJ_WIN32=1 /D PJ_M_I386=1 /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /c45 # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../pjlib/include" /I "../include" /I "../../pjnath/include" /I "../../pjlib-util/include" /D "NDEBUG" /D PJ_WIN32=1 /D PJ_M_I386=1 /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 46 46 # ADD BASE RSC /l 0x409 /d "NDEBUG" 47 47 # ADD RSC /l 0x409 /d "NDEBUG" … … 67 67 # PROP Target_Dir "" 68 68 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c 69 # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../pjlib/include" /I "../include" / D "_DEBUG" /D PJ_WIN32=1 /D PJ_M_I386=1 /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c69 # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../pjlib/include" /I "../include" /I "../../pjnath/include" /I "../../pjlib-util/include" /D "_DEBUG" /D PJ_WIN32=1 /D PJ_M_I386=1 /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c 70 70 # ADD BASE RSC /l 0x409 /d "_DEBUG" 71 71 # ADD RSC /l 0x409 /d "_DEBUG" -
pjproject/trunk/pjmedia/src/test/jbuf_test.c
r974 r1895 19 19 #include <stdio.h> 20 20 #include <ctype.h> 21 #include <pjmedia/jbuf.h>22 21 #include <pj/pool.h> 22 #include "test.h" 23 23 24 #define JB_MIN 1 25 #define JB_MAX 8 26 #define JB_BUF_SIZE 10 24 #define JB_INIT_PREFETCH 0 25 #define JB_MIN_PREFETCH 0 26 #define JB_MAX_PREFETCH 10 27 #define JB_PTIME 20 28 #define JB_BUF_SIZE 20 27 29 28 30 #define REPORT 29 31 //#define PRINT_COMMENT 30 32 31 int jbuf_main( pj_pool_factory *pf)33 int jbuf_main(void) 32 34 { 33 pj _jitter_bufferjb;35 pjmedia_jbuf *jb; 34 36 FILE *input = fopen("JBTEST.DAT", "rt"); 35 unsigned lastseq; 36 void *data = "Hello world"; 37 char line[1024], *p; 38 int lastget = 0, lastput = 0; 37 unsigned seq; 38 char line[1024 * 10], *p; 39 39 pj_pool_t *pool; 40 pjmedia_jb_state state; 41 pj_str_t jb_name = {"JBTEST", 6}; 40 42 41 43 pj_init(); 42 pool = pj_pool_create( pf, "JBPOOL", 256*16, 256*16, NULL);44 pool = pj_pool_create(mem, "JBPOOL", 256*16, 256*16, NULL); 43 45 44 pj _jb_init(&jb, pool, JB_MIN, JB_MAX, JB_BUF_SIZE);45 46 lastseq = 1;46 pjmedia_jbuf_create(pool, &jb_name, 1, JB_PTIME, JB_BUF_SIZE, &jb); 47 pjmedia_jbuf_set_adaptive(jb, JB_INIT_PREFETCH, JB_MIN_PREFETCH, 48 JB_MAX_PREFETCH); 47 49 48 50 while ((p=fgets(line, sizeof(line), input)) != NULL) { … … 56 58 if (*p == '#') { 57 59 #ifdef PRINT_COMMENT 58 printf(" \n%s", p);60 printf("%s", p); 59 61 #endif 60 62 continue; 61 63 } 62 64 63 pj_jb_reset(&jb); 65 pjmedia_jbuf_reset(jb); 66 seq = 1; 67 64 68 #ifdef REPORT 65 printf( "Initial\t%c size=%d prefetch=%d level=%d\n", 66 ' ', jb.lst.count, jb.prefetch, jb.level); 69 pjmedia_jbuf_get_state(jb, &state); 70 printf("Initial\tsize=%d\tprefetch=%d\tmin.pftch=%d\tmax.pftch=%d\n", 71 state.size, state.prefetch, state.min_prefetch, state.max_prefetch); 67 72 #endif 68 73 69 74 while (*p) { 70 75 int c; 71 unsigned seq = 0; 72 void *thedata; 73 int status = 1234; 76 char frame[1]; 77 char f_type; 74 78 75 79 c = *p++; … … 78 82 79 83 if (c == '/') { 80 char *end;84 putchar('\n'); 81 85 82 printf("/*"); 83 84 do { 85 putchar(*++p); 86 } while (*p != '/'); 86 while (*++p && *p != '/') 87 putchar(*p); 87 88 88 89 putchar('\n'); 89 90 90 c = *++p;91 end = p;91 if (*++p == 0) 92 break; 92 93 94 continue; 93 95 } 94 95 if (isspace(c))96 continue;97 98 if (isdigit(c)) {99 seq = c - '0';100 while (*p) {101 c = *p++;102 103 if (isspace(c))104 continue;105 106 if (!isdigit(c))107 break;108 109 seq = seq * 10 + c - '0';110 }111 }112 113 if (!*p)114 break;115 96 116 97 switch (toupper(c)) { 117 98 case 'G': 118 seq = -1; 119 status = pj_jb_get(&jb, &seq, &thedata); 120 lastget = seq; 99 pjmedia_jbuf_get_frame(jb, frame, &f_type); 121 100 break; 122 101 case 'P': 123 if (seq == 0) 124 seq = lastseq++; 125 else 126 lastseq = seq; 127 status = pj_jb_put(&jb, seq, data); 128 if (status == 0) 129 lastput = seq; 102 pjmedia_jbuf_put_frame(jb, (void*)frame, 1, seq); 103 seq++; 104 break; 105 case 'L': 106 seq++; 107 printf("Lost\n"); 130 108 break; 131 109 default: … … 135 113 136 114 #ifdef REPORT 137 printf("seq=%d\t%c rc=%d\tsize=%d\tpfch=%d\tlvl=%d\tmxl=%d\tdelay=%d\n", 138 seq, toupper(c), status, jb.lst.count, jb.prefetch, jb.level, jb.max_level, 139 (lastget>0 && lastput>0) ? lastput-lastget : -1); 115 if (toupper(c) != 'L') { 116 pjmedia_jbuf_get_state(jb, &state); 117 printf("seq=%d\t%c\tsize=%d\tprefetch=%d\n", 118 seq, toupper(c), state.size, state.prefetch); 119 } 140 120 #endif 141 121 } 142 122 } 143 123 144 #ifdef REPORT 145 printf("0\t%c size=%d prefetch=%d level=%d\n", 146 ' ', jb.lst.count, jb.prefetch, jb.level); 147 #endif 124 pjmedia_jbuf_destroy(jb); 148 125 149 126 if (input != stdin) -
pjproject/trunk/pjmedia/src/test/test.c
r974 r1895 36 36 void app_perror(pj_status_t status, const char *msg) 37 37 { 38 char errbuf[PJ MEDIA_ERR_MSG_SIZE];38 char errbuf[PJ_ERR_MSG_SIZE]; 39 39 40 40 pjmedia_strerror(status, errbuf, sizeof(errbuf)); … … 45 45 int test_main(void) 46 46 { 47 int rc ;47 int rc = 0; 48 48 pj_caching_pool caching_pool; 49 49 … … 55 55 mem = &caching_pool.factory; 56 56 57 DO_TEST(sdp_neg_test());57 //DO_TEST(sdp_neg_test()); 58 58 //sdp_test (&caching_pool.factory); 59 59 //rtp_test(&caching_pool.factory); 60 60 //session_test (&caching_pool.factory); 61 //jbuf_main(&caching_pool.factory);61 jbuf_main(); 62 62 63 63 PJ_LOG(3,(THIS_FILE," ")); 64 65 on_return:66 64 67 65 if (rc != 0) {
Note: See TracChangeset
for help on using the changeset viewer.