![]() |
Home page |
Mailing list |
Docs
This graph shows which files directly or indirectly include this file:Asterisk developer's documentation :: Codename Pineapple
jitterbuf.h File Reference

|
|
Definition at line 36 of file jitterbuf.h. Referenced by _jb_get(). |
|
|
Definition at line 28 of file jitterbuf.h. Referenced by history_get(). |
|
|
Definition at line 30 of file jitterbuf.h. |
|
|
Definition at line 32 of file jitterbuf.h. Referenced by history_calc_maxbuf(), and history_put(). |
|
|
Definition at line 25 of file jitterbuf.h. Referenced by history_get(), and history_put(). |
|
|
Definition at line 34 of file jitterbuf.h. Referenced by jb_reset(), and jb_setconf(). |
|
|
Definition at line 155 of file jitterbuf.h. |
|
|
Definition at line 48 of file jitterbuf.h. 00048 { 00049 /* frame types */ 00050 JB_TYPE_CONTROL, /* 0 */ 00051 JB_TYPE_VOICE, /* 1 */ 00052 JB_TYPE_VIDEO, /* 2 - reserved */ 00053 JB_TYPE_SILENCE /* 3 */ 00054 };
|
|
|
Definition at line 38 of file jitterbuf.h. 00038 { 00039 /* return codes */ 00040 JB_OK, /* 0 */ 00041 JB_EMPTY, /* 1 */ 00042 JB_NOFRAME, /* 2 */ 00043 JB_INTERP, /* 3 */ 00044 JB_DROP, /* 4 */ 00045 JB_SCHED /* 5 */ 00046 };
|
|
|
Definition at line 100 of file jitterbuf.c. References free, jitterbuf::free, jb_dbg2, and jb_frame::next. Referenced by iax2_destroy(), and jb_destroy_adaptive(). 00101 { 00102 jb_frame *frame; 00103 jb_dbg2("jb_destroy(%x)\n", jb); 00104 00105 /* free all the frames on the "free list" */ 00106 frame = jb->free; 00107 while (frame != NULL) { 00108 jb_frame *next = frame->next; 00109 free(frame); 00110 frame = next; 00111 } 00112 00113 /* free ourselves! */ 00114 free(jb); 00115 }
|
|
||||||||||||||||||||
|
Definition at line 788 of file jitterbuf.c. References _jb_get(), jitterbuf::info, JB_DROP, JB_INTERP, JB_OK, jb_warn, jb_info::last_voice_ms, jb_frame::ms, and jb_frame::ts. Referenced by __get_from_jb(), and jb_get_adaptive(). 00789 { 00790 enum jb_return_code ret = _jb_get(jb, frameout, now, interpl); 00791 #if 0 00792 static int lastts=0; 00793 int thists = ((ret == JB_OK) || (ret == JB_DROP)) ? frameout->ts : 0; 00794 jb_warn("jb_get(%x,%x,%ld) = %d (%d)\n", jb, frameout, now, ret, thists); 00795 if (thists && thists < lastts) jb_warn("XXXX timestamp roll-back!!!\n"); 00796 lastts = thists; 00797 #endif 00798 if (ret == JB_INTERP) 00799 frameout->ms = jb->info.last_voice_ms; 00800 00801 return ret; 00802 }
|
|
||||||||||||
|
Definition at line 804 of file jitterbuf.c. References JB_NOFRAME, JB_OK, and queue_getall(). Referenced by complete_transfer(), iax2_destroy(), jb_remove_adaptive(), and schedule_delivery(). 00805 { 00806 jb_frame *frame; 00807 frame = queue_getall(jb); 00808 00809 if (!frame) { 00810 return JB_NOFRAME; 00811 } 00812 00813 *frameout = *frame; 00814 return JB_OK; 00815 }
|
|
||||||||||||
|
Definition at line 818 of file jitterbuf.c. References history_get(), jitterbuf::info, and JB_OK. Referenced by ast_cli_netstats(), construct_rr(), and iax2_show_channels(). 00819 { 00820 00821 history_get(jb); 00822 00823 *stats = jb->info; 00824 00825 return JB_OK; 00826 }
|
|
|
Definition at line 87 of file jitterbuf.c. References ast_malloc, jb_dbg2, and jb_reset(). Referenced by jb_create_adaptive(), and new_iax(). 00088 { 00089 jitterbuf *jb; 00090 00091 if (!(jb = ast_malloc(sizeof(*jb)))) 00092 return NULL; 00093 00094 jb_reset(jb); 00095 00096 jb_dbg2("jb_new() = %x\n", jb); 00097 return jb; 00098 }
|
|
|
Definition at line 770 of file jitterbuf.c. References jb_info::conf, jb_info::current, jitterbuf::frames, history_get(), jitterbuf::info, JB_LONGMAX, jb_info::last_adjustment, jb_info::next_voice_ts, queue_next(), jb_info::silence_begin_ts, jb_info::target, and jb_conf::target_extra. Referenced by __get_from_jb(), jb_next_adaptive(), and update_jbsched(). 00771 { 00772 if (jb->info.silence_begin_ts) { 00773 if (jb->frames) { 00774 long next = queue_next(jb); 00775 history_get(jb); 00776 /* shrink during silence */ 00777 if (jb->info.target - jb->info.current < -jb->info.conf.target_extra) 00778 return jb->info.last_adjustment + 10; 00779 return next + jb->info.target; 00780 } 00781 else 00782 return JB_LONGMAX; 00783 } else { 00784 return jb->info.next_voice_ts; 00785 } 00786 }
|
|
||||||||||||||||||||||||||||
|
Definition at line 513 of file jitterbuf.c. References ast_log(), jb_info::conf, jitterbuf::dropem, jitterbuf::frames, jb_info::frames_in, history_put(), jitterbuf::info, jb_dbg2, JB_DROP, JB_OK, JB_SCHED, JB_TYPE_VOICE, LOG_DEBUG, jb_conf::max_jitterbuf, jb_frame::prev, queue_put(), and jb_frame::ts. Referenced by jb_put_adaptive(), and schedule_delivery(). 00514 { 00515 long numts; 00516 00517 jb_dbg2("jb_put(%x,%x,%ld,%ld,%ld)\n", jb, data, ms, ts, now); 00518 00519 jb->info.frames_in++; 00520 00521 if (jb->frames && jb->dropem) 00522 return JB_DROP; 00523 jb->dropem = 0; 00524 00525 if (type == JB_TYPE_VOICE) { 00526 /* presently, I'm only adding VOICE frames to history and drift calculations; mostly because with the 00527 * IAX integrations, I'm sending retransmitted control frames with their awkward timestamps through */ 00528 if (history_put(jb,ts,now,ms)) 00529 return JB_DROP; 00530 } 00531 numts = 0; 00532 if (jb->frames) 00533 numts = jb->frames->prev->ts - jb->frames->ts; 00534 if (numts >= jb->info.conf.max_jitterbuf) { 00535 ast_log(LOG_DEBUG, "Attempting to exceed Jitterbuf max %ld timeslots\n", 00536 jb->info.conf.max_jitterbuf); 00537 jb->dropem = 1; 00538 return JB_DROP; 00539 } 00540 /* if put into head of queue, caller needs to reschedule */ 00541 if (queue_put(jb,data,type,ms,ts)) { 00542 return JB_SCHED; 00543 } 00544 return JB_OK; 00545 }
|
|
|
Definition at line 75 of file jitterbuf.c. References jb_info::conf, jitterbuf::info, JB_TARGET_EXTRA, and s. Referenced by complete_transfer(), jb_new(), and schedule_delivery(). 00076 { 00077 /* only save settings */ 00078 jb_conf s = jb->info.conf; 00079 memset(jb, 0, sizeof(*jb)); 00080 jb->info.conf = s; 00081 00082 /* initialize length, using the default value */ 00083 jb->info.current = jb->info.target = jb->info.conf.target_extra = JB_TARGET_EXTRA; 00084 jb->info.silence_begin_ts = -1; 00085 }
|
|
||||||||||||
|
Definition at line 828 of file jitterbuf.c. References jb_info::conf, jb_info::current, jitterbuf::info, JB_OK, JB_TARGET_EXTRA, jb_conf::max_contig_interp, jb_conf::max_jitterbuf, jb_conf::resync_threshold, jb_info::target, and jb_conf::target_extra. Referenced by jb_create_adaptive(), and new_iax(). 00829 { 00830 /* take selected settings from the struct */ 00831 00832 jb->info.conf.max_jitterbuf = conf->max_jitterbuf; 00833 jb->info.conf.resync_threshold = conf->resync_threshold; 00834 jb->info.conf.max_contig_interp = conf->max_contig_interp; 00835 00836 /* -1 indicates use of the default JB_TARGET_EXTRA value */ 00837 jb->info.conf.target_extra = ( conf->target_extra == -1 ) 00838 ? JB_TARGET_EXTRA 00839 : conf->target_extra 00840 ; 00841 00842 /* update these to match new target_extra setting */ 00843 jb->info.current = jb->info.conf.target_extra; 00844 jb->info.target = jb->info.conf.target_extra; 00845 00846 return JB_OK; 00847 }
|
|
||||||||||||||||
|
Definition at line 58 of file jitterbuf.c. Referenced by iax2_do_jb_debug(), and load_module().
|