mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-11-03 20:38:59 +00:00 
			
		
		
		
	https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r135841 | mmichelson | 2008-08-05 19:25:10 -0500 (Tue, 05 Aug 2008) | 27 lines Merging the issue11259 branch. The purpose of this branch was to take into account "burps" which could cause jitterbuffers to misbehave. One such example is if the L option to Dial() were used to inject audio into a bridged conversation at regular intervals. Since the audio here was not passed through the jitterbuffer, it would cause a gap in the jitterbuffer's timestamps which would cause a frames to be dropped for a brief period. Now ast_generic_bridge will empty and reset the jitterbuffer each time it is called. This causes injected audio to be handled properly. ast_generic_bridge also will empty and reset the jitterbuffer if it receives an AST_CONTROL_SRCUPDATE frame since the change in audio source could negatively affect the jitterbuffer. All of this was made possible by adding a new public API call to the abstract_jb called ast_jb_empty_and_reset. (closes issue #11259) Reported by: plack Tested by: putnopvut ........ r135847 | mmichelson | 2008-08-05 19:27:54 -0500 (Tue, 05 Aug 2008) | 4 lines Revert inadvertent changes to app_skel that occurred when I was testing for a memory leak ........ r135850 | mmichelson | 2008-08-05 19:29:54 -0500 (Tue, 05 Aug 2008) | 3 lines Remove properties that should not be here ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@135851 65c4cc65-6c06-0410-ace0-fbb531ad65f3
		
			
				
	
	
		
			93 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			93 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
/*
 | 
						|
 * Copyright (C) 2005, Attractel OOD
 | 
						|
 *
 | 
						|
 * Contributors:
 | 
						|
 * Slav Klenov <slav@securax.org>
 | 
						|
 *
 | 
						|
 * Copyright on this file is disclaimed to Digium for inclusion in Asterisk
 | 
						|
 *
 | 
						|
 * See http://www.asterisk.org for more information about
 | 
						|
 * the Asterisk project. Please do not directly contact
 | 
						|
 * any of the maintainers of this project for assistance;
 | 
						|
 * the project provides a web site, mailing lists and IRC
 | 
						|
 * channels for your use.
 | 
						|
 *
 | 
						|
 * This program is free software, distributed under the terms of
 | 
						|
 * the GNU General Public License Version 2. See the LICENSE file
 | 
						|
 * at the top of the source tree.
 | 
						|
 */
 | 
						|
 | 
						|
/*! \file 
 | 
						|
 * 
 | 
						|
 * \brief Jitterbuffering algorithm.
 | 
						|
 * 
 | 
						|
 */
 | 
						|
 | 
						|
#ifndef _FIXEDJITTERBUF_H_
 | 
						|
#define _FIXEDJITTERBUF_H_
 | 
						|
 | 
						|
#if defined(__cplusplus) || defined(c_plusplus)
 | 
						|
extern "C" {
 | 
						|
#endif
 | 
						|
 | 
						|
 | 
						|
/* return codes */
 | 
						|
enum {
 | 
						|
	FIXED_JB_OK,
 | 
						|
	FIXED_JB_DROP,
 | 
						|
	FIXED_JB_INTERP,
 | 
						|
	FIXED_JB_NOFRAME
 | 
						|
};
 | 
						|
 | 
						|
 | 
						|
/* defaults */
 | 
						|
#define FIXED_JB_SIZE_DEFAULT 200
 | 
						|
#define FIXED_JB_RESYNCH_THRESHOLD_DEFAULT 1000
 | 
						|
 | 
						|
 | 
						|
/* jb configuration properties */
 | 
						|
struct fixed_jb_conf
 | 
						|
{
 | 
						|
	long jbsize;
 | 
						|
 	long resync_threshold;
 | 
						|
};
 | 
						|
 | 
						|
 | 
						|
struct fixed_jb_frame
 | 
						|
{
 | 
						|
	void *data;
 | 
						|
	long ts;
 | 
						|
	long ms;
 | 
						|
	long delivery;
 | 
						|
	struct fixed_jb_frame *next;
 | 
						|
	struct fixed_jb_frame *prev;
 | 
						|
};
 | 
						|
 | 
						|
 | 
						|
struct fixed_jb;
 | 
						|
 | 
						|
 | 
						|
/* jb interface */
 | 
						|
 | 
						|
struct fixed_jb * fixed_jb_new(struct fixed_jb_conf *conf);
 | 
						|
 | 
						|
void fixed_jb_destroy(struct fixed_jb *jb);
 | 
						|
 | 
						|
int fixed_jb_put_first(struct fixed_jb *jb, void *data, long ms, long ts, long now);
 | 
						|
 | 
						|
int fixed_jb_put(struct fixed_jb *jb, void *data, long ms, long ts, long now);
 | 
						|
 | 
						|
int fixed_jb_get(struct fixed_jb *jb, struct fixed_jb_frame *frame, long now, long interpl);
 | 
						|
 | 
						|
long fixed_jb_next(struct fixed_jb *jb);
 | 
						|
 | 
						|
int fixed_jb_remove(struct fixed_jb *jb, struct fixed_jb_frame *frameout);
 | 
						|
 | 
						|
void fixed_jb_set_force_resynch(struct fixed_jb *jb);
 | 
						|
 | 
						|
#if defined(__cplusplus) || defined(c_plusplus)
 | 
						|
}
 | 
						|
#endif
 | 
						|
 | 
						|
#endif /* _FIXEDJITTERBUF_H_ */
 |