Changeset 1266 for pjproject/trunk/pjmedia/src/pjmedia/jbuf.c
- Timestamp:
- May 11, 2007 3:14:34 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/jbuf.c
r974 r1266 31 31 32 32 33 struct jb_framelist33 typedef struct jb_framelist_t 34 34 { 35 35 char *flist_buffer; … … 41 41 unsigned flist_tail; 42 42 unsigned flist_origin; 43 }; 44 45 46 typedef struct jb_framelist jb_framelist; 43 } jb_framelist_t; 44 47 45 48 46 struct pjmedia_jbuf 49 47 { 50 48 pj_str_t name; // jitter buffer name 51 jb_framelist 49 jb_framelist_t jb_framelist; 52 50 pj_size_t jb_frame_size; // frame size 53 51 unsigned jb_frame_ptime; // frame duration. … … 93 91 94 92 static pj_status_t jb_framelist_init( pj_pool_t *pool, 95 jb_framelist *framelist,93 jb_framelist_t *framelist, 96 94 unsigned frame_size, 97 95 unsigned max_count) … … 99 97 PJ_ASSERT_RETURN(pool && framelist, PJ_EINVAL); 100 98 101 pj_bzero(framelist, sizeof(jb_framelist ));99 pj_bzero(framelist, sizeof(jb_framelist_t)); 102 100 103 101 framelist->flist_frame_size = frame_size; 104 102 framelist->flist_max_count = max_count; 105 framelist->flist_buffer = pj_pool_zalloc(pool, 103 framelist->flist_buffer = (char*) 104 pj_pool_zalloc(pool, 106 105 framelist->flist_frame_size * 107 106 framelist->flist_max_count); 108 107 109 framelist->flist_frame_type = 108 framelist->flist_frame_type = (int*) 110 109 pj_pool_zalloc(pool, sizeof(framelist->flist_frame_type[0]) * 111 110 framelist->flist_max_count); … … 117 116 } 118 117 119 static pj_status_t jb_framelist_destroy(jb_framelist *framelist)118 static pj_status_t jb_framelist_destroy(jb_framelist_t *framelist) 120 119 { 121 120 PJ_UNUSED_ARG(framelist); … … 124 123 125 124 126 static unsigned jb_framelist_size(jb_framelist *framelist)125 static unsigned jb_framelist_size(jb_framelist_t *framelist) 127 126 { 128 127 if (framelist->flist_tail == framelist->flist_head) { … … 135 134 136 135 137 static pj_bool_t jb_framelist_get(jb_framelist *framelist,136 static pj_bool_t jb_framelist_get(jb_framelist_t *framelist, 138 137 void *frame, 139 138 pjmedia_jb_frame_type *p_type) … … 168 167 169 168 170 static void jb_framelist_remove_head( jb_framelist *framelist,169 static void jb_framelist_remove_head( jb_framelist_t *framelist, 171 170 unsigned count) 172 171 { … … 215 214 216 215 217 static pj_bool_t jb_framelist_put_at(jb_framelist *framelist,216 static pj_bool_t jb_framelist_put_at(jb_framelist_t *framelist, 218 217 unsigned index, 219 218 const void *frame, … … 283 282 pj_status_t status; 284 283 285 jb = pj_pool_zalloc(pool, sizeof(pjmedia_jbuf));284 jb = PJ_POOL_ZALLOC_T(pool, pjmedia_jbuf); 286 285 287 286 status = jb_framelist_init(pool, &jb->jb_framelist, frame_size, max_count);
Note: See TracChangeset
for help on using the changeset viewer.