Hello community, here is the log from the commit of package ortp for openSUSE:Factory checked in at 2015-08-25 07:18:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ortp (Old) and /work/SRC/openSUSE:Factory/.ortp.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ortp" Changes: -------- --- /work/SRC/openSUSE:Factory/ortp/ortp.changes 2015-08-10 09:12:10.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ortp.new/ortp.changes 2015-08-25 07:18:40.000000000 +0200 @@ -1,0 +2,29 @@ +Sat Aug 22 07:28:46 UTC 2015 - [email protected] + +- update to 0.24.2: + * Minor release v0.24.2 + * fix typo in rtcp_common_header_get padbit() macro definition + * Add option to enable/disable documentation generation when building with CMake. + * set correct dependency + * configure.ac: add --disable-documentation option to speed up dev builds + * re-add Requires field for devel rpm + * AVPF TMMBR/TMMBN: set correct ssrc to handle TMMBR in one-way video calls + * Release 0.24.1 + * devel package does not require explicit dependency + * also add epoch to devel rpm + * set rpm epoc to 1 to be alined with redhat rpm + * logging.c: split line into 3 + * Fix redefinition of WINAPI_FAMILY_PARTITION when using MinGW64 (thanks to Henrik Pauli for pointing this). + * increased the size of OrtpEventData.zrtp_sas.sas from 5 to 32 bytes to accomodate the B256 format SAS string + * add rtp_session_get_symmetric_rtp + * Define the "Additional #using Directories" when building winrttimer.cpp for Windows Phone. + * improve logging + * Fix last commit + allow use of C++. + * Begin handling of build for Windows Phone with CMake. + * Do not use absolute path in install instruction of CMake. + * Fix crash with RTPFB and PSFB packets scheduling. + * avoid uninstall to fail if nothing was installed before + * Add support for TMMBR and TMMBN feedback messages (part of RFC 5104). + * Fix possible receive bandwidth computation imprecision. + +------------------------------------------------------------------- Old: ---- ortp-0.24.0.tar.gz New: ---- ortp-0.24.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ortp.spec ++++++ --- /var/tmp/diff_new_pack.CS1tGU/_old 2015-08-25 07:18:41.000000000 +0200 +++ /var/tmp/diff_new_pack.CS1tGU/_new 2015-08-25 07:18:41.000000000 +0200 @@ -19,7 +19,7 @@ %define lname libortp9 Name: ortp -Version: 0.24.0 +Version: 0.24.2 Release: 0 Summary: Real-time Transport Protocol Stack License: LGPL-2.1+ ++++++ ortp-0.24.0.tar.gz -> ortp-0.24.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ortp-0.24.0/Makefile.am new/ortp-0.24.2/Makefile.am --- old/ortp-0.24.0/Makefile.am 2015-01-30 10:36:41.000000000 +0100 +++ new/ortp-0.24.2/Makefile.am 2015-05-07 17:15:16.000000000 +0200 @@ -37,7 +37,7 @@ cd $(DESTDIR)$(doc_htmldir) && tar xf html.tar && rm -f html.tar uninstall-hook: - cd $(DESTDIR)$(doc_htmldir) && rm -f * + - cd $(DESTDIR)$(doc_htmldir) && rm -f * endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ortp-0.24.0/Makefile.in new/ortp-0.24.2/Makefile.in --- old/ortp-0.24.0/Makefile.in 2015-03-11 17:47:54.000000000 +0100 +++ new/ortp-0.24.2/Makefile.in 2015-05-07 17:21:56.000000000 +0200 @@ -196,7 +196,7 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/ortp-config.h.in \ $(srcdir)/ortp.doxygen.in $(srcdir)/ortp.pc.in \ $(srcdir)/ortp.spec.in AUTHORS COPYING ChangeLog INSTALL NEWS \ - README TODO compile config.guess config.sub depcomp install-sh \ + README TODO compile config.guess config.sub install-sh \ ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) @@ -984,7 +984,7 @@ @HAVE_DOXYGEN_TRUE@ cd $(DESTDIR)$(doc_htmldir) && tar xf html.tar && rm -f html.tar @HAVE_DOXYGEN_TRUE@uninstall-hook: -@HAVE_DOXYGEN_TRUE@ cd $(DESTDIR)$(doc_htmldir) && rm -f * +@HAVE_DOXYGEN_TRUE@ - cd $(DESTDIR)$(doc_htmldir) && rm -f * # `make rpm' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ortp-0.24.0/NEWS new/ortp-0.24.2/NEWS --- old/ortp-0.24.0/NEWS 2015-03-11 16:19:39.000000000 +0100 +++ new/ortp-0.24.2/NEWS 2015-05-07 17:15:16.000000000 +0200 @@ -1,3 +1,9 @@ +May 6, 2015: ortp-0.24.2 + - Bug fixes + +Mar 31, 2015: ortp-0.24.1 + - Add support of TMMBR and TMMBN (RFC 5104) + Mar 11, 2015: ortp-0.24.0 - RTCP send algorithm as describe in RFC3550 - RTCP XR (RFC3611) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ortp-0.24.0/configure new/ortp-0.24.2/configure --- old/ortp-0.24.0/configure 2015-03-11 17:47:55.000000000 +0100 +++ new/ortp-0.24.2/configure 2015-05-07 17:21:57.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for ortp 0.24.0. +# Generated by GNU Autoconf 2.69 for ortp 0.24.2. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ # Identity of this package. PACKAGE_NAME='ortp' PACKAGE_TARNAME='ortp' -PACKAGE_VERSION='0.24.0' -PACKAGE_STRING='ortp 0.24.0' +PACKAGE_VERSION='0.24.2' +PACKAGE_STRING='ortp 0.24.2' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -810,6 +810,7 @@ enable_memcheck enable_ssl_hmac enable_tests +enable_doxygen ' ac_precious_vars='build_alias host_alias @@ -1361,7 +1362,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ortp 0.24.0 to adapt to many kinds of systems. +\`configure' configures ortp 0.24.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1432,7 +1433,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ortp 0.24.0:";; + short | recursive ) echo "Configuration of ortp 0.24.2:";; esac cat <<\_ACEOF @@ -1462,6 +1463,8 @@ --enable-memcheck Enable memory leak detection (HPUX only) --enable-ssl-hmac Enable use of ssl/hmac for stun (default=no) --disable-tests Disable compilation of tests + --disable-documentation Disable documentation generation using doxygen + (default=no) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1555,7 +1558,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ortp configure 0.24.0 +ortp configure 0.24.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1920,7 +1923,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ortp $as_me 0.24.0, which was +It was created by ortp $as_me 0.24.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2925,7 +2928,7 @@ # Define the identity of the package. PACKAGE='ortp' - VERSION='0.24.0' + VERSION='0.24.2' cat >>confdefs.h <<_ACEOF @@ -4246,8 +4249,8 @@ -macro_version='2.4.5' -macro_revision='2.4.5' +macro_version='2.4.6' +macro_revision='2.4.6' @@ -7635,7 +7638,7 @@ x) ;; *:) - eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \S|@1\" + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" @@ -11734,13 +11737,20 @@ sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi -# lt_cv_sys_lib... is unaugmented for libtool script decls... -lt_cv_sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec -# ..but sys_lib_... needs LT_SYS_LIBRARY_PATH munging for -# LT_SYS_DLSEARCH_PATH macro in ltdl.m4 to work with the correct paths: +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + @@ -13576,6 +13586,67 @@ ;; esac +# Check whether --enable-doxygen was given. +if test "${enable_doxygen+set}" = set; then : + enableval=$enable_doxygen; case "${enableval}" in + yes) documentation_enabled=yes;; + no) documentation_enabled=no;; + *) as_fn_error $? "\"Bad value for --disable-documentation\"" "$LINENO" 5;; + esac +else + documentation_enabled=yes + +fi + +if test "$documentation_enabled" = "yes" ; then + # Extract the first word of "doxygen", so it can be a program name with args. +set dummy doxygen; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DOXYGEN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DOXYGEN"; then + ac_cv_prog_DOXYGEN="$DOXYGEN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DOXYGEN="doxygen" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_DOXYGEN" && ac_cv_prog_DOXYGEN="false" +fi +fi +DOXYGEN=$ac_cv_prog_DOXYGEN +if test -n "$DOXYGEN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOXYGEN" >&5 +$as_echo "$DOXYGEN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +else + DOXYGEN=false +fi + if test "$DOXYGEN" != "false"; then + HAVE_DOXYGEN_TRUE= + HAVE_DOXYGEN_FALSE='#' +else + HAVE_DOXYGEN_TRUE='#' + HAVE_DOXYGEN_FALSE= +fi # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; ac_word=$2 @@ -13969,6 +14040,10 @@ as_fn_error $? "conditional \"HAVE_DOXYGEN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_DOXYGEN_TRUE}" && test -z "${HAVE_DOXYGEN_FALSE}"; then + as_fn_error $? "conditional \"HAVE_DOXYGEN\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${WITH_EPM_TRUE}" && test -z "${WITH_EPM_FALSE}"; then as_fn_error $? "conditional \"WITH_EPM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -14370,7 +14445,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ortp $as_me 0.24.0, which was +This file was extended by ortp $as_me 0.24.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14436,7 +14511,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -ortp config.status 0.24.0 +ortp config.status 0.24.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -14693,7 +14768,8 @@ finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_lib_dlsearch_path_spec='`$ECHO "$lt_cv_sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' +configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' @@ -14812,7 +14888,8 @@ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ -lt_cv_sys_lib_dlsearch_path_spec; do +configure_time_dlsearch_path \ +configure_time_lt_sys_library_path; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes @@ -15605,7 +15682,7 @@ available_tags='' # Configured defaults for sys_lib_dlsearch_path munging. -: \${LT_SYS_LIBRARY_PATH="$LT_SYS_LIBRARY_PATH"} +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG @@ -15859,8 +15936,11 @@ # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -# Run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_lt_cv_sys_lib_dlsearch_path_spec +# Detected run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path + +# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. +configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen @@ -16012,9 +16092,8 @@ _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" -## -------------------------------------- ## -## Shell functions shared with configure. ## -## -------------------------------------- ## + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- @@ -16036,7 +16115,7 @@ x) ;; *:) - eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \S|@1\" + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" @@ -16067,6 +16146,8 @@ } +# ### END FUNCTIONS SHARED WITH CONFIGURE + _LT_EOF case $host_os in diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ortp-0.24.0/configure.ac new/ortp-0.24.2/configure.ac --- old/ortp-0.24.0/configure.ac 2015-03-11 16:19:21.000000000 +0100 +++ new/ortp-0.24.2/configure.ac 2015-05-07 17:15:16.000000000 +0200 @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([ortp],[0.24.0]) +AC_INIT([ortp],[0.24.2]) AC_CANONICAL_SYSTEM case $INSTALL in @@ -321,7 +321,21 @@ dnl ################################################## dnl # Check for doxygen dnl ################################################## - +AC_ARG_ENABLE(doxygen, + [AS_HELP_STRING([--disable-documentation], [Disable documentation generation using doxygen (default=no)])], + [case "${enableval}" in + yes) documentation_enabled=yes;; + no) documentation_enabled=no;; + *) AC_MSG_ERROR("Bad value for --disable-documentation");; + esac], + [documentation_enabled=yes] +) +if test "$documentation_enabled" = "yes" ; then + AC_CHECK_PROG(DOXYGEN,doxygen,doxygen,false) +else + DOXYGEN=false +fi +AM_CONDITIONAL(HAVE_DOXYGEN, test "$DOXYGEN" != "false") AC_CHECK_PROG(DOXYGEN,doxygen,doxygen,false) AM_CONDITIONAL(HAVE_DOXYGEN, test "$DOXYGEN" != "false") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ortp-0.24.0/include/ortp/event.h new/ortp-0.24.2/include/ortp/event.h --- old/ortp-0.24.0/include/ortp/event.h 2015-01-30 10:36:41.000000000 +0100 +++ new/ortp-0.24.2/include/ortp/event.h 2015-05-07 17:15:16.000000000 +0200 @@ -42,11 +42,12 @@ bool_t dtls_stream_encrypted; bool_t zrtp_stream_encrypted; struct _ZrtpSas{ - char sas[5]; // 4 characters + char sas[32]; // up to 31 + null characters bool_t verified; } zrtp_sas; OrtpSocketType socket_type; bool_t ice_processing_successful; + uint64_t tmmbr_mxtbr; } info; }; @@ -74,6 +75,7 @@ #define ORTP_EVENT_ICE_LOSING_PAIRS_COMPLETED 11 #define ORTP_EVENT_ICE_RESTART_NEEDED 12 #define ORTP_EVENT_DTLS_ENCRYPTION_CHANGED 13 +#define ORTP_EVENT_TMMBR_RECEIVED 14 ORTP_PUBLIC OrtpEventData * ortp_event_get_data(OrtpEvent *ev); ORTP_PUBLIC void ortp_event_destroy(OrtpEvent *ev); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ortp-0.24.0/include/ortp/port.h new/ortp-0.24.2/include/ortp/port.h --- old/ortp-0.24.0/include/ortp/port.h 2015-03-10 10:11:45.000000000 +0100 +++ new/ortp-0.24.2/include/ortp/port.h 2015-05-07 17:15:16.000000000 +0200 @@ -126,7 +126,7 @@ #include <winsock2.h> #include <ws2tcpip.h> -#if defined(__MINGW32__) || !defined(WINAPI_FAMILY_PARTITION) +#if !defined(WINAPI_FAMILY_PARTITION) // Only use with x being WINAPI_PARTITION_DESKTOP to test if building on desktop #define WINAPI_FAMILY_PARTITION(x) 1 #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ortp-0.24.0/include/ortp/rtcp.h new/ortp-0.24.2/include/ortp/rtcp.h --- old/ortp-0.24.0/include/ortp/rtcp.h 2015-03-10 10:11:45.000000000 +0100 +++ new/ortp-0.24.2/include/ortp/rtcp.h 2015-05-07 17:15:16.000000000 +0200 @@ -71,7 +71,7 @@ #define rtcp_common_header_set_length(ch,l) (ch)->length=htons(l) #define rtcp_common_header_get_version(ch) ((ch)->version) -#define rtcp_common_header_get padbit(ch) ((ch)->padbit) +#define rtcp_common_header_get_padbit(ch) ((ch)->padbit) #define rtcp_common_header_get_rc(ch) ((ch)->rc) #define rtcp_common_header_get_packet_type(ch) ((ch)->packet_type) #define rtcp_common_header_get_length(ch) ntohs((ch)->length) @@ -292,6 +292,12 @@ #define MIN_RTCP_XR_PACKET_SIZE (sizeof(rtcp_xr_header_t) + 4) typedef enum { + RTCP_RTPFB_NACK = 1, + RTCP_RTPFB_TMMBR = 3, + RTCP_RTPFB_TMMBN = 4 +} rtcp_rtpfb_type_t; + +typedef enum { RTCP_PSFB_PLI = 1, RTCP_PSFB_SLI = 2, RTCP_PSFB_RPSI = 3, @@ -304,6 +310,25 @@ uint32_t media_source_ssrc; } rtcp_fb_header_t; +typedef struct rtcp_fb_tmmbr_fci { + uint32_t ssrc; + uint32_t value; +} rtcp_fb_tmmbr_fci_t; + +#define rtcp_fb_tmmbr_fci_get_ssrc(tmmbr) ntohl((tmmbr)->ssrc) +#define rtcp_fb_tmmbr_fci_get_mxtbr_exp(tmmbr) \ + ((uint8_t)((ntohl((tmmbr)->value) >> 26) & 0x0000003F)) +#define rtcp_fb_tmmbr_fci_set_mxtbr_exp(tmmbr, mxtbr_exp) \ + ((tmmbr)->value) = htonl((ntohl((tmmbr)->value) & 0x03FFFFFF) | (((mxtbr_exp) & 0x0000003F) << 26)) +#define rtcp_fb_tmmbr_fci_get_mxtbr_mantissa(tmmbr) \ + ((uint32_t)((ntohl((tmmbr)->value) >> 9) & 0x0001FFFF)) +#define rtcp_fb_tmmbr_fci_set_mxtbr_mantissa(tmmbr, mxtbr_mantissa) \ + ((tmmbr)->value) = htonl((ntohl((tmmbr)->value) & 0xFC0001FF) | (((mxtbr_mantissa) & 0x0001FFFF) << 9)) +#define rtcp_fb_tmmbr_fci_get_measured_overhead(tmmbr) \ + ((uint16_t)(ntohl((tmmbr)->value) & 0x000001FF)) +#define rtcp_fb_tmmbr_fci_set_measured_overhead(tmmbr, measured_overhead) \ + ((tmmbr)->value) = htonl((ntohl((tmmbr)->value) & 0xFFFFFE00) | ((measured_overhead) & 0x000001FF)) + typedef struct rtcp_fb_fir_fci { uint32_t ssrc; uint8_t seq_nr; @@ -341,6 +366,7 @@ #define rtcp_fb_rpsi_fci_get_bit_string(fci) ((uint8_t *)(fci)->bit_string) #define MIN_RTCP_PSFB_PACKET_SIZE (sizeof(rtcp_common_header_t) + sizeof(rtcp_fb_header_t)) +#define MIN_RTCP_RTPFB_PACKET_SIZE (sizeof(rtcp_common_header_t) + sizeof(rtcp_fb_header_t)) @@ -457,6 +483,13 @@ ORTP_PUBLIC uint16_t rtcp_XR_voip_metrics_get_jb_maximum(const mblk_t *m); ORTP_PUBLIC uint16_t rtcp_XR_voip_metrics_get_jb_abs_max(const mblk_t *m); +/* RTCP RTPFB accessors */ +ORTP_PUBLIC bool_t rtcp_is_RTPFB(const mblk_t *m); +ORTP_PUBLIC rtcp_rtpfb_type_t rtcp_RTPFB_get_type(const mblk_t *m); +ORTP_PUBLIC rtcp_fb_tmmbr_fci_t * rtcp_RTPFB_tmmbr_get_fci(const mblk_t *m); +ORTP_PUBLIC uint32_t rtcp_RTPFB_get_packet_sender_ssrc(const mblk_t *m); +ORTP_PUBLIC uint32_t rtcp_RTPFB_get_media_source_ssrc(const mblk_t *m); + /* RTCP PSFB accessors */ ORTP_PUBLIC bool_t rtcp_is_PSFB(const mblk_t *m); ORTP_PUBLIC rtcp_psfb_type_t rtcp_PSFB_get_type(const mblk_t *m); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ortp-0.24.0/include/ortp/rtpsession.h new/ortp-0.24.2/include/ortp/rtpsession.h --- old/ortp-0.24.0/include/ortp/rtpsession.h 2015-03-02 11:57:11.000000000 +0100 +++ new/ortp-0.24.2/include/ortp/rtpsession.h 2015-05-07 17:15:16.000000000 +0200 @@ -42,6 +42,9 @@ #include <ortp/event.h> +#define ORTP_AVPF_FEATURE_NONE 0 +#define ORTP_AVPF_FEATURE_TMMBR (1 << 0) + typedef enum { RTP_SESSION_RECVONLY, @@ -175,6 +178,8 @@ bool_t initialized; /* Whether the RTCP send algorithm is fully initialized. */ bool_t initial; bool_t allow_early; + bool_t tmmbr_scheduled; + bool_t tmmbn_scheduled; } OrtpRtcpSendAlgorithm; #define ORTP_RTCP_XR_UNAVAILABLE_PARAMETER 127 @@ -247,6 +252,11 @@ uint32_t discarded_count; } OrtpRtcpXrStats; +typedef struct OrtpRtcpTmmbrInfo { + mblk_t *sent; + mblk_t *received; +} OrtpRtcpTmmbrInfo; + typedef struct _OrtpAddress{ struct sockaddr_storage addr; socklen_t len; @@ -317,6 +327,7 @@ OrtpRtcpSendAlgorithm send_algo; OrtpRtcpXrConfiguration xr_conf; OrtpRtcpXrMediaCallbacks xr_media_callbacks; + OrtpRtcpTmmbrInfo tmmbr_info; bool_t enabled; /*tells whether we can send RTCP packets */ bool_t rtcp_xr_dlrr_to_send; uint8_t rtcp_fb_fir_seq_nr; /* The FIR command sequence number */ @@ -390,6 +401,7 @@ bool_t use_connect; /* use connect() on the socket */ bool_t ssrc_set; bool_t reuseaddr; /*setsockopt SO_REUSEADDR */ + unsigned char avpf_features; /**< A bitmask of ORTP_AVPF_FEATURE_* macros. */ }; @@ -485,6 +497,8 @@ ORTP_PUBLIC void rtp_session_set_symmetric_rtp (RtpSession * session, bool_t yesno); +ORTP_PUBLIC bool_t rtp_session_get_symmetric_rtp (const RtpSession * session); + ORTP_PUBLIC void rtp_session_set_connected_mode(RtpSession *session, bool_t yesno); ORTP_PUBLIC void rtp_session_enable_rtcp(RtpSession *session, bool_t yesno); @@ -592,12 +606,18 @@ ORTP_PUBLIC bool_t rtp_session_avpf_enabled(RtpSession *session); +ORTP_PUBLIC bool_t rtp_session_avpf_payload_type_feature_enabled(RtpSession *session, unsigned char feature); ORTP_PUBLIC bool_t rtp_session_avpf_feature_enabled(RtpSession *session, unsigned char feature); +ORTP_PUBLIC void rtp_session_enable_avpf_feature(RtpSession *session, unsigned char feature, bool_t enable); ORTP_PUBLIC uint16_t rtp_session_get_avpf_rr_interval(RtpSession *session); +ORTP_PUBLIC bool_t rtp_session_rtcp_psfb_scheduled(RtpSession *session, rtcp_psfb_type_t type); +ORTP_PUBLIC bool_t rtp_session_rtcp_rtpfb_scheduled(RtpSession *session, rtcp_rtpfb_type_t type); ORTP_PUBLIC void rtp_session_send_rtcp_fb_pli(RtpSession *session); ORTP_PUBLIC void rtp_session_send_rtcp_fb_fir(RtpSession *session); ORTP_PUBLIC void rtp_session_send_rtcp_fb_sli(RtpSession *session, uint16_t first, uint16_t number, uint8_t picture_id); ORTP_PUBLIC void rtp_session_send_rtcp_fb_rpsi(RtpSession *session, uint8_t *bit_string, uint16_t bit_string_len); +ORTP_PUBLIC void rtp_session_send_rtcp_fb_tmmbr(RtpSession *session, uint64_t mxtbr); +ORTP_PUBLIC void rtp_session_send_rtcp_fb_tmmbn(RtpSession *session, uint32_t ssrc); /*private */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ortp-0.24.0/ltmain.sh new/ortp-0.24.2/ltmain.sh --- old/ortp-0.24.0/ltmain.sh 2015-01-30 10:37:07.000000000 +0100 +++ new/ortp-0.24.2/ltmain.sh 2015-05-07 17:21:49.000000000 +0200 @@ -2,7 +2,7 @@ ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 -# libtool (GNU libtool) 2.4.5 +# libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit <[email protected]>, 1996 @@ -31,8 +31,8 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.5 -package_revision=2.4.5 +VERSION=2.4.6 +package_revision=2.4.6 ## ------ ## @@ -64,7 +64,7 @@ # libraries, which are installed to $pkgauxdir. # Set a version string for this script. -scriptversion=2014-01-03.01; # UTC +scriptversion=2015-01-20.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 @@ -192,7 +192,7 @@ _G_path_prog_max=0 _G_path_prog_found=false - _G_save_IFS=$IFS; IFS=$PATH_SEPARATOR + _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. @@ -1977,7 +1977,7 @@ # End: # Set a version string. -scriptversion='(GNU libtool) 2.4.5' +scriptversion='(GNU libtool) 2.4.6' # func_echo ARG... @@ -2039,7 +2039,12 @@ " # Additional text appended to 'usage_message' in response to '--help'. -long_help_message=$long_help_message" +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$long_help_message MODE must be one of the following: @@ -2063,13 +2068,15 @@ compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.4.5 + version: $progname (GNU libtool) 2.4.6 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to <[email protected]>. GNU libtool home page: <http://www.gnu.org/software/libtool/>. General help using GNU software: <http://www.gnu.org/gethelp/>." + exit 0 +} # func_lo2o OBJECT-NAME diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ortp-0.24.0/m4/libtool.m4 new/ortp-0.24.2/m4/libtool.m4 --- old/ortp-0.24.0/m4/libtool.m4 2015-01-30 10:37:07.000000000 +0100 +++ new/ortp-0.24.2/m4/libtool.m4 2015-05-07 17:21:49.000000000 +0200 @@ -738,7 +738,7 @@ _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. -: \${LT_SYS_LIBRARY_PATH="$LT_SYS_LIBRARY_PATH"} +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS @@ -748,13 +748,14 @@ _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" -## -------------------------------------- ## -## Shell functions shared with configure. ## -## -------------------------------------- ## + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME +# ### END FUNCTIONS SHARED WITH CONFIGURE + _LT_EOF case $host_os in @@ -2256,7 +2257,7 @@ x) ;; *:) - eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \$@S|@1\" + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" @@ -3100,13 +3101,15 @@ sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi -# lt_cv_sys_lib... is unaugmented for libtool script decls... -lt_cv_sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec -# ..but sys_lib_... needs LT_SYS_LIBRARY_PATH munging for -# LT_SYS_DLSEARCH_PATH macro in ltdl.m4 to work with the correct paths: +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) @@ -3139,8 +3142,10 @@ [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) -_LT_DECL([sys_lib_dlsearch_path_spec], [lt_cv_sys_lib_dlsearch_path_spec], [2], - [Run-time system search path for libraries]) +_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], + [Detected run-time system search path for libraries]) +_LT_DECL([], [configure_time_lt_sys_library_path], [2], + [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ortp-0.24.0/m4/ltversion.m4 new/ortp-0.24.2/m4/ltversion.m4 --- old/ortp-0.24.0/m4/ltversion.m4 2015-01-30 10:37:07.000000000 +0100 +++ new/ortp-0.24.2/m4/ltversion.m4 2015-05-07 17:21:49.000000000 +0200 @@ -9,15 +9,15 @@ # @configure_input@ -# serial 4171 ltversion.m4 +# serial 4179 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.5]) -m4_define([LT_PACKAGE_REVISION], [2.4.5]) +m4_define([LT_PACKAGE_VERSION], [2.4.6]) +m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.5' -macro_revision='2.4.5' +[macro_version='2.4.6' +macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ortp-0.24.0/ortp.doxygen new/ortp-0.24.2/ortp.doxygen --- old/ortp-0.24.0/ortp.doxygen 2015-03-11 17:47:59.000000000 +0100 +++ new/ortp-0.24.2/ortp.doxygen 2015-05-07 17:22:01.000000000 +0200 @@ -4,7 +4,7 @@ # Project related configuration options #--------------------------------------------------------------------------- PROJECT_NAME = oRTP -PROJECT_NUMBER = 0.24.0 +PROJECT_NUMBER = 0.24.2 OUTPUT_DIRECTORY = doc CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ortp-0.24.0/ortp.spec new/ortp-0.24.2/ortp.spec --- old/ortp-0.24.0/ortp.spec 2015-03-11 17:47:59.000000000 +0100 +++ new/ortp-0.24.2/ortp.spec 2015-05-07 17:22:01.000000000 +0200 @@ -25,8 +25,10 @@ Summary: Real-time Transport Protocol Stack Name: %pkg_name -Version: 0.24.0 +Version: 0.24.2 Release: %(git describe --tags --abbrev=40 | sed -rn 's/^.*-([0-9]+)-g[a-z0-9]{40}$/\1/p' || echo '1')%{?dist} +#to be alined with redhat which changed epoc to 1 for an unknown reason +Epoch: 1 License: LGPL Group: Applications/Communications URL: http://linphone.org/ortp/ @@ -44,8 +46,10 @@ %package devel Summary: Headers, libraries and docs for the oRTP library Group: Development/Libraries -Requires: %{name} = %{version}-%{release} BuildRequires: doxygen +#to be alined with redhat which changed epoc to 1 for an unknown reason +Epoch: 1 +Requires: %{name} = %{epoch}:%{version}-%{release} %description devel oRTP is a LGPL licensed C library implementing the RTP protocol diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ortp-0.24.0/ortp.spec.in new/ortp-0.24.2/ortp.spec.in --- old/ortp-0.24.0/ortp.spec.in 2015-01-30 10:36:41.000000000 +0100 +++ new/ortp-0.24.2/ortp.spec.in 2015-05-07 17:15:16.000000000 +0200 @@ -27,6 +27,8 @@ Name: %pkg_name Version: @ORTP_PKGCONFIG_VERSION@ Release: %(git describe --tags --abbrev=40 | sed -rn 's/^.*-([0-9]+)-g[a-z0-9]{40}$/\1/p' || echo '1')%{?dist} +#to be alined with redhat which changed epoc to 1 for an unknown reason +Epoch: 1 License: LGPL Group: Applications/Communications URL: http://linphone.org/ortp/ @@ -44,8 +46,10 @@ %package devel Summary: Headers, libraries and docs for the oRTP library Group: Development/Libraries -Requires: %{name} = %{version}-%{release} BuildRequires: doxygen +#to be alined with redhat which changed epoc to 1 for an unknown reason +Epoch: 1 +Requires: %{name} = %{epoch}:%{version}-%{release} %description devel oRTP is a LGPL licensed C library implementing the RTP protocol diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ortp-0.24.0/src/logging.c new/ortp-0.24.2/src/logging.c --- old/ortp-0.24.0/src/logging.c 2015-03-10 10:11:45.000000000 +0100 +++ new/ortp-0.24.2/src/logging.c 2015-05-07 17:15:16.000000000 +0200 @@ -274,7 +274,9 @@ } #endif #endif - fprintf(__log_file,"%i-%.2i-%.2i %.2i:%.2i:%.2i:%.3i ortp-%s-%s" ENDLINE,1900+lt->tm_year,1+lt->tm_mon,lt->tm_mday,lt->tm_hour,lt->tm_min,lt->tm_sec,(int)(tp.tv_usec/1000), lname,msg); + fprintf(__log_file,"%i-%.2i-%.2i %.2i:%.2i:%.2i:%.3i ortp-%s-%s" ENDLINE + ,1900+lt->tm_year,1+lt->tm_mon,lt->tm_mday,lt->tm_hour,lt->tm_min,lt->tm_sec + ,(int)(tp.tv_usec/1000), lname,msg); fflush(__log_file); ortp_free(msg); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ortp-0.24.0/src/netsim.c new/ortp-0.24.2/src/netsim.c --- old/ortp-0.24.0/src/netsim.c 2015-03-10 10:11:45.000000000 +0100 +++ new/ortp-0.24.2/src/netsim.c 2015-05-07 17:15:16.000000000 +0200 @@ -57,6 +57,17 @@ ortp_free(sim); } +#ifndef WIN32 +static const char *sched_policy_to_string(int policy){ + switch(policy){ + case SCHED_OTHER: return "SCHED_OTHER"; + case SCHED_RR: return "SCHED_RR"; + case SCHED_FIFO: return "SCHED_FIFO"; + } + return "SCHED_INVALID"; +} +#endif + static void set_high_prio(){ #ifndef WIN32 const char *sched_pref=getenv("ORTP_SIMULATOR_SCHED_POLICY"); @@ -86,8 +97,8 @@ if((result=pthread_setschedparam(pthread_self(),policy, ¶m))) { ortp_warning("Ortp simulator: set pthread_setschedparam failed: %s",strerror(result)); } else { - ortp_message("Priority set to %i and value (%i)", - policy, param.sched_priority); + ortp_message("ortp network simulator: sched policy set to %s and priority value (%i)", + sched_policy_to_string(policy), param.sched_priority); } #endif } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ortp-0.24.0/src/rtcp.c new/ortp-0.24.2/src/rtcp.c --- old/ortp-0.24.0/src/rtcp.c 2015-01-30 10:36:41.000000000 +0100 +++ new/ortp-0.24.2/src/rtcp.c 2015-05-07 17:15:16.000000000 +0200 @@ -430,6 +430,17 @@ concatb(m, session->rtcp.send_algo.fb_packets); session->rtcp.send_algo.fb_packets = NULL; } + + /* Repeat TMMBR packets until they are acknowledged with a TMMBN unless a TMMBN is being sent. */ + if (rtp_session_avpf_feature_enabled(session, ORTP_AVPF_FEATURE_TMMBR) + && (session->rtcp.tmmbr_info.sent != NULL) + && (session->rtcp.send_algo.tmmbr_scheduled != TRUE) + && (session->rtcp.send_algo.tmmbn_scheduled != TRUE)) { + concatb(m, copymsg(session->rtcp.tmmbr_info.sent)); + } + + session->rtcp.send_algo.tmmbr_scheduled = FALSE; + session->rtcp.send_algo.tmmbn_scheduled = FALSE; } static void rtp_session_create_and_send_rtcp_packet(RtpSession *session, bool_t full) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ortp-0.24.0/src/rtcp_fb.c new/ortp-0.24.2/src/rtcp_fb.c --- old/ortp-0.24.0/src/rtcp_fb.c 2015-01-30 10:36:41.000000000 +0100 +++ new/ortp-0.24.2/src/rtcp_fb.c 2015-05-07 17:15:16.000000000 +0200 @@ -170,10 +170,88 @@ return h; } -static bool_t rtp_session_rtcp_fb_scheduled(RtpSession *session, rtcp_psfb_type_t type) { +static mblk_t * make_rtcp_fb_tmmbr(RtpSession *session, uint64_t mxtbr, uint16_t measured_overhead) { + int size = sizeof(rtcp_common_header_t) + sizeof(rtcp_fb_header_t) + sizeof(rtcp_fb_tmmbr_fci_t); + mblk_t *h = allocb(size, 0); + rtcp_common_header_t *ch; + rtcp_fb_header_t *fbh; + rtcp_fb_tmmbr_fci_t *fci; + uint8_t mxtbr_exp = 0; + uint32_t mxtbr_mantissa = 0; + + /* Compute mxtbr exp and mantissa */ + while (mxtbr >= (1 << 17)) { + mxtbr >>= 1; + mxtbr_exp++; + } + mxtbr_mantissa = mxtbr & 0x0001FFFF; + + /* Fill TMMBR */ + ch = (rtcp_common_header_t *)h->b_wptr; + h->b_wptr += sizeof(rtcp_common_header_t); + fbh = (rtcp_fb_header_t *)h->b_wptr; + h->b_wptr += sizeof(rtcp_fb_header_t); + fci = (rtcp_fb_tmmbr_fci_t *)h->b_wptr; + h->b_wptr += sizeof(rtcp_fb_tmmbr_fci_t); + fbh->packet_sender_ssrc = htonl(rtp_session_get_send_ssrc(session)); + fbh->media_source_ssrc = htonl(0); + fci->ssrc = htonl(rtp_session_get_recv_ssrc(session)); + rtcp_fb_tmmbr_fci_set_mxtbr_exp(fci, mxtbr_exp); + rtcp_fb_tmmbr_fci_set_mxtbr_mantissa(fci, mxtbr_mantissa); + rtcp_fb_tmmbr_fci_set_measured_overhead(fci, measured_overhead); + + /* Fill common header */ + rtcp_common_header_init(ch, session, RTCP_RTPFB, RTCP_RTPFB_TMMBR, msgdsize(h)); + + /* Store packet to be able to retransmit. */ + if (session->rtcp.tmmbr_info.sent) freemsg(session->rtcp.tmmbr_info.sent); + session->rtcp.tmmbr_info.sent = copymsg(h); + + return h; +} + +static mblk_t * make_rtcp_fb_tmmbn(RtpSession *session, uint32_t ssrc) { + int size = sizeof(rtcp_common_header_t) + sizeof(rtcp_fb_header_t) + sizeof(rtcp_fb_tmmbr_fci_t); + mblk_t *h = allocb(size, 0); + rtcp_common_header_t *ch; + rtcp_fb_header_t *fbh; + rtcp_fb_tmmbr_fci_t *fci; + + if (!session->rtcp.tmmbr_info.received) return NULL; + + /* Fill TMMBN */ + ch = (rtcp_common_header_t *)h->b_wptr; + h->b_wptr += sizeof(rtcp_common_header_t); + fbh = (rtcp_fb_header_t *)h->b_wptr; + h->b_wptr += sizeof(rtcp_fb_header_t); + fci = (rtcp_fb_tmmbr_fci_t *)h->b_wptr; + h->b_wptr += sizeof(rtcp_fb_tmmbr_fci_t); + fbh->packet_sender_ssrc = htonl(rtp_session_get_send_ssrc(session)); + fbh->media_source_ssrc = htonl(0); + memcpy(fci, rtcp_RTPFB_tmmbr_get_fci(session->rtcp.tmmbr_info.received), sizeof(rtcp_fb_tmmbr_fci_t)); + fci->ssrc = htonl(ssrc); + + /* Fill common header */ + rtcp_common_header_init(ch, session, RTCP_RTPFB, RTCP_RTPFB_TMMBN, msgdsize(h)); + + return h; +} + +bool_t rtp_session_rtcp_psfb_scheduled(RtpSession *session, rtcp_psfb_type_t type) { + mblk_t *m = session->rtcp.send_algo.fb_packets; + while (m != NULL) { + if ((rtcp_is_PSFB_internal(m) == TRUE) && (rtcp_PSFB_get_type(m) == type)) { + return TRUE; + } + m = m->b_cont; + } + return FALSE; +} + +bool_t rtp_session_rtcp_rtpfb_scheduled(RtpSession *session, rtcp_rtpfb_type_t type) { mblk_t *m = session->rtcp.send_algo.fb_packets; while (m != NULL) { - if (rtcp_PSFB_get_type(m) == type) { + if ((rtcp_is_RTPFB_internal(m) == TRUE) && (rtcp_RTPFB_get_type(m) == type)) { return TRUE; } m = m->b_cont; @@ -183,8 +261,8 @@ void rtp_session_send_rtcp_fb_pli(RtpSession *session) { mblk_t *m; - if ((rtp_session_avpf_enabled(session) == TRUE) && (rtp_session_avpf_feature_enabled(session, PAYLOAD_TYPE_AVPF_PLI) == TRUE)) { - if (rtp_session_rtcp_fb_scheduled(session, RTCP_PSFB_PLI) != TRUE) { + if ((rtp_session_avpf_enabled(session) == TRUE) && (rtp_session_avpf_payload_type_feature_enabled(session, PAYLOAD_TYPE_AVPF_PLI) == TRUE)) { + if (rtp_session_rtcp_psfb_scheduled(session, RTCP_PSFB_PLI) != TRUE) { m = make_rtcp_fb_pli(session); rtp_session_add_fb_packet_to_send(session, m); } @@ -196,8 +274,8 @@ void rtp_session_send_rtcp_fb_fir(RtpSession *session) { mblk_t *m; - if ((rtp_session_avpf_enabled(session) == TRUE) && (rtp_session_avpf_feature_enabled(session, PAYLOAD_TYPE_AVPF_FIR) == TRUE)) { - if (rtp_session_rtcp_fb_scheduled(session, RTCP_PSFB_FIR) != TRUE) { + if ((rtp_session_avpf_enabled(session) == TRUE) && (rtp_session_avpf_payload_type_feature_enabled(session, PAYLOAD_TYPE_AVPF_FIR) == TRUE)) { + if (rtp_session_rtcp_psfb_scheduled(session, RTCP_PSFB_FIR) != TRUE) { m = make_rtcp_fb_fir(session); rtp_session_add_fb_packet_to_send(session, m); } @@ -209,7 +287,7 @@ void rtp_session_send_rtcp_fb_sli(RtpSession *session, uint16_t first, uint16_t number, uint8_t picture_id) { mblk_t *m; - if ((rtp_session_avpf_enabled(session) == TRUE) && (rtp_session_avpf_feature_enabled(session, PAYLOAD_TYPE_AVPF_SLI) == TRUE)) { + if ((rtp_session_avpf_enabled(session) == TRUE) && (rtp_session_avpf_payload_type_feature_enabled(session, PAYLOAD_TYPE_AVPF_SLI) == TRUE)) { m = make_rtcp_fb_sli(session, first, number, picture_id); rtp_session_add_fb_packet_to_send(session, m); if (is_fb_packet_to_be_sent_immediately(session) == TRUE) { @@ -220,7 +298,7 @@ void rtp_session_send_rtcp_fb_rpsi(RtpSession *session, uint8_t *bit_string, uint16_t bit_string_len) { mblk_t *m; - if ((rtp_session_avpf_enabled(session) == TRUE) && (rtp_session_avpf_feature_enabled(session, PAYLOAD_TYPE_AVPF_RPSI) == TRUE)) { + if ((rtp_session_avpf_enabled(session) == TRUE) && (rtp_session_avpf_payload_type_feature_enabled(session, PAYLOAD_TYPE_AVPF_RPSI) == TRUE)) { m = make_rtcp_fb_rpsi(session, bit_string, bit_string_len); rtp_session_add_fb_packet_to_send(session, m); if (is_fb_packet_to_be_sent_immediately(session) == TRUE) { @@ -229,12 +307,37 @@ } } +void rtp_session_send_rtcp_fb_tmmbr(RtpSession *session, uint64_t mxtbr) { + mblk_t *m; + if ((rtp_session_avpf_enabled(session) == TRUE) && (rtp_session_avpf_feature_enabled(session, ORTP_AVPF_FEATURE_TMMBR) == TRUE)) { + if ((rtp_session_rtcp_rtpfb_scheduled(session, RTCP_RTPFB_TMMBR) != TRUE) && (rtp_session_get_recv_ssrc(session) != 0)) { + uint16_t overhead = (session->rtp.gs.sockfamily == AF_INET6) ? IP6_UDP_OVERHEAD : IP_UDP_OVERHEAD; + m = make_rtcp_fb_tmmbr(session, mxtbr, overhead); + rtp_session_add_fb_packet_to_send(session, m); + session->rtcp.send_algo.tmmbr_scheduled = TRUE; + } + rtp_session_send_fb_rtcp_packet_and_reschedule(session); + } +} + +void rtp_session_send_rtcp_fb_tmmbn(RtpSession *session, uint32_t ssrc) { + mblk_t *m; + if ((rtp_session_avpf_enabled(session) == TRUE) && (rtp_session_avpf_feature_enabled(session, ORTP_AVPF_FEATURE_TMMBR) == TRUE)) { + m = make_rtcp_fb_tmmbn(session, ssrc); + if (m) { + rtp_session_add_fb_packet_to_send(session, m); + session->rtcp.send_algo.tmmbn_scheduled = TRUE; + } + rtp_session_send_fb_rtcp_packet_and_reschedule(session); + } +} + bool_t rtp_session_avpf_enabled(RtpSession *session) { PayloadType *pt = rtp_profile_get_payload(session->rcv.profile, session->rcv.pt); return pt && (payload_type_get_flags(pt) & PAYLOAD_TYPE_RTCP_FEEDBACK_ENABLED); } -bool_t rtp_session_avpf_feature_enabled(RtpSession *session, unsigned char feature) { +bool_t rtp_session_avpf_payload_type_feature_enabled(RtpSession *session, unsigned char feature) { PayloadType *pt = rtp_profile_get_payload(session->rcv.profile, session->rcv.pt); PayloadTypeAvpfParams params; if (!pt) return FALSE; @@ -243,6 +346,19 @@ return FALSE; } +bool_t rtp_session_avpf_feature_enabled(RtpSession *session, unsigned char feature) { + if (session->avpf_features & feature) return TRUE; + return FALSE; +} + +void rtp_session_enable_avpf_feature(RtpSession *session, unsigned char feature, bool_t enable) { + if (enable) { + session->avpf_features |= feature; + } else { + session->avpf_features &= ~feature; + } +} + uint16_t rtp_session_get_avpf_rr_interval(RtpSession *session) { PayloadType *pt = rtp_profile_get_payload(session->rcv.profile, session->rcv.pt); PayloadTypeAvpfParams params; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ortp-0.24.0/src/rtcpparse.c new/ortp-0.24.2/src/rtcpparse.c --- old/ortp-0.24.0/src/rtcpparse.c 2015-01-30 10:36:41.000000000 +0100 +++ new/ortp-0.24.2/src/rtcpparse.c 2015-05-07 17:15:16.000000000 +0200 @@ -508,6 +508,50 @@ } +/* RTCP RTPFB accessors */ +bool_t rtcp_is_RTPFB(const mblk_t *m) { + const rtcp_common_header_t *ch = rtcp_get_common_header(m); + if ((ch != NULL) && (rtcp_common_header_get_packet_type(ch) == RTCP_RTPFB)) { + if (msgdsize(m) < MIN_RTCP_RTPFB_PACKET_SIZE) { + ortp_warning("Too short RTCP RTPFB packet."); + return FALSE; + } + return TRUE; + } + return FALSE; +} + +/* Same as rtcp_is_RTPFB but not needing msgpullup. To be used internally only. */ +bool_t rtcp_is_RTPFB_internal(const mblk_t *m) { + rtcp_common_header_t *ch = (rtcp_common_header_t *)m->b_rptr; + return (rtcp_common_header_get_packet_type(ch) == RTCP_RTPFB) ? TRUE : FALSE; +} + +rtcp_rtpfb_type_t rtcp_RTPFB_get_type(const mblk_t *m) { + rtcp_common_header_t *ch = (rtcp_common_header_t *)m->b_rptr; + return (rtcp_rtpfb_type_t)rtcp_common_header_get_rc(ch); +} + +uint32_t rtcp_RTPFB_get_packet_sender_ssrc(const mblk_t *m) { + rtcp_fb_header_t *fbh = (rtcp_fb_header_t *)(m->b_rptr + sizeof(rtcp_common_header_t)); + return ntohl(fbh->packet_sender_ssrc); +} + +uint32_t rtcp_RTPFB_get_media_source_ssrc(const mblk_t *m) { + rtcp_fb_header_t *fbh = (rtcp_fb_header_t *)(m->b_rptr + sizeof(rtcp_common_header_t)); + return ntohl(fbh->media_source_ssrc); +} + +rtcp_fb_tmmbr_fci_t * rtcp_RTPFB_tmmbr_get_fci(const mblk_t *m) { + unsigned int size = sizeof(rtcp_common_header_t) + sizeof(rtcp_fb_header_t) + sizeof(rtcp_fb_tmmbr_fci_t); + unsigned int rtcp_size = rtcp_get_size(m); + if (size > rtcp_size) { + return NULL; + } + return (rtcp_fb_tmmbr_fci_t *)(m->b_rptr + size - sizeof(rtcp_fb_tmmbr_fci_t)); +} + + /* RTCP PSFB accessors */ bool_t rtcp_is_PSFB(const mblk_t *m) { const rtcp_common_header_t *ch = rtcp_get_common_header(m); @@ -521,6 +565,12 @@ return FALSE; } +/* Same as rtcp_is_PSFB but not needing msgpullup. To be used internally only. */ +bool_t rtcp_is_PSFB_internal(const mblk_t *m) { + rtcp_common_header_t *ch = (rtcp_common_header_t *)m->b_rptr; + return (rtcp_common_header_get_packet_type(ch) == RTCP_PSFB) ? TRUE : FALSE; +} + rtcp_psfb_type_t rtcp_PSFB_get_type(const mblk_t *m) { rtcp_common_header_t *ch = (rtcp_common_header_t *)m->b_rptr; return (rtcp_psfb_type_t)rtcp_common_header_get_rc(ch); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ortp-0.24.0/src/rtpsession.c new/ortp-0.24.2/src/rtpsession.c --- old/ortp-0.24.0/src/rtpsession.c 2015-03-11 16:19:07.000000000 +0100 +++ new/ortp-0.24.2/src/rtpsession.c 2015-05-07 17:15:16.000000000 +0200 @@ -2232,3 +2232,6 @@ tpm->session = tp->session; } } +bool_t rtp_session_get_symmetric_rtp(const RtpSession *session) { + return session->symmetric_rtp; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ortp-0.24.0/src/rtpsession_inet.c new/ortp-0.24.2/src/rtpsession_inet.c --- old/ortp-0.24.0/src/rtpsession_inet.c 2015-03-10 10:11:45.000000000 +0100 +++ new/ortp-0.24.2/src/rtpsession_inet.c 2015-05-07 17:15:16.000000000 +0200 @@ -115,7 +115,7 @@ ortp_warning ("Error in getaddrinfo on (addr=%s): %s", addr, gai_strerror(err)); return -1; } - + switch (res->ai_family){ case AF_INET: if (IN_MULTICAST(ntohl(((struct sockaddr_in *) res->ai_addr)->sin_addr.s_addr))) @@ -204,7 +204,7 @@ ortp_warning ("Fail to IPV6_V6ONLY: %s.",getSocketError()); } } - + #if defined(ORTP_TIMESTAMP) optval=1; err = setsockopt (sock, SOL_SOCKET, SO_TIMESTAMP, @@ -1024,7 +1024,7 @@ int _rtp_session_sendto(RtpSession *session, bool_t is_rtp, mblk_t *m, int flags, const struct sockaddr *destaddr, socklen_t destlen){ int ret; - + if (session->net_sim_ctx && (session->net_sim_ctx->params.mode==OrtpNetworkSimulatorOutbound || session->net_sim_ctx->params.mode==OrtpNetworkSimulatorOutboundControlled)){ ret=msgdsize(m); @@ -1053,7 +1053,7 @@ static void update_recv_bytes(OrtpStream *os, int nbytes) { int overhead = ortp_stream_is_ipv6(os) ? IP6_UDP_OVERHEAD : IP_UDP_OVERHEAD; - if (os->recv_bytes == 0) { + if ((os->recv_bytes == 0) && (os->recv_bw_start.tv_sec == 0) && (os->recv_bw_start.tv_usec == 0)) { ortp_gettimeofday(&os->recv_bw_start, NULL); } os->recv_bytes += nbytes + overhead; @@ -1334,6 +1334,40 @@ } } +static void notify_tmmbr_received(RtpSession *session, mblk_t *m) { + if (session->eventqs != NULL) { + rtcp_fb_tmmbr_fci_t *fci = rtcp_RTPFB_tmmbr_get_fci(m); + OrtpEvent *ev = ortp_event_new(ORTP_EVENT_TMMBR_RECEIVED); + OrtpEventData *d = ortp_event_get_data(ev); + d->packet = copymsg(m); + d->info.tmmbr_mxtbr = rtcp_fb_tmmbr_fci_get_mxtbr_mantissa(fci) * (1 << rtcp_fb_tmmbr_fci_get_mxtbr_exp(fci)); + rtp_session_dispatch_event(session, ev); + } +} + +static void handle_rtcp_rtpfb_packet(RtpSession *session, mblk_t *block) { + switch (rtcp_RTPFB_get_type(block)) { + case RTCP_RTPFB_TMMBR: + if (session->rtcp.tmmbr_info.received) freemsg(session->rtcp.tmmbr_info.received); + session->rtcp.tmmbr_info.received = copymsg(block); + rtp_session_send_rtcp_fb_tmmbn(session, rtcp_RTPFB_get_packet_sender_ssrc(block)); + notify_tmmbr_received(session, block); + break; + case RTCP_RTPFB_TMMBN: + if (session->rtcp.tmmbr_info.sent) { + rtcp_fb_tmmbr_fci_t *tmmbn_fci = rtcp_RTPFB_tmmbr_get_fci(block); + rtcp_fb_tmmbr_fci_t *tmmbr_fci = rtcp_RTPFB_tmmbr_get_fci(session->rtcp.tmmbr_info.sent); + if ((ntohl(tmmbn_fci->ssrc) == rtp_session_get_send_ssrc(session)) && (tmmbn_fci->value == tmmbr_fci->value)) { + freemsg(session->rtcp.tmmbr_info.sent); + session->rtcp.tmmbr_info.sent = NULL; + } + } + break; + default: + break; + } +} + /* * @brief : for SR packets, retrieves their timestamp, gets the date, and stores these information into the session descriptor. The date values may be used for setting some fields of the report block of the next RTCP packet to be sent. * @param session : the current session descriptor. @@ -1417,6 +1451,8 @@ if (rb) compute_rtt_from_report_block(session,&reception_date,rb); } else if (rtcp_is_XR(block)) { compute_rtcp_xr_statistics(session, block, &reception_date); + } else if (rtcp_is_RTPFB(block)) { + handle_rtcp_rtpfb_packet(session, block); } }while (rtcp_next_packet(block)); rtcp_rewind(block); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ortp-0.24.0/src/rtpsession_priv.h new/ortp-0.24.2/src/rtpsession_priv.h --- old/ortp-0.24.0/src/rtpsession_priv.h 2015-01-30 10:36:41.000000000 +0100 +++ new/ortp-0.24.2/src/rtpsession_priv.h 2015-05-07 17:15:16.000000000 +0200 @@ -73,6 +73,8 @@ mblk_t * make_xr_stat_summary(RtpSession *session); mblk_t * make_xr_voip_metrics(RtpSession *session); +bool_t rtcp_is_RTPFB_internal(const mblk_t *m); +bool_t rtcp_is_PSFB_internal(const mblk_t *m); bool_t rtp_session_has_fb_packets_to_send(RtpSession *session); void rtp_session_send_regular_rtcp_packet_and_reschedule(RtpSession *session, uint64_t tc); void rtp_session_send_fb_rtcp_packet_and_reschedule(RtpSession *session);
