[xiph-commits] r14092 - trunk/speex/speexclient

jm at svn.xiph.org jm at svn.xiph.org
Sat Nov 3 15:02:06 PDT 2007


Author: jm
Date: 2007-11-03 15:02:06 -0700 (Sat, 03 Nov 2007)
New Revision: 14092

Added:
   trunk/speex/speexclient/speex_jitter_buffer.h
Log:
Oops. Forgot to add speex_jitter_buffer.h


Added: trunk/speex/speexclient/speex_jitter_buffer.h
===================================================================
--- trunk/speex/speexclient/speex_jitter_buffer.h	                        (rev 0)
+++ trunk/speex/speexclient/speex_jitter_buffer.h	2007-11-03 22:02:06 UTC (rev 14092)
@@ -0,0 +1,50 @@
+/* Copyright (C) 2002 Jean-Marc Valin */
+/**
+   @file speex_jitter_buffer.h
+   @brief Adaptive jitter buffer for Speex packets only
+*/
+
+#include <speex/speex_jitter.h>
+#include <speex/speex.h>
+
+/** @defgroup SpeexJitter SpeexJitter: Adaptive jitter buffer specifically for Speex
+ *  This is the jitter buffer that reorders UDP/RTP packets and adjusts the buffer size
+ * to maintain good quality and low latency. This is a simplified version that works only
+ * with Speex, but is much easier to use.
+ *  @{
+*/
+
+/** Speex jitter-buffer state. Never use it directly! */
+typedef struct SpeexJitter {
+   SpeexBits current_packet;         /**< Current Speex packet */
+   int valid_bits;                   /**< True if Speex bits are valid */
+   JitterBuffer *packets;            /**< Generic jitter buffer state */
+   void *dec;                        /**< Pointer to Speex decoder */
+   spx_int32_t frame_size;           /**< Frame size of Speex decoder */
+} SpeexJitter;
+
+/** Initialise jitter buffer 
+ * 
+ * @param jitter State of the Speex jitter buffer
+ * @param decoder Speex decoder to call
+ * @param sampling_rate Sampling rate used by the decoder
+*/
+void speex_jitter_init(SpeexJitter *jitter, void *decoder, int sampling_rate);
+
+/** Destroy jitter buffer */
+void speex_jitter_destroy(SpeexJitter *jitter);
+
+/** Put one packet into the jitter buffer */
+void speex_jitter_put(SpeexJitter *jitter, char *packet, int len, int timestamp);
+
+/** Get one packet from the jitter buffer */
+void speex_jitter_get(SpeexJitter *jitter, spx_int16_t *out, int *start_offset);
+
+/** Get pointer timestamp of jitter buffer */
+int speex_jitter_get_pointer_timestamp(SpeexJitter *jitter);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* @} */



More information about the commits mailing list