提交 78e37908 authored 作者: Brian West's avatar Brian West

Add optional packetization and VAD buster options to RTP

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1090 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 809dfc84
......@@ -34,7 +34,7 @@ CC = gcc
INCDIR = -Icrypto/include -I$(srcdir)/include -I$(srcdir)/crypto/include
DEFS = -DHAVE_CONFIG_H
CPPFLAGS=
CFLAGS = -Wall -O4 -fexpensive-optimizations -funroll-loops
CFLAGS = -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops
LIBS =
LDFLAGS = -L.
COMPILE = $(CC) $(DEFS) $(INCDIR) $(CPPFLAGS) $(CFLAGS)
......
差异被折叠。
......@@ -300,7 +300,7 @@ Report bugs to <bug-autoconf@gnu.org>."
ac_cs_version="\
config.status
configured by ./configure, generated by GNU Autoconf 2.59,
with options \"'--prefix=/usr/local/freeswitch'\"
with options \"'--prefix=/usr/local/freeswitch' '--enable-pic'\"
Copyright (C) 2003 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
......@@ -379,8 +379,8 @@ if $ac_cs_silent; then
fi
if $ac_cs_recheck; then
echo "running /bin/sh ./configure " '--prefix=/usr/local/freeswitch' $ac_configure_extra_args " --no-create --no-recursion" >&6
exec /bin/sh ./configure '--prefix=/usr/local/freeswitch' $ac_configure_extra_args --no-create --no-recursion
echo "running /bin/sh ./configure " '--prefix=/usr/local/freeswitch' '--enable-pic' $ac_configure_extra_args " --no-create --no-recursion" >&6
exec /bin/sh ./configure '--prefix=/usr/local/freeswitch' '--enable-pic' $ac_configure_extra_args --no-create --no-recursion
fi
for ac_config_target in $ac_config_targets
......@@ -475,7 +475,7 @@ s,@LIBS@,,;t t
s,@RANLIB@,ranlib,;t t
s,@ac_ct_RANLIB@,ranlib,;t t
s,@CC@,gcc,;t t
s,@CFLAGS@,-Wall -O4 -fexpensive-optimizations -funroll-loops,;t t
s,@CFLAGS@,-fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops,;t t
s,@LDFLAGS@,,;t t
s,@CPPFLAGS@,,;t t
s,@ac_ct_CC@,gcc,;t t
......@@ -487,13 +487,13 @@ s,@INSTALL_DATA@,${INSTALL} -m 644,;t t
s,@RNG_OBJS@,rand_source.o,;t t
s,@CPP@,gcc -E,;t t
s,@EGREP@,grep -E,;t t
s,@build@,i686-pc-linux-gnu,;t t
s,@build_cpu@,i686,;t t
s,@build_vendor@,pc,;t t
s,@build@,x86_64-unknown-linux-gnu,;t t
s,@build_cpu@,x86_64,;t t
s,@build_vendor@,unknown,;t t
s,@build_os@,linux-gnu,;t t
s,@host@,i686-pc-linux-gnu,;t t
s,@host_cpu@,i686,;t t
s,@host_vendor@,pc,;t t
s,@host@,x86_64-unknown-linux-gnu,;t t
s,@host_cpu@,x86_64,;t t
s,@host_vendor@,unknown,;t t
s,@host_os@,linux-gnu,;t t
s,@EXE@,,;t t
s,@GDOI_OBJS@,,;t t
......@@ -841,7 +841,7 @@ ${ac_dA}HAVE_UINT16_T${ac_dB}HAVE_UINT16_T${ac_dC}1${ac_dD}
${ac_dA}HAVE_INT32_T${ac_dB}HAVE_INT32_T${ac_dC}1${ac_dD}
${ac_dA}HAVE_UINT32_T${ac_dB}HAVE_UINT32_T${ac_dC}1${ac_dD}
${ac_dA}HAVE_UINT64_T${ac_dB}HAVE_UINT64_T${ac_dC}1${ac_dD}
${ac_dA}SIZEOF_UNSIGNED_LONG${ac_dB}SIZEOF_UNSIGNED_LONG${ac_dC}4${ac_dD}
${ac_dA}SIZEOF_UNSIGNED_LONG${ac_dB}SIZEOF_UNSIGNED_LONG${ac_dC}8${ac_dD}
${ac_dA}SIZEOF_UNSIGNED_LONG_LONG${ac_dB}SIZEOF_UNSIGNED_LONG_LONG${ac_dC}8${ac_dD}
${ac_dA}HAVE_SOCKET${ac_dB}HAVE_SOCKET${ac_dC}1${ac_dD}
${ac_dA}HAVE_INET_ATON${ac_dB}HAVE_INET_ATON${ac_dC}1${ac_dD}
......@@ -856,7 +856,6 @@ t clr
: clr
${ac_dA}HAVE_USLEEP${ac_dB}HAVE_USLEEP${ac_dC}1${ac_dD}
${ac_dA}CPU_CISC${ac_dB}CPU_CISC${ac_dC}1${ac_dD}
${ac_dA}HAVE_X86${ac_dB}HAVE_X86${ac_dC}1${ac_dD}
${ac_dA}ENABLE_DEBUGGING${ac_dB}ENABLE_DEBUGGING${ac_dC}1${ac_dD}
${ac_dA}ERR_REPORTING_STDOUT${ac_dB}ERR_REPORTING_STDOUT${ac_dC}1${ac_dD}
CEOF
......@@ -905,7 +904,7 @@ ${ac_uA}HAVE_UINT16_T${ac_uB}HAVE_UINT16_T${ac_uC}1${ac_uD}
${ac_uA}HAVE_INT32_T${ac_uB}HAVE_INT32_T${ac_uC}1${ac_uD}
${ac_uA}HAVE_UINT32_T${ac_uB}HAVE_UINT32_T${ac_uC}1${ac_uD}
${ac_uA}HAVE_UINT64_T${ac_uB}HAVE_UINT64_T${ac_uC}1${ac_uD}
${ac_uA}SIZEOF_UNSIGNED_LONG${ac_uB}SIZEOF_UNSIGNED_LONG${ac_uC}4${ac_uD}
${ac_uA}SIZEOF_UNSIGNED_LONG${ac_uB}SIZEOF_UNSIGNED_LONG${ac_uC}8${ac_uD}
${ac_uA}SIZEOF_UNSIGNED_LONG_LONG${ac_uB}SIZEOF_UNSIGNED_LONG_LONG${ac_uC}8${ac_uD}
${ac_uA}HAVE_SOCKET${ac_uB}HAVE_SOCKET${ac_uC}1${ac_uD}
${ac_uA}HAVE_INET_ATON${ac_uB}HAVE_INET_ATON${ac_uC}1${ac_uD}
......@@ -920,7 +919,6 @@ t clr
: clr
${ac_uA}HAVE_USLEEP${ac_uB}HAVE_USLEEP${ac_uC}1${ac_uD}
${ac_uA}CPU_CISC${ac_uB}CPU_CISC${ac_uC}1${ac_uD}
${ac_uA}HAVE_X86${ac_uB}HAVE_X86${ac_uC}1${ac_uD}
${ac_uA}ENABLE_DEBUGGING${ac_uB}ENABLE_DEBUGGING${ac_uC}1${ac_uD}
${ac_uA}ERR_REPORTING_STDOUT${ac_uB}ERR_REPORTING_STDOUT${ac_uC}1${ac_uD}
s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
......
......@@ -12,7 +12,7 @@ CC = gcc
INCDIR = -Iinclude -I$(srcdir)/include
DEFS = -DHAVE_CONFIG_H
CPPFLAGS=
CFLAGS = -Wall -O4 -fexpensive-optimizations -funroll-loops
CFLAGS = -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops
LIBS =
LDFLAGS = -L.
COMPILE = $(CC) $(DEFS) $(INCDIR) $(CPPFLAGS) $(CFLAGS)
......
......@@ -113,7 +113,7 @@
/* #undef HAVE_WINSOCK2_H */
/* Define to use X86 inlined assembly code */
#define HAVE_X86 1
/* #undef HAVE_X86 */
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
......@@ -131,7 +131,7 @@
#define PACKAGE_VERSION ""
/* The size of a `unsigned long', as computed by sizeof. */
#define SIZEOF_UNSIGNED_LONG 4
#define SIZEOF_UNSIGNED_LONG 8
/* The size of a `unsigned long long', as computed by sizeof. */
#define SIZEOF_UNSIGNED_LONG_LONG 8
......
......@@ -73,16 +73,20 @@ SWITCH_DECLARE(switch_port_t) switch_rtp_request_port(void);
\brief create a new RTP session handle
\param new_rtp_session a poiter to aim at the new session
\param payload the IANA payload number
\param packet_size the default packet_size
\param ms_per_packet time in microseconds per packet
\param flags flags to control behaviour
\param err a pointer to resolve error messages
\param pool a memory pool to use for the session
\return the new RTP session or NULL on failure
*/
SWITCH_DECLARE(switch_status)switch_rtp_create(switch_rtp **new_rtp_session,
int payload,
switch_rtp_flag_t flags,
const char **err,
switch_memory_pool *pool);
int payload,
switch_size_t packet_size,
uint32_t ms_per_packet,
switch_rtp_flag_t flags,
const char **err,
switch_memory_pool *pool);
/*!
......@@ -92,6 +96,8 @@ SWITCH_DECLARE(switch_status)switch_rtp_create(switch_rtp **new_rtp_session,
\param tx_host the remote address
\param tx_port the remote port
\param payload the IANA payload number
\param packet_size the default packet_size
\param ms_per_packet time in microseconds per packet
\param flags flags to control behaviour
\param err a pointer to resolve error messages
\param pool a memory pool to use for the session
......@@ -102,6 +108,8 @@ SWITCH_DECLARE(switch_rtp *)switch_rtp_new(char *rx_host,
char *tx_host,
switch_port_t tx_port,
int payload,
switch_size_t packet_size,
uint32_t ms_per_packet,
switch_rtp_flag_t flags,
const char **err,
switch_memory_pool *pool);
......@@ -151,6 +159,20 @@ SWITCH_DECLARE(switch_status) switch_rtp_activate_ice(switch_rtp *rtp_session, c
*/
SWITCH_DECLARE(switch_socket_t *)switch_rtp_get_rtp_socket(switch_rtp *rtp_session);
/*!
\brief Set the default packet size for a given RTP session
\param rtp_session the RTP session to set the packet size on
\param packet_size the new default packet size
*/
SWITCH_DECLARE(void) switch_rtp_set_default_packet_size(switch_rtp *rtp_session, uint32_t packet_size);
/*!
\brief Get the default packet size for a given RTP session
\param rtp_session the RTP session to get the packet size from
\return the default packet_size of the RTP session
*/
SWITCH_DECLARE(uint32_t) switch_rtp_get_default_packet_size(switch_rtp *rtp_session);
/*!
\brief Set the default payload number for a given RTP session
\param rtp_session the RTP session to set the payload number on
......
......@@ -98,13 +98,15 @@ SWITCH_DECLARE_DATA extern switch_directories SWITCH_GLOBAL_dirs;
\enum switch_rtp_flag_t
\brief RTP Related Flags
<pre>
SWITCH_RTP_NOBLOCK - Do not block
SWITCH_RTP_FLAG_IO - IO is ready
SWITCH_RTP_FLAG_NOBLOCK - Do not block
SWITCH_RTP_FLAG_IO - IO is ready
SWITCH_RTP_FLAG_USE_TIMER - Timeout Reads and replace with a CNG Frame
</pre>
*/
typedef enum {
SWITCH_RTP_NOBLOCK = ( 1 << 0),
SWITCH_RTP_FLAG_IO = (1 << 1)
SWITCH_RTP_FLAG_NOBLOCK = ( 1 << 0),
SWITCH_RTP_FLAG_IO = (1 << 1),
SWITCH_RTP_FLAG_USE_TIMER = (1 << 2)
} switch_rtp_flag_t;
/*!
......
......@@ -1286,6 +1286,8 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
tech_pvt->remote_ip,
tech_pvt->remote_port,
tech_pvt->codec_num,
tech_pvt->read_codec.implementation->encoded_bytes_per_frame,
tech_pvt->read_codec.implementation->microseconds_per_frame,
0,
&err, switch_core_session_get_pool(tech_pvt->session)))) {
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "RTP ERROR %s\n", err);
......
......@@ -479,6 +479,8 @@ static switch_status activate_rtp(struct private_object *tech_pvt)
tech_pvt->remote_sdp_audio_ip,
tech_pvt->remote_sdp_audio_port,
tech_pvt->read_codec.codec_interface->ianacode,
tech_pvt->read_codec.implementation->encoded_bytes_per_frame,
ms,
0,
&err, switch_core_session_get_pool(tech_pvt->session));
......
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论