pax_global_header00006660000000000000000000000064131517264360014522gustar00rootroot0000000000000052 comment=90fd024508112e1e5aac249b4c53c4eac73265ff ortp-1.0.2/000077500000000000000000000000001315172643600125065ustar00rootroot00000000000000ortp-1.0.2/.clang-format000066400000000000000000000036721315172643600150710ustar00rootroot00000000000000--- # BasedOnStyle: LLVM AccessModifierOffset: -2 AlignAfterOpenBracket: true AlignEscapedNewlinesLeft: false AlignOperands: true AlignTrailingComments: true AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: false AllowShortIfStatementsOnASingleLine: false AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: false AlwaysBreakBeforeMultilineStrings: false AlwaysBreakTemplateDeclarations: false BinPackArguments: true BinPackParameters: true BreakBeforeBinaryOperators: None BreakBeforeBraces: Attach BreakBeforeTernaryOperators: true BreakConstructorInitializersBeforeComma: false ColumnLimit: 120 CommentPragmas: '^ IWYU pragma:' ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 4 Cpp11BracedListStyle: true DerivePointerAlignment: false DisableFormat: false ExperimentalAutoDetectBinPacking: false ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] IndentCaseLabels: false IndentFunctionDeclarationAfterType: false IndentWidth: 4 IndentWrappedFunctionNames: false KeepEmptyLinesAtTheStartOfBlocks: true Language: Cpp MaxEmptyLinesToKeep: 1 NamespaceIndentation: None ObjCBlockIndentWidth: 2 ObjCSpaceAfterProperty: false ObjCSpaceBeforeProtocolList: true PenaltyBreakBeforeFirstCallParameter: 19 PenaltyBreakComment: 300 PenaltyBreakFirstLessLess: 120 PenaltyBreakString: 1000 PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 60 PointerAlignment: Right SpaceAfterCStyleCast: false SpaceBeforeAssignmentOperators: true SpaceBeforeParens: ControlStatements SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 1 SpacesInAngles: false SpacesInContainerLiterals: true SpacesInCStyleCastParentheses: false SpacesInParentheses: false SpacesInSquareBrackets: false Standard: Cpp11 TabWidth: 4 UseTab: Always ... ortp-1.0.2/.git-pre-commit000077500000000000000000000043501315172643600153510ustar00rootroot00000000000000#!/bin/bash # This hook purpose is to keep coding style consistent between all developers # It is automatically installed in .git/hooks folder by cmake on first run. # From https://github.com/tatsuhiro-t/nghttp2/blob/master/pre-commit function invalid-format-detected { cat git-clang-format.diff echo "*****************" echo "$0: Invalid coding style detected (see git-clang-format.diff for issues). Please correct it using one of the following:" echo "1) Apply patch located at git-clang-format.diff using:" echo " cd $(git rev-parse --show-toplevel) && $1" echo "2) Use clang-format to correctly format source code using:" echo " $2" echo "3) Reformat these lines manually." echo "*** Aborting commit.***" exit 1 } function git-clang-format-diffing { format_diff=$(which git-clang-format) format_diff_options="--style=file" #only diffing commited files, ignored staged one $format_diff $format_diff_options --diff $(git --no-pager diff --cached --name-status | grep -v '^D' | cut -f2) > git-clang-format.diff if ! grep -q -E '(no modified files to format|clang-format did not modify any files)' git-clang-format.diff; then invalid-format-detected "git apply git-clang-format.diff" "clang-format $format_diff_options -i " fi } function clang-format-diff-diffing { format_diff=$(find /usr/bin/ -name 'clang-format-diff*' -type f | tail -n1) format_diff_options="-style file" git diff-index --cached --diff-filter=ACMR -p HEAD -- | $format_diff $format_diff_options -p1 > git-clang-format.diff if [ -s git-clang-format.diff ]; then invalid-format-detected "patch -p0 < git-clang-format.diff" "${format_diff/-diff/} $format_diff_options -i " fi } set -e if which git-clang-format &>/dev/null; then git-clang-format-diffing $@ elif [ ! -z "$(find /usr/bin/ /usr/local/bin/ /opt/bin/ -name 'clang-format-diff*' -type f 2>/dev/null)" ]; then # Warning! We need at least version 1.6... clang-format-diff-diffing $@ else echo "$0: Please install clang-format (coding style checker) - could not find git-clang-format nor clang-format-diff in PATH. Skipping code verification..." exit 0 fi ortp-1.0.2/.gitignore000066400000000000000000000005331315172643600144770ustar00rootroot00000000000000INSTALL *.o *.lo *.la configure Makefile.in missing ltmain.sh libtool Makefile .libs aclocal.m4 config.guess config.status config.log config.sub depcomp *~ autom4te.cache/ install-sh ortp-config.h.in ortp-config.h ortp.spec ortp.pc ortp.doxygen lt*.m4 libtool.m4 doc ortp.defs INSTALL stamp-h1 *.vcxproj.* compile git-clang-format.diff *.DS_Store ortp-1.0.2/AUTHORS000066400000000000000000000021401315172643600135530ustar00rootroot00000000000000Copyright (c) 2010-2013 Belledonne Communications SARL Simon MORLAT (simon dot morlat at linphone dot org) is the author the oRTP library. Contributors: * Copyright (c) 2013 Vadim Zhukov Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - support of arc4random() - bugfix in b64.c for platforms where char is unsigned. * Lovadina Nicola < lovadina dot nicola dot 10272 at unimo dot it > worked on RTCP support. ortp-1.0.2/CMakeLists.txt000066400000000000000000000157671315172643600152660ustar00rootroot00000000000000############################################################################ # CMakeLists.txt # Copyright (C) 2014 Belledonne Communications, Grenoble France # ############################################################################ # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # ############################################################################ cmake_minimum_required(VERSION 3.0) project(oRTP VERSION 1.0.2) set(ORTP_MAJOR_VERSION ${PROJECT_VERSION_MAJOR}) set(ORTP_MINOR_VERSION ${PROJECT_VERSION_MINOR}) set(ORTP_MICRO_VERSION ${PROJECT_VERSION_PATCH}) set(ORTP_VERSION ${PROJECT_VERSION}) set(ORTP_SO_VERSION "13") # incremented on January 10, 2017 option(ENABLE_SHARED "Build shared library." YES) option(ENABLE_STATIC "Build static library." YES) option(ENABLE_DOC "Enable documentation generation with Doxygen." YES) option(ENABLE_NTP_TIMESTAMP "Turn on NTP timestamping on packet reception." NO) option(ENABLE_PERF "Disable costly features to reduce cpu consumtion and increase performance." NO) option(ENABLE_STRICT "Build with strict compile options." YES) option(ENABLE_TESTS "Enable compilation of test programs." NO) option(ENABLE_DEBUG_LOGS "Turn on or off debug level logs." NO) set(WITH_THREAD_STACK_SIZE "0" CACHE STRING "Set thread stack size (0 is the OS default).") include(CheckIncludeFile) include(CheckFunctionExists) include(GNUInstallDirs) if(NOT CMAKE_INSTALL_RPATH AND CMAKE_INSTALL_PREFIX) set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}) message(STATUS "Setting install rpath to ${CMAKE_INSTALL_RPATH}") endif() set(MSVC_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/MSVC") if(MSVC) list(APPEND CMAKE_REQUIRED_INCLUDES "${MSVC_INCLUDE_DIR}") endif() find_package(Threads) find_library(LIBM NAMES m) if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS) include("${EP_bctoolbox_CONFIG_DIR}/BcToolboxConfig.cmake") else() find_package(BcToolbox 0.2.0 REQUIRED) endif() add_subdirectory(build) check_include_file(sys/uio.h HAVE_SYS_UIO_H) check_include_file(sys/audio.h HAVE_SYS_AUDIO_H) if(NOT ANDROID) check_include_file(sys/shm.h HAVE_SYS_SHM_H) endif() check_include_file(stdatomic.h HAVE_STDATOMIC_H) check_function_exists(arc4random HAVE_ARC4RANDOM) include(TestBigEndian) test_big_endian(WORDS_BIGENDIAN) if(WORDS_BIGENDIAN) set(ORTP_BIGENDIAN 1) endif() include_directories( include/ src/ ${CMAKE_CURRENT_BINARY_DIR} ) if(MSVC) include_directories(${MSVC_INCLUDE_DIR}) endif() set(ORTP_CPPFLAGS ${BCTOOLBOX_CPPFLAGS}) if(ENABLE_STATIC) list(APPEND ORTP_CPPFLAGS "-DORTP_STATIC") endif() if(ENABLE_PERF) set(PERF 1) endif() if(ENABLE_NTP_TIMESTAMP) set(ORTP_TIMESTAMP 1) list(APPEND ORTP_CPPFLAGS "-DORTP_TIMESTAMP") endif() if(ENABLE_DEBUG_LOGS) set(ORTP_DEBUG_MODE 1) endif() if(CMAKE_USE_PTHREADS_INIT) set(ORTP_DEFAULT_THREAD_STACK_SIZE ${WITH_THREAD_STACK_SIZE}) endif() if(APPLE) set(__APPLE_USE_RFC_3542 1) endif() if(ORTP_CPPFLAGS) add_definitions(${ORTP_CPPFLAGS}) endif() set(POSIXTIMER_INTERVAL 10000) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ortp-config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/ortp-config.h) set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/ortp-config.h PROPERTIES GENERATED ON) add_definitions(-DHAVE_CONFIG_H) set(STRICT_OPTIONS_CPP ) set(STRICT_OPTIONS_C ) if(MSVC) if(ENABLE_STRICT) list(APPEND STRICT_OPTIONS_CPP "/WX") endif() else() list(APPEND STRICT_OPTIONS_CPP "-Wall" "-Wuninitialized") list(APPEND STRICT_OPTIONS_C "-Wdeclaration-after-statement" "-Wstrict-prototypes" "-Wno-error=strict-prototypes") if(CMAKE_C_COMPILER_ID STREQUAL "Clang") list(APPEND STRICT_OPTIONS_CPP "-Qunused-arguments" "-Wno-array-bounds") endif() if(APPLE) list(APPEND STRICT_OPTIONS_CPP "-Wno-error=unknown-warning-option" "-Qunused-arguments" "-Wno-tautological-compare" "-Wno-unused-function" "-Wno-array-bounds") endif() if(ENABLE_STRICT) list(APPEND STRICT_OPTIONS_CPP "-Werror" "-Wextra" "-Wno-unused-parameter" "-Wno-missing-field-initializers" "-fno-strict-aliasing") endif() endif() if(STRICT_OPTIONS_CPP) list(REMOVE_DUPLICATES STRICT_OPTIONS_CPP) endif() if(STRICT_OPTIONS_C) list(REMOVE_DUPLICATES STRICT_OPTIONS_C) endif() if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS) set(EXPORT_TARGETS_NAME "LinphoneBuilder") else() set(EXPORT_TARGETS_NAME "ORTP") endif() add_subdirectory(include) add_subdirectory(src) if(ENABLE_DOC) find_package(Doxygen) if(DOXYGEN_FOUND) set(srcdir ${CMAKE_CURRENT_SOURCE_DIR}) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ortp.doxygen.in ${CMAKE_CURRENT_BINARY_DIR}/ortp.doxygen) file(GLOB DOC_INPUT_FILES include/ortp/[^.]*.h src/[^.]*.h src/[^.]*.c ) add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/doc/html/index.html" COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/ortp.doxygen DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ortp.doxygen ${DOC_INPUT_FILES} ) add_custom_target(ortp-html-doc ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/doc/html/index.html") install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/doc/html" DESTINATION "${CMAKE_INSTALL_DATADIR}/doc/ortp-${ORTP_VERSION}") endif() endif() set(prefix ${CMAKE_INSTALL_PREFIX}) set(exec_prefix ${prefix}/bin) set(libdir ${prefix}/lib) set(includedir ${prefix}/include) set(ORTP_PKGCONFIG_VERSION "${ORTP_VERSION}") set(ORTPDEPS_LIBS ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ortp.pc.in ${CMAKE_CURRENT_BINARY_DIR}/ortp.pc) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ortp.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") include(CMakePackageConfigHelpers) write_basic_package_version_file( "${CMAKE_CURRENT_BINARY_DIR}/ORTPConfigVersion.cmake" VERSION ${ORTP_VERSION} COMPATIBILITY AnyNewerVersion ) export(EXPORT ${EXPORT_TARGETS_NAME}Targets FILE "${CMAKE_CURRENT_BINARY_DIR}/ORTPTargets.cmake" ) configure_file(ORTPConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/ORTPConfig.cmake" @ONLY ) set(CONFIG_PACKAGE_LOCATION "${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake") install(EXPORT ${EXPORT_TARGETS_NAME}Targets FILE ORTPTargets.cmake DESTINATION ${CONFIG_PACKAGE_LOCATION} ) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ORTPConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/ORTPConfigVersion.cmake" DESTINATION ${CONFIG_PACKAGE_LOCATION} ) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/README.md" "${CMAKE_CURRENT_SOURCE_DIR}/ChangeLog" "${CMAKE_CURRENT_SOURCE_DIR}/COPYING" "${CMAKE_CURRENT_SOURCE_DIR}/AUTHORS" DESTINATION "${CMAKE_INSTALL_DATADIR}/doc/ortp-${ORTP_VERSION}") ortp-1.0.2/COPYING000066400000000000000000000431031315172643600135420ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. ortp-1.0.2/ChangeLog000066400000000000000000000122401315172643600142570ustar00rootroot000000000000002007-07-26 Francois-Xavier Kowalski * pkg.list: 1.3 Do not run makewhatis when installing EPM-generated package. 2007-04-19 Francois-Xavier Kowalski * ortp.spec.in (Requires): 1.4 Adapt to new documentation generation change from gtk-doc to Doxygen. * Makefile.am (docdir): 1.27 automake's docdir is not always defined & is generally not package specific, so we manually define docdir & pkgdocdir. 2007-03-01 Francois-Xavier Kowalski * include/ortp/payloadtype.h: 1.28 Encompass every declaration (whether lvalue or not) under extern "C". 2007-01-18 Francois-Xavier Kowalski * oRTP/Makefile.am: 1.24 Fix RPM package generattion to cope with 2006-10-24 Francois-Xavier 'FiX' KOWALSKI * include/ortp/port.h: 1.21 * src/scheduler.h (ortp_get_scheduler): 1.13 Disable some Intel C/C++ warnings to build with icc. * include/ortp/stun_udp.h (__STUN_UDP_H__): 1.6 * include/ortp/stun.h: 1.6 Use 2006-07-10 Francois-Xavier 'FiX' KOWALSKI * configure.ac: 1.89 * gtk-doc.make (dist-check-gtkdoc): 1.1 Non-fatal but incomplete "make dist" when gtk-doc is not installed. 2006-07-07 Francois-Xavier 'FiX' KOWALSKI * src/avprofile.c (NORMAL_BITRATE): 1.27 Use ISO C/99 tagged struct syntax rather than GCC's legacy one. 2006-07-07 Francois-Xavier Kowalski * src/rtpsession.c (RTP_SEQ_IS_GREATER): 1.132 Fix comment content (using <>) that breaks gtkdoc SGML generation. * include/ortp/event.h: 1.3 OrtpEventData cannot be a type a s struct at the same time. * ortp.spec.in (Requires): 1.2 Drop glib option * gtk-doc.make: * docs/Makefile.am (#DOC_MAIN_SGML_FILE): 1.7 * Makefile.am Use slightly modified gtkdocize. * ortp.spec.in (Requires): 1.2 Force build of gtk-doc, as the default choice that comes with GTK_DOC_CHECK m4 macro is "no". 2006-07-06 Francois-Xavier Kowalski * src/payloadtype.c (rtp_profile_destroy): 1.20 avoid double-free * configure.ac: 1.88 ortp-0.10.1.1 Friday March 10 2006 : ortp-0.9.1 - fix package name (was 0.9.0.) Wednesday March 8 2006 : ortp-0.9.0 - a lot of cleanups, glib dropped, win32 port reactivated Tuesday December 20 2005 : ortp-0.8.1 - change session's clockrate dependant parameters upon payload type changed events at socket level - rtp_session_set_recv_buf_size() added. - bugfix in rtp_session_set_remote_addr() - memory leak fixed in rtp_profile_destroy() Wednesday December 07 2005: ortp-0.8.0 - make package modifications - make rpm added - add support for different payload types for incoming and outgoing stream (which breaks api compatibility) - prefix all PayloadType with payload_type_* to avoid naming conflicts Wednesday August 24 2005: ortp-0.7.1 - added patch for pkgconfig support from Jean-Philippe Barrette-LaPierre Monday August 8 2005: ortp-0.7.1pre5 - adaptive jitter buffer improvements - timestamp compensated packets returned by rtp_session_recvm_with_ts - new payload definitions. Tuesday August 2 2005: ortp-0.7.1pre4 - adaptive jitter buffer cleanups. - hton24 utility function added for RTCP Tuesday July 4 2005: ortp-0.7.1pre3 - improve automatic jitter buffer: no more closed-loop; just estimation. - merge patch for multicast from Samuel Thibault - merge patch for parsing of rtcp packets from Nicola Baldo - add static payload definitions for g723.1 and g729. Wednesday November 17 2004: ortp-0.7.0 series starts - add automatic jitter buffer: * compensate clock slides * estimate the jitter and sets the minimum jitter compensation delay accordingly - posix timer simplified - less system calls: use non blocking recv() and don't use select() or poll() - add new functions for optimized packet sending - recv() and send() are always made within the rtp_session_recv..() and rtp_session_send..() functions. That means that scheduled non blocking mode does no more work as it worked before, ie that packet will be sent immediately rather than being sent on time by the scheduler as it was before. - HPUX kernel target removed. - scheduler always built. Tuesday August 12 2003 : ortp-0.6.3 - some improvements by Aymeric Moizard for Win32 build - some bug fixes concerning ipv6 support. Thursday August 7 2003 : ortp-0.6.2 - just some minor improvements for using oRTP in a C++ environment. Wednesday January 8 2003: ortp-0.6.0 - many bug fixes by Telisma: the most important bug concerned the windows port. - some new functionnalities concerning the RTP profiles and payload management. - ported to glib-2.0 . Monday September 23 2002: ortp-0.5.0 - ortp has been ported to the Microsoft Windows OS (version 2000 and later) by Eloquant (http://www.eloquant.com) - some bug fixes and improvements of the windows port have been made by Telisma (http://www.telisma.com) Wednesday June 5 2002: ortp-0.4.4 - Some crashing bugs fixed. Wednesday May 15 2002: ortp-0.4.3 - Install include files properly. Tuesday May 7 2002: ortp-0.4.2 - First official and public release of oRTP. ortp-1.0.2/Makefile.am000066400000000000000000000050611315172643600145440ustar00rootroot00000000000000# linphone/oRTP/Makefile.am -- ACLOCAL_AMFLAGS = -I m4 $(ACLOCAL_MACOS_FLAGS) EXTRA_DIST = \ oRTP.prj \ ortp-config.h.in \ pkg.list autogen.sh \ ortp.pc.in \ ortp.spec.in \ ortp.spec \ ortp.doxygen \ oRTP.pws \ CMakeLists.txt \ include/CMakeLists.txt \ src/CMakeLists.txt \ src/tests/CMakeLists.txt \ ORTPConfig.cmake.in \ ortp-config.h.cmake \ README.md SUBDIRS=src build m4 include ACLOCAL_FLAGS=-I$(top_srcdir)/m4 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = ortp.pc SOURCES=$(top_srcdir)/include/ortp/*.h $(top_srcdir)/src/*.c $(top_srcdir)/src/*.h CLEANFILES= #html doc if HAVE_DOXYGEN # docdir & pkgdocdir are not always defined by automake pkgdocdir=$(docdir)/$(PACKAGE)-$(VERSION) doc_htmldir=$(pkgdocdir)/html pkgdoc_DATA = README.md AUTHORS ChangeLog COPYING doc_html_DATA = $(top_builddir)/doc/html/html.tar $(top_builddir)/doc/html/html.tar: $(top_builddir)/doc/html/index.html cd $(top_builddir)/doc/html/ && rm -f html.tar && tar cf html.tar * $(top_builddir)/doc/html/index.html: $(SOURCES) ortp.doxygen Makefile.am rm -rf doc $(DOXYGEN) ortp.doxygen install-data-hook: cd $(DESTDIR)$(doc_htmldir) && tar xf html.tar && rm -f html.tar uninstall-hook: - cd $(DESTDIR)$(doc_htmldir) && rm -f * endif ## oRTP packaging methods: # `make rpm' .phony: rpm rpm: $(MAKE) dist # TAR_OPTIONS=--wildcards rpmbuild -ta --clean --rmsource --rmspec $(PACKAGE)-$(VERSION).tar.gz # `make package' if WITH_EPM .PHONY: package PKG_NAME=$(PACKAGE)-$(VERSION)-$(RELEASE) BUILDROOT=`pwd`/epm-install package: $(srcdir)/pkg.list $(srcdir)/configure -rm -rf pkg $(BUILDROOT) $(PKG_NAME).* $(MAKE) install DESTDIR=$(BUILDROOT) $(MKEPMLIST) -u $(SYS_USER) -g $(SYS_GROUP) --prefix $(prefix) \ $(BUILDROOT)/$(prefix) > files.list $(EPM) -vv -f native -g -n -a $(ARCH) --keep-files --output-dir pkg \ srcdir=$(srcdir) \ top_srcdir=$(top_srcdir) \ top_builddir=$(top_builddir) \ PACKAGE=$(PACKAGE) \ SUMMARY="$(SUMMARY)" \ VERSION=$(ORTP_PKGCONFIG_VERSION) \ RELEASE=$(RELEASE) \ LICENSE="$(LICENSE)" \ VENDOR="$(VENDOR)" \ PACKAGER="$(PACKAGER)" \ $(PACKAGE) $(srcdir)/pkg.list mv -f pkg/$(PACKAGE)-$(ORTP_PKGCONFIG_VERSION)-$(RELEASE).$(EPM_PKG_EXT) $(PKG_NAME).$(ARCH).$(EPM_PKG_EXT) clean-local: rm -rf pkg $(BUILDROOT) rm -f files.list rm -rf doc endif WITH_EPM distclean-local: -rm -f ortp.defs -rm -rf doc all-local: ortp.spec ortp.spec: ortp.spec.in deb: $(MAKE) dist mv $(distdir).tar.gz ../$(PACKAGE)_$(VERSION).orig.tar.gz dpkg-buildpackage -us -uc ortp-1.0.2/NEWS000066400000000000000000000065631315172643600132170ustar00rootroot00000000000000July 20, 2017: ortp-1.0.2 - Bug fixes February 23, 2017: ortp-1.0.1 - minor enhancements and bugfixes January 10, 2017: ortp-1.0.0 - oRTP license is changed to be GPLv2 - new adaptive jitter buffer algorithm added June 1st 2016: ortp-0.27.0 May XX, 2016:  - Fix DSCP on Windows. - bctoolbox added as dependency - fixes around IPv6 support for windows and android January 22, 2016: ortp-0.26.0 November 2, 2015: ortp-0.25.0 - Support AVPF generic NACK - Add payload types for RTT (Real-Time Text) and Codec2 - Bug fixes 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) - RTCP send algorithm as describe in RFC4585: AVPF streams Feb 19, 2014: ortp-0.23.0 - network simulator improvements - updated to use ZRTPCPP>=4.0 - security bugfixes May 27, 2012: ortp-0.22.0 - network simulator improvements for simulating random lost packets - srtp initialization bugfix February 22th, 2012: ortp-0.20.0 - fix an issue on video call with ZRTP February 17th, 2012: ortp-0.19.0 - ZRTP media encryption December 22th, 2011: ortp-0.18.0 - SRTP media encryption May XXth, 2011: ortp-0.17.0 - RTCP support fixes - add rtp_session_get_round_trip_propagation() March 28th, 2011: ortp-0.16.5 - optimisations in session-set intersection computation February 7, 2011: ortp-0.16.4 - workaround fix for some versions of uclibc June 3, 2010 : ortp-0.16.3 - cosmetics improvements for compilation. May 10, 2010 : ortp-0.16.2 - add support for setting dscp on windows - add accessors to struct PayloadType September 17, 2009: ortp-0.16.1 - minor compilation fixes May 4, 2009 : ortp-0.16.0 - update stun api to support new RFC - fix gcc warnings - added new PayloadType October 13, 2008: ortp-0.15.0 - telephone event detection bugfix - reduce number of memory allocation: !! attention here ABI/API change !! If you are using mp=rtp_session_recvm_with_ts(), the payload data is no more pointed by mp->b_cont->b_rptr. Instead you can use the following to skip the header: rtp_get_payload(mp,mp->b_rptr); March 14, 2007: ortp-0.14.3 - new ortp_set_memory_functions() method - jitter buffer bugfixes, simplification and improvements July 27, 2007: ortp-0.14.0 - a few optimisations - support for number of channels in PayloadType (interface changed !) - srtp optional support (using libsrtp from http://srtp.sf.net) April, 11 2007: ortp-0.13.1: - do not recv rtcp packets from rtp_session_sendm_with_ts() when session is not send-only. - removed gtk-doc, using doxygen instead. - minor patches January, 23 2007: ortp-0.13.0 - add support for a pluggable transport layer - enables use of different RtpProfile for send and recv directions - fix RTCP memleak - new telephone-event types added. November, 9 2006: ortp-0.12.0 - fix statistics - jitter buffer accuracy improved - enable 0 ms jitter buffer (implies permissive dequeuing of packets) - enable optional connected mode: the udp socket is connect()ed so only packets coming from the connected destination are received. August, 22 2006: ortp-0.11.0 - added rtp_session_set_dscp, rtp_session_send_rtcp_APP - fixed statistics little bugs. May, 30 2006: ortp-0.10.0 - new RTCP parser - new event api - stun helper routines - permissive algorithm for video packet enqueueing ortp-1.0.2/ORTPConfig.cmake.in000066400000000000000000000044431315172643600160340ustar00rootroot00000000000000############################################################################ # ORTPConfig.cmake # Copyright (C) 2015 Belledonne Communications, Grenoble France # ############################################################################ # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # ############################################################################ # # Config file for the oRTP package. # It defines the following variables: # # ORTP_FOUND - system has oRTP # ORTP_INCLUDE_DIRS - the oRTP include directory # ORTP_LIBRARIES - The libraries needed to use oRTP # ORTP_CPPFLAGS - The cflags needed to use oRTP if(NOT LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS) include("${CMAKE_CURRENT_LIST_DIR}/ORTPTargets.cmake") endif() if(@ENABLE_SHARED@) set(ORTP_TARGETNAME ortp) set(ORTP_LIBRARIES ${ORTP_TARGETNAME}) else() set(ORTP_TARGETNAME ortp-static) if(TARGET ${ORTP_TARGETNAME}) if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS) set(ORTP_LIBRARIES ${ORTP_TARGETNAME}) else() get_target_property(ORTP_LIBRARIES ${ORTP_TARGETNAME} LOCATION) endif() get_target_property(ORTP_LINK_LIBRARIES ${ORTP_TARGETNAME} INTERFACE_LINK_LIBRARIES) if(ORTP_LINK_LIBRARIES) list(APPEND ORTP_LIBRARIES ${ORTP_LINK_LIBRARIES}) endif() endif() endif() get_target_property(ORTP_INCLUDE_DIRS ${ORTP_TARGETNAME} INTERFACE_INCLUDE_DIRECTORIES) if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS) list(INSERT ORTP_INCLUDE_DIRS 0 "${EP_ortp_INCLUDE_DIR}") else() list(INSERT ORTP_INCLUDE_DIRS 0 "@CMAKE_INSTALL_FULL_INCLUDEDIR@") endif() list(REMOVE_DUPLICATES ORTP_INCLUDE_DIRS) set(ORTP_CPPFLAGS @ORTP_CPPFLAGS@) set(ORTP_FOUND 1) ortp-1.0.2/README.md000066400000000000000000000065251315172643600137750ustar00rootroot00000000000000oRTP ==== What is it ? ------------ oRTP is a GPLv2 licensed C library implementing the RTP protocol (rfc3550). It is available for most unix clones (primilarly Linux and HP-UX), and Microsoft Windows. Prior to version 1.0.0, oRTP was licensed under LGPLv2. Due to inclusion of new code licensed under GPLv2, oRTP has become GPLv2. For the sake of clarity, all source files headers were updated to mention the GPLv2 only. oRTP versions prior to 1.0.0 of course remain LGPLv2. What are the build prequisites ? -------------------------------- *bctoolbox[1]*: portability layer What build instructions ----------------------- Autotools procedure is deprecated. Use CMake to configure the source code. cmake . -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= make make install ### Options: - `CMAKE_INSTALL_PREFIX=` : install prefix - `CMAKE_PREFIX_PATH=` : column-separated list of prefixes where to search for dependencies - `ENABLE_SHARED=NO` : do not build the shared library - `ENABLE_STATIC=NO` : do not build the static library - `ENABLE_STRICT=NO` : build without strict compilation flags (-Wall -Werror) - `ENABLE_TESTS=YES` : build tester binaries - `ENABLE_DOC=NO` : do not generate the documentation - `ENABLE_DEBUG_LOGS=YES` : turn on debug-level logs ### Note for packagers: Our CMake scripts may automatically add some paths into research paths of generated binaries. To ensure that the installed binaries are striped of any rpath, use `-DCMAKE_SKIP_INSTALL_RPATH=ON` while you invoke cmake. Rpm packaging ortp rpm can be generated with cmake3 using the following command: mkdir WORK cd WORK cmake3 ../ make package_source rpmbuild -ta --clean --rmsource --rmspec ortp--.tar.gz How do you I test ? ------------------- There are shorts and easy to understand programs given with the library. There are good example to understand how to use oRTP api. - rtpsend : sends a stream from a file on disk. - rtprecv : receives a stream and writes it to disk. - mrtpsend: sends multiple streams from a file on disk to a range of remote port. - mrtprecv: receives mutiple streams on a range of local ports and writes them on disk. Is there some documentation ? ----------------------------- See the doxygen generated API documentation in docs/html. Program examples are a very good starting point. What are the current features ? ------------------------------- - works with ipv6 - packet scheduler - adaptive jitter compensation - automatic sending of RTCP SR or RR coumpounded with a SDES - RTCP parser API What are the planned features ? ------------------------------- - multi-endpoint rtp sessions. In which application oRTP is being used ? ----------------------------------------- - linphone (http://www.linphone.org) was the first. - the OCMP platform (a Hewlett Packard product). How to compile my program using ortp ? -------------------------------------- gcc -o myprogram `pkg-config --cflags ortp` myprogram.c \ `pkg-config --libs ortp` What about Windows port ? ------------------------- There are instructions and Microsoft Visual C++ project files in build/win32native/oRTP. ---------------------------------------- [1] git://git.linphone.org/bctoolbox.git *or* ortp-1.0.2/autogen.sh000077500000000000000000000023701315172643600145110ustar00rootroot00000000000000#!/bin/sh srcdir=`dirname $0` test -z "$srcdir" && srcdir=. THEDIR=`pwd` cd $srcdir #AM_VERSION="1.10" if ! type aclocal-$AM_VERSION 1>/dev/null 2>&1; then # automake-1.10 (recommended) is not available on Fedora 8 AUTOMAKE=automake ACLOCAL=aclocal else ACLOCAL=aclocal-${AM_VERSION} AUTOMAKE=automake-${AM_VERSION} fi libtoolize="libtoolize" for lt in glibtoolize libtoolize15 libtoolize14 libtoolize13 ; do if test -x /usr/bin/$lt ; then libtoolize=$lt ; break fi if test -x /usr/local/bin/$lt ; then libtoolize=$lt ; break fi if test -x /opt/local/bin/$lt ; then libtoolize=$lt ; break fi done if test -d /usr/local/share/aclocal ; then ACLOCAL_ARGS="$ACLOCAL_ARGS -I /usr/local/share/aclocal" fi if test -d /share/aclocal ; then ACLOCAL_ARGS="$ACLOCAL_ARGS -I /share/aclocal" fi set -x rm -rf config.cache autom4te.cache $libtoolize --copy --force $ACLOCAL -I m4 $ACLOCAL_ARGS autoheader $AUTOMAKE --force-missing --add-missing --copy autoconf #install git pre-commit hooks if possible if [ -d .git/hooks ] && [ ! -f .git/hooks/pre-commit ]; then cp .git-pre-commit .git/hooks/pre-commit chmod +x .git/hooks/pre-commit fi cd $THEDIR ortp-1.0.2/build/000077500000000000000000000000001315172643600136055ustar00rootroot00000000000000ortp-1.0.2/build/.gitignore000066400000000000000000000000251315172643600155720ustar00rootroot00000000000000Makefile Makefile.in ortp-1.0.2/build/CMakeLists.txt000066400000000000000000000036161315172643600163530ustar00rootroot00000000000000############################################################################ # CMakeLists.txt # Copyright (C) 2017 Belledonne Communications, Grenoble France # ############################################################################ # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # ############################################################################ if (NOT CPACK_PACKAGE_NAME) set(CPACK_PACKAGE_NAME "ortp") ENDIF() set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../COPYING") set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${PROJECT_VERSION}) set(CPACK_SOURCE_GENERATOR "TGZ") set(CPACK_SOURCE_IGNORE_FILES "${CMAKE_BINARY_DIR}" "^${PROJECT_SOURCE_DIR}/.git*" ) bc_project_build_version(${PROJECT_VERSION} PROJECT_VERSION_BUILD) set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-${PROJECT_VERSION_BUILD}") message("Package file name is ${CPACK_PACKAGE_FILE_NAME}" ) set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/rpm/ortp.spec.cmake ${CMAKE_CURRENT_SOURCE_DIR}/../ortp.spec) include(CPack) ortp-1.0.2/build/Makefile.am000066400000000000000000000002121315172643600156340ustar00rootroot00000000000000EXTRA_DIST=android/Android.mk android/ortp_AndroidConfig.h wp8/oRTP/oRTP.sln wp8/oRTP/inttypes.h wp8/oRTP/oRTP.vcxproj wp8/oRTP/stdint.h ortp-1.0.2/build/android/000077500000000000000000000000001315172643600152255ustar00rootroot00000000000000ortp-1.0.2/build/android/Android.mk000066400000000000000000000034751315172643600171470ustar00rootroot00000000000000## ## Android.mk -Android build script- ## ## ## Copyright (C) 2010 Belledonne Communications, Grenoble, France ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU Library General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ## LOCAL_PATH:= $(call my-dir)/../../ include $(CLEAR_VARS) LOCAL_MODULE := libortp LOCAL_SRC_FILES := \ src/avprofile.c \ src/b64.c \ src/congestiondetector.c \ src/event.c \ src/extremum.c \ src/jitterctl.c \ src/kalmanrls.c \ src/logging.c \ src/netsim.c \ src/ortp.c \ src/payloadtype.c \ src/port.c \ src/posixtimer.c \ src/rtcp.c \ src/rtcp_fb.c \ src/rtcp_xr.c \ src/rtcpparse.c \ src/rtpparse.c \ src/rtpprofile.c \ src/rtpsession.c \ src/rtpsession_inet.c \ src/rtpsignaltable.c \ src/rtptimer.c \ src/scheduler.c \ src/sessionset.c \ src/str_utils.c \ src/telephonyevents.c \ src/utils.c LOCAL_CFLAGS += \ -DORTP_INET6 \ -UHAVE_CONFIG_H \ -include ortp_AndroidConfig.h \ -DHAVE_PTHREADS \ -Werror -Wall -Wno-error=strict-aliasing -Wuninitialized LOCAL_C_INCLUDES += \ $(LOCAL_PATH) \ $(LOCAL_PATH)/include \ $(LOCAL_PATH)/build/android LOCAL_CPPFLAGS = $(LOCAL_CLFAGS) LOCAL_CFLAGS += -Wdeclaration-after-statement include $(BUILD_STATIC_LIBRARY) ortp-1.0.2/build/android/ortp_AndroidConfig.h000066400000000000000000000072721315172643600211600ustar00rootroot00000000000000/* ortp-config.h. Generated from ortp-config.h.in by configure. */ /* ortp-config.h.in. Generated from configure.ac by autoheader. */ /* Defined when memory leak checking if enabled */ /* #undef ENABLE_MEMCHECK */ /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LINUX_SOUNDCARD_H 1 /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the header file. */ #define HAVE_POLL_H 1 /* Define to 1 if you have the `select' function. */ #define HAVE_SELECT 1 /* Define to 1 if you have the `seteuid' function. */ #define HAVE_SETEUID 1 /* Define to 1 if you have the `socket' function. */ #define HAVE_SOCKET 1 /* Defined when srtp support is compiled */ /*#define HAVE_SRTP 1*/ /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1 /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_AUDIO_H */ /* Define to 1 if you have the header file. */ #define HAVE_SYS_POLL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* Defined if we should not use connect() on udp sockets */ /* #undef NOCONNECT */ /* Default thread stack size (0 = let operating system decide) */ #define ORTP_DEFAULT_THREAD_STACK_SIZE 0 /* major version */ #define ORTP_MAJOR_VERSION 0 /* micro version */ #define ORTP_MICRO_VERSION 0 /* minor version */ #define ORTP_MINOR_VERSION 15 /* ortp version number */ #define ORTP_VERSION "0.15.0" /* Name of package */ #define PACKAGE "ortp" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ #define PACKAGE_NAME "ortp" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "ortp 0.15.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "ortp" /* Define to the version of this package. */ #define PACKAGE_VERSION "0.15.0" /* Defines the periodicity of the rtp scheduler in microseconds */ #define POSIXTIMER_INTERVAL 10000 /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define to 1 if you can safely include both and . */ #define TIME_WITH_SYS_TIME 1 /* Version number of package */ #define VERSION "0.15.0" /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ /* #undef WORDS_BIGENDIAN */ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus /* #undef inline */ #endif /* /dev/random cannot be guessed at ./configure time in case or * cross-compilation */ #define HAVE_DEV_RANDOM 1 ortp-1.0.2/build/osx/000077500000000000000000000000001315172643600144165ustar00rootroot00000000000000ortp-1.0.2/build/osx/Info.plist.in000066400000000000000000000025531315172643600170000ustar00rootroot00000000000000 CFBundleDevelopmentRegion English CFBundleExecutable ortp CFBundleGetInfoString ${MACOSX_BUNDLE_INFO_STRING} CFBundleIconFile ${MACOSX_BUNDLE_ICON_FILE} CFBundleIdentifier ${MACOSX_FRAMEWORK_IDENTIFIER} LSMinimumSystemVersion ${MIN_OS} MinimumOSVersion ${MIN_OS} CFBundleInfoDictionaryVersion 6.0 CFBundleLongVersionString ${MACOSX_BUNDLE_LONG_VERSION_STRING} CFBundleName ${MACOSX_BUNDLE_BUNDLE_NAME} CFBundlePackageType FMWK CFBundleShortVersionString ${ORTP_VERSION} CFBundleSignature ???? CFBundleVersion ${ORTP_VERSION} CSResourcesFileMapped NSHumanReadableCopyright ${MACOSX_BUNDLE_COPYRIGHT} NSPrincipalClass NSApplication NSHighResolutionCapable True ortp-1.0.2/build/rpm/000077500000000000000000000000001315172643600144035ustar00rootroot00000000000000ortp-1.0.2/build/rpm/ortp.spec.cmake000066400000000000000000000070021315172643600173210ustar00rootroot00000000000000# -*- rpm-spec -*- # # ortp -- Real-time Transport Protocol Stack # # Default is optimized for Pentium IV but will execute on Pentium II & # later (i686). # These 2 lines are here because we can build the RPM for flexisip, in which # case we prefix the entire installation so that we don't break compatibility # with the user's libs. # To compile with bc prefix, use rpmbuild -ba --with bc [SPEC] %define pkg_name %{?_with_bc:bc-ortp}%{!?_with_bc:ortp} %{?_with_bc: %define _prefix /opt/belledonne-communications} %define srtp %{?_without_srtp:0}%{?!_without_srtp:1} # re-define some directories for older RPMBuild versions which don't. This messes up the doc/ dir # taken from https://fedoraproject.org/wiki/Packaging:RPMMacros?rd=Packaging/RPMMacros %define _datarootdir %{_prefix}/share %define _datadir %{_datarootdir} %define _docdir %{_datadir}/doc %ifarch %ix86 %define ortp_cpu pentium4 %endif %define build_number @PROJECT_VERSION_BUILD@ Summary: Real-time Transport Protocol Stack Name: %pkg_name Version: @PROJECT_VERSION@ Release: %build_number%{?dist} #to be alined with redhat which changed epoc to 1 for an unknown reason Epoch: 1 License: GPL Group: Applications/Communications URL: http://linphone.org/ortp/ Source0: %{name}-%{version}-%build_number.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot %ifarch %ix86 BuildArch: i686 %endif %if 0%{?rhel} && 0%{?rhel} <= 7 %global cmake_name cmake3 %define ctest_name ctest3 %else %global cmake_name cmake %define ctest_name ctest %endif %description oRTP is a GPL licensed C library implementing the RTP protocol (rfc3550). It is available for most unix clones (primilarly Linux and HP-UX), and Microsoft Windows. %package devel Summary: Headers, libraries and docs for the oRTP library Group: Development/Libraries 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 GPL licensed C library implementing the RTP protocol (rfc1889). It is available for most unix clones (primilarly Linux and HP-UX), and Microsoft Windows. This package contains header files and development libraries needed to develop programs using the oRTP library. %ifarch %ix86 %define ortp_arch_cflags -malign-double -march=i686 -mtune=%{ortp_cpu} %else # Must be non-empty %define ortp_arch_cflags -Wall %endif %define ortp_cflags %ortp_arch_cflags -Wall -g -pipe -pthread -O3 -fomit-frame-pointer -fno-schedule-insns -fschedule-insns2 -fno-strict-aliasing %prep %setup -n %{name}-%{version}-%build_number %build %{expand:%%%cmake_name} . -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} -DCMAKE_PREFIX_PATH:PATH=%{_prefix} make %{?_smp_mflags} %install make install DESTDIR=%{buildroot} %check %{ctest_name} -V %{?_smp_mflags} %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc %{_docdir}/ortp-%{version}/README.md %doc %{_docdir}/ortp-%{version}/ChangeLog %doc %{_docdir}/ortp-%{version}/COPYING %doc %{_docdir}/ortp-%{version}/AUTHORS %{_libdir}/*.so.* %files devel %defattr(-,root,root,-) %doc %{_docdir}/ortp-%{version}/html/* %{_libdir}/*.a %{_libdir}/*.so %{_libdir}/pkgconfig/*.pc %{_includedir}/* %{_datadir}/oRTP/cmake/ORTPConfig.cmake %{_datadir}/oRTP/cmake/ORTPConfigVersion.cmake %{_datadir}/oRTP/cmake/ORTPTargets-noconfig.cmake %{_datadir}/oRTP/cmake/ORTPTargets.cmake %changelog * Tue Oct 25 2005 Francois-Xavier Kowalski - Add to oRTP distribution with "make rpm" target ortp-1.0.2/build/wp8/000077500000000000000000000000001315172643600143235ustar00rootroot00000000000000ortp-1.0.2/build/wp8/oRTP/000077500000000000000000000000001315172643600151475ustar00rootroot00000000000000ortp-1.0.2/build/wp8/oRTP/inttypes.h000066400000000000000000000175041315172643600172060ustar00rootroot00000000000000// ISO C9x compliant inttypes.h for Microsoft Visual Studio // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 // // Copyright (c) 2006 Alexander Chemeris // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // 3. The name of the author may be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////////// #ifndef _MSC_VER // [ #error "Use this header only with Microsoft Visual C++ compilers!" #endif // _MSC_VER ] #ifndef _MSC_INTTYPES_H_ // [ #define _MSC_INTTYPES_H_ #if _MSC_VER > 1000 #pragma once #endif #include "stdint.h" // 7.8 Format conversion of integer types typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t; // 7.8.1 Macros for format specifiers #if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198 // The fprintf macros for signed integers are: #define PRId8 "d" #define PRIi8 "i" #define PRIdLEAST8 "d" #define PRIiLEAST8 "i" #define PRIdFAST8 "d" #define PRIiFAST8 "i" #define PRId16 "hd" #define PRIi16 "hi" #define PRIdLEAST16 "hd" #define PRIiLEAST16 "hi" #define PRIdFAST16 "hd" #define PRIiFAST16 "hi" #define PRId32 "I32d" #define PRIi32 "I32i" #define PRIdLEAST32 "I32d" #define PRIiLEAST32 "I32i" #define PRIdFAST32 "I32d" #define PRIiFAST32 "I32i" #define PRId64 "I64d" #define PRIi64 "I64i" #define PRIdLEAST64 "I64d" #define PRIiLEAST64 "I64i" #define PRIdFAST64 "I64d" #define PRIiFAST64 "I64i" #define PRIdMAX "I64d" #define PRIiMAX "I64i" #define PRIdPTR "Id" #define PRIiPTR "Ii" // The fprintf macros for unsigned integers are: #define PRIo8 "o" #define PRIu8 "u" #define PRIx8 "x" #define PRIX8 "X" #define PRIoLEAST8 "o" #define PRIuLEAST8 "u" #define PRIxLEAST8 "x" #define PRIXLEAST8 "X" #define PRIoFAST8 "o" #define PRIuFAST8 "u" #define PRIxFAST8 "x" #define PRIXFAST8 "X" #define PRIo16 "ho" #define PRIu16 "hu" #define PRIx16 "hx" #define PRIX16 "hX" #define PRIoLEAST16 "ho" #define PRIuLEAST16 "hu" #define PRIxLEAST16 "hx" #define PRIXLEAST16 "hX" #define PRIoFAST16 "ho" #define PRIuFAST16 "hu" #define PRIxFAST16 "hx" #define PRIXFAST16 "hX" #define PRIo32 "I32o" #define PRIu32 "I32u" #define PRIx32 "I32x" #define PRIX32 "I32X" #define PRIoLEAST32 "I32o" #define PRIuLEAST32 "I32u" #define PRIxLEAST32 "I32x" #define PRIXLEAST32 "I32X" #define PRIoFAST32 "I32o" #define PRIuFAST32 "I32u" #define PRIxFAST32 "I32x" #define PRIXFAST32 "I32X" #define PRIo64 "I64o" #define PRIu64 "I64u" #define PRIx64 "I64x" #define PRIX64 "I64X" #define PRIoLEAST64 "I64o" #define PRIuLEAST64 "I64u" #define PRIxLEAST64 "I64x" #define PRIXLEAST64 "I64X" #define PRIoFAST64 "I64o" #define PRIuFAST64 "I64u" #define PRIxFAST64 "I64x" #define PRIXFAST64 "I64X" #define PRIoMAX "I64o" #define PRIuMAX "I64u" #define PRIxMAX "I64x" #define PRIXMAX "I64X" #define PRIoPTR "Io" #define PRIuPTR "Iu" #define PRIxPTR "Ix" #define PRIXPTR "IX" // The fscanf macros for signed integers are: #define SCNd8 "d" #define SCNi8 "i" #define SCNdLEAST8 "d" #define SCNiLEAST8 "i" #define SCNdFAST8 "d" #define SCNiFAST8 "i" #define SCNd16 "hd" #define SCNi16 "hi" #define SCNdLEAST16 "hd" #define SCNiLEAST16 "hi" #define SCNdFAST16 "hd" #define SCNiFAST16 "hi" #define SCNd32 "ld" #define SCNi32 "li" #define SCNdLEAST32 "ld" #define SCNiLEAST32 "li" #define SCNdFAST32 "ld" #define SCNiFAST32 "li" #define SCNd64 "I64d" #define SCNi64 "I64i" #define SCNdLEAST64 "I64d" #define SCNiLEAST64 "I64i" #define SCNdFAST64 "I64d" #define SCNiFAST64 "I64i" #define SCNdMAX "I64d" #define SCNiMAX "I64i" #ifdef _WIN64 // [ # define SCNdPTR "I64d" # define SCNiPTR "I64i" #else // _WIN64 ][ # define SCNdPTR "ld" # define SCNiPTR "li" #endif // _WIN64 ] // The fscanf macros for unsigned integers are: #define SCNo8 "o" #define SCNu8 "u" #define SCNx8 "x" #define SCNX8 "X" #define SCNoLEAST8 "o" #define SCNuLEAST8 "u" #define SCNxLEAST8 "x" #define SCNXLEAST8 "X" #define SCNoFAST8 "o" #define SCNuFAST8 "u" #define SCNxFAST8 "x" #define SCNXFAST8 "X" #define SCNo16 "ho" #define SCNu16 "hu" #define SCNx16 "hx" #define SCNX16 "hX" #define SCNoLEAST16 "ho" #define SCNuLEAST16 "hu" #define SCNxLEAST16 "hx" #define SCNXLEAST16 "hX" #define SCNoFAST16 "ho" #define SCNuFAST16 "hu" #define SCNxFAST16 "hx" #define SCNXFAST16 "hX" #define SCNo32 "lo" #define SCNu32 "lu" #define SCNx32 "lx" #define SCNX32 "lX" #define SCNoLEAST32 "lo" #define SCNuLEAST32 "lu" #define SCNxLEAST32 "lx" #define SCNXLEAST32 "lX" #define SCNoFAST32 "lo" #define SCNuFAST32 "lu" #define SCNxFAST32 "lx" #define SCNXFAST32 "lX" #define SCNo64 "I64o" #define SCNu64 "I64u" #define SCNx64 "I64x" #define SCNX64 "I64X" #define SCNoLEAST64 "I64o" #define SCNuLEAST64 "I64u" #define SCNxLEAST64 "I64x" #define SCNXLEAST64 "I64X" #define SCNoFAST64 "I64o" #define SCNuFAST64 "I64u" #define SCNxFAST64 "I64x" #define SCNXFAST64 "I64X" #define SCNoMAX "I64o" #define SCNuMAX "I64u" #define SCNxMAX "I64x" #define SCNXMAX "I64X" #ifdef _WIN64 // [ # define SCNoPTR "I64o" # define SCNuPTR "I64u" # define SCNxPTR "I64x" # define SCNXPTR "I64X" #else // _WIN64 ][ # define SCNoPTR "lo" # define SCNuPTR "lu" # define SCNxPTR "lx" # define SCNXPTR "lX" #endif // _WIN64 ] #endif // __STDC_FORMAT_MACROS ] // 7.8.2 Functions for greatest-width integer types // 7.8.2.1 The imaxabs function #define imaxabs _abs64 // 7.8.2.2 The imaxdiv function // This is modified version of div() function from Microsoft's div.c found // in %MSVC.NET%\crt\src\div.c #ifdef STATIC_IMAXDIV // [ static #else // STATIC_IMAXDIV ][ _inline #endif // STATIC_IMAXDIV ] imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom) { imaxdiv_t result; result.quot = numer / denom; result.rem = numer % denom; if (numer < 0 && result.rem > 0) { // did division wrong; must fix up ++result.quot; result.rem -= denom; } return result; } // 7.8.2.3 The strtoimax and strtoumax functions #define strtoimax _strtoi64 #define strtoumax _strtoui64 // 7.8.2.4 The wcstoimax and wcstoumax functions #define wcstoimax _wcstoi64 #define wcstoumax _wcstoui64 #endif // _MSC_INTTYPES_H_ ] ortp-1.0.2/build/wp8/oRTP/oRTP.sln000066400000000000000000000037171315172643600165210ustar00rootroot00000000000000 Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Express 2012 for Windows Phone Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "oRTP", "oRTP.vcxproj", "{FFC7B532-0502-4D88-AC98-9E89071CBC97}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "srtp", "..\..\..\..\..\srtp\build\wp8\srtp\srtp.vcxproj", "{B4B96BC4-2B72-4964-98E4-7FD048A43363}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|ARM = Debug|ARM Debug|Win32 = Debug|Win32 Release|ARM = Release|ARM Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {FFC7B532-0502-4D88-AC98-9E89071CBC97}.Debug|ARM.ActiveCfg = Debug|ARM {FFC7B532-0502-4D88-AC98-9E89071CBC97}.Debug|ARM.Build.0 = Debug|ARM {FFC7B532-0502-4D88-AC98-9E89071CBC97}.Debug|Win32.ActiveCfg = Debug|Win32 {FFC7B532-0502-4D88-AC98-9E89071CBC97}.Debug|Win32.Build.0 = Debug|Win32 {FFC7B532-0502-4D88-AC98-9E89071CBC97}.Release|ARM.ActiveCfg = Release|ARM {FFC7B532-0502-4D88-AC98-9E89071CBC97}.Release|ARM.Build.0 = Release|ARM {FFC7B532-0502-4D88-AC98-9E89071CBC97}.Release|Win32.ActiveCfg = Release|Win32 {FFC7B532-0502-4D88-AC98-9E89071CBC97}.Release|Win32.Build.0 = Release|Win32 {B4B96BC4-2B72-4964-98E4-7FD048A43363}.Debug|ARM.ActiveCfg = Debug|ARM {B4B96BC4-2B72-4964-98E4-7FD048A43363}.Debug|ARM.Build.0 = Debug|ARM {B4B96BC4-2B72-4964-98E4-7FD048A43363}.Debug|Win32.ActiveCfg = Debug|Win32 {B4B96BC4-2B72-4964-98E4-7FD048A43363}.Debug|Win32.Build.0 = Debug|Win32 {B4B96BC4-2B72-4964-98E4-7FD048A43363}.Release|ARM.ActiveCfg = Release|ARM {B4B96BC4-2B72-4964-98E4-7FD048A43363}.Release|ARM.Build.0 = Release|ARM {B4B96BC4-2B72-4964-98E4-7FD048A43363}.Release|Win32.ActiveCfg = Release|Win32 {B4B96BC4-2B72-4964-98E4-7FD048A43363}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal ortp-1.0.2/build/wp8/oRTP/oRTP.vcxproj000066400000000000000000000174121315172643600174150ustar00rootroot00000000000000 Debug Win32 Debug ARM Release Win32 Release ARM {ffc7b532-0502-4d88-ac98-9e89071cbc97} oRTP en-US 11.0 DynamicLibrary true v110_wp80 false DynamicLibrary false true v110_wp80 false $(SolutionDir)$(Platform)\$(Configuration)\ $(SolutionDir)$(Platform)\$(Configuration)\$(TargetName)\ false Level4 $(ProjectDir);$(ProjectDir)..\..\..\include;$(ProjectDir)..\..\..\..\..\srtp\include;$(ProjectDir)..\..\..\..\..\srtp\crypto\include;$(ProjectDir)..\..\..\..\..\srtp\build\wp8\srtp;%(AdditionalIncludeDirectories) _WIN32;_WINDLL;_USRDLL;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;ORTP_INET6;WIN32;ORTP_EXPORTS;WINDOWS_NATIVE;HAVE_SRTP;ORTP_VERSION="0.23.0";ORTP_MAJOR_VERSION=0;ORTP_MINOR_VERSION=23;ORTP_MICRO_VERSION=0;%(PreprocessorDefinitions) Default NotUsing false $(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories) Console false false ws2_32.lib;%(AdditionalDependencies) $(TargetDir)$(TargetName).lib _DEBUG;%(PreprocessorDefinitions) true NDEBUG;%(PreprocessorDefinitions) true true true false true false true true false ortp-1.0.2/build/wp8/oRTP/stdint.h000066400000000000000000000170601315172643600166310ustar00rootroot00000000000000// ISO C9x compliant stdint.h for Microsoft Visual Studio // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 // // Copyright (c) 2006-2008 Alexander Chemeris // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // 3. The name of the author may be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////////// #ifndef _MSC_VER // [ #error "Use this header only with Microsoft Visual C++ compilers!" #endif // _MSC_VER ] #ifndef _MSC_STDINT_H_ // [ #define _MSC_STDINT_H_ #if _MSC_VER > 1000 #pragma once #endif #include // For Visual Studio 6 in C++ mode and for many Visual Studio versions when // compiling for ARM we should wrap include with 'extern "C++" {}' // or compiler give many errors like this: // error C2733: second C linkage of overloaded function 'wmemchr' not allowed #ifdef __cplusplus extern "C" { #endif # include #ifdef __cplusplus } #endif // Define _W64 macros to mark types changing their size, like intptr_t. #ifndef _W64 # if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 # define _W64 __w64 # else # define _W64 # endif #endif // 7.18.1 Integer types // 7.18.1.1 Exact-width integer types // Visual Studio 6 and Embedded Visual C++ 4 doesn't // realize that, e.g. char has the same size as __int8 // so we give up on __intX for them. #if (_MSC_VER < 1300) typedef signed char int8_t; typedef signed short int16_t; typedef signed int int32_t; typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef signed __int8 int8_t; typedef signed __int16 int16_t; typedef signed __int32 int32_t; typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif typedef signed __int64 int64_t; typedef unsigned __int64 uint64_t; // 7.18.1.2 Minimum-width integer types typedef int8_t int_least8_t; typedef int16_t int_least16_t; typedef int32_t int_least32_t; typedef int64_t int_least64_t; typedef uint8_t uint_least8_t; typedef uint16_t uint_least16_t; typedef uint32_t uint_least32_t; typedef uint64_t uint_least64_t; // 7.18.1.3 Fastest minimum-width integer types typedef int8_t int_fast8_t; typedef int16_t int_fast16_t; typedef int32_t int_fast32_t; typedef int64_t int_fast64_t; typedef uint8_t uint_fast8_t; typedef uint16_t uint_fast16_t; typedef uint32_t uint_fast32_t; typedef uint64_t uint_fast64_t; // 7.18.1.4 Integer types capable of holding object pointers #ifdef _WIN64 // [ typedef signed __int64 intptr_t; typedef unsigned __int64 uintptr_t; #else // _WIN64 ][ typedef _W64 signed int intptr_t; typedef _W64 unsigned int uintptr_t; #endif // _WIN64 ] // 7.18.1.5 Greatest-width integer types typedef int64_t intmax_t; typedef uint64_t uintmax_t; // 7.18.2 Limits of specified-width integer types #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 // 7.18.2.1 Limits of exact-width integer types #define INT8_MIN ((int8_t)_I8_MIN) #define INT8_MAX _I8_MAX #define INT16_MIN ((int16_t)_I16_MIN) #define INT16_MAX _I16_MAX #define INT32_MIN ((int32_t)_I32_MIN) #define INT32_MAX _I32_MAX #define INT64_MIN ((int64_t)_I64_MIN) #define INT64_MAX _I64_MAX #define UINT8_MAX _UI8_MAX #define UINT16_MAX _UI16_MAX #define UINT32_MAX _UI32_MAX #define UINT64_MAX _UI64_MAX // 7.18.2.2 Limits of minimum-width integer types #define INT_LEAST8_MIN INT8_MIN #define INT_LEAST8_MAX INT8_MAX #define INT_LEAST16_MIN INT16_MIN #define INT_LEAST16_MAX INT16_MAX #define INT_LEAST32_MIN INT32_MIN #define INT_LEAST32_MAX INT32_MAX #define INT_LEAST64_MIN INT64_MIN #define INT_LEAST64_MAX INT64_MAX #define UINT_LEAST8_MAX UINT8_MAX #define UINT_LEAST16_MAX UINT16_MAX #define UINT_LEAST32_MAX UINT32_MAX #define UINT_LEAST64_MAX UINT64_MAX // 7.18.2.3 Limits of fastest minimum-width integer types #define INT_FAST8_MIN INT8_MIN #define INT_FAST8_MAX INT8_MAX #define INT_FAST16_MIN INT16_MIN #define INT_FAST16_MAX INT16_MAX #define INT_FAST32_MIN INT32_MIN #define INT_FAST32_MAX INT32_MAX #define INT_FAST64_MIN INT64_MIN #define INT_FAST64_MAX INT64_MAX #define UINT_FAST8_MAX UINT8_MAX #define UINT_FAST16_MAX UINT16_MAX #define UINT_FAST32_MAX UINT32_MAX #define UINT_FAST64_MAX UINT64_MAX // 7.18.2.4 Limits of integer types capable of holding object pointers #ifdef _WIN64 // [ # define INTPTR_MIN INT64_MIN # define INTPTR_MAX INT64_MAX # define UINTPTR_MAX UINT64_MAX #else // _WIN64 ][ # define INTPTR_MIN INT32_MIN # define INTPTR_MAX INT32_MAX # define UINTPTR_MAX UINT32_MAX #endif // _WIN64 ] // 7.18.2.5 Limits of greatest-width integer types #define INTMAX_MIN INT64_MIN #define INTMAX_MAX INT64_MAX #define UINTMAX_MAX UINT64_MAX // 7.18.3 Limits of other integer types #ifdef _WIN64 // [ # define PTRDIFF_MIN _I64_MIN # define PTRDIFF_MAX _I64_MAX #else // _WIN64 ][ # define PTRDIFF_MIN _I32_MIN # define PTRDIFF_MAX _I32_MAX #endif // _WIN64 ] #define SIG_ATOMIC_MIN INT_MIN #define SIG_ATOMIC_MAX INT_MAX #ifndef SIZE_MAX // [ # ifdef _WIN64 // [ # define SIZE_MAX _UI64_MAX # else // _WIN64 ][ # define SIZE_MAX _UI32_MAX # endif // _WIN64 ] #endif // SIZE_MAX ] // WCHAR_MIN and WCHAR_MAX are also defined in #ifndef WCHAR_MIN // [ # define WCHAR_MIN 0 #endif // WCHAR_MIN ] #ifndef WCHAR_MAX // [ # define WCHAR_MAX _UI16_MAX #endif // WCHAR_MAX ] #define WINT_MIN 0 #define WINT_MAX _UI16_MAX #endif // __STDC_LIMIT_MACROS ] // 7.18.4 Limits of other integer types #if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 // 7.18.4.1 Macros for minimum-width integer constants #define INT8_C(val) val##i8 #define INT16_C(val) val##i16 #define INT32_C(val) val##i32 #define INT64_C(val) val##i64 #define UINT8_C(val) val##ui8 #define UINT16_C(val) val##ui16 #define UINT32_C(val) val##ui32 #define UINT64_C(val) val##ui64 // 7.18.4.2 Macros for greatest-width integer constants #define INTMAX_C INT64_C #define UINTMAX_C UINT64_C #endif // __STDC_CONSTANT_MACROS ] #endif // _MSC_STDINT_H_ ] ortp-1.0.2/configure.ac000066400000000000000000000255771315172643600150140ustar00rootroot00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT([ortp],[1.0.1]) AC_CANONICAL_SYSTEM case $INSTALL in *ginstall*) INSTALL="$INSTALL -C" ;; esac dnl Source packaging numbers ORTP_MAJOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f1) ORTP_MINOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f2) ORTP_MICRO_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f3) ORTP_EXTRA_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f4) LIBORTP_SO_CURRENT=13 dnl increment this number when you add/change/remove an interface LIBORTP_SO_REVISION=0 dnl increment this number when you change source code, without changing interfaces; set to 0 when incrementing CURRENT LIBORTP_SO_AGE=0 dnl increment this number when you add an interface, set to 0 if you remove an interface LIBORTP_SO_VERSION=$LIBORTP_SO_CURRENT:$LIBORTP_SO_REVISION:$LIBORTP_SO_AGE ORTP_VERSION=${ORTP_MAJOR_VERSION}.${ORTP_MINOR_VERSION}.${ORTP_MICRO_VERSION} if test -n "$ORTP_EXTRA_VERSION" ; then ORTP_VERSION="${ORTP_VERSION}.${ORTP_EXTRA_VERSION}" fi ORTP_PKGCONFIG_VERSION=${ORTP_VERSION} AC_SUBST(LIBORTP_SO_CURRENT, $LIBORTP_SO_CURRENT) AC_SUBST(LIBORTP_SO_VERSION) AC_SUBST(ORTP_VERSION) AC_SUBST(ORTP_PKGCONFIG_VERSION) PACKAGE=ortp AM_INIT_AUTOMAKE([tar-ustar foreign]) m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],) AC_SUBST([docdir], [${datadir}/doc]) AC_CONFIG_HEADERS(ortp-config.h) AC_CONFIG_MACRO_DIR([m4]) AC_DEFINE_UNQUOTED(ORTP_MAJOR_VERSION,$ORTP_MAJOR_VERSION, [major version]) AC_DEFINE_UNQUOTED(ORTP_MINOR_VERSION,$ORTP_MINOR_VERSION, [minor version]) AC_DEFINE_UNQUOTED(ORTP_MICRO_VERSION,$ORTP_MICRO_VERSION, [micro version]) AC_DEFINE_UNQUOTED(ORTP_VERSION,"$ORTP_VERSION",[ortp version number]) dnl Checks for programs. AC_PROG_CC LT_INIT([win32-dll shared disable-static]) gl_LD_OUTPUT_DEF AC_MSG_CHECKING([warning make an error on compilation]) AC_ARG_ENABLE(strict, AC_HELP_STRING([--enable-strict], [Build with stricter options @<:@yes@:>@]), [strictness="${enableval}"], [strictness=yes] ) STRICT_OPTIONS="-Wall -Wuninitialized" STRICT_OPTIONS_CC="-Wdeclaration-after-statement -Wstrict-prototypes" STRICT_OPTIONS_CXX="" #for clang case $CC in *clang*) STRICT_OPTIONS="$STRICT_OPTIONS -Qunused-arguments " ;; esac # because Darwin's gcc is actually clang, we need to check it... case "$target_os" in *darwin*) STRICT_OPTIONS="$STRICT_OPTIONS -Wno-error=unknown-warning-option -Qunused-arguments -Wno-tautological-compare -Wno-unused-function " #disabled due to wrong optimization false positive with small string #(cf. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35903) STRICT_OPTIONS="$STRICT_OPTIONS -Wno-array-bounds " ;; esac if test "$strictness" = "yes" ; then STRICT_OPTIONS="$STRICT_OPTIONS -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers" CFLAGS="$CFLAGS -fno-strict-aliasing" fi AC_SUBST(STRICT_OPTIONS) AC_SUBST(STRICT_OPTIONS_CC) AC_SUBST(STRICT_OPTIONS_CXX) AC_ARG_ENABLE(perf, [AS_HELP_STRING([--enable-perf], [Disable costly features to reduce cpu consumtion (default=no)])], [perf=$enableval], [perf=no] ) ORTP_DEFS= AC_DEFINE(__APPLE_USE_RFC_3542, 1, [ Apple wants you to declare what behavior you want by defining either __APPLE_USE_RFC_3542]) dnl enable timestamp support AC_ARG_ENABLE(ntp-timestamp, [AS_HELP_STRING([--enable-ntp-timestamp], [Turn on NTP timestamping on received packet (default=no)])], [case "${enableval}" in yes) ntptimestamp=true;; no) ntptimestamp=false;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-ntp-timestamp) ;; esac], [ntptimestamp=false] ) if test x$ntptimestamp = xtrue ; then ORTP_DEFS="$ORTP_DEFS -DORTP_TIMESTAMP" fi AC_ARG_ENABLE(mode64bit, [AS_HELP_STRING([--enable-mode64bit], [Produce a 64-bit library (default=no)])], [case "${enableval}" in yes) mode64bit_enabled=yes;; no) mode64bit_enabled=no;; *) AC_MSG_ERROR("Bad value for --enable-mode64bit");; esac], [mode64bit_enabled=no] ) AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug], [Enable the display of traces showing the execution of the library (default=yes)])], [case "${enableval}" in yes) debug_enabled=yes;; no) debug_enabled=no;; *) AC_MSG_ERROR("Bad value for --enable-debug");; esac], [debug_enabled=no] ) hpux_host=no posixtimer_interval=10000 PTHREAD_LDFLAGS= case "$target_os" in *hpux*) hpux_host=yes AC_DEFINE(NOCONNECT,1,[Defined if we should not use connect() on udp sockets]) CFLAGS="$CFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506L" LIBS="$LIBS -lxnet" ;; *freebsd*) AC_DEFINE(NOCONNECT,1,[Defined if we should not use connect() on udp sockets]) PTHREAD_LDFLAGS="-pthread" ;; *mingw32ce) CFLAGS="$CFLAGS -D_WIN32_WCE -D_WIN32_WINNT=0x0501 -DORTP_STATIC" LIBS="$LIBS -lws2 -liphlpapi" mingw_found=yes ;; *mingw*) CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0501 -DORTP_STATIC" LIBS="$LIBS -lws2_32 -liphlpapi -lwinmm" mingw_found=yes ;; esac AM_CONDITIONAL(BUILD_WIN32, test "$mingw_found" = "yes") AC_CONFIG_COMMANDS([libtool-hacking], [if test "$mingw_found" = "yes" ; then echo "Hacking libtool to work with mingw..." sed -e 's/\*\" \$a_deplib \"\*/\*/' < ./libtool > libtool.tmp cp -f ./libtool.tmp ./libtool rm -f ./libtool.tmp fi], [mingw_found=$mingw_found] ) if test "$GCC" != "yes" ; then if test "$hpux_host" = "yes" ; then dnl we are probably using HPUX cc compiler, so add a +O2 to CFLAGS CFLAGS="$CFLAGS +O2 -g " if test x$mode64bit_enabled = xyes ; then CFLAGS="$CFLAGS +DA2.0W +DS2.0" fi fi else CFLAGS="$CFLAGS -Wall" fi build_scheduler=yes dnl Check if we have seteuid system call AC_CHECK_FUNCS(seteuid) dnl Check if we have arc4random family routines available AC_CHECK_FUNCS(arc4random) dnl check if we can use the pthread_library AC_CHECK_LIB(pthread, pthread_mutex_init, [pthread_enabled=yes], [pthread_enabled=no]) if test $pthread_enabled = "no" ; then build_scheduler=no else PTHREAD_LIBS="-lpthread" PTHREAD_CFLAGS="-D_REENTRANT" AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_LIBS) AC_SUBST(PTHREAD_LDFLAGS) fi AC_ARG_WITH(thread-stack-size, AC_HELP_STRING([--with-thread-stack-size=SIZE-IN-BYTES],[Set thread stack size [[default=os-default]]]), [thread_stack_size=$withval], [thread_stack_size=0] ) AC_DEFINE_UNQUOTED(ORTP_DEFAULT_THREAD_STACK_SIZE, $thread_stack_size, [Default thread stack size (0 = let uperating system decide)]) dnl check if we can use the rt library AC_CHECK_LIB(rt, clock_gettime, [rt_enabled=yes]) if test "$rt_enabled" = "yes" ; then RT_LIBS="-lrt" AC_SUBST(RT_LIBS) fi if test $debug_enabled = "yes"; then ORTP_DEFS="$ORTP_DEFS -DORTP_DEBUG_MODE" CFLAGS=`echo $CFLAGS | sed 's/-O.//'` CFLAGS="$CFLAGS -g" fi AC_ARG_ENABLE(memcheck, [AS_HELP_STRING([--enable-memcheck], [Enable memory leak detection (HPUX only)])], [case "${enableval}" in yes) memcheck_enabled=yes;; no) memcheck_enabled=no;; *) AC_MSG_ERROR("Bad value for --enable-memcheck");; esac], [memcheck_enabled=no] ) if test "$memcheck_enabled" = "yes" ; then if test "$hpux_host" = "yes" ; then AC_DEFINE(ENABLE_MEMCHECK,1,[Defined when memory leak checking if enabled]) else echo "WARNING ************ : the memory check option is only available for HPUX." fi fi dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(poll.h sys/poll.h sys/uio.h fcntl.h sys/time.h unistd.h sys/audio.h linux/soundcard.h sys/shm.h stdatomic.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_HEADER_TIME AC_WORDS_BIGENDIAN if test x$ac_cv_c_bigendian = xyes ; then ORTP_DEFS="$ORTP_DEFS -DORTP_BIGENDIAN" fi dnl Checks for library functions. AC_CHECK_FUNCS(select socket strerror) if test $hpux_host = "yes" ; then dnl it seems 10 ms is too fast on hpux and it causes trouble posixtimer_interval=20000 fi AC_DEFINE_UNQUOTED(POSIXTIMER_INTERVAL,$posixtimer_interval,[Defines the periodicity of the rtp scheduler in microseconds]) if test "$perf" = "yes" ; then CFLAGS="$CFLAGS -DPERF" fi PKG_CHECK_MODULES(BCTOOLBOX, bctoolbox, [found_bctoolbox=yes],[found_bctoolbox=no]) if test "x$found_bctoolbox" != "xyes" ; then AC_MSG_ERROR(["Could not find bctoolbox (required dependency)"]) fi ORTPDEPS_LIBS="$ORTPDEPS_LIBS $PTHREAD_LDFLAGS $BCTOOLBOX_LIBS" ORTPDEPS_CFLAGS="$ORTPDEPS_CFLAGS $PTHREAD_CFLAGS $ORTP_DEFS $BCTOOLBOX_CFLAGS" CFLAGS="$CFLAGS $ORTP_DEFS" echo "$ORTPDEPS_CFLAGS" > ortp.defs AC_ARG_ENABLE(tests, [AS_HELP_STRING([--disable-tests], [Disable compilation of tests])], [case "${enableval}" in yes) tests_enabled=true ;; no) tests_enabled=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;; esac], [tests_enabled=false] ) AM_CONDITIONAL(ENABLE_TESTS, test x$tests_enabled = xtrue) case "$target_os" in *linux*) # Eliminate -lstdc++ addition to postdeps for cross compiles. postdeps_CXX=`echo " $postdeps_CXX " | sed 's, -lstdc++ ,,g'` ;; esac dnl ################################################## dnl # Check for doxygen dnl ################################################## AC_ARG_ENABLE(documentation, [AS_HELP_STRING([--enable-documentation], [Documentation generation using doxygen (default=yes)])], [case "${enableval}" in yes) documentation_enabled=yes;; no) documentation_enabled=no;; *) AC_MSG_ERROR("Bad value for --enable-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") dnl ################################################## dnl # Check for ESP Packager dnl ################################################## AC_PATH_PROG(EPM,epm,false) AC_PATH_PROG(MKEPMLIST,mkepmlist,false) AC_PATH_PROG(EPMINSTALL,epminstall,false) AM_CONDITIONAL(WITH_EPM,test $EPM != false && test $MKEPMLIST != false && test $EPMINSTALL != false) # Preferred packaging system, as per EPM terminology case $target in *-*-linux*) if test -f /etc/debian_version ; then EPM_PKG_EXT=deb else EPM_PKG_EXT=rpm fi ;; *-hp-hpux*) EPM_PKG_EXT=depot.gz ;; *-dec-osf*) EPM_PKG_EXT=setld ;; esac AC_SUBST(EPM_PKG_EXT) # System software User & Group names case $target in *-*-linux*) SYS_USER=root SYS_GROUP=root ;; *-*-hpux*|*-dec-osf*) SYS_USER=bin SYS_GROUP=bin ;; esac AC_SUBST(SYS_USER) AC_SUBST(SYS_GROUP) # CPU Architecture case $target_cpu in i?86) ARCH=i386 ;; *) ARCH=$target_cpu ;; esac AC_SUBST(ARCH) # Various other packaging variables, that can be over-ridden ad `make # package' time SUMMARY="Implementation of RTP - RFC3550" AC_SUBST(SUMMARY) PACKAGER=anonymous AC_SUBST(PACKAGER) LICENSE=GPLv2+ AC_SUBST(LICENSE) VENDOR=Linphone AC_SUBST(VENDOR) RELEASE=1 AC_SUBST(RELEASE) AC_SUBST(ORTPDEPS_CFLAGS) AC_SUBST(ORTPDEPS_LIBS) AC_SUBST(ORTPDEPS_LDFLAGS) AC_OUTPUT( Makefile include/Makefile include/ortp/Makefile m4/Makefile src/Makefile src/tests/Makefile src/tests/win_receiver/Makefile src/tests/win_sender/Makefile build/Makefile ortp.pc ortp.spec ortp.doxygen ) ortp-1.0.2/debian/000077500000000000000000000000001315172643600137305ustar00rootroot00000000000000ortp-1.0.2/debian/changelog000066400000000000000000000026501315172643600156050ustar00rootroot00000000000000ortp (1.0.0) unstable; urgency=low * oRTP license is changed to be GPLv2 * new adaptive jitter buffer algorithm added -- Belledonne Communications Wed, 10 Jan 2017 17:36:30 +0200 ortp (0.27.0) unstable; urgency=low -- Belledonne Communications Wed, 1 June 2016 16:47:00 +0200 ortp (0.26.0) unstable; urgency=low * Fix DSCP on Windows. -- Belledonne Communications Wed, 26 May 2016 14:21:00 +0200 ortp (0.25.0) unstable; urgency=low * Suppot AVPF generic NACK * Add payload types for RTT (Real-Time Text) and Codec2 * Bug fixes -- Belledonne Communications Mon, 02 Nov 2015 13:54:00 +0200 ortp (0.24.2) unstable; urgency=low * Initial package -- Belledonne Communications Tue, 07 Oct 2015 14:44:00 +0200 ortp (0.23.0) unstable; urgency=low * Network simulator improvements * Security bugfixes * Updated to use ZRTPCPP>=4.0 -- Sylvain Berfini Mon, 31 March 2013 15:10:01 +0200 ortp (0.22.0) unstable; urgency=low * New version + migrate to ABI9. * -- Guillaume Beraudo Thu, 30 May 2013 15:32:14 +0200 ortp (0.21.0) unstable; urgency=low * Initial Release. -- Guillaume Beraudo Fri, 3 May 2012 13:58:16 +0200 ortp-1.0.2/debian/compat000066400000000000000000000000021315172643600151260ustar00rootroot000000000000008 ortp-1.0.2/debian/control000066400000000000000000000037661315172643600153470ustar00rootroot00000000000000Source: ortp Section: sound Priority: optional Maintainer: Debian VoIP Team Uploaders: Samuel Mimram , Kilian Krause , Faidon Liambotis , Mark Purcell , Lionel Elie Mamane , Tzafrir Cohen Build-Depends: debhelper (>= 8), autoconf, automake, autotools-dev, libtool, pkg-config, intltool, libglib2.0-dev, doxygen Standards-Version: 3.9.1 Homepage: http://www.linphone.org/ Vcs-Svn: svn://svn.debian.org/pkg-voip/linphone/trunk/ Vcs-Browser: http://anonscm.debian.org/viewvc/pkg-voip/linphone/trunk/ Package: libortp13 Section: libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: Real-time Transport Protocol stack This library implements the RFC1889 (RTP) with a easy to use API with high and low level access. . Its main features are: - support for multiple profiles, AV profile (RFC 1890) being the default one; - an optional packet scheduler for synchronizing RTP recv and send; - implements blocking and non blocking IO for RTP sessions; - supports multiplexing IO; - supports part of RFC2833 for telephone events over RTP. Package: libortp-dev Section: libdevel Architecture: any Depends: ${misc:Depends}, libortp13 (= ${binary:Version}) Conflicts: libortp7-dev Description: Real-time Transport Protocol stack This library implements the RFC1889 (RTP) with a easy to use API with high and low level access. . Its main features are: - support for multiple profiles, AV profile (RFC 1890) being the default one; - an optional packet scheduler for synchronizing RTP recv and send; - implements blocking and non blocking IO for RTP sessions; - supports multiplexing IO; - supports part of RFC2833 for telephone events over RTP. Package: libortp13-dbg Architecture: any Depends: libortp13 (= ${binary:Version}), ${misc:Depends} Section: debug Priority: extra Description: Debugging symbols for ortp . ortp-1.0.2/debian/copyright000066400000000000000000000065451315172643600156750ustar00rootroot00000000000000This package was debianized by Samuel Mimram on Wed, 30 Jun 2004 13:58:16 +0200. It was downloaded from http://www.linphone.org/ Upstream Authors: Simon Morlat, Florian Wintertein, Aymeric Moizard, Sharath Udupa. Copyright (C) 2001-2005 Simon Morlat This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. On Debian systems you can find a copy of this license in /usr/share/common-licenses/GPL. Some libraries are under other copyrights / licenses: * FFmpeg: Copyright (C) 2000, 2001 Gerard Lantau. Released under the GNU General Public License (see /usr/share/common-licenses/GPL) * gsmlib: Copyright 1992, 1993, 1994 by Jutta Degener and Carsten Bormann, Technische Universitaet Berlin Released under the following license: Any use of this software is permitted provided that this notice is not removed and that neither the authors nor the Technische Universitaet Berlin are deemed to have made any representations as to the suitability of this software for any purpose nor are held responsible for any defects of this software. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. As a matter of courtesy, the authors request to be informed about uses this software has found, about bugs in this software, and about any improvements that may be of general interest. Berlin, 28.11.1994 Jutta Degener Carsten Bormann * oRTP: Copyright (C) Simon Morlat Released under the GNU Lesser General Public License (see /usr/share/common-licenses/LGPL). * osipua: Copyright (C) 2001 Simon Morlat and Aymeric Moizard Released under the GNU Lesser General Public License (see /usr/share/common-licenses/LGPL). * speex: Copyright (C) 2002-2003 Jean-Marc Valin Released under the following license: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the Xiph.org Foundation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ortp-1.0.2/debian/libortp-dev.docs000066400000000000000000000000331315172643600170250ustar00rootroot00000000000000usr/share/doc/ortp-*/html/ ortp-1.0.2/debian/libortp-dev.install000066400000000000000000000001701315172643600175450ustar00rootroot00000000000000usr/include/ortp/*.h usr/lib/libortp.so usr/lib/pkgconfig/ortp.pc usr/share/doc/ortp-*/html usr/share/doc/libortp13-dev ortp-1.0.2/debian/libortp13.docs000066400000000000000000000000171315172643600164170ustar00rootroot00000000000000AUTHORS README ortp-1.0.2/debian/libortp13.install000066400000000000000000000000251315172643600171340ustar00rootroot00000000000000usr/lib/libortp.so.* ortp-1.0.2/debian/rules000077500000000000000000000005501315172643600150100ustar00rootroot00000000000000#!/usr/bin/make -f %: dh $@ --parallel --with autotools_dev override_dh_auto_configure: ./configure --prefix=/usr --with-srtp=none # As of today, neither flexisip or linphone need the broken srtp override_dh_makeshlibs: dh_makeshlibs -V override_dh_installchangelogs: dh_installchangelogs NEWS override_dh_strip: dh_strip --dbg-package=libortp13-dbg ortp-1.0.2/debian/source/000077500000000000000000000000001315172643600152305ustar00rootroot00000000000000ortp-1.0.2/debian/source/format000066400000000000000000000000151315172643600164370ustar00rootroot000000000000003.0 (native) ortp-1.0.2/debian/source/options000066400000000000000000000001651315172643600166500ustar00rootroot00000000000000# Don't store changes on autogenerated files extend-diff-ignore = "(^|/)(config\.sub|config\.guess|Makefile|m4/.*)$" ortp-1.0.2/debian/watch000066400000000000000000000002061315172643600147570ustar00rootroot00000000000000version=3 http://download.savannah.gnu.org/releases-noredirect/linphone/stable/sources/ linphone-([\d\.]+).tar.gz debian svn-upgrade ortp-1.0.2/docs/000077500000000000000000000000001315172643600134365ustar00rootroot00000000000000ortp-1.0.2/docs/.gitignore000066400000000000000000000000251315172643600154230ustar00rootroot00000000000000Makefile Makefile.in ortp-1.0.2/include/000077500000000000000000000000001315172643600141315ustar00rootroot00000000000000ortp-1.0.2/include/.gitignore000066400000000000000000000000251315172643600161160ustar00rootroot00000000000000Makefile Makefile.in ortp-1.0.2/include/CMakeLists.txt000066400000000000000000000030621315172643600166720ustar00rootroot00000000000000############################################################################ # CMakeLists.txt # Copyright (C) 2014 Belledonne Communications, Grenoble France # ############################################################################ # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # ############################################################################ set(HEADER_FILES b64.h event.h logging.h ortp.h payloadtype.h port.h rtcp.h rtp.h rtpprofile.h rtpsession.h rtpsignaltable.h sessionset.h str_utils.h telephonyevents.h utils.h ) set(ORTP_HEADER_FILES ) foreach(HEADER_FILE ${HEADER_FILES}) list(APPEND ORTP_HEADER_FILES "${CMAKE_CURRENT_LIST_DIR}/ortp/${HEADER_FILE}") endforeach() set(ORTP_HEADER_FILES ${ORTP_HEADER_FILES} PARENT_SCOPE) install(FILES ${ORTP_HEADER_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ortp PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) ortp-1.0.2/include/MSVC/000077500000000000000000000000001315172643600147015ustar00rootroot00000000000000ortp-1.0.2/include/MSVC/inttypes.h000066400000000000000000000175041315172643600167400ustar00rootroot00000000000000// ISO C9x compliant inttypes.h for Microsoft Visual Studio // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 // // Copyright (c) 2006 Alexander Chemeris // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // 3. The name of the author may be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////////// #ifndef _MSC_VER // [ #error "Use this header only with Microsoft Visual C++ compilers!" #endif // _MSC_VER ] #ifndef _MSC_INTTYPES_H_ // [ #define _MSC_INTTYPES_H_ #if _MSC_VER > 1000 #pragma once #endif #include "stdint.h" // 7.8 Format conversion of integer types typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t; // 7.8.1 Macros for format specifiers #if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198 // The fprintf macros for signed integers are: #define PRId8 "d" #define PRIi8 "i" #define PRIdLEAST8 "d" #define PRIiLEAST8 "i" #define PRIdFAST8 "d" #define PRIiFAST8 "i" #define PRId16 "hd" #define PRIi16 "hi" #define PRIdLEAST16 "hd" #define PRIiLEAST16 "hi" #define PRIdFAST16 "hd" #define PRIiFAST16 "hi" #define PRId32 "I32d" #define PRIi32 "I32i" #define PRIdLEAST32 "I32d" #define PRIiLEAST32 "I32i" #define PRIdFAST32 "I32d" #define PRIiFAST32 "I32i" #define PRId64 "I64d" #define PRIi64 "I64i" #define PRIdLEAST64 "I64d" #define PRIiLEAST64 "I64i" #define PRIdFAST64 "I64d" #define PRIiFAST64 "I64i" #define PRIdMAX "I64d" #define PRIiMAX "I64i" #define PRIdPTR "Id" #define PRIiPTR "Ii" // The fprintf macros for unsigned integers are: #define PRIo8 "o" #define PRIu8 "u" #define PRIx8 "x" #define PRIX8 "X" #define PRIoLEAST8 "o" #define PRIuLEAST8 "u" #define PRIxLEAST8 "x" #define PRIXLEAST8 "X" #define PRIoFAST8 "o" #define PRIuFAST8 "u" #define PRIxFAST8 "x" #define PRIXFAST8 "X" #define PRIo16 "ho" #define PRIu16 "hu" #define PRIx16 "hx" #define PRIX16 "hX" #define PRIoLEAST16 "ho" #define PRIuLEAST16 "hu" #define PRIxLEAST16 "hx" #define PRIXLEAST16 "hX" #define PRIoFAST16 "ho" #define PRIuFAST16 "hu" #define PRIxFAST16 "hx" #define PRIXFAST16 "hX" #define PRIo32 "I32o" #define PRIu32 "I32u" #define PRIx32 "I32x" #define PRIX32 "I32X" #define PRIoLEAST32 "I32o" #define PRIuLEAST32 "I32u" #define PRIxLEAST32 "I32x" #define PRIXLEAST32 "I32X" #define PRIoFAST32 "I32o" #define PRIuFAST32 "I32u" #define PRIxFAST32 "I32x" #define PRIXFAST32 "I32X" #define PRIo64 "I64o" #define PRIu64 "I64u" #define PRIx64 "I64x" #define PRIX64 "I64X" #define PRIoLEAST64 "I64o" #define PRIuLEAST64 "I64u" #define PRIxLEAST64 "I64x" #define PRIXLEAST64 "I64X" #define PRIoFAST64 "I64o" #define PRIuFAST64 "I64u" #define PRIxFAST64 "I64x" #define PRIXFAST64 "I64X" #define PRIoMAX "I64o" #define PRIuMAX "I64u" #define PRIxMAX "I64x" #define PRIXMAX "I64X" #define PRIoPTR "Io" #define PRIuPTR "Iu" #define PRIxPTR "Ix" #define PRIXPTR "IX" // The fscanf macros for signed integers are: #define SCNd8 "d" #define SCNi8 "i" #define SCNdLEAST8 "d" #define SCNiLEAST8 "i" #define SCNdFAST8 "d" #define SCNiFAST8 "i" #define SCNd16 "hd" #define SCNi16 "hi" #define SCNdLEAST16 "hd" #define SCNiLEAST16 "hi" #define SCNdFAST16 "hd" #define SCNiFAST16 "hi" #define SCNd32 "ld" #define SCNi32 "li" #define SCNdLEAST32 "ld" #define SCNiLEAST32 "li" #define SCNdFAST32 "ld" #define SCNiFAST32 "li" #define SCNd64 "I64d" #define SCNi64 "I64i" #define SCNdLEAST64 "I64d" #define SCNiLEAST64 "I64i" #define SCNdFAST64 "I64d" #define SCNiFAST64 "I64i" #define SCNdMAX "I64d" #define SCNiMAX "I64i" #ifdef _WIN64 // [ # define SCNdPTR "I64d" # define SCNiPTR "I64i" #else // _WIN64 ][ # define SCNdPTR "ld" # define SCNiPTR "li" #endif // _WIN64 ] // The fscanf macros for unsigned integers are: #define SCNo8 "o" #define SCNu8 "u" #define SCNx8 "x" #define SCNX8 "X" #define SCNoLEAST8 "o" #define SCNuLEAST8 "u" #define SCNxLEAST8 "x" #define SCNXLEAST8 "X" #define SCNoFAST8 "o" #define SCNuFAST8 "u" #define SCNxFAST8 "x" #define SCNXFAST8 "X" #define SCNo16 "ho" #define SCNu16 "hu" #define SCNx16 "hx" #define SCNX16 "hX" #define SCNoLEAST16 "ho" #define SCNuLEAST16 "hu" #define SCNxLEAST16 "hx" #define SCNXLEAST16 "hX" #define SCNoFAST16 "ho" #define SCNuFAST16 "hu" #define SCNxFAST16 "hx" #define SCNXFAST16 "hX" #define SCNo32 "lo" #define SCNu32 "lu" #define SCNx32 "lx" #define SCNX32 "lX" #define SCNoLEAST32 "lo" #define SCNuLEAST32 "lu" #define SCNxLEAST32 "lx" #define SCNXLEAST32 "lX" #define SCNoFAST32 "lo" #define SCNuFAST32 "lu" #define SCNxFAST32 "lx" #define SCNXFAST32 "lX" #define SCNo64 "I64o" #define SCNu64 "I64u" #define SCNx64 "I64x" #define SCNX64 "I64X" #define SCNoLEAST64 "I64o" #define SCNuLEAST64 "I64u" #define SCNxLEAST64 "I64x" #define SCNXLEAST64 "I64X" #define SCNoFAST64 "I64o" #define SCNuFAST64 "I64u" #define SCNxFAST64 "I64x" #define SCNXFAST64 "I64X" #define SCNoMAX "I64o" #define SCNuMAX "I64u" #define SCNxMAX "I64x" #define SCNXMAX "I64X" #ifdef _WIN64 // [ # define SCNoPTR "I64o" # define SCNuPTR "I64u" # define SCNxPTR "I64x" # define SCNXPTR "I64X" #else // _WIN64 ][ # define SCNoPTR "lo" # define SCNuPTR "lu" # define SCNxPTR "lx" # define SCNXPTR "lX" #endif // _WIN64 ] #endif // __STDC_FORMAT_MACROS ] // 7.8.2 Functions for greatest-width integer types // 7.8.2.1 The imaxabs function #define imaxabs _abs64 // 7.8.2.2 The imaxdiv function // This is modified version of div() function from Microsoft's div.c found // in %MSVC.NET%\crt\src\div.c #ifdef STATIC_IMAXDIV // [ static #else // STATIC_IMAXDIV ][ _inline #endif // STATIC_IMAXDIV ] imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom) { imaxdiv_t result; result.quot = numer / denom; result.rem = numer % denom; if (numer < 0 && result.rem > 0) { // did division wrong; must fix up ++result.quot; result.rem -= denom; } return result; } // 7.8.2.3 The strtoimax and strtoumax functions #define strtoimax _strtoi64 #define strtoumax _strtoui64 // 7.8.2.4 The wcstoimax and wcstoumax functions #define wcstoimax _wcstoi64 #define wcstoumax _wcstoui64 #endif // _MSC_INTTYPES_H_ ] ortp-1.0.2/include/MSVC/stdint.h000066400000000000000000000170601315172643600163630ustar00rootroot00000000000000// ISO C9x compliant stdint.h for Microsoft Visual Studio // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 // // Copyright (c) 2006-2008 Alexander Chemeris // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // 3. The name of the author may be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////////// #ifndef _MSC_VER // [ #error "Use this header only with Microsoft Visual C++ compilers!" #endif // _MSC_VER ] #ifndef _MSC_STDINT_H_ // [ #define _MSC_STDINT_H_ #if _MSC_VER > 1000 #pragma once #endif #include // For Visual Studio 6 in C++ mode and for many Visual Studio versions when // compiling for ARM we should wrap include with 'extern "C++" {}' // or compiler give many errors like this: // error C2733: second C linkage of overloaded function 'wmemchr' not allowed #ifdef __cplusplus extern "C" { #endif # include #ifdef __cplusplus } #endif // Define _W64 macros to mark types changing their size, like intptr_t. #ifndef _W64 # if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 # define _W64 __w64 # else # define _W64 # endif #endif // 7.18.1 Integer types // 7.18.1.1 Exact-width integer types // Visual Studio 6 and Embedded Visual C++ 4 doesn't // realize that, e.g. char has the same size as __int8 // so we give up on __intX for them. #if (_MSC_VER < 1300) typedef signed char int8_t; typedef signed short int16_t; typedef signed int int32_t; typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef signed __int8 int8_t; typedef signed __int16 int16_t; typedef signed __int32 int32_t; typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif typedef signed __int64 int64_t; typedef unsigned __int64 uint64_t; // 7.18.1.2 Minimum-width integer types typedef int8_t int_least8_t; typedef int16_t int_least16_t; typedef int32_t int_least32_t; typedef int64_t int_least64_t; typedef uint8_t uint_least8_t; typedef uint16_t uint_least16_t; typedef uint32_t uint_least32_t; typedef uint64_t uint_least64_t; // 7.18.1.3 Fastest minimum-width integer types typedef int8_t int_fast8_t; typedef int16_t int_fast16_t; typedef int32_t int_fast32_t; typedef int64_t int_fast64_t; typedef uint8_t uint_fast8_t; typedef uint16_t uint_fast16_t; typedef uint32_t uint_fast32_t; typedef uint64_t uint_fast64_t; // 7.18.1.4 Integer types capable of holding object pointers #ifdef _WIN64 // [ typedef signed __int64 intptr_t; typedef unsigned __int64 uintptr_t; #else // _WIN64 ][ typedef _W64 signed int intptr_t; typedef _W64 unsigned int uintptr_t; #endif // _WIN64 ] // 7.18.1.5 Greatest-width integer types typedef int64_t intmax_t; typedef uint64_t uintmax_t; // 7.18.2 Limits of specified-width integer types #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 // 7.18.2.1 Limits of exact-width integer types #define INT8_MIN ((int8_t)_I8_MIN) #define INT8_MAX _I8_MAX #define INT16_MIN ((int16_t)_I16_MIN) #define INT16_MAX _I16_MAX #define INT32_MIN ((int32_t)_I32_MIN) #define INT32_MAX _I32_MAX #define INT64_MIN ((int64_t)_I64_MIN) #define INT64_MAX _I64_MAX #define UINT8_MAX _UI8_MAX #define UINT16_MAX _UI16_MAX #define UINT32_MAX _UI32_MAX #define UINT64_MAX _UI64_MAX // 7.18.2.2 Limits of minimum-width integer types #define INT_LEAST8_MIN INT8_MIN #define INT_LEAST8_MAX INT8_MAX #define INT_LEAST16_MIN INT16_MIN #define INT_LEAST16_MAX INT16_MAX #define INT_LEAST32_MIN INT32_MIN #define INT_LEAST32_MAX INT32_MAX #define INT_LEAST64_MIN INT64_MIN #define INT_LEAST64_MAX INT64_MAX #define UINT_LEAST8_MAX UINT8_MAX #define UINT_LEAST16_MAX UINT16_MAX #define UINT_LEAST32_MAX UINT32_MAX #define UINT_LEAST64_MAX UINT64_MAX // 7.18.2.3 Limits of fastest minimum-width integer types #define INT_FAST8_MIN INT8_MIN #define INT_FAST8_MAX INT8_MAX #define INT_FAST16_MIN INT16_MIN #define INT_FAST16_MAX INT16_MAX #define INT_FAST32_MIN INT32_MIN #define INT_FAST32_MAX INT32_MAX #define INT_FAST64_MIN INT64_MIN #define INT_FAST64_MAX INT64_MAX #define UINT_FAST8_MAX UINT8_MAX #define UINT_FAST16_MAX UINT16_MAX #define UINT_FAST32_MAX UINT32_MAX #define UINT_FAST64_MAX UINT64_MAX // 7.18.2.4 Limits of integer types capable of holding object pointers #ifdef _WIN64 // [ # define INTPTR_MIN INT64_MIN # define INTPTR_MAX INT64_MAX # define UINTPTR_MAX UINT64_MAX #else // _WIN64 ][ # define INTPTR_MIN INT32_MIN # define INTPTR_MAX INT32_MAX # define UINTPTR_MAX UINT32_MAX #endif // _WIN64 ] // 7.18.2.5 Limits of greatest-width integer types #define INTMAX_MIN INT64_MIN #define INTMAX_MAX INT64_MAX #define UINTMAX_MAX UINT64_MAX // 7.18.3 Limits of other integer types #ifdef _WIN64 // [ # define PTRDIFF_MIN _I64_MIN # define PTRDIFF_MAX _I64_MAX #else // _WIN64 ][ # define PTRDIFF_MIN _I32_MIN # define PTRDIFF_MAX _I32_MAX #endif // _WIN64 ] #define SIG_ATOMIC_MIN INT_MIN #define SIG_ATOMIC_MAX INT_MAX #ifndef SIZE_MAX // [ # ifdef _WIN64 // [ # define SIZE_MAX _UI64_MAX # else // _WIN64 ][ # define SIZE_MAX _UI32_MAX # endif // _WIN64 ] #endif // SIZE_MAX ] // WCHAR_MIN and WCHAR_MAX are also defined in #ifndef WCHAR_MIN // [ # define WCHAR_MIN 0 #endif // WCHAR_MIN ] #ifndef WCHAR_MAX // [ # define WCHAR_MAX _UI16_MAX #endif // WCHAR_MAX ] #define WINT_MIN 0 #define WINT_MAX _UI16_MAX #endif // __STDC_LIMIT_MACROS ] // 7.18.4 Limits of other integer types #if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 // 7.18.4.1 Macros for minimum-width integer constants #define INT8_C(val) val##i8 #define INT16_C(val) val##i16 #define INT32_C(val) val##i32 #define INT64_C(val) val##i64 #define UINT8_C(val) val##ui8 #define UINT16_C(val) val##ui16 #define UINT32_C(val) val##ui32 #define UINT64_C(val) val##ui64 // 7.18.4.2 Macros for greatest-width integer constants #define INTMAX_C INT64_C #define UINTMAX_C UINT64_C #endif // __STDC_CONSTANT_MACROS ] #endif // _MSC_STDINT_H_ ] ortp-1.0.2/include/Makefile.am000066400000000000000000000000151315172643600161610ustar00rootroot00000000000000SUBDIRS=ortp ortp-1.0.2/include/ortp/000077500000000000000000000000001315172643600151155ustar00rootroot00000000000000ortp-1.0.2/include/ortp/.gitignore000066400000000000000000000000251315172643600171020ustar00rootroot00000000000000Makefile Makefile.in ortp-1.0.2/include/ortp/Makefile.am000066400000000000000000000004211315172643600171460ustar00rootroot00000000000000ortp_includedir=$(includedir)/ortp ortp_include_HEADERS=str_utils.h rtpsession.h rtp.h port.h logging.h \ ortp.h telephonyevents.h sessionset.h payloadtype.h rtpprofile.h rtpsignaltable.h \ rtcp.h event.h utils.h \ b64.h EXTRA_DIST=$(ortp_include_HEADERS) ortp-1.0.2/include/ortp/b64.h000066400000000000000000000414361315172643600156710ustar00rootroot00000000000000/* ///////////////////////////////////////////////////////////////////////////// * File: b64/b64.h * * Purpose: Header file for the b64 library * * Created: 18th October 2004 * Updated: 24th August 2008 * * Thanks: To Adam McLaurin, for ideas regarding the b64_decode2() and * b64_encode2(). * * Home: http://synesis.com.au/software/ * * Copyright (c) 2004-2008, Matthew Wilson and Synesis Software * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of * any contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * ////////////////////////////////////////////////////////////////////////// */ /** \file ortp/b64.h * * \brief [C/C++] Header file for the b64 library. */ #ifndef B64_INCL_B64_H_B64 #define B64_INCL_B64_H_B64 /* ///////////////////////////////////////////////////////////////////////////// * Version information */ #ifndef B64_DOCUMENTATION_SKIP_SECTION # define B64_VER_B64_H_B64_MAJOR 1 # define B64_VER_B64_H_B64_MINOR 5 # define B64_VER_B64_H_B64_REVISION 4 # define B64_VER_B64_H_B64_EDIT 28 #endif /* !B64_DOCUMENTATION_SKIP_SECTION */ /** \def B64_VER_MAJOR * The major version number of b64 */ /** \def B64_VER_MINOR * The minor version number of b64 */ /** \def B64_VER_REVISION * The revision version number of b64 */ /** \def B64_VER * The current composite version number of b64 */ #ifndef B64_DOCUMENTATION_SKIP_SECTION # define B64_VER_1_0_1 0x01000100 # define B64_VER_1_0_2 0x01000200 # define B64_VER_1_0_3 0x01000300 # define B64_VER_1_1_1 0x01010100 # define B64_VER_1_1_2 0x01010200 # define B64_VER_1_1_3 0x01010300 # define B64_VER_1_2_1 0x01020100 # define B64_VER_1_2_2 0x01020200 # define B64_VER_1_2_3 0x01020300 # define B64_VER_1_2_4 0x01020400 # define B64_VER_1_2_5 0x01020500 # define B64_VER_1_2_6 0x01020600 # define B64_VER_1_2_7 0x01020700 # define B64_VER_1_3_1 0x010301ff # define B64_VER_1_3_2 0x010302ff # define B64_VER_1_3_3 0x010303ff # define B64_VER_1_3_4 0x010304ff # define B64_VER B64_VER_1_3_4 #else /* ? B64_DOCUMENTATION_SKIP_SECTION */ # define B64_VER 0x010304ff #endif /* !B64_DOCUMENTATION_SKIP_SECTION */ #define B64_VER_MAJOR 1 #define B64_VER_MINOR 3 #define B64_VER_REVISION 4 /* ///////////////////////////////////////////////////////////////////////////// * Includes */ #include /* ///////////////////////////////////////////////////////////////////////////// * Namespace */ #if !defined(B64_NO_NAMESPACE) && \ !defined(__cplusplus) # define B64_NO_NAMESPACE #endif /* !B64_NO_NAMESPACE && !__cplusplus */ #ifdef B64_NAMESPACE # undef B64_NAMESPACE #endif /* B64_NAMESPACE */ #ifdef B64_NAMESPACE_QUALIFIER # undef B64_NAMESPACE_QUALIFIER #endif /* B64_NAMESPACE_QUALIFIER */ #ifndef B64_NO_NAMESPACE # ifdef B64_CUSTOM_NAMESPACE # define B64_NAMESPACE B64_CUSTOM_NAMESPACE # else /* ? B64_CUSTOM_NAMESPACE */ # define B64_NAMESPACE b64 # endif /* B64_CUSTOM_NAMESPACE */ # if defined(B64_CUSTOM_NAMESPACE) && \ defined(B64_CUSTOM_NAMESPACE_QUALIFIER) # define B64_NAMESPACE_QUALIFIER B64_CUSTOM_NAMESPACE_QUALIFIER # else /* B64_CUSTOM_NAMESPACE && B64_CUSTOM_NAMESPACE_QUALIFIER */ # define B64_NAMESPACE_QUALIFIER ::B64_NAMESPACE # endif /* B64_CUSTOM_NAMESPACE && B64_CUSTOM_NAMESPACE_QUALIFIER */ /** \brief [C/C++] The b64 namespace, within which the core library types and functions * reside in C++ compilation. In C compilation, they all reside in the global * namespace. * * \htmlonly *
* \endhtmlonly */ namespace B64_NAMESPACE { #endif /* !B64_NO_NAMESPACE */ /* ///////////////////////////////////////////////////////////////////////////// * Enumerations */ /** \brief Return codes (from b64_encode2() / b64_decode2()) */ enum B64_RC { B64_RC_OK = 0 /*!< Operation was successful. */ , B64_RC_INSUFFICIENT_BUFFER = 1 /*!< The given translation buffer was not of sufficient size. */ , B64_RC_TRUNCATED_INPUT = 2 /*!< The input did not represent a fully formed stream of octet couplings. */ , B64_RC_DATA_ERROR = 3 /*!< Invalid data. */ #ifndef B64_DOCUMENTATION_SKIP_SECTION , B64_max_RC_value #endif /* !B64_DOCUMENTATION_SKIP_SECTION */ }; #ifndef __cplusplus typedef enum B64_RC B64_RC; #endif /* !__cplusplus */ /** \brief Coding behaviour modification flags (for b64_encode2() / b64_decode2()) */ enum B64_FLAGS { B64_F_LINE_LEN_USE_PARAM = 0x0000 /*!< Uses the lineLen parameter to b64_encode2(). Ignored by b64_decode2(). */ , B64_F_LINE_LEN_INFINITE = 0x0001 /*!< Ignores the lineLen parameter to b64_encode2(). Line length is infinite. Ignored by b64_decode2(). */ , B64_F_LINE_LEN_64 = 0x0002 /*!< Ignores the lineLen parameter to b64_encode2(). Line length is 64. Ignored by b64_decode2(). */ , B64_F_LINE_LEN_76 = 0x0003 /*!< Ignores the lineLen parameter to b64_encode2(). Line length is 76. Ignored by b64_decode2(). */ , B64_F_LINE_LEN_MASK = 0x000f /*!< Mask for testing line length flags to b64_encode2(). Ignored by b64_encode2(). */ , B64_F_STOP_ON_NOTHING = 0x0000 /*!< Decoding ignores all invalid characters in the input data. Ignored by b64_encode2(). */ , B64_F_STOP_ON_UNKNOWN_CHAR = 0x0100 /*!< Causes decoding to break if any non-Base-64 [a-zA-Z0-9=+/], non-whitespace character is encountered. Ignored by b64_encode2(). */ , B64_F_STOP_ON_UNEXPECTED_WS = 0x0200 /*!< Causes decoding to break if any unexpected whitespace is encountered. Ignored by b64_encode2(). */ , B64_F_STOP_ON_BAD_CHAR = 0x0300 /*!< Causes decoding to break if any non-Base-64 [a-zA-Z0-9=+/] character is encountered. Ignored by b64_encode2(). */ }; #ifndef __cplusplus typedef enum B64_FLAGS B64_FLAGS; #endif /* !__cplusplus */ /* ///////////////////////////////////////////////////////////////////////////// * Functions */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** \brief Encodes a block of binary data into Base-64 * * \param src Pointer to the block to be encoded. May not be NULL, except when * \c dest is NULL, in which case it is ignored. * \param srcSize Length of block to be encoded * \param dest Pointer to the buffer into which the result is to be written. May * be NULL, in which case the function returns the required length * \param destLen Length of the buffer into which the result is to be written. Must * be at least as large as that indicated by the return value from * \link b64::b64_encode b64_encode(NULL, srcSize, NULL, 0)\endlink. * * \return 0 if the size of the buffer was insufficient, or the length of the * converted buffer was longer than \c destLen * * \note The function returns the required length if \c dest is NULL * * \note The function returns the required length if \c dest is NULL. The returned size * might be larger than the actual required size, but will never be smaller. * * \note Threading: The function is fully re-entrant. * * \see b64::encode() */ ORTP_PUBLIC size_t b64_encode(void const *src, size_t srcSize, char *dest, size_t destLen); /** \brief Encodes a block of binary data into Base-64 * * \param src Pointer to the block to be encoded. May not be NULL, except when * \c dest is NULL, in which case it is ignored. * \param srcSize Length of block to be encoded * \param dest Pointer to the buffer into which the result is to be written. May * be NULL, in which case the function returns the required length * \param destLen Length of the buffer into which the result is to be written. Must * be at least as large as that indicated by the return value from * \link b64::b64_encode2 b64_encode2(NULL, srcSize, NULL, 0, flags, lineLen, rc)\endlink. * \param flags A combination of the B64_FLAGS enumeration, that moderate the * behaviour of the function * \param lineLen If the flags parameter contains B64_F_LINE_LEN_USE_PARAM, then * this parameter represents the length of the lines into which the encoded form is split, * with a hard line break ('\\r\\n'). If this value is 0, then the line is not * split. If it is <0, then the RFC-1113 recommended line length of 64 is used * \param rc The return code representing the status of the operation. May be NULL. * * \return 0 if the size of the buffer was insufficient, or the length of the * converted buffer was longer than \c destLen * * \note The function returns the required length if \c dest is NULL. The returned size * might be larger than the actual required size, but will never be smaller. * * \note Threading: The function is fully re-entrant. * * \see b64::encode() */ size_t b64_encode2( void const *src , size_t srcSize , char *dest , size_t destLen , unsigned flags , int lineLen /* = 0 */ , B64_RC *rc /* = NULL */); /** \brief Decodes a sequence of Base-64 into a block of binary data * * \param src Pointer to the Base-64 block to be decoded. May not be NULL, except when * \c dest is NULL, in which case it is ignored. If \c dest is NULL, and \c src is * not NULL, then the returned value is calculated exactly, otherwise a value * is returned that is guaranteed to be large enough to hold the decoded block. * * \param srcLen Length of block to be encoded. Must be an integral of 4, the Base-64 * encoding quantum, otherwise the Base-64 block is assumed to be invalid * \param dest Pointer to the buffer into which the result is to be written. May * be NULL, in which case the function returns the required length * \param destSize Length of the buffer into which the result is to be written. Must * be at least as large as that indicated by the return value from * \c b64_decode(src, srcSize, NULL, 0), even in the case where the encoded form * contains a number of characters that will be ignored, resulting in a lower total * length of converted form. * * \return 0 if the size of the buffer was insufficient, or the length of the * converted buffer was longer than \c destSize * * \note The function returns the required length if \c dest is NULL. The returned size * might be larger than the actual required size, but will never be smaller. * * \note \anchor anchor__4_characters The behaviour of both * \link b64::b64_encode2 b64_encode2()\endlink * and * \link b64::b64_decode2 b64_decode2()\endlink * are undefined if the line length is not a multiple of 4. * * \note Threading: The function is fully re-entrant. * * \see b64::decode() */ ORTP_PUBLIC size_t b64_decode(char const *src, size_t srcLen, void *dest, size_t destSize); /** \brief Decodes a sequence of Base-64 into a block of binary data * * \param src Pointer to the Base-64 block to be decoded. May not be NULL, except when * \c dest is NULL, in which case it is ignored. If \c dest is NULL, and \c src is * not NULL, then the returned value is calculated exactly, otherwise a value * is returned that is guaranteed to be large enough to hold the decoded block. * * \param srcLen Length of block to be encoded. Must be an integral of 4, the Base-64 * encoding quantum, otherwise the Base-64 block is assumed to be invalid * \param dest Pointer to the buffer into which the result is to be written. May * be NULL, in which case the function returns the required length * \param destSize Length of the buffer into which the result is to be written. Must * be at least as large as that indicated by the return value from * \c b64_decode(src, srcSize, NULL, 0), even in the case where the encoded form * contains a number of characters that will be ignored, resulting in a lower total * length of converted form. * \param flags A combination of the B64_FLAGS enumeration, that moderate the * behaviour of the function. * \param rc The return code representing the status of the operation. May be NULL. * \param badChar If the flags parameter does not contain B64_F_STOP_ON_NOTHING, this * parameter specifies the address of a pointer that will be set to point to any * character in the sequence that stops the parsing, as dictated by the flags * parameter. May be NULL. * * \return 0 if the size of the buffer was insufficient, or the length of the * converted buffer was longer than \c destSize, or a bad character stopped parsing. * * \note The function returns the required length if \c dest is NULL. The returned size * might be larger than the actual required size, but will never be smaller. * * \note The behaviour of both * \link b64::b64_encode2 b64_encode2()\endlink * and * \link b64::b64_decode2 b64_decode2()\endlink * are undefined if the line length is not a multiple of 4. * * \note Threading: The function is fully re-entrant. * * \see b64::decode() */ size_t b64_decode2( char const *src , size_t srcLen , void *dest , size_t destSize , unsigned flags , char const **badChar /* = NULL */ , B64_RC *rc /* = NULL */); /** \brief Returns the textual description of the error * * \param code The \link b64::B64_RC error code\endlink */ char const *b64_getErrorString(B64_RC code); /** \brief Returns the length of the textual description of the error * * \see b64_getErrorString() * * \param code The \link b64::B64_RC error code\endlink */ size_t b64_getErrorStringLength(B64_RC code); #ifdef __cplusplus } /* extern "C" */ #endif /* __cplusplus */ /* ///////////////////////////////////////////////////////////////////////////// * Namespace */ #ifndef B64_NO_NAMESPACE } /* namespace B64_NAMESPACE */ # ifndef B64_DOCUMENTATION_SKIP_SECTION namespace stlsoft { inline char const *c_str_data_a( B64_NAMESPACE_QUALIFIER::B64_RC code) { return B64_NAMESPACE_QUALIFIER::b64_getErrorString(code); } inline char const *c_str_data( B64_NAMESPACE_QUALIFIER::B64_RC code) { return B64_NAMESPACE_QUALIFIER::b64_getErrorString(code); } inline size_t c_str_len_a( B64_NAMESPACE_QUALIFIER::B64_RC code) { return B64_NAMESPACE_QUALIFIER::b64_getErrorStringLength(code); } inline size_t c_str_len( B64_NAMESPACE_QUALIFIER::B64_RC code) { return B64_NAMESPACE_QUALIFIER::b64_getErrorStringLength(code); } inline char const *c_str_ptr_a( B64_NAMESPACE_QUALIFIER::B64_RC code) { return B64_NAMESPACE_QUALIFIER::b64_getErrorString(code); } inline char const *c_str_ptr( B64_NAMESPACE_QUALIFIER::B64_RC code) { return B64_NAMESPACE_QUALIFIER::b64_getErrorString(code); } } /* namespace stlsoft */ # endif /* !B64_DOCUMENTATION_SKIP_SECTION */ #endif /* !B64_NO_NAMESPACE */ /* ////////////////////////////////////////////////////////////////////////// */ #endif /* B64_INCL_B64_H_B64 */ /* ////////////////////////////////////////////////////////////////////////// */ ortp-1.0.2/include/ortp/event.h000066400000000000000000000142501315172643600164110ustar00rootroot00000000000000/* * The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) implementation with additional features. * Copyright (C) 2017 Belledonne Communications SARL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ortp_events_h #define ortp_events_h #include "ortp/str_utils.h" #include "ortp/rtcp.h" #include "bctoolbox/list.h" typedef mblk_t OrtpEvent; typedef unsigned long OrtpEventType; typedef enum { OrtpRTPSocket, OrtpRTCPSocket } OrtpSocketType; struct _OrtpEventData{ mblk_t *packet; /* most events are associated to a received packet */ struct sockaddr_storage source_addr; socklen_t source_addrlen; ortpTimeSpec ts; union { int telephone_event; int payload_type; bool_t dtls_stream_encrypted; bool_t zrtp_stream_encrypted; bool_t ice_processing_successful; struct _ZrtpInfo{ char sas[32]; // up to 31 + null characters bool_t verified; bool_t cache_mismatch; bool_t pad[2]; } zrtp_info; OrtpSocketType socket_type; uint32_t received_rtt_character; bool_t congestion_detected; float video_bandwidth_available; } info; }; typedef struct _OrtpEventData OrtpEventData; #ifdef __cplusplus extern "C"{ #endif ORTP_PUBLIC OrtpEvent * ortp_event_new(OrtpEventType tp); ORTP_PUBLIC OrtpEventType ortp_event_get_type(const OrtpEvent *ev); /* type is one of the following*/ #define ORTP_EVENT_STUN_PACKET_RECEIVED 1 #define ORTP_EVENT_PAYLOAD_TYPE_CHANGED 2 #define ORTP_EVENT_TELEPHONE_EVENT 3 #define ORTP_EVENT_RTCP_PACKET_RECEIVED 4 /** #ifndef ORTP_LOG_DOMAIN #define ORTP_LOG_DOMAIN NULL #endif #ifdef __cplusplus extern "C" { #endif typedef enum { ORTP_DEBUG=1, ORTP_TRACE=1<<1, ORTP_MESSAGE=1<<2, ORTP_WARNING=1<<3, ORTP_ERROR=1<<4, ORTP_FATAL=1<<5, ORTP_LOGLEV_END=1<<6 } OrtpLogLevel; typedef void (*OrtpLogFunc)(const char *domain, OrtpLogLevel lev, const char *fmt, va_list args); ORTP_PUBLIC void ortp_set_log_file(FILE *file); ORTP_PUBLIC void ortp_set_log_handler(OrtpLogFunc func); ORTP_PUBLIC OrtpLogFunc ortp_get_log_handler(void); ORTP_PUBLIC void ortp_logv_out(const char *domain, OrtpLogLevel level, const char *fmt, va_list args); #define ortp_log_level_enabled(domain, level) (ortp_get_log_level_mask(domain) & (level)) ORTP_PUBLIC void ortp_logv(const char *domain, OrtpLogLevel level, const char *fmt, va_list args); /** * Flushes the log output queue. * WARNING: Must be called from the thread that has been defined with ortp_set_log_thread_id(). */ ORTP_PUBLIC void ortp_logv_flush(void); /** * Activate all log level greater or equal than specified level argument. **/ ORTP_PUBLIC void ortp_set_log_level(const char *domain, OrtpLogLevel level); ORTP_PUBLIC void ortp_set_log_level_mask(const char *domain, int levelmask); ORTP_PUBLIC unsigned int ortp_get_log_level_mask(const char *domain); /** * Tell oRTP the id of the thread used to output the logs. * This is meant to output all the logs from the same thread to prevent deadlock problems at the application level. * @param[in] thread_id The id of the thread that will output the logs (can be obtained using ortp_thread_self()). */ ORTP_PUBLIC void ortp_set_log_thread_id(unsigned long thread_id); #ifdef __GNUC__ #define CHECK_FORMAT_ARGS(m,n) __attribute__((format(printf,m,n))) #else #define CHECK_FORMAT_ARGS(m,n) #endif #ifdef __clang__ /*in case of compile with -g static inline can produce this type of warning*/ #pragma GCC diagnostic ignored "-Wunused-function" #endif #ifdef ORTP_DEBUG_MODE static ORTP_INLINE void CHECK_FORMAT_ARGS(1,2) ortp_debug(const char *fmt,...) { va_list args; va_start (args, fmt); ortp_logv(ORTP_LOG_DOMAIN, ORTP_DEBUG, fmt, args); va_end (args); } #else #define ortp_debug(...) #endif #ifdef ORTP_NOMESSAGE_MODE #define ortp_log(...) #define ortp_message(...) #define ortp_warning(...) #else static ORTP_INLINE void CHECK_FORMAT_ARGS(2,3) ortp_log(OrtpLogLevel lev, const char *fmt,...) { va_list args; va_start (args, fmt); ortp_logv(ORTP_LOG_DOMAIN, lev, fmt, args); va_end (args); } static ORTP_INLINE void CHECK_FORMAT_ARGS(1,2) ortp_message(const char *fmt,...) { va_list args; va_start (args, fmt); ortp_logv(ORTP_LOG_DOMAIN, ORTP_MESSAGE, fmt, args); va_end (args); } static ORTP_INLINE void CHECK_FORMAT_ARGS(1,2) ortp_warning(const char *fmt,...) { va_list args; va_start (args, fmt); ortp_logv(ORTP_LOG_DOMAIN, ORTP_WARNING, fmt, args); va_end (args); } #endif static ORTP_INLINE void CHECK_FORMAT_ARGS(1,2) ortp_error(const char *fmt,...) { va_list args; va_start (args, fmt); ortp_logv(ORTP_LOG_DOMAIN, ORTP_ERROR, fmt, args); va_end (args); } static ORTP_INLINE void CHECK_FORMAT_ARGS(1,2) ortp_fatal(const char *fmt,...) { va_list args; va_start (args, fmt); ortp_logv(ORTP_LOG_DOMAIN, ORTP_FATAL, fmt, args); va_end (args); } #ifdef __QNX__ void ortp_qnx_log_handler(const char *domain, OrtpLogLevel lev, const char *fmt, va_list args); #endif #ifdef __cplusplus } #endif #endif ortp-1.0.2/include/ortp/ortp.h000066400000000000000000000054621315172643600162610ustar00rootroot00000000000000/* * The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) implementation with additional features. * Copyright (C) 2017 Belledonne Communications SARL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** \mainpage oRTP API documentation * * \section init Initializing oRTP * * see ortp.h documentation. * * \section rtpsession the RtpSession object * * see the rtpsession.h documentation. * * \section payloadtypes Managing PayloadType(s) and RtpProfile(s) * * see the payloadtype.h documentation. * * \section telephonevents Sending and receiving telephone-event (RFC2833) * * see the telephonyevents.h documentation. * To get informed about incoming telephone-event you can register a callback * using rtp_session_signal_connect() or by registering an event queue using * rtp_session_register_event_queue(). * * \section sessionset Managing several RtpSession simultaneously * * see the sessionset.h documentation. * * \section rtcp Parsing incoming rtcp packets. * * The parsing api is defined in rtcp.h (not yet documented). * * \section examples Examples * * oRTP comes with a set of examples in src/tests. * - rtprecv.c rtpsend.c show how to receive and send a single RTP stream. * - mrtprecv.c mrtpsend.c show how to receive and send multiple RTP streams * simultaneously * */ /** * \file ortp.h * \brief General purpose library functions. * **/ #ifndef ORTP_H #define ORTP_H #include "ortp/logging.h" #include "ortp/rtpsession.h" #include "ortp/sessionset.h" #ifdef __cplusplus extern "C" { #endif ORTP_PUBLIC bool_t ortp_min_version_required(int major, int minor, int micro); ORTP_PUBLIC void ortp_init(void); ORTP_PUBLIC void ortp_scheduler_init(void); ORTP_PUBLIC void ortp_exit(void); /****************/ /*statistics api*/ /****************/ extern rtp_stats_t ortp_global_stats; ORTP_PUBLIC void ortp_global_stats_reset(void); ORTP_PUBLIC rtp_stats_t *ortp_get_global_stats(void); ORTP_PUBLIC void ortp_global_stats_display(void); ORTP_PUBLIC void rtp_stats_display(const rtp_stats_t *stats, const char *header); ORTP_PUBLIC void rtp_stats_reset(rtp_stats_t *stats); #ifdef __cplusplus } #endif #endif ortp-1.0.2/include/ortp/payloadtype.h000066400000000000000000000174251315172643600176320ustar00rootroot00000000000000/* * The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) implementation with additional features. * Copyright (C) 2017 Belledonne Communications SARL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * \file payloadtype.h * \brief Definition of payload types * **/ #ifndef PAYLOADTYPE_H #define PAYLOADTYPE_H #include #ifdef __cplusplus extern "C"{ #endif /* flags for PayloadType::flags */ #define PAYLOAD_TYPE_ALLOCATED (1) /*payload type represents a VBR codec*/ #define PAYLOAD_TYPE_IS_VBR (1<<1) #define PAYLOAD_TYPE_RTCP_FEEDBACK_ENABLED (1<<2) /* private flags for future use by ortp */ #define PAYLOAD_TYPE_PRIV1 (1<<3) /* user flags, can be used by the application on top of oRTP */ #define PAYLOAD_TYPE_USER_FLAG_0 (1<<4) #define PAYLOAD_TYPE_USER_FLAG_1 (1<<5) #define PAYLOAD_TYPE_USER_FLAG_2 (1<<6) #define PAYLOAD_TYPE_USER_FLAG_3 (1<<7) #define PAYLOAD_TYPE_USER_FLAG_4 (1<<8) /* ask for more if you need*/ #define PAYLOAD_TYPE_FLAG_CAN_RECV PAYLOAD_TYPE_USER_FLAG_1 #define PAYLOAD_TYPE_FLAG_CAN_SEND PAYLOAD_TYPE_USER_FLAG_2 #define PAYLOAD_AUDIO_CONTINUOUS 0 #define PAYLOAD_AUDIO_PACKETIZED 1 #define PAYLOAD_VIDEO 2 #define PAYLOAD_TEXT 3 #define PAYLOAD_OTHER 4 /* ?? */ #define PAYLOAD_TYPE_AVPF_NONE 0 #define PAYLOAD_TYPE_AVPF_FIR (1 << 0) #define PAYLOAD_TYPE_AVPF_PLI (1 << 1) #define PAYLOAD_TYPE_AVPF_SLI (1 << 2) #define PAYLOAD_TYPE_AVPF_RPSI (1 << 3) struct _PayloadTypeAvpfParams { unsigned char features; /**< A bitmask of PAYLOAD_TYPE_AVPF_* macros. */ bool_t rpsi_compatibility; /*< Linphone uses positive feeback for RPSI. However first versions handling AVPF wrongly declared RPSI as negative feedback, so this is kept for compatibility with these versions but will probably be removed at some point in time. */ uint16_t trr_interval; /**< The interval in milliseconds between regular RTCP packets. */ }; struct _OrtpPayloadType { int type; /**< one of PAYLOAD_* macros*/ int clock_rate; /**< rtp clock rate*/ char bits_per_sample; /* in case of continuous audio data */ char *zero_pattern; int pattern_length; /* other useful information for the application*/ int normal_bitrate; /*in bit/s */ char *mime_type; /**flags|=((int)flag) #define payload_type_unset_flag(pt,flag) (pt)->flags&=(~(int)flag) #define payload_type_get_flags(pt) (pt)->flags ORTP_PUBLIC PayloadType *payload_type_new(void); ORTP_PUBLIC PayloadType *payload_type_clone(const PayloadType *payload); ORTP_PUBLIC char *payload_type_get_rtpmap(PayloadType *pt); ORTP_PUBLIC void payload_type_destroy(PayloadType *pt); ORTP_PUBLIC void payload_type_set_recv_fmtp(PayloadType *pt, const char *fmtp); ORTP_PUBLIC void payload_type_set_send_fmtp(PayloadType *pt, const char *fmtp); ORTP_PUBLIC void payload_type_append_recv_fmtp(PayloadType *pt, const char *fmtp); ORTP_PUBLIC void payload_type_append_send_fmtp(PayloadType *pt, const char *fmtp); #define payload_type_get_avpf_params(pt) ((pt)->avpf) ORTP_PUBLIC void payload_type_set_avpf_params(PayloadType *pt, PayloadTypeAvpfParams params); ORTP_PUBLIC bool_t payload_type_is_vbr(const PayloadType *pt); #define payload_type_get_bitrate(pt) ((pt)->normal_bitrate) #define payload_type_get_rate(pt) ((pt)->clock_rate) #define payload_type_get_mime(pt) ((pt)->mime_type) ORTP_PUBLIC bool_t fmtp_get_value(const char *fmtp, const char *param_name, char *result, size_t result_len); #define payload_type_set_user_data(pt,p) (pt)->user_data=(p) #define payload_type_get_user_data(pt) ((pt)->user_data) /* some payload types */ /* audio */ ORTP_VAR_PUBLIC PayloadType payload_type_pcmu8000; ORTP_VAR_PUBLIC PayloadType payload_type_pcma8000; ORTP_VAR_PUBLIC PayloadType payload_type_pcm8000; ORTP_VAR_PUBLIC PayloadType payload_type_l16_mono; ORTP_VAR_PUBLIC PayloadType payload_type_l16_stereo; ORTP_VAR_PUBLIC PayloadType payload_type_lpc1016; ORTP_VAR_PUBLIC PayloadType payload_type_g729; ORTP_VAR_PUBLIC PayloadType payload_type_g7231; ORTP_VAR_PUBLIC PayloadType payload_type_g7221; ORTP_VAR_PUBLIC PayloadType payload_type_cn; ORTP_VAR_PUBLIC PayloadType payload_type_g726_40; ORTP_VAR_PUBLIC PayloadType payload_type_g726_32; ORTP_VAR_PUBLIC PayloadType payload_type_g726_24; ORTP_VAR_PUBLIC PayloadType payload_type_g726_16; ORTP_VAR_PUBLIC PayloadType payload_type_aal2_g726_40; ORTP_VAR_PUBLIC PayloadType payload_type_aal2_g726_32; ORTP_VAR_PUBLIC PayloadType payload_type_aal2_g726_24; ORTP_VAR_PUBLIC PayloadType payload_type_aal2_g726_16; ORTP_VAR_PUBLIC PayloadType payload_type_gsm; ORTP_VAR_PUBLIC PayloadType payload_type_lpc; ORTP_VAR_PUBLIC PayloadType payload_type_lpc1015; ORTP_VAR_PUBLIC PayloadType payload_type_speex_nb; ORTP_VAR_PUBLIC PayloadType payload_type_speex_wb; ORTP_VAR_PUBLIC PayloadType payload_type_speex_uwb; ORTP_VAR_PUBLIC PayloadType payload_type_ilbc; ORTP_VAR_PUBLIC PayloadType payload_type_amr; ORTP_VAR_PUBLIC PayloadType payload_type_amrwb; ORTP_VAR_PUBLIC PayloadType payload_type_truespeech; ORTP_VAR_PUBLIC PayloadType payload_type_evrc0; ORTP_VAR_PUBLIC PayloadType payload_type_evrcb0; ORTP_VAR_PUBLIC PayloadType payload_type_silk_nb; ORTP_VAR_PUBLIC PayloadType payload_type_silk_mb; ORTP_VAR_PUBLIC PayloadType payload_type_silk_wb; ORTP_VAR_PUBLIC PayloadType payload_type_silk_swb; ORTP_VAR_PUBLIC PayloadType payload_type_aaceld_16k; ORTP_VAR_PUBLIC PayloadType payload_type_aaceld_22k; ORTP_VAR_PUBLIC PayloadType payload_type_aaceld_32k; ORTP_VAR_PUBLIC PayloadType payload_type_aaceld_44k; ORTP_VAR_PUBLIC PayloadType payload_type_aaceld_48k; ORTP_VAR_PUBLIC PayloadType payload_type_opus; ORTP_VAR_PUBLIC PayloadType payload_type_isac; ORTP_VAR_PUBLIC PayloadType payload_type_gsm_efr; ORTP_VAR_PUBLIC PayloadType payload_type_codec2; ORTP_VAR_PUBLIC PayloadType payload_type_bv16; /* video */ ORTP_VAR_PUBLIC PayloadType payload_type_mpv; ORTP_VAR_PUBLIC PayloadType payload_type_h261; ORTP_VAR_PUBLIC PayloadType payload_type_h263; ORTP_VAR_PUBLIC PayloadType payload_type_h263_1998; ORTP_VAR_PUBLIC PayloadType payload_type_h263_2000; ORTP_VAR_PUBLIC PayloadType payload_type_mp4v; ORTP_VAR_PUBLIC PayloadType payload_type_theora; ORTP_VAR_PUBLIC PayloadType payload_type_h264; ORTP_VAR_PUBLIC PayloadType payload_type_x_snow; ORTP_VAR_PUBLIC PayloadType payload_type_jpeg; ORTP_VAR_PUBLIC PayloadType payload_type_vp8; ORTP_VAR_PUBLIC PayloadType payload_type_g722; /* text */ ORTP_VAR_PUBLIC PayloadType payload_type_t140; ORTP_VAR_PUBLIC PayloadType payload_type_t140_red; /* non standard file transfer over UDP */ ORTP_VAR_PUBLIC PayloadType payload_type_x_udpftp; /* telephone-event */ ORTP_VAR_PUBLIC PayloadType payload_type_telephone_event; #ifdef __cplusplus } #endif #endif ortp-1.0.2/include/ortp/port.h000066400000000000000000000263441315172643600162630ustar00rootroot00000000000000/* * The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) implementation with additional features. * Copyright (C) 2017 Belledonne Communications SARL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* this file is responsible of the portability of the stack */ #ifndef ORTP_PORT_H #define ORTP_PORT_H #if __APPLE__ #include "TargetConditionals.h" #endif #if !defined(_WIN32) && !defined(_WIN32_WCE) /********************************/ /* definitions for UNIX flavour */ /********************************/ #include #include #include #include #include #include #include #include #include #ifdef __linux #include #endif #include #include #include #if defined(_XOPEN_SOURCE_EXTENDED) || !defined(__hpux) #include #endif #include #include typedef int ortp_socket_t; typedef pthread_t ortp_thread_t; typedef pthread_mutex_t ortp_mutex_t; typedef pthread_cond_t ortp_cond_t; #ifdef __INTEL_COMPILER #pragma warning(disable : 111) // statement is unreachable #pragma warning(disable : 181) // argument is incompatible with corresponding format string conversion #pragma warning(disable : 188) // enumerated type mixed with another type #pragma warning(disable : 593) // variable "xxx" was set but never used #pragma warning(disable : 810) // conversion from "int" to "unsigned short" may lose significant bits #pragma warning(disable : 869) // parameter "xxx" was never referenced #pragma warning(disable : 981) // operands are evaluated in unspecified order #pragma warning(disable : 1418) // external function definition with no prior declaration #pragma warning(disable : 1419) // external declaration in primary source file #pragma warning(disable : 1469) // "cc" clobber ignored #endif #define ORTP_PUBLIC #define ORTP_INLINE inline #ifdef __cplusplus extern "C" { #endif int __ortp_thread_join(ortp_thread_t thread, void **ptr); int __ortp_thread_create(ortp_thread_t *thread, pthread_attr_t *attr, void * (*routine)(void*), void *arg); unsigned long __ortp_thread_self(void); #ifdef __cplusplus } #endif #define ortp_thread_create __ortp_thread_create #define ortp_thread_join __ortp_thread_join #define ortp_thread_self __ortp_thread_self #define ortp_thread_exit pthread_exit #define ortp_mutex_init pthread_mutex_init #define ortp_mutex_lock pthread_mutex_lock #define ortp_mutex_unlock pthread_mutex_unlock #define ortp_mutex_destroy pthread_mutex_destroy #define ortp_cond_init pthread_cond_init #define ortp_cond_signal pthread_cond_signal #define ortp_cond_broadcast pthread_cond_broadcast #define ortp_cond_wait pthread_cond_wait #define ortp_cond_destroy pthread_cond_destroy #define SOCKET_OPTION_VALUE void * #define SOCKET_BUFFER void * #define getSocketError() strerror(errno) #define getSocketErrorCode() (errno) #define ortp_gettimeofday(tv,tz) gettimeofday(tv,tz) #define ortp_log10f(x) log10f(x) #else /*********************************/ /* definitions for WIN32 flavour */ /*********************************/ #include #define _CRT_RAND_S #include #include #include #include #ifdef _MSC_VER #include #endif #if defined(__MINGW32__) || !defined(WINAPI_FAMILY_PARTITION) || !defined(WINAPI_PARTITION_DESKTOP) #define ORTP_WINDOWS_DESKTOP 1 #elif defined(WINAPI_FAMILY_PARTITION) #if defined(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) #define ORTP_WINDOWS_DESKTOP 1 #elif defined(WINAPI_PARTITION_PHONE_APP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP) #define ORTP_WINDOWS_PHONE 1 #elif defined(WINAPI_PARTITION_APP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) #define ORTP_WINDOWS_UNIVERSAL 1 #endif #endif #ifdef _MSC_VER #ifdef ORTP_STATIC #define ORTP_PUBLIC #else #ifdef ORTP_EXPORTS #define ORTP_PUBLIC __declspec(dllexport) #else #define ORTP_PUBLIC __declspec(dllimport) #endif #endif #pragma push_macro("_WINSOCKAPI_") #ifndef _WINSOCKAPI_ #define _WINSOCKAPI_ #endif typedef unsigned __int64 uint64_t; typedef __int64 int64_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; typedef int int32_t; typedef unsigned char uint8_t; typedef __int16 int16_t; #else #include /*provided by mingw32*/ #include #define ORTP_PUBLIC ORTP_PUBLIC char* strtok_r(char *str, const char *delim, char **nextp); #endif #define vsnprintf _vsnprintf typedef SOCKET ortp_socket_t; #ifdef ORTP_WINDOWS_DESKTOP typedef HANDLE ortp_cond_t; typedef HANDLE ortp_mutex_t; #else typedef CONDITION_VARIABLE ortp_cond_t; typedef SRWLOCK ortp_mutex_t; #endif typedef HANDLE ortp_thread_t; #define ortp_thread_create WIN_thread_create #define ortp_thread_join WIN_thread_join #define ortp_thread_self WIN_thread_self #define ortp_thread_exit(arg) #define ortp_mutex_init WIN_mutex_init #define ortp_mutex_lock WIN_mutex_lock #define ortp_mutex_unlock WIN_mutex_unlock #define ortp_mutex_destroy WIN_mutex_destroy #define ortp_cond_init WIN_cond_init #define ortp_cond_signal WIN_cond_signal #define ortp_cond_broadcast WIN_cond_broadcast #define ortp_cond_wait WIN_cond_wait #define ortp_cond_destroy WIN_cond_destroy #ifdef __cplusplus extern "C" { #endif ORTP_PUBLIC int WIN_mutex_init(ortp_mutex_t *m, void *attr_unused); ORTP_PUBLIC int WIN_mutex_lock(ortp_mutex_t *mutex); ORTP_PUBLIC int WIN_mutex_unlock(ortp_mutex_t *mutex); ORTP_PUBLIC int WIN_mutex_destroy(ortp_mutex_t *mutex); ORTP_PUBLIC int WIN_thread_create(ortp_thread_t *t, void *attr_unused, void *(*func)(void*), void *arg); ORTP_PUBLIC int WIN_thread_join(ortp_thread_t thread, void **unused); ORTP_PUBLIC unsigned long WIN_thread_self(void); ORTP_PUBLIC int WIN_cond_init(ortp_cond_t *cond, void *attr_unused); ORTP_PUBLIC int WIN_cond_wait(ortp_cond_t * cond, ortp_mutex_t * mutex); ORTP_PUBLIC int WIN_cond_signal(ortp_cond_t * cond); ORTP_PUBLIC int WIN_cond_broadcast(ortp_cond_t * cond); ORTP_PUBLIC int WIN_cond_destroy(ortp_cond_t * cond); #ifdef __cplusplus } #endif #define SOCKET_OPTION_VALUE char * #define ORTP_INLINE __inline #if defined(_WIN32_WCE) #define ortp_log10f(x) (float)log10 ((double)x) #ifdef assert #undef assert #endif /*assert*/ #define assert(exp) ((void)0) #ifdef errno #undef errno #endif /*errno*/ #define errno GetLastError() #ifdef strerror #undef strerror #endif /*strerror*/ const char * ortp_strerror(DWORD value); #define strerror ortp_strerror #else /*_WIN32_WCE*/ #define ortp_log10f(x) log10f(x) #endif ORTP_PUBLIC const char *getWinSocketError(int error); #ifndef getSocketErrorCode #define getSocketErrorCode() WSAGetLastError() #endif #ifndef getSocketError #define getSocketError() getWinSocketError(WSAGetLastError()) #endif #ifndef F_OK #define F_OK 00 /* Visual Studio does not define F_OK */ #endif #ifdef __cplusplus extern "C"{ #endif ORTP_PUBLIC int ortp_gettimeofday (struct timeval *tv, void* tz); #ifdef _WORKAROUND_MINGW32_BUGS char * WSAAPI gai_strerror(int errnum); #endif #ifdef __cplusplus } #endif #endif #ifndef _BOOL_T_ #define _BOOL_T_ typedef unsigned char bool_t; #endif /* _BOOL_T_ */ #undef TRUE #undef FALSE #define TRUE 1 #define FALSE 0 typedef struct ortpTimeSpec{ int64_t tv_sec; int64_t tv_nsec; }ortpTimeSpec; #ifdef __cplusplus extern "C"{ #endif ORTP_PUBLIC void* ortp_malloc(size_t sz); ORTP_PUBLIC void ortp_free(void *ptr); ORTP_PUBLIC void* ortp_realloc(void *ptr, size_t sz); ORTP_PUBLIC void* ortp_malloc0(size_t sz); ORTP_PUBLIC char * ortp_strdup(const char *tmp); /*override the allocator with this method, to be called BEFORE ortp_init()*/ typedef struct _OrtpMemoryFunctions{ void *(*malloc_fun)(size_t sz); void *(*realloc_fun)(void *ptr, size_t sz); void (*free_fun)(void *ptr); }OrtpMemoryFunctions; void ortp_set_memory_functions(OrtpMemoryFunctions *functions); #define ortp_new(type,count) (type*)ortp_malloc(sizeof(type)*(count)) #define ortp_new0(type,count) (type*)ortp_malloc0(sizeof(type)*(count)) ORTP_PUBLIC int close_socket(ortp_socket_t sock); ORTP_PUBLIC int set_non_blocking_socket(ortp_socket_t sock); ORTP_PUBLIC char *ortp_strndup(const char *str,int n); ORTP_PUBLIC char *ortp_strdup_printf(const char *fmt,...); ORTP_PUBLIC char *ortp_strdup_vprintf(const char *fmt, va_list ap); ORTP_PUBLIC char *ortp_strcat_printf(char *dst, const char *fmt,...); ORTP_PUBLIC char *ortp_strcat_vprintf(char *dst, const char *fmt, va_list ap); ORTP_PUBLIC int ortp_file_exist(const char *pathname); ORTP_PUBLIC void ortp_get_cur_time(ortpTimeSpec *ret); void _ortp_get_cur_time(ortpTimeSpec *ret, bool_t realtime); ORTP_PUBLIC uint64_t ortp_get_cur_time_ms(void); ORTP_PUBLIC void ortp_sleep_ms(int ms); ORTP_PUBLIC void ortp_sleep_until(const ortpTimeSpec *ts); ORTP_PUBLIC int ortp_timespec_compare(const ortpTimeSpec *s1, const ortpTimeSpec *s2); ORTP_PUBLIC unsigned int ortp_random(void); /* portable named pipes and shared memory*/ #if !defined(_WIN32_WCE) #ifdef _WIN32 typedef HANDLE ortp_pipe_t; #define ORTP_PIPE_INVALID INVALID_HANDLE_VALUE #else typedef int ortp_pipe_t; #define ORTP_PIPE_INVALID (-1) #endif ORTP_PUBLIC ortp_pipe_t ortp_server_pipe_create(const char *name); /* * warning: on win32 ortp_server_pipe_accept_client() might return INVALID_HANDLE_VALUE without * any specific error, this happens when ortp_server_pipe_close() is called on another pipe. * This pipe api is not thread-safe. */ ORTP_PUBLIC ortp_pipe_t ortp_server_pipe_accept_client(ortp_pipe_t server); ORTP_PUBLIC int ortp_server_pipe_close(ortp_pipe_t spipe); ORTP_PUBLIC int ortp_server_pipe_close_client(ortp_pipe_t client); ORTP_PUBLIC ortp_pipe_t ortp_client_pipe_connect(const char *name); ORTP_PUBLIC int ortp_client_pipe_close(ortp_pipe_t sock); ORTP_PUBLIC int ortp_pipe_read(ortp_pipe_t p, uint8_t *buf, int len); ORTP_PUBLIC int ortp_pipe_write(ortp_pipe_t p, const uint8_t *buf, int len); ORTP_PUBLIC void *ortp_shm_open(unsigned int keyid, int size, int create); ORTP_PUBLIC void ortp_shm_close(void *memory); ORTP_PUBLIC bool_t ortp_is_multicast_addr(const struct sockaddr *addr); #endif #ifdef __cplusplus } #endif #if (defined(_WIN32) || defined(_WIN32_WCE)) && !defined(ORTP_STATIC) #ifdef ORTP_EXPORTS #define ORTP_VAR_PUBLIC extern __declspec(dllexport) #else #define ORTP_VAR_PUBLIC __declspec(dllimport) #endif #else #define ORTP_VAR_PUBLIC extern #endif #ifndef IN6_IS_ADDR_MULTICAST #define IN6_IS_ADDR_MULTICAST(i) (((uint8_t *) (i))[0] == 0xff) #endif /*define __ios when we are compiling for ios. The TARGET_OS_IPHONE macro is stupid, it is defined to 0 when compiling on mac os x. */ #if TARGET_OS_IPHONE #define __ios 1 #endif #endif ortp-1.0.2/include/ortp/rtcp.h000066400000000000000000000502241315172643600162410ustar00rootroot00000000000000/* * The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) implementation with additional features. * Copyright (C) 2017 Belledonne Communications SARL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef RTCP_H #define RTCP_H #include #define RTCP_MAX_RECV_BUFSIZE 1500 #define RTCP_SENDER_INFO_SIZE 20 #define RTCP_REPORT_BLOCK_SIZE 24 #define RTCP_COMMON_HEADER_SIZE 4 #define RTCP_SSRC_FIELD_SIZE 4 #ifdef __cplusplus extern "C"{ #endif /* RTCP common header */ typedef enum { RTCP_SR = 200, RTCP_RR = 201, RTCP_SDES = 202, RTCP_BYE = 203, RTCP_APP = 204, RTCP_RTPFB = 205, RTCP_PSFB = 206, RTCP_XR = 207 } rtcp_type_t; typedef struct rtcp_common_header { #ifdef ORTP_BIGENDIAN uint16_t version:2; uint16_t padbit:1; uint16_t rc:5; uint16_t packet_type:8; #else uint16_t rc:5; uint16_t padbit:1; uint16_t version:2; uint16_t packet_type:8; #endif uint16_t length:16; } rtcp_common_header_t; #define rtcp_common_header_set_version(ch,v) (ch)->version=v #define rtcp_common_header_set_padbit(ch,p) (ch)->padbit=p #define rtcp_common_header_set_rc(ch,rc) (ch)->rc=rc #define rtcp_common_header_set_packet_type(ch,pt) (ch)->packet_type=pt #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_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) /* RTCP SR or RR packets */ typedef struct sender_info { uint32_t ntp_timestamp_msw; uint32_t ntp_timestamp_lsw; uint32_t rtp_timestamp; uint32_t senders_packet_count; uint32_t senders_octet_count; } sender_info_t; static ORTP_INLINE uint64_t sender_info_get_ntp_timestamp(const sender_info_t *si) { return ((((uint64_t)ntohl(si->ntp_timestamp_msw)) << 32) + ((uint64_t) ntohl(si->ntp_timestamp_lsw))); } #define sender_info_get_rtp_timestamp(si) ntohl((si)->rtp_timestamp) #define sender_info_get_packet_count(si) \ ntohl((si)->senders_packet_count) #define sender_info_get_octet_count(si) \ ntohl((si)->senders_octet_count) typedef struct report_block { uint32_t ssrc; uint32_t fl_cnpl;/*fraction lost + cumulative number of packet lost*/ uint32_t ext_high_seq_num_rec; /*extended highest sequence number received */ uint32_t interarrival_jitter; uint32_t lsr; /*last SR */ uint32_t delay_snc_last_sr; /*delay since last sr*/ } report_block_t; static ORTP_INLINE uint32_t report_block_get_ssrc(const report_block_t * rb) { return ntohl(rb->ssrc); } static ORTP_INLINE uint32_t report_block_get_high_ext_seq(const report_block_t * rb) { return ntohl(rb->ext_high_seq_num_rec); } static ORTP_INLINE uint32_t report_block_get_interarrival_jitter(const report_block_t * rb) { return ntohl(rb->interarrival_jitter); } static ORTP_INLINE uint32_t report_block_get_last_SR_time(const report_block_t * rb) { return ntohl(rb->lsr); } static ORTP_INLINE uint32_t report_block_get_last_SR_delay(const report_block_t * rb) { return ntohl(rb->delay_snc_last_sr); } static ORTP_INLINE uint32_t report_block_get_fraction_lost(const report_block_t * rb) { return (ntohl(rb->fl_cnpl)>>24); } static ORTP_INLINE int32_t report_block_get_cum_packet_lost(const report_block_t * rb){ int cum_loss = ntohl(rb->fl_cnpl); if (((cum_loss>>23)&1)==0) return 0x00FFFFFF & cum_loss; else return 0xFF000000 | (cum_loss-0xFFFFFF-1); } static ORTP_INLINE void report_block_set_fraction_lost(report_block_t * rb, int fl){ rb->fl_cnpl = htonl( (ntohl(rb->fl_cnpl) & 0xFFFFFF) | (fl&0xFF)<<24); } static ORTP_INLINE void report_block_set_cum_packet_lost(report_block_t * rb, int64_t cpl) { uint32_t clamp = (uint32_t)((1<<24) + ((cpl>=0) ? (cpl>0x7FFFFF?0x7FFFFF:cpl) : (-cpl>0x800000?-0x800000:cpl))); rb->fl_cnpl=htonl( (ntohl(rb->fl_cnpl) & 0xFF000000) | (cpl >= 0 ? clamp&0x7FFFFF : clamp|0x800000) ); } /* SDES packets */ typedef enum { RTCP_SDES_END = 0, RTCP_SDES_CNAME = 1, RTCP_SDES_NAME = 2, RTCP_SDES_EMAIL = 3, RTCP_SDES_PHONE = 4, RTCP_SDES_LOC = 5, RTCP_SDES_TOOL = 6, RTCP_SDES_NOTE = 7, RTCP_SDES_PRIV = 8, RTCP_SDES_MAX = 9 } rtcp_sdes_type_t; typedef struct sdes_chunk { uint32_t csrc; } sdes_chunk_t; #define sdes_chunk_get_csrc(c) ntohl((c)->csrc) typedef struct sdes_item { uint8_t item_type; uint8_t len; char content[1]; } sdes_item_t; #define RTCP_SDES_MAX_STRING_SIZE 255 #define RTCP_SDES_ITEM_HEADER_SIZE 2 #define RTCP_SDES_CHUNK_DEFAULT_SIZE 1024 #define RTCP_SDES_CHUNK_HEADER_SIZE (sizeof(sdes_chunk_t)) /* RTCP bye packet */ typedef struct rtcp_bye_reason { uint8_t len; char content[1]; } rtcp_bye_reason_t; typedef struct rtcp_bye { rtcp_common_header_t ch; uint32_t ssrc[1]; /* the bye may contain several ssrc/csrc */ } rtcp_bye_t; #define RTCP_BYE_HEADER_SIZE sizeof(rtcp_bye_t) #define RTCP_BYE_REASON_MAX_STRING_SIZE 255 /* RTCP XR packet */ #define RTCP_XR_VOIP_METRICS_CONFIG_PLC_STD ((1 << 7) | (1 << 6)) #define RTCP_XR_VOIP_METRICS_CONFIG_PLC_ENH (1 << 7) #define RTCP_XR_VOIP_METRICS_CONFIG_PLC_DIS (1 << 6) #define RTCP_XR_VOIP_METRICS_CONFIG_PLC_UNS 0 #define RTCP_XR_VOIP_METRICS_CONFIG_JBA_ADA ((1 << 5) | (1 << 4)) #define RTCP_XR_VOIP_METRICS_CONFIG_JBA_NON (1 << 5) #define RTCP_XR_VOIP_METRICS_CONFIG_JBA_UNK 0 typedef enum { RTCP_XR_LOSS_RLE = 1, RTCP_XR_DUPLICATE_RLE = 2, RTCP_XR_PACKET_RECEIPT_TIMES = 3, RTCP_XR_RCVR_RTT = 4, RTCP_XR_DLRR = 5, RTCP_XR_STAT_SUMMARY = 6, RTCP_XR_VOIP_METRICS = 7 } rtcp_xr_block_type_t; typedef struct rtcp_xr_header { rtcp_common_header_t ch; uint32_t ssrc; } rtcp_xr_header_t; typedef struct rtcp_xr_generic_block_header { uint8_t bt; uint8_t flags; uint16_t length; } rtcp_xr_generic_block_header_t; typedef struct rtcp_xr_rcvr_rtt_report_block { rtcp_xr_generic_block_header_t bh; uint32_t ntp_timestamp_msw; uint32_t ntp_timestamp_lsw; } rtcp_xr_rcvr_rtt_report_block_t; typedef struct rtcp_xr_dlrr_report_subblock { uint32_t ssrc; uint32_t lrr; uint32_t dlrr; } rtcp_xr_dlrr_report_subblock_t; typedef struct rtcp_xr_dlrr_report_block { rtcp_xr_generic_block_header_t bh; rtcp_xr_dlrr_report_subblock_t content[1]; } rtcp_xr_dlrr_report_block_t; typedef struct rtcp_xr_stat_summary_report_block { rtcp_xr_generic_block_header_t bh; uint32_t ssrc; uint16_t begin_seq; uint16_t end_seq; uint32_t lost_packets; uint32_t dup_packets; uint32_t min_jitter; uint32_t max_jitter; uint32_t mean_jitter; uint32_t dev_jitter; uint8_t min_ttl_or_hl; uint8_t max_ttl_or_hl; uint8_t mean_ttl_or_hl; uint8_t dev_ttl_or_hl; } rtcp_xr_stat_summary_report_block_t; typedef struct rtcp_xr_voip_metrics_report_block { rtcp_xr_generic_block_header_t bh; uint32_t ssrc; uint8_t loss_rate; uint8_t discard_rate; uint8_t burst_density; uint8_t gap_density; uint16_t burst_duration; uint16_t gap_duration; uint16_t round_trip_delay; uint16_t end_system_delay; uint8_t signal_level; uint8_t noise_level; uint8_t rerl; uint8_t gmin; uint8_t r_factor; uint8_t ext_r_factor; uint8_t mos_lq; uint8_t mos_cq; uint8_t rx_config; uint8_t reserved2; uint16_t jb_nominal; uint16_t jb_maximum; uint16_t jb_abs_max; } rtcp_xr_voip_metrics_report_block_t; #define MIN_RTCP_XR_PACKET_SIZE (sizeof(rtcp_xr_header_t) + 4) /* RTCP FB packet */ 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, RTCP_PSFB_FIR = 4, RTCP_PSFB_AFB = 15 } rtcp_psfb_type_t; typedef struct rtcp_fb_header { uint32_t packet_sender_ssrc; uint32_t media_source_ssrc; } rtcp_fb_header_t; typedef struct rtcp_fb_generic_nack_fci { uint16_t pid; uint16_t blp; } rtcp_fb_generic_nack_fci_t; #define rtcp_fb_generic_nack_fci_get_pid(nack) ntohs((nack)->pid) #define rtcp_fb_generic_nack_fci_set_pid(nack, value) ((nack)->pid) = htons(value) #define rtcp_fb_generic_nack_fci_get_blp(nack) ntohs((nack)->blp) #define rtcp_fb_generic_nack_fci_set_blp(nack, value) ((nack)->blp) = htons(value) 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; uint8_t pad1; uint16_t pad2; } rtcp_fb_fir_fci_t; #define rtcp_fb_fir_fci_get_ssrc(fci) ntohl((fci)->ssrc) #define rtcp_fb_fir_fci_get_seq_nr(fci) (fci)->seq_nr typedef struct rtcp_fb_sli_fci { uint32_t value; } rtcp_fb_sli_fci_t; #define rtcp_fb_sli_fci_get_first(fci) \ ((uint16_t)((ntohl((fci)->value) >> 19) & 0x00001FFF)) #define rtcp_fb_sli_fci_set_first(fci, first) \ ((fci)->value) = htonl((ntohl((fci)->value) & 0x0007FFFF) | (((first) & 0x00001FFF) << 19)) #define rtcp_fb_sli_fci_get_number(fci) \ ((uint16_t)((ntohl((fci)->value) >> 6) & 0x00001FFF)) #define rtcp_fb_sli_fci_set_number(fci, number) \ ((fci)->value) = htonl((ntohl((fci)->value) & 0xFFF8003F) | (((number) & 0x00001FFF) << 6)) #define rtcp_fb_sli_fci_get_picture_id(fci) \ ((uint8_t)(ntohl((fci)->value) & 0x0000003F)) #define rtcp_fb_sli_fci_set_picture_id(fci, picture_id) \ ((fci)->value) = htonl((ntohl((fci)->value) & 0xFFFFFFC0) | ((picture_id) & 0x0000003F)) typedef struct rtcp_fb_rpsi_fci { uint8_t pb; uint8_t payload_type; uint16_t bit_string[1]; } rtcp_fb_rpsi_fci_t; #define rtcp_fb_rpsi_fci_get_payload_type(fci) (fci)->payload_type #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)) /* RTCP structs */ typedef struct rtcp_sr{ rtcp_common_header_t ch; uint32_t ssrc; sender_info_t si; report_block_t rb[1]; } rtcp_sr_t; typedef struct rtcp_rr{ rtcp_common_header_t ch; uint32_t ssrc; report_block_t rb[1]; } rtcp_rr_t; typedef struct rtcp_app{ rtcp_common_header_t ch; uint32_t ssrc; char name[4]; } rtcp_app_t; struct _RtpSession; struct _RtpStream; ORTP_PUBLIC void rtp_session_rtcp_process_send(struct _RtpSession *s); ORTP_PUBLIC void rtp_session_rtcp_process_recv(struct _RtpSession *s); #define RTCP_DEFAULT_REPORT_INTERVAL 5000 /* in milliseconds */ /* packet parsing api */ /*in case of coumpound packet, set read pointer of m to the beginning of the next RTCP packet */ ORTP_PUBLIC bool_t rtcp_next_packet(mblk_t *m); /* put the read pointer at the first RTCP packet of the compound packet (as before any previous calls ot rtcp_next_packet() */ ORTP_PUBLIC void rtcp_rewind(mblk_t *m); /* get common header*/ ORTP_PUBLIC const rtcp_common_header_t * rtcp_get_common_header(const mblk_t *m); /*Sender Report accessors */ /* check if this packet is a SR and if it is correct */ ORTP_PUBLIC bool_t rtcp_is_SR(const mblk_t *m); ORTP_PUBLIC uint32_t rtcp_SR_get_ssrc(const mblk_t *m); ORTP_PUBLIC const sender_info_t * rtcp_SR_get_sender_info(const mblk_t *m); ORTP_PUBLIC const report_block_t * rtcp_SR_get_report_block(const mblk_t *m, int idx); /*Receiver report accessors*/ ORTP_PUBLIC bool_t rtcp_is_RR(const mblk_t *m); ORTP_PUBLIC uint32_t rtcp_RR_get_ssrc(const mblk_t *m); ORTP_PUBLIC const report_block_t * rtcp_RR_get_report_block(const mblk_t *m,int idx); /*SDES accessors */ ORTP_PUBLIC bool_t rtcp_is_SDES(const mblk_t *m); typedef void (*SdesItemFoundCallback)(void *user_data, uint32_t csrc, rtcp_sdes_type_t t, const char *content, uint8_t content_len); ORTP_PUBLIC void rtcp_sdes_parse(const mblk_t *m, SdesItemFoundCallback cb, void *user_data); /*BYE accessors */ ORTP_PUBLIC bool_t rtcp_is_BYE(const mblk_t *m); ORTP_PUBLIC bool_t rtcp_BYE_get_ssrc(const mblk_t *m, int idx, uint32_t *ssrc); ORTP_PUBLIC bool_t rtcp_BYE_get_reason(const mblk_t *m, const char **reason, int *reason_len); /*APP accessors */ ORTP_PUBLIC bool_t rtcp_is_APP(const mblk_t *m); ORTP_PUBLIC int rtcp_APP_get_subtype(const mblk_t *m); ORTP_PUBLIC uint32_t rtcp_APP_get_ssrc(const mblk_t *m); /* name argument is supposed to be at least 4 characters (note: no '\0' written)*/ ORTP_PUBLIC void rtcp_APP_get_name(const mblk_t *m, char *name); /* retrieve the data. when returning, data points directly into the mblk_t */ ORTP_PUBLIC void rtcp_APP_get_data(const mblk_t *m, uint8_t **data, int *len); /* RTCP XR accessors */ ORTP_PUBLIC bool_t rtcp_is_XR(const mblk_t *m); ORTP_PUBLIC rtcp_xr_block_type_t rtcp_XR_get_block_type(const mblk_t *m); ORTP_PUBLIC uint32_t rtcp_XR_get_ssrc(const mblk_t *m); ORTP_PUBLIC uint64_t rtcp_XR_rcvr_rtt_get_ntp_timestamp(const mblk_t *m); ORTP_PUBLIC uint32_t rtcp_XR_dlrr_get_ssrc(const mblk_t *m); ORTP_PUBLIC uint32_t rtcp_XR_dlrr_get_lrr(const mblk_t *m); ORTP_PUBLIC uint32_t rtcp_XR_dlrr_get_dlrr(const mblk_t *m); ORTP_PUBLIC uint8_t rtcp_XR_stat_summary_get_flags(const mblk_t *m); ORTP_PUBLIC uint32_t rtcp_XR_stat_summary_get_ssrc(const mblk_t *m); ORTP_PUBLIC uint16_t rtcp_XR_stat_summary_get_begin_seq(const mblk_t *m); ORTP_PUBLIC uint16_t rtcp_XR_stat_summary_get_end_seq(const mblk_t *m); ORTP_PUBLIC uint32_t rtcp_XR_stat_summary_get_lost_packets(const mblk_t *m); ORTP_PUBLIC uint32_t rtcp_XR_stat_summary_get_dup_packets(const mblk_t *m); ORTP_PUBLIC uint32_t rtcp_XR_stat_summary_get_min_jitter(const mblk_t *m); ORTP_PUBLIC uint32_t rtcp_XR_stat_summary_get_max_jitter(const mblk_t *m); ORTP_PUBLIC uint32_t rtcp_XR_stat_summary_get_mean_jitter(const mblk_t *m); ORTP_PUBLIC uint32_t rtcp_XR_stat_summary_get_dev_jitter(const mblk_t *m); ORTP_PUBLIC uint8_t rtcp_XR_stat_summary_get_min_ttl_or_hl(const mblk_t *m); ORTP_PUBLIC uint8_t rtcp_XR_stat_summary_get_max_ttl_or_hl(const mblk_t *m); ORTP_PUBLIC uint8_t rtcp_XR_stat_summary_get_mean_ttl_or_hl(const mblk_t *m); ORTP_PUBLIC uint8_t rtcp_XR_stat_summary_get_dev_ttl_or_hl(const mblk_t *m); ORTP_PUBLIC uint32_t rtcp_XR_voip_metrics_get_ssrc(const mblk_t *m); ORTP_PUBLIC uint8_t rtcp_XR_voip_metrics_get_loss_rate(const mblk_t *m); ORTP_PUBLIC uint8_t rtcp_XR_voip_metrics_get_discard_rate(const mblk_t *m); ORTP_PUBLIC uint8_t rtcp_XR_voip_metrics_get_burst_density(const mblk_t *m); ORTP_PUBLIC uint8_t rtcp_XR_voip_metrics_get_gap_density(const mblk_t *m); ORTP_PUBLIC uint16_t rtcp_XR_voip_metrics_get_burst_duration(const mblk_t *m); ORTP_PUBLIC uint16_t rtcp_XR_voip_metrics_get_gap_duration(const mblk_t *m); ORTP_PUBLIC uint16_t rtcp_XR_voip_metrics_get_round_trip_delay(const mblk_t *m); ORTP_PUBLIC uint16_t rtcp_XR_voip_metrics_get_end_system_delay(const mblk_t *m); ORTP_PUBLIC uint8_t rtcp_XR_voip_metrics_get_signal_level(const mblk_t *m); ORTP_PUBLIC uint8_t rtcp_XR_voip_metrics_get_noise_level(const mblk_t *m); ORTP_PUBLIC uint8_t rtcp_XR_voip_metrics_get_rerl(const mblk_t *m); ORTP_PUBLIC uint8_t rtcp_XR_voip_metrics_get_gmin(const mblk_t *m); ORTP_PUBLIC uint8_t rtcp_XR_voip_metrics_get_r_factor(const mblk_t *m); ORTP_PUBLIC uint8_t rtcp_XR_voip_metrics_get_ext_r_factor(const mblk_t *m); ORTP_PUBLIC uint8_t rtcp_XR_voip_metrics_get_mos_lq(const mblk_t *m); ORTP_PUBLIC uint8_t rtcp_XR_voip_metrics_get_mos_cq(const mblk_t *m); ORTP_PUBLIC uint8_t rtcp_XR_voip_metrics_get_rx_config(const mblk_t *m); ORTP_PUBLIC uint16_t rtcp_XR_voip_metrics_get_jb_nominal(const mblk_t *m); 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_generic_nack_fci_t * rtcp_RTPFB_generic_nack_get_fci(const mblk_t *m); ORTP_PUBLIC rtcp_fb_tmmbr_fci_t * rtcp_RTPFB_tmmbr_get_fci(const mblk_t *m); /** * Return the maximum bitrate in bits / sec contained in the packet. * * @param m RTCP TMMBR packet to read * @return maximum bitrate in bits / sec. */ ORTP_PUBLIC uint64_t rtcp_RTPFB_tmmbr_get_max_bitrate(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); ORTP_PUBLIC uint32_t rtcp_PSFB_get_packet_sender_ssrc(const mblk_t *m); ORTP_PUBLIC uint32_t rtcp_PSFB_get_media_source_ssrc(const mblk_t *m); ORTP_PUBLIC rtcp_fb_fir_fci_t * rtcp_PSFB_fir_get_fci(const mblk_t *m, unsigned int idx); ORTP_PUBLIC rtcp_fb_sli_fci_t * rtcp_PSFB_sli_get_fci(const mblk_t *m, unsigned int idx); ORTP_PUBLIC rtcp_fb_rpsi_fci_t * rtcp_PSFB_rpsi_get_fci(const mblk_t *m); ORTP_PUBLIC uint16_t rtcp_PSFB_rpsi_get_fci_bit_string_len(const mblk_t *m); typedef struct OrtpLossRateEstimator{ int min_packet_count_interval; uint64_t min_time_ms_interval; uint64_t last_estimate_time_ms; int32_t last_cum_loss; int32_t last_ext_seq; float loss_rate; /** * Total number of outgoing duplicate packets on last * ortp_loss_rate_estimator_process_report_block iteration. **/ int64_t last_dup_packet_sent_count; /** * Total number of outgoing unique packets on last * ortp_loss_rate_estimator_process_report_block iteration. **/ int64_t last_packet_sent_count; }OrtpLossRateEstimator; ORTP_PUBLIC OrtpLossRateEstimator * ortp_loss_rate_estimator_new(int min_packet_count_interval, uint64_t min_time_ms_interval, struct _RtpSession *session); ORTP_PUBLIC void ortp_loss_rate_estimator_init(OrtpLossRateEstimator *obj, int min_packet_count_interval, uint64_t min_time_ms_interval, struct _RtpSession *session); /** * Process an incoming report block to compute loss rate percentage. It tries to compute * loss rate, depending on the previous report block. It may fails if the two * reports are too close or if a discontinuity occurred. You should NOT use * loss rate field of the report block directly (see below). * This estimator is useful for two reasons: first, on AVPF session, multiple * reports can be received in a short period and loss_rate contained in these * reports is unreliable. Secondly, it computes the loss rate using the * cumulative loss factor which allows us to take into consideration duplicates * packets as well. * @param[in] obj #OrtpLossRateEstimator object. * @param[in] session #_RtpSession stream in which the report block to consider belongs. * @param[in] rb Report block to analyze. * @return TRUE if a new loss rate estimation is ready, FALSE otherwise. */ ORTP_PUBLIC bool_t ortp_loss_rate_estimator_process_report_block(OrtpLossRateEstimator *obj, const struct _RtpSession *session, const report_block_t *rb); /** * Get the latest loss rate in percentage estimation computed. * * @param obj #OrtpLossRateEstimator object. * @return The latest loss rate in percentage computed. */ ORTP_PUBLIC float ortp_loss_rate_estimator_get_value(OrtpLossRateEstimator *obj); ORTP_PUBLIC void ortp_loss_rate_estimator_destroy(OrtpLossRateEstimator *obj); #ifdef __cplusplus } #endif #endif ortp-1.0.2/include/ortp/rtp.h000066400000000000000000000121341315172643600160740ustar00rootroot00000000000000/* * The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) implementation with additional features. * Copyright (C) 2017 Belledonne Communications SARL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef RTP_H #define RTP_H #include #include #define IPMAXLEN 20 #define UDP_MAX_SIZE 1500 #define RTP_FIXED_HEADER_SIZE 12 #define RTP_DEFAULT_JITTER_TIME 80 /*miliseconds*/ #define RTP_DEFAULT_MULTICAST_TTL 5 /*hops*/ #define RTP_DEFAULT_MULTICAST_LOOPBACK 0 /*false*/ #define RTP_DEFAULT_DSCP 0x00 /*best effort*/ typedef struct rtp_header { #ifdef ORTP_BIGENDIAN uint16_t version:2; uint16_t padbit:1; uint16_t extbit:1; uint16_t cc:4; uint16_t markbit:1; uint16_t paytype:7; #else uint16_t cc:4; uint16_t extbit:1; uint16_t padbit:1; uint16_t version:2; uint16_t paytype:7; uint16_t markbit:1; #endif uint16_t seq_number; uint32_t timestamp; uint32_t ssrc; uint32_t csrc[16]; } rtp_header_t; typedef struct rtp_stats { uint64_t packet_sent; /*number of outgoing packets */ uint64_t packet_dup_sent; /*number of outgoing duplicate packets */ uint64_t sent; /* outgoing total bytes (excluding IP header) */ uint64_t packet_recv; /* number of incoming packets */ uint64_t packet_dup_recv; /* number of incoming duplicate packets */ uint64_t recv; /* incoming bytes of payload and delivered in time to the application */ uint64_t hw_recv; /* incoming bytes of payload */ uint64_t outoftime; /* number of incoming packets that were received too late */ int64_t cum_packet_loss; /* cumulative number of incoming packet lost */ uint64_t bad; /* incoming packets that did not appear to be RTP */ uint64_t discarded; /* incoming packets discarded because the queue exceeds its max size */ uint64_t sent_rtcp_packets; /* outgoing RTCP packets counter (only packets that embed a report block are considered) */ uint64_t recv_rtcp_packets; /* incoming RTCP packets counter (only packets that embed a report block are considered) */ } rtp_stats_t; typedef struct jitter_stats { uint32_t jitter; /* interarrival jitter at last emitted sender report */ uint32_t max_jitter; /* biggest interarrival jitter (value in stream clock unit) */ uint64_t sum_jitter; /* sum of all interarrival jitter (value in stream clock unit) */ uint64_t max_jitter_ts; /* date (in ms since Epoch) of the biggest interarrival jitter */ float jitter_buffer_size_ms;/* mean jitter buffer size in milliseconds.*/ } jitter_stats_t; #define RTP_TIMESTAMP_IS_NEWER_THAN(ts1,ts2) \ ((uint32_t)((uint32_t)(ts1) - (uint32_t)(ts2))< (uint32_t)(1<<31)) #define RTP_TIMESTAMP_IS_STRICTLY_NEWER_THAN(ts1,ts2) \ ( ((uint32_t)((uint32_t)(ts1) - (uint32_t)(ts2))< (uint32_t)(1<<31)) && (ts1)!=(ts2) ) #define RTP_SEQ_IS_STRICTLY_GREATER_THAN(seq1,seq2)\ (((uint16_t)((uint16_t)(seq1) - (uint16_t)(seq2))< (uint16_t)(1<<15)) && (seq1!=seq2)) #define TIME_IS_NEWER_THAN(t1,t2) RTP_TIMESTAMP_IS_NEWER_THAN(t1,t2) #define TIME_IS_STRICTLY_NEWER_THAN(t1,t2) RTP_TIMESTAMP_IS_STRICTLY_NEWER_THAN(t1,t2) #ifdef __cplusplus extern "C"{ #endif /* packet api */ /* the first argument is a mblk_t. The header is supposed to be not splitted */ #define rtp_set_markbit(mp,value) ((rtp_header_t*)((mp)->b_rptr))->markbit=(value) #define rtp_set_seqnumber(mp,seq) ((rtp_header_t*)((mp)->b_rptr))->seq_number=(seq) #define rtp_set_timestamp(mp,ts) ((rtp_header_t*)((mp)->b_rptr))->timestamp=(ts) #define rtp_set_ssrc(mp,_ssrc) ((rtp_header_t*)((mp)->b_rptr))->ssrc=(_ssrc) ORTP_PUBLIC void rtp_add_csrc(mblk_t *mp ,uint32_t csrc); #define rtp_set_payload_type(mp,pt) ((rtp_header_t*)((mp)->b_rptr))->paytype=(pt) #define rtp_get_version(mp) (((rtp_header_t*)((mp)->b_rptr))->version) #define rtp_get_markbit(mp) (((rtp_header_t*)((mp)->b_rptr))->markbit) #define rtp_get_extbit(mp) (((rtp_header_t*)((mp)->b_rptr))->extbit) #define rtp_get_timestamp(mp) (((rtp_header_t*)((mp)->b_rptr))->timestamp) #define rtp_get_seqnumber(mp) (((rtp_header_t*)((mp)->b_rptr))->seq_number) #define rtp_get_payload_type(mp) (((rtp_header_t*)((mp)->b_rptr))->paytype) #define rtp_get_ssrc(mp) (((rtp_header_t*)((mp)->b_rptr))->ssrc) #define rtp_get_cc(mp) (((rtp_header_t*)((mp)->b_rptr))->cc) #define rtp_get_csrc(mp, idx) (((rtp_header_t*)((mp)->b_rptr))->csrc[idx]) ORTP_PUBLIC int rtp_get_payload(mblk_t *packet, unsigned char **start); ORTP_PUBLIC int rtp_get_extheader(mblk_t *packet, uint16_t *profile, uint8_t **start_ext); #ifdef __cplusplus } #endif #endif ortp-1.0.2/include/ortp/rtpprofile.h000066400000000000000000000074171315172643600174650ustar00rootroot00000000000000/* * The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) implementation with additional features. * Copyright (C) 2017 Belledonne Communications SARL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * \file rtpprofile.h * \brief Using and creating standart and custom RTP profiles * **/ #ifndef RTPPROFILE_H #define RTPPROFILE_H #include #ifdef __cplusplus extern "C"{ #endif #define RTP_PROFILE_MAX_PAYLOADS 128 /** * The RTP profile is a table RTP_PROFILE_MAX_PAYLOADS entries to make the matching * between RTP payload type number and the PayloadType that defines the type of * media. **/ struct _RtpProfile { char *name; PayloadType *payload[RTP_PROFILE_MAX_PAYLOADS]; }; typedef struct _RtpProfile RtpProfile; ORTP_VAR_PUBLIC RtpProfile av_profile; #define rtp_profile_get_name(profile) (const char*)((profile)->name) ORTP_PUBLIC void rtp_profile_set_payload(RtpProfile *prof, int idx, PayloadType *pt); /** * Set payload type number \a index unassigned in the profile. * *@param profile an RTP profile *@param index the payload type number **/ #define rtp_profile_clear_payload(profile,index) \ rtp_profile_set_payload(profile,index,NULL) /* I prefer have this function inlined because it is very often called in the code */ /** * * Gets the payload description of the payload type \a index in the profile. * *@param prof an RTP profile (a #_RtpProfile object) *@param idx the payload type number *@return the payload description (a PayloadType object) **/ static ORTP_INLINE PayloadType * rtp_profile_get_payload(const RtpProfile *prof, int idx){ if (idx<0 || idx>=RTP_PROFILE_MAX_PAYLOADS) { return NULL; } return prof->payload[idx]; } ORTP_PUBLIC void rtp_profile_clear_all(RtpProfile *prof); ORTP_PUBLIC void rtp_profile_set_name(RtpProfile *prof, const char *name); ORTP_PUBLIC PayloadType * rtp_profile_get_payload_from_mime(RtpProfile *profile,const char *mime); ORTP_PUBLIC PayloadType * rtp_profile_get_payload_from_rtpmap(RtpProfile *profile, const char *rtpmap); ORTP_PUBLIC int rtp_profile_get_payload_number_from_mime(RtpProfile *profile, const char *mime); ORTP_PUBLIC int rtp_profile_get_payload_number_from_mime_and_flag(RtpProfile *profile, const char *mime, int flag); ORTP_PUBLIC int rtp_profile_get_payload_number_from_rtpmap(RtpProfile *profile, const char *rtpmap); ORTP_PUBLIC int rtp_profile_find_payload_number(RtpProfile *prof,const char *mime,int rate, int channels); ORTP_PUBLIC PayloadType * rtp_profile_find_payload(RtpProfile *prof,const char *mime,int rate, int channels); ORTP_PUBLIC int rtp_profile_move_payload(RtpProfile *prof,int oldpos,int newpos); ORTP_PUBLIC RtpProfile * rtp_profile_new(const char *name); /* clone a profile, payload are not cloned */ ORTP_PUBLIC RtpProfile * rtp_profile_clone(RtpProfile *prof); /*clone a profile and its payloads (ie payload type are newly allocated, not reusing payload types of the reference profile) */ ORTP_PUBLIC RtpProfile * rtp_profile_clone_full(RtpProfile *prof); /* frees the profile and all its PayloadTypes*/ ORTP_PUBLIC void rtp_profile_destroy(RtpProfile *prof); #ifdef __cplusplus } #endif #endif ortp-1.0.2/include/ortp/rtpsession.h000066400000000000000000001056511315172643600175070ustar00rootroot00000000000000/* * The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) implementation with additional features. * Copyright (C) 2017 Belledonne Communications SARL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * \file rtpsession.h * \brief The RtpSession api * * The RtpSession objects represent a RTP session: once it is configured with * local and remote network addresses and a payload type is given, it let you send * and recv a media stream. **/ #ifndef RTPSESSION_H #define RTPSESSION_H #include #include #include #include #include #include #include #include #include #include #include #define ORTP_AVPF_FEATURE_NONE 0 #define ORTP_AVPF_FEATURE_TMMBR (1 << 0) #define ORTP_AVPF_FEATURE_GENERIC_NACK (1 << 1) typedef enum { RTP_SESSION_RECVONLY, RTP_SESSION_SENDONLY, RTP_SESSION_SENDRECV } RtpSessionMode; typedef enum _OrtpJitterBufferAlgorithm { OrtpJitterBufferBasic, OrtpJitterBufferRecursiveLeastSquare, } OrtpJitterBufferAlgorithm; /*! Jitter buffer parameters */ typedef struct _JBParameters{ int min_size; /*(adaptive=TRUE only) maximum dynamic delay to be added to incoming packets (ms) */ int nom_size; /*(adaptive=TRUE only) initial dynamic delay to be added to incoming packets (ms) */ int max_size; /*(adaptive=TRUE only) minimum dynamic delay to be added to incoming packets (ms) */ bool_t adaptive; /*either a dynamic buffer should be used or not to compensate bursts */ bool_t enabled; /*whether jitter buffer is enabled*/ bool_t pad[2]; /*(dev only) alignment pad: insert your bool_t here*/ int max_packets; /**max number of packets allowed to be queued in the jitter buffer */ OrtpJitterBufferAlgorithm buffer_algorithm; int refresh_ms; /* (adaptive=TRUE only) dynamic buffer size update frequency (ms) */ int ramp_threshold; /*(adaptive=TRUE, algo=RLS only) Percentage in [0;100] threshold between current jitter and previous jitter to enable smooth ramp*/ int ramp_step_ms; /*(adaptive=TRUE, algo=RLS only) In smooth ramp, how much we should reduce jitter size on each step*/ int ramp_refresh_ms; /*(adaptive=TRUE, algo=RLS only) In smooth ramp, frequency of step*/ } JBParameters; typedef struct _JitterControl { JBParameters params; unsigned int count; /* number of packets handled in jitter_control_new_packet. Used internally only. */ int jitt_comp_ts; /* the nominal jitter buffer size converted in rtp time (same unit as timestamp) */ int adapt_jitt_comp_ts; int32_t clock_offset_ts; /*offset difference between local and distant clock, in timestamp units*/ int32_t prev_clock_offset_ts; int32_t olddiff; float jitter; float inter_jitter; /* interarrival jitter as defined in the RFC */ float jitter_buffer_mean_size; /*effective size (fullness) of jitter buffer*/ int corrective_step; int corrective_slide; uint64_t cum_jitter_buffer_size; /*in timestamp units*/ unsigned int cum_jitter_buffer_count; /*used for computation of jitter buffer size*/ int clock_rate; uint32_t adapt_refresh_prev_ts; /*last time we refreshed the buffer*/ OrtpExtremum max_ts_deviation; /*maximum difference between packet and expected timestamps */ OrtpKalmanRLS kalman_rls; double capped_clock_ratio; uint32_t last_log_ts; uint32_t local_ts_start; uint32_t remote_ts_start; } JitterControl; typedef struct _WaitPoint { ortp_mutex_t lock; ortp_cond_t cond; uint32_t time; bool_t wakeup; } WaitPoint; typedef struct _RtpTransportModifier { void *data; struct _RtpSession *session;//flags|=(flag) #define rtp_session_unset_flag(session,flag) (session)->flags&=~(flag) ORTP_PUBLIC void rtp_session_uninit(RtpSession *session); ORTP_PUBLIC void rtp_session_dispatch_event(RtpSession *session, OrtpEvent *ev); ORTP_PUBLIC void rtp_session_set_reuseaddr(RtpSession *session, bool_t yes); ORTP_PUBLIC int meta_rtp_transport_modifier_inject_packet_to_send(RtpTransport *t, RtpTransportModifier *tpm, mblk_t *msg, int flags); ORTP_PUBLIC int meta_rtp_transport_modifier_inject_packet_to_send_to(RtpTransport *t, RtpTransportModifier *tpm, mblk_t *msg, int flags, const struct sockaddr *to, socklen_t tolen); ORTP_PUBLIC int meta_rtp_transport_modifier_inject_packet_to_recv(RtpTransport *t, RtpTransportModifier *tpm, mblk_t *msg, int flags); /** * get endpoint if any * @param[in] transport RtpTransport object. * @return #_RtpTransport * * */ ORTP_PUBLIC RtpTransport* meta_rtp_transport_get_endpoint(const RtpTransport *transport); /** * set endpoint * @param[in] transport RtpTransport object. * @param[in] endpoint RtpEndpoint. * * */ ORTP_PUBLIC void meta_rtp_transport_set_endpoint(RtpTransport *transport,RtpTransport *endpoint); ORTP_PUBLIC void meta_rtp_transport_destroy(RtpTransport *tp); ORTP_PUBLIC void meta_rtp_transport_append_modifier(RtpTransport *tp,RtpTransportModifier *tpm); ORTP_PUBLIC int rtp_session_splice(RtpSession *session, RtpSession *to_session); ORTP_PUBLIC int rtp_session_unsplice(RtpSession *session, RtpSession *to_session); ORTP_PUBLIC bool_t ortp_stream_is_ipv6(OrtpStream *os); #ifdef __cplusplus } #endif #endif ortp-1.0.2/include/ortp/rtpsignaltable.h000066400000000000000000000035111315172643600203010ustar00rootroot00000000000000/* * The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) implementation with additional features. * Copyright (C) 2017 Belledonne Communications SARL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef rtpsignaltable_h #define rtpsignaltable_h #define RTP_CALLBACK_TABLE_MAX_ENTRIES 5 typedef void (*RtpCallback)(struct _RtpSession *, void *arg1, void *arg2, void *arg3); struct _RtpSignalTable { RtpCallback callback[RTP_CALLBACK_TABLE_MAX_ENTRIES]; void * user_data[RTP_CALLBACK_TABLE_MAX_ENTRIES]; struct _RtpSession *session; const char *signal_name; int count; }; typedef struct _RtpSignalTable RtpSignalTable; void rtp_signal_table_init(RtpSignalTable *table,struct _RtpSession *session, const char *signal_name); int rtp_signal_table_add(RtpSignalTable *table,RtpCallback cb, void *user_data); void rtp_signal_table_emit(RtpSignalTable *table); /* emit but with a second arg */ void rtp_signal_table_emit2(RtpSignalTable *table, void *arg); /* emit but with a third arg */ void rtp_signal_table_emit3(RtpSignalTable *table, void *arg1, void *arg2); int rtp_signal_table_remove_by_callback(RtpSignalTable *table,RtpCallback cb); #endif ortp-1.0.2/include/ortp/sessionset.h000066400000000000000000000075711315172643600174770ustar00rootroot00000000000000/* * The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) implementation with additional features. * Copyright (C) 2017 Belledonne Communications SARL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * \file sessionset.h * \brief Sending and receiving multiple streams together with only one thread. * **/ #ifndef SESSIONSET_H #define SESSIONSET_H #include #ifdef __cplusplus extern "C"{ #endif #if !defined(_WIN32) && !defined(_WIN32_WCE) /* UNIX */ #include #include #include #define ORTP_FD_SET(d, s) FD_SET(d, s) #define ORTP_FD_CLR(d, s) FD_CLR(d, s) #define ORTP_FD_ISSET(d, s) FD_ISSET(d, s) #define ORTP_FD_ZERO(s) FD_ZERO(s) typedef fd_set ortp_fd_set; #else /* _WIN32 */ #define ORTP_FD_ZERO(s) \ do { \ unsigned int __i; \ ortp_fd_set *__arr = (s); \ for (__i = 0; __i < sizeof (ortp_fd_set) / sizeof (ortp__fd_mask); ++__i) \ ORTP__FDS_BITS (__arr)[__i] = 0; \ } while (0) #define ORTP_FD_SET(d, s) (ORTP__FDS_BITS (s)[ORTP__FDELT(d)] |= ORTP__FDMASK(d)) #define ORTP_FD_CLR(d, s) (ORTP__FDS_BITS (s)[ORTP__FDELT(d)] &= ~ORTP__FDMASK(d)) #define ORTP_FD_ISSET(d, s) ((ORTP__FDS_BITS (s)[ORTP__FDELT(d)] & ORTP__FDMASK(d)) != 0) /* The fd_set member is required to be an array of longs. */ typedef long int ortp__fd_mask; /* Number of bits per word of `fd_set' (some code assumes this is 32). */ #define ORTP__FD_SETSIZE 1024 /* It's easier to assume 8-bit bytes than to get CHAR_BIT. */ #define ORTP__NFDBITS (8 * sizeof (ortp__fd_mask)) #define ORTP__FDELT(d) ((d) / ORTP__NFDBITS) #define ORTP__FDMASK(d) ((ortp__fd_mask) 1 << ((d) % ORTP__NFDBITS)) /* fd_set for select and pselect. */ typedef struct { ortp__fd_mask fds_bits[ORTP__FD_SETSIZE / ORTP__NFDBITS]; # define ORTP__FDS_BITS(set) ((set)->fds_bits) } ortp_fd_set; #endif /*end _WIN32*/ struct _SessionSet { ortp_fd_set rtpset; }; typedef struct _SessionSet SessionSet; #define session_set_init(ss) ORTP_FD_ZERO(&(ss)->rtpset) ORTP_PUBLIC SessionSet * session_set_new(void); /** * This macro adds the rtp session to the set. * @param ss a set (SessionSet object) * @param rtpsession a RtpSession **/ #define session_set_set(ss,rtpsession) ORTP_FD_SET((rtpsession)->mask_pos,&(ss)->rtpset) /** * This macro tests if the session is part of the set. 1 is returned if true, 0 else. *@param ss a set *@param rtpsession a rtp session * **/ #define session_set_is_set(ss,rtpsession) ORTP_FD_ISSET((rtpsession)->mask_pos,&(ss)->rtpset) /** * Removes the session from the set. *@param ss a set of sessions. *@param rtpsession a rtp session. * * **/ #define session_set_clr(ss,rtpsession) ORTP_FD_CLR((rtpsession)->mask_pos,&(ss)->rtpset) #define session_set_copy(dest,src) memcpy(&(dest)->rtpset,&(src)->rtpset,sizeof(ortp_fd_set)) /** * Frees a SessionSet. **/ ORTP_PUBLIC void session_set_destroy(SessionSet *set); ORTP_PUBLIC int session_set_select(SessionSet *recvs, SessionSet *sends, SessionSet *errors); ORTP_PUBLIC int session_set_timedselect(SessionSet *recvs, SessionSet *sends, SessionSet *errors, struct timeval *timeout); #ifdef __cplusplus } #endif #endif ortp-1.0.2/include/ortp/str_utils.h000066400000000000000000000125021315172643600173160ustar00rootroot00000000000000/* * The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) implementation with additional features. * Copyright (C) 2017 Belledonne Communications SARL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef STR_UTILS_H #define STR_UTILS_H #include #if defined(ORTP_TIMESTAMP) #include #endif #ifndef MIN #define MIN(a,b) (((a)>(b)) ? (b) : (a)) #endif #ifndef MAX #define MAX(a,b) (((a)>(b)) ? (a) : (b)) #endif #define return_if_fail(expr) if (!(expr)) {printf("%s:%i- assertion"#expr "failed\n",__FILE__,__LINE__); return;} #define return_val_if_fail(expr,ret) if (!(expr)) {printf("%s:%i- assertion" #expr "failed\n",__FILE__,__LINE__); return (ret);} typedef struct ortp_recv_addr { int family; union { struct in_addr ipi_addr; struct in6_addr ipi6_addr; } addr; unsigned short port; } ortp_recv_addr_t; typedef struct ortp_recv_addr_map { struct sockaddr_storage ss; ortp_recv_addr_t recv_addr; uint64_t ts; } ortp_recv_addr_map_t; typedef struct msgb { struct msgb *b_prev; struct msgb *b_next; struct msgb *b_cont; struct datab *b_datap; unsigned char *b_rptr; unsigned char *b_wptr; uint32_t reserved1; uint32_t reserved2; struct timeval timestamp; ortp_recv_addr_t recv_addr; /*contains the destination address of incoming packets, used for ICE processing*/ struct sockaddr_storage net_addr; /*source address of incoming packet, or dest address of outgoing packet, used only by simulator and modifiers*/ socklen_t net_addrlen; /*source (dest) address of incoming (outgoing) packet length used by simulator and modifiers*/ uint8_t ttl_or_hl; } mblk_t; typedef struct datab dblk_t; typedef struct _queue { mblk_t _q_stopper; int q_mcount; /*number of packet in the q */ } queue_t; #ifdef __cplusplus extern "C" { #endif ORTP_PUBLIC void dblk_ref(dblk_t *d); ORTP_PUBLIC void dblk_unref(dblk_t *d); ORTP_PUBLIC unsigned char * dblk_base(dblk_t *db); ORTP_PUBLIC unsigned char * dblk_lim(dblk_t *db); ORTP_PUBLIC int dblk_ref_value(dblk_t *db); ORTP_PUBLIC void qinit(queue_t *q); ORTP_PUBLIC void putq(queue_t *q, mblk_t *m); ORTP_PUBLIC mblk_t * getq(queue_t *q); ORTP_PUBLIC void insq(queue_t *q,mblk_t *emp, mblk_t *mp); ORTP_PUBLIC void remq(queue_t *q, mblk_t *mp); ORTP_PUBLIC mblk_t * peekq(queue_t *q); /* remove and free all messages in the q */ #define FLUSHALL 0 ORTP_PUBLIC void flushq(queue_t *q, int how); ORTP_PUBLIC void mblk_init(mblk_t *mp); ORTP_PUBLIC void mblk_meta_copy(const mblk_t *source, mblk_t *dest); /* allocates a mblk_t, that points to a datab_t, that points to a buffer of size size. */ ORTP_PUBLIC mblk_t *allocb(size_t size, int unused); #define BPRI_MED 0 /* allocates a mblk_t, that points to a datab_t, that points to buf; buf will be freed using freefn */ ORTP_PUBLIC mblk_t *esballoc(uint8_t *buf, size_t size, int pri, void (*freefn)(void*) ); /* frees a mblk_t, and if the datab ref_count is 0, frees it and the buffer too */ ORTP_PUBLIC void freeb(mblk_t *m); /* frees recursively (follow b_cont) a mblk_t, and if the datab ref_count is 0, frees it and the buffer too */ ORTP_PUBLIC void freemsg(mblk_t *mp); /* duplicates a mblk_t , buffer is not duplicated*/ ORTP_PUBLIC mblk_t *dupb(mblk_t *m); /* duplicates a complex mblk_t, buffer is not duplicated */ ORTP_PUBLIC mblk_t *dupmsg(mblk_t* m); /* returns the size of data of a message */ ORTP_PUBLIC size_t msgdsize(const mblk_t *mp); /* concatenates all fragment of a complex message*/ ORTP_PUBLIC void msgpullup(mblk_t *mp,size_t len); /* duplicates a single message, but with buffer included */ ORTP_PUBLIC mblk_t *copyb(const mblk_t *mp); /* duplicates a complex message with buffer included */ ORTP_PUBLIC mblk_t *copymsg(const mblk_t *mp); ORTP_PUBLIC mblk_t * appendb(mblk_t *mp, const char *data, size_t size, bool_t pad); ORTP_PUBLIC void msgappend(mblk_t *mp, const char *data, size_t size, bool_t pad); ORTP_PUBLIC mblk_t *concatb(mblk_t *mp, mblk_t *newm); #define qempty(q) (&(q)->_q_stopper==(q)->_q_stopper.b_next) #define qfirst(q) ((q)->_q_stopper.b_next!=&(q)->_q_stopper ? (q)->_q_stopper.b_next : NULL) #define qbegin(q) ((q)->_q_stopper.b_next) #define qlast(q) ((q)->_q_stopper.b_prev!=&(q)->_q_stopper ? (q)->_q_stopper.b_prev : NULL) #define qend(q,mp) ((mp)==&(q)->_q_stopper) #define qnext(q,mp) ((mp)->b_next) typedef struct _msgb_allocator{ queue_t q; }msgb_allocator_t; ORTP_PUBLIC void msgb_allocator_init(msgb_allocator_t *pa); ORTP_PUBLIC mblk_t *msgb_allocator_alloc(msgb_allocator_t *pa, size_t size); ORTP_PUBLIC void msgb_allocator_uninit(msgb_allocator_t *pa); ORTP_PUBLIC void ortp_recvaddr_to_sockaddr(ortp_recv_addr_t *recvaddr, struct sockaddr *addr, socklen_t *socklen); #ifdef __cplusplus } #endif #endif ortp-1.0.2/include/ortp/telephonyevents.h000066400000000000000000000061641315172643600205310ustar00rootroot00000000000000/* * The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) implementation with additional features. * Copyright (C) 2017 Belledonne Communications SARL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * \file telephonyevents.h * \brief Receiving and sending telephone events (RFC2833) * **/ #ifndef TELEPHONYEVENTS_H #define TELEPHONYEVENTS_H #include struct _telephone_event { #ifdef ORTP_BIGENDIAN uint32_t event:8; uint32_t E:1; uint32_t R:1; uint32_t volume:6; uint32_t duration:16; #else uint32_t event:8; uint32_t volume:6; uint32_t R:1; uint32_t E:1; uint32_t duration:16; #endif }; typedef struct _telephone_event telephone_event_t; #ifdef __cplusplus extern "C" { #endif /* tell if the session supports telephony events. For this the telephony events payload_type must be present in the rtp profile used by the session */ /* low level functions */ ORTP_PUBLIC int rtp_session_telephone_events_supported(RtpSession *session); ORTP_PUBLIC int rtp_session_send_telephone_events_supported(RtpSession *session); ORTP_PUBLIC int rtp_session_recv_telephone_events_supported(RtpSession *session); ORTP_PUBLIC mblk_t *rtp_session_create_telephone_event_packet(RtpSession *session, int start); ORTP_PUBLIC int rtp_session_add_telephone_event(RtpSession *session, mblk_t *packet, uint8_t event, int end, uint8_t volume, uint16_t duration); ORTP_PUBLIC int rtp_session_read_telephone_event(RtpSession *session, mblk_t *packet,telephone_event_t **tab); /* high level functions*/ ORTP_PUBLIC int rtp_session_send_dtmf(RtpSession *session, char dtmf, uint32_t userts); ORTP_PUBLIC int rtp_session_send_dtmf2(RtpSession *session, char dtmf, uint32_t userts, int duration); /* for high level telephony event callback */ ORTP_PUBLIC void rtp_session_check_telephone_events(RtpSession *session, mblk_t *m0); #ifdef __cplusplus } #endif /* the size allocated for telephony events packets */ #define TELEPHONY_EVENTS_ALLOCATED_SIZE (4*sizeof(telephone_event_t)) /* list of named events */ #define TEV_DTMF_0 (0) #define TEV_DTMF_1 (1) #define TEV_DTMF_2 (2) #define TEV_DTMF_3 (3) #define TEV_DTMF_4 (4) #define TEV_DTMF_5 (5) #define TEV_DTMF_6 (6) #define TEV_DTMF_7 (7) #define TEV_DTMF_8 (8) #define TEV_DTMF_9 (9) #define TEV_DTMF_STAR (10) #define TEV_DTMF_POUND (11) #define TEV_DTMF_A (12) #define TEV_DTMF_B (13) #define TEV_DTMF_C (14) #define TEV_DTMF_D (15) #define TEV_FLASH (16) #endif ortp-1.0.2/include/ortp/utils.h000066400000000000000000000071041315172643600164300ustar00rootroot00000000000000/* * The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) implementation with additional features. * Copyright (C) 2017 Belledonne Communications SARL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ORTP_UTILS_H #define ORTP_UTILS_H #include "ortp/port.h" #ifdef __cplusplus extern "C" { #endif /** * Utility object to determine a maximum or minimum (but not both at the same * time), of a signal during a sliding period of time. */ typedef struct _OrtpExtremum{ float current_extremum; float last_stable; uint64_t extremum_time; int period; }OrtpExtremum; ORTP_PUBLIC void ortp_extremum_reset(OrtpExtremum *obj); ORTP_PUBLIC void ortp_extremum_init(OrtpExtremum *obj, int period); /** * Record a new value for minimal. * @return TRUE if extremum has changed or false otherwise. */ ORTP_PUBLIC bool_t ortp_extremum_record_min(OrtpExtremum *obj, uint64_t curtime, float value); ORTP_PUBLIC bool_t ortp_extremum_record_max(OrtpExtremum *obj, uint64_t curtime, float value); ORTP_PUBLIC float ortp_extremum_get_current(OrtpExtremum *obj); /** * Unlike ortp_extremum_get_current() which can be very fluctuating, ortp_extremum_get_previous() returns the extremum found for the previous period. **/ ORTP_PUBLIC float ortp_extremum_get_previous(OrtpExtremum *obj); /** * Utility object to interpolate linear model based on captures with 0-mean noise. * Based on the model (x, y) where y evolves depending on x with relation y = m*x+b, * it will estimate unknown values b, m using given noisy measures xmes and ymes, eg real * system is evolving with: y = m * x + b + noise. * Note: If noise is NOT white, the residue will be absorbed by one of the estimators. * It is an implementation of recursive least square algorithm, based on Kalman filter. */ typedef struct _OrtpKalmanRLS{ /* Unknown parameters to estimate */ double m, b; /* Gain matrix, must not be modified */ double P[2][2]; /** Forgetting factor in [94, .999]. Used when unknown parameters vary in time. **/ double lambda; }OrtpKalmanRLS; ORTP_PUBLIC void ortp_kalman_rls_init(OrtpKalmanRLS *obj, double m0, double b0); ORTP_PUBLIC void ortp_kalman_rls_record(OrtpKalmanRLS *obj, double xmes, double ymes); typedef struct _OrtpBwEstimator{ float one_minus_alpha; float inv_step; float exp_constant; struct timeval last_packet_recv; float value; }OrtpBwEstimator; /** * Utility object to compute a sliding exponential mean bitrate. * @param obj the estimator structure to initialize * @param alpha the weight of previous estimation (between 0 and 1) * @param step a time constant in seconds representing the sampling period **/ ORTP_PUBLIC void ortp_bw_estimator_init(OrtpBwEstimator *obj, float alpha, float step); ORTP_PUBLIC void ortp_bw_estimator_packet_received (OrtpBwEstimator *obj, size_t bytes, const struct timeval *recv_time); ORTP_PUBLIC float ortp_bw_estimator_get_value(OrtpBwEstimator *obj); #ifdef __cplusplus } #endif #endif ortp-1.0.2/m4/000077500000000000000000000000001315172643600130265ustar00rootroot00000000000000ortp-1.0.2/m4/Makefile.am000066400000000000000000000000321315172643600150550ustar00rootroot00000000000000EXTRA_DIST=\ obsolete.m4 ortp-1.0.2/m4/ld-output-def.m4000066400000000000000000000020451315172643600157620ustar00rootroot00000000000000# ld-output-def.m4 serial 2 dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Simon Josefsson # gl_LD_OUTPUT_DEF() # ------------- # Check if linker supports -Wl,--output-def and define automake # conditional HAVE_LD_OUTPUT_DEF if it is. AC_DEFUN([gl_LD_OUTPUT_DEF], [ AC_CACHE_CHECK([if gcc/ld supports -Wl,--output-def], [gl_cv_ld_output_def], [if test "$enable_shared" = no; then gl_cv_ld_output_def="not needed, shared libraries are disabled" else gl_ldflags_save=$LDFLAGS LDFLAGS="-Wl,--output-def,conftest.def" AC_LINK_IFELSE([AC_LANG_PROGRAM([])], [gl_cv_ld_output_def=yes], [gl_cv_ld_output_def=no]) rm -f conftest.def LDFLAGS="$gl_ldflags_save" fi]) AM_CONDITIONAL([HAVE_LD_OUTPUT_DEF], test "x$gl_cv_ld_output_def" = "xyes") ]) ortp-1.0.2/m4/obsolete.m4000066400000000000000000000000651315172643600151050ustar00rootroot00000000000000AC_DEFUN([AM_PROG_MKDIR_P], [AC_PROG_MKDIR_P([$@])]) ortp-1.0.2/oRTP.prj000066400000000000000000000104631315172643600140530ustar00rootroot00000000000000# Anjuta Version 1.1.97 Compatibility Level: 1 Some description props.file.type=project anjuta.version=1.1.97 anjuta.compatibility.level=1 project.name=oRTP project.type=GENERIC project.target.type=EXECUTABLE project.version=0.99 project.author=Simon Morlat project.source.target=Rtp stack project.has.gettext=0 project.gui.command= project.programming.language=C project.excluded.modules=intl project.config.extra.modules.before= project.config.extra.modules.after= project.config.blocked=1 project.config.disable.overwriting=1 1 1 1 1 1 1 1 1 project.menu.entry=oRTP Version 0.99 project.menu.group=Application project.menu.comment=oRTP Version 0.99 project.menu.icon= project.menu.need.terminal=0 project.configure.options= anjuta.program.arguments= preferences.build.option.jobs=0 preferences.build.option.silent=0 preferences.build.option.autosave=1 preferences.anjuta.make.options=-k preferences.make=make preferences.build.option.keep.going=1 preferences.build.option.warn.undef=0 preferences.autoformat.custom.style= -i8 -sc -bli0 -bl0 -cbi0 -ss preferences.autoformat.style=Style of Kangleipak preferences.indent.opening=0 preferences.autoformat.disable=0 preferences.indent.automatic=1 preferences.use.tabs=1 preferences.indent.size=4 preferences.tabsize=4 preferences.indent.closing=0 module.include.name=. module.include.type= module.include.files=\ src/errno-win32.h\ src/export.h\ src/ortp-config-win32.h\ src/ortp.h\ src/payloadtype.h\ src/port_fct.h\ src/rtp.h\ src/rtpmod.h\ src/rtpport.h\ src/rtpsession.h\ src/rtpsignaltable.h\ src/rtptimer.h\ src/scheduler.h\ src/sessionset.h\ src/str_utils.h\ src/telephonyevents.h\ src/rtcp.h\ ortp-config.h module.source.name=. module.source.type= module.source.files=\ src/avprofile.c\ src/export.c\ src/mrtprecv.c\ src/mrtpsend.c\ src/ortp.c\ src/ortpdlkm.c\ src/payloadtype.c\ src/port_fct.c\ src/posixtimer.c\ src/rtpmemtest.c\ src/rtpmod.c\ src/rtpparse.c\ src/rtprecv.c\ src/rtpsend.c\ src/rtpsession.c\ src/rtpsignaltable.c\ src/rtptimer.c\ src/scheduler.c\ src/sessionset.c\ src/str_utils.c\ src/telephonyevents.c\ src/test_tevrecv.c\ src/test_tevsend.c\ src/test_timer.c\ src/tevmrtprecv.c\ src/tevrtprecv.c\ src/tevrtpsend.c module.pixmap.name=. module.pixmap.type= module.pixmap.files=\ docs/html/home.png\ docs/html/left.png\ docs/html/right.png\ docs/html/up.png module.data.name=. module.data.type= module.data.files= module.help.name=. module.help.type= module.help.files= module.doc.name=. module.doc.type= module.doc.files=\ build/win32/oRTP/README\ AUTHORS\ COPYING\ ChangeLog\ INSTALL\ NEWS\ README\ TODO\ docs/tmpl/multiplexing.sgml\ docs/tmpl/ortp-unused.sgml\ docs/tmpl/payloads.sgml\ docs/tmpl/rtpsessionapi.sgml\ docs/tmpl/stackinit.sgml\ docs/tmpl/stackmanagement.sgml\ docs/tmpl/telephoneevents.sgml\ docs/sgml/payloads.sgml\ docs/sgml/tree_index.sgml\ docs/sgml/object_index.sgml\ docs/sgml/rtpsessionapi.sgml\ docs/sgml/stackmanagement.sgml\ docs/sgml/multiplexing.sgml\ docs/sgml/telephoneevents.sgml\ docs/ortp-docs.sgml\ docs/html/book1.html\ docs/html/ortpapi.html\ docs/html/ortp-stack-management-functions.html\ docs/html/ortp-rtpsession-api.html\ docs/html/ortp-rtp-payloads-and-profiles.html\ docs/html/ortp-multiplexing-sessions-(in-a-one-thread-design).html\ docs/html/ortp-telephone-events-(rfc2833)-.html\ docs/html/index.sgml\ docs/html/ortp-library-management-functions.html module.po.files= compiler.options.supports= compiler.options.include.paths=\ .\ .. compiler.options.library.paths= compiler.options.libraries= compiler.options.libraries.selected= compiler.options.defines=\ HAVE_CONFIG_H compiler.options.defines.selected= compiler.options.warning.buttons=0 0 1 1 0 1 0 0 0 0 0 0 0 1 0 0 compiler.options.optimize.buttons=0 0 1 0 compiler.options.other.buttons=1 0 compiler.options.other.c.flags= compiler.options.other.l.flags= compiler.options.other.l.libs= project.src.paths= ortp-1.0.2/oRTP.pws000066400000000000000000000015241315172643600140670ustar00rootroot00000000000000 [executer] RunInTerminal=true [Project DBase] ShowLocals=true [filenumbers] 0=1846 1=270 2=1 3=34 4=43 5=1 6=4 7=27 8=9 [filemarkers] 0= 1= 2= 3= 4= 5= 6= 7= 8= [File View] filter.file.unmatch=*.so *.o *.a *.la filter.file.ignore.hidden=0 filter.dir.ignore.hidden=0 [filelist] 0=/home/sangamon/src/devel/linphone/oRTP/src/rtpsession.c 1=/home/sangamon/src/devel/linphone/oRTP/src/rtpsession.h 2=/home/sangamon/src/devel/linphone/oRTP/src/rtcp.h 3=/home/sangamon/src/devel/linphone/oRTP/src/scheduler.c [Project Tree] 0=0 1=0:1 [File Tree] 0=0 [replace_text] 0=telephone_event 1=session->rtp 2=PAYLOAD_AUDIO_CONTINUOUS 3=ortp_global_stats 4=session->rtp.rq 5=session->rtp.wq [find_text] 0=rtp_session_create 1=chunk_item_new 2=rtcp_calculate_sdes_padding 3=rtp_session_process 4=scheduler 5=rtp 6=rtp_send 7=RtpSession [find_in_files] 0=exit ortp-1.0.2/ortp-config.h.cmake000066400000000000000000000031521315172643600161660ustar00rootroot00000000000000/*************************************************************************** * config.h.cmake * Copyright (C) 2014 Belledonne Communications, Grenoble France * **************************************************************************** * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ****************************************************************************/ #define ORTP_MAJOR_VERSION ${ORTP_MAJOR_VERSION} #define ORTP_MINOR_VERSION ${ORTP_MINOR_VERSION} #define ORTP_MICRO_VERSION ${ORTP_MICRO_VERSION} #define ORTP_VERSION "${ORTP_VERSION}" #cmakedefine HAVE_SYS_UIO_H 1 #cmakedefine HAVE_SYS_AUDIO_H 1 #cmakedefine HAVE_SYS_SHM_H 1 #cmakedefine HAVE_STDATOMIC_H 1 #cmakedefine HAVE_ARC4RANDOM 1 #cmakedefine ORTP_BIGENDIAN #cmakedefine PERF #cmakedefine ORTP_TIMESTAMP #cmakedefine ORTP_DEBUG_MODE #cmakedefine ORTP_DEFAULT_THREAD_STACK_SIZE ${ORTP_DEFAULT_THREAD_STACK_SIZE} #cmakedefine POSIXTIMER_INTERVAL ${POSIXTIMER_INTERVAL} #cmakedefine __APPLE_USE_RFC_3542 ortp-1.0.2/ortp.doxygen.in000066400000000000000000003157001315172643600155040ustar00rootroot00000000000000# Doxyfile 1.8.11 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. # # All text after a double hash (##) is considered a comment and is placed in # front of the TAG it is preceding. # # All text after a single hash (#) is considered a comment and will be ignored. # The format is: # TAG = value [value, ...] # For lists, items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (\" \"). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all text # before the first occurrence of this tag. Doxygen uses libiconv (or the iconv # built into libc) for the transcoding. See http://www.gnu.org/software/libiconv # for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded by # double-quotes, unless you are using Doxywizard) that should identify the # project for which the documentation is generated. This name is used in the # title of most generated pages and in a few other places. # The default value is: My Project. PROJECT_NAME = oRTP # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version # control system is used. PROJECT_NUMBER = @ORTP_VERSION@ # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. OUTPUT_DIRECTORY = doc # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and # will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where # putting all generated files in the same directory would otherwise causes # performance problems for the file system. # The default value is: NO. CREATE_SUBDIRS = NO # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII # characters to appear in the names of generated files. If set to NO, non-ASCII # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode # U+3044. # The default value is: NO. ALLOW_UNICODE_NAMES = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, # Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), # Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, # Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), # Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, # Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, # Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, # Ukrainian and Vietnamese. # The default value is: English. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. # The default value is: YES. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator that is # used to form the text in various listings. Each string in this list, if found # as the leading text of the brief description, will be stripped from the text # and the result, after processing the whole list, is used as the annotated # text. Otherwise, the brief description is used as-is. If left blank, the # following values are used ($name is automatically replaced with the name of # the entity):The $name class, The $name widget, The $name file, is, provides, # specifies, contains, represents, a, an and the. ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # doxygen will generate a detailed section even if there is only a brief # description. # The default value is: NO. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. # The default value is: NO. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. FULL_PATH_NAMES = NO # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # Stripping is only done if one of the specified strings matches the left-hand # part of the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the path to # strip. # # Note that you can specify absolute paths here, but also relative paths, which # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which # header file to include in order to use a class. If left blank only the name of # the header file containing the class definition is used. Otherwise one should # specify the list of include paths that are normally passed to the compiler # using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't # support long names like on DOS, Mac, or CD-ROM. # The default value is: NO. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the # first line (until the first dot) of a Javadoc-style comment as the brief # description. If set to NO, the Javadoc-style will behave just like regular Qt- # style comments (thus requiring an explicit @brief command for a brief # description.) # The default value is: NO. JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus # requiring an explicit \brief command for a brief description.) # The default value is: NO. QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a # multi-line C++ special comment block (i.e. a block of //! or /// comments) as # a brief description. This used to be the default behavior. The new default is # to treat a multi-line C++ comment block as a detailed description. Set this # tag to YES if you prefer the old behavior instead. # # Note that setting this tag to YES also means that rational rose comments are # not recognized any more. # The default value is: NO. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new # page for each member. If set to NO, the documentation of a member will be part # of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen # uses this value to replace tabs by spaces in code fragments. # Minimum value: 1, maximum value: 16, default value: 4. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that act as commands in # the documentation. An alias has the form: # name=value # For example adding # "sideeffect=@par Side Effects:\n" # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all # members will be omitted, etc. # The default value is: NO. OPTIMIZE_OUTPUT_FOR_C = YES # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or # Python sources only. Doxygen will then generate output that is more tailored # for that language. For instance, namespaces will be presented as packages, # qualified scopes will look different, etc. # The default value is: NO. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources. Doxygen will then generate output that is tailored for Fortran. # The default value is: NO. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for VHDL. # The default value is: NO. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and # language is one of the parsers supported by doxygen: IDL, Java, Javascript, # C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: # FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: # Fortran. In the later case the parser tries to guess whether the code is fixed # or free formatted code, this is the default for Fortran type files), VHDL. For # instance to make doxygen treat .inc files as Fortran files (default is PHP), # and .f files as C (default is Fortran), use: inc=Fortran f=C. # # Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable # documentation. See http://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. # The default value is: YES. MARKDOWN_SUPPORT = YES # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by putting a % sign in front of the word or # globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should set this # tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); # versus func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. # The default value is: NO. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. # The default value is: NO. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: # http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate # getter and setter methods for a property. Setting this option to YES will make # doxygen to replace the get and set methods by a property in the documentation. # This will only work if the methods are indeed getting or setting a simple # type. If this is not the case, or you want to show the methods anyway, you # should set this option to NO. # The default value is: YES. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. DISTRIBUTE_GROUP_DOC = NO # If one adds a struct or class to a group and this option is enabled, then also # any nested class or struct is added to the same group. By default this option # is disabled and one has to add nested compounds explicitly via \ingroup. # The default value is: NO. GROUP_NESTED_COMPOUNDS = NO # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that # type (e.g. under the Public Functions section). Set it to NO to prevent # subgrouping. Alternatively, this can be done per class using the # \nosubgrouping command. # The default value is: YES. SUBGROUPING = YES # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions # are shown inside the group in which they are included (e.g. using \ingroup) # instead of on a separate page (for HTML and Man pages) or section (for LaTeX # and RTF). # # Note that this feature does not work in combination with # SEPARATE_MEMBER_PAGES. # The default value is: NO. INLINE_GROUPED_CLASSES = NO # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions # with only public data fields or simple typedef fields will be shown inline in # the documentation of the scope in which they are defined (i.e. file, # namespace, or group documentation), provided this scope is documented. If set # to NO, structs, classes, and unions are shown on a separate page (for HTML and # Man pages) or section (for LaTeX and RTF). # The default value is: NO. INLINE_SIMPLE_STRUCTS = NO # When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or # enum is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically be # useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. # The default value is: NO. TYPEDEF_HIDES_STRUCT = NO # The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This # cache is used to resolve symbols given their name and scope. Since this can be # an expensive process and often the same symbol appears multiple times in the # code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small # doxygen will become slower. If the cache is too large, memory is wasted. The # cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range # is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 # symbols. At the end of a run doxygen will report the cache usage and suggest # the optimal cache size from a speed point of view. # Minimum value: 0, maximum value: 9, default value: 0. LOOKUP_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. # Note: This will also disable the warnings about undocumented members that are # normally produced when WARNINGS is set to YES. # The default value is: NO. EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = NO # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = NO # If the EXTRACT_STATIC tag is set to YES, all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined # locally in source files will be included in the documentation. If set to NO, # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. If set to YES, local methods, # which are defined in the implementation section but not in the interface are # included in the documentation. If set to NO, only methods in the interface are # included. # The default value is: NO. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base name of # the file that contains the anonymous namespace. By default anonymous namespace # are hidden. # The default value is: NO. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation # section is generated. This option has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set # to NO, these classes will be included in the various overviews. This option # has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend # (class|struct|union) declarations. If set to NO, these declarations will be # included in the documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any # documentation blocks found inside the body of a function. If set to NO, these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation that is typed after a # \internal command is included. If the tag is set to NO then the documentation # will be excluded. Set it to YES to include the internal documentation. # The default value is: NO. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file # names in lower-case letters. If set to YES, upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. # The default value is: system dependent. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with # their full class and namespace scopes in the documentation. If set to YES, the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO # If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will # append additional text to a page's title, such as Class Reference. If set to # YES the compound reference will be hidden. # The default value is: NO. HIDE_COMPOUND_REFERENCE= NO # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. SHOW_INCLUDE_FILES = YES # If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each # grouped member an include statement to the documentation, telling the reader # which file to include in order to use the member. # The default value is: NO. SHOW_GROUPED_MEMB_INC = NO # If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include # files with double quotes in the documentation rather than with sharp brackets. # The default value is: NO. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the # documentation for inline members. # The default value is: YES. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the # (brief and detailed) documentation of class members so that constructors and # destructors are listed first. If set to NO the constructors will appear in the # respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. # Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief # member documentation. # Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting # detailed member documentation. # The default value is: NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy # of group names into alphabetical order. If set to NO the group names will # appear in their defined order. # The default value is: NO. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by # fully-qualified names, including namespaces. If set to NO, the class list will # be sorted only by class name, not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the alphabetical # list. # The default value is: NO. SORT_BY_SCOPE_NAME = NO # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper # type resolution of all parameters of a function it will reject a match between # the prototype and the implementation of a member function even if there is # only one candidate or it is obvious which candidate to choose by doing a # simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still # accept a match between prototype and implementation in such cases. # The default value is: NO. STRICT_PROTO_MATCHING = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo # list. This list is created by putting \todo commands in the documentation. # The default value is: YES. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test # list. This list is created by putting \test commands in the documentation. # The default value is: YES. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional documentation # sections, marked by \if ... \endif and \cond # ... \endcond blocks. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the # documentation. If the initializer consists of more lines than specified here # it will be hidden. Use a value of 0 to hide initializers completely. The # appearance of the value of individual variables and macros / defines can be # controlled using \showinitializer or \hideinitializer command in the # documentation regardless of this setting. # Minimum value: 0, maximum value: 10000, default value: 30. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at # the bottom of the documentation of classes and structs. If set to YES, the # list will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. This # will remove the Files entry from the Quick Index and from the Folder Tree View # (if specified). # The default value is: YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces # page. This will remove the Namespaces entry from the Quick Index and from the # Folder Tree View (if specified). # The default value is: YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command command input-file, where command is the value of the # FILE_VERSION_FILTER tag, and input-file is the name of an input file provided # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. You can # optionally specify a file name after the option, if omitted DoxygenLayout.xml # will be used as the name of the layout file. # # Note that if you run doxygen from a directory containing a file called # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool # to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated to # standard output by doxygen. If QUIET is set to YES this implies that the # messages are off. # The default value is: NO. QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages that are # generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. # The default value is: YES. WARNINGS = YES # If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. WARN_IF_UNDOCUMENTED = NO # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some parameters # in a documented function, or documenting parameters that don't exist or using # markup commands wrongly. # The default value is: YES. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return # value. If set to NO, doxygen will only warn about wrong or incomplete # parameter documentation, but not about the absence of documentation. # The default value is: NO. WARN_NO_PARAMDOC = NO # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when # a warning is encountered. # The default value is: NO. WARN_AS_ERROR = YES # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated # and the warning text. Optionally the format may contain $version, which will # be replaced by the version of the file (if it could be obtained via # FILE_VERSION_FILTER) # The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard # error (stderr). WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. INPUT = @srcdir@/src \ @srcdir@/include/ortp # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv # documentation (see: http://www.gnu.org/software/libiconv) for the list of # possible encodings. # The default value is: UTF-8. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and # *.h) to filter out the source-files in the directories. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # read by doxygen. # # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, # *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, # *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, # *.vhdl, *.ucf, *.qsf, *.as and *.js. FILE_PATTERNS = *.c \ *.h \ *.dox # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. # The default value is: NO. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. # # Note that relative paths are relative to the directory from which doxygen is # run. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. # The default value is: NO. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). EXAMPLE_PATH = @srcdir@/src/tests # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and # *.h) to filter out the source-files in the directories. If left blank all # files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude commands # irrespective of the value of the RECURSIVE tag. # The default value is: NO. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or directories # that contain images that are to be included in the documentation (see the # \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command: # # # # where is the value of the INPUT_FILTER tag, and is the # name of an input file. Doxygen will then use the output that the filter # program writes to standard output. If FILTER_PATTERNS is specified, this tag # will be ignored. # # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: pattern=filter # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. FILTER_SOURCE_FILES = NO # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file # pattern. A pattern will override the setting for FILTER_PATTERN (if any) and # it is also possible to disable source filtering for a specific pattern using # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will be # generated. Documented entities will be cross-referenced with these sources. # # Note: To get rid of all source code in the generated output, make sure that # also VERBATIM_HEADERS is set to NO. # The default value is: NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body of functions, # classes and enums directly into the documentation. # The default value is: NO. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any # special comment blocks from generated source code fragments. Normal C, C++ and # Fortran comments will always remain visible. # The default value is: YES. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented # function all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES then for each documented function # all documented entities called/used by that function will be listed. # The default value is: NO. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set # to YES then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. REFERENCES_LINK_SOURCE = YES # If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the # source code will show a tooltip with additional information such as prototype, # brief description and links to the definition and documentation. Since this # will make the HTML file larger and loading of large files a bit slower, you # can opt to disable this feature. # The default value is: YES. # This tag requires that the tag SOURCE_BROWSER is set to YES. SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system # (see http://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global # - Enable SOURCE_BROWSER and USE_HTAGS in the config file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # # Doxygen will invoke htags (and that will in turn invoke gtags), so these # tools must be available from the command line (i.e. in the search path). # # The result: instead of the source browser generated by doxygen, the links to # source code will now point to the output of htags. # The default value is: NO. # This tag requires that the tag SOURCE_BROWSER is set to YES. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a # verbatim copy of the header file for each class for which an include is # specified. Set to NO to disable this. # See also: Section \class. # The default value is: YES. VERBATIM_HEADERS = NO #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all # compounds will be generated. Enable this if the project contains a lot of # classes, structs, unions or interfaces. # The default value is: YES. ALPHABETICAL_INDEX = NO # The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in # which the alphabetical index list will be split. # Minimum value: 1, maximum value: 20, default value: 5. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of # it. # The default directory is: html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each # generated HTML page (for example: .htm, .php, .asp). # The default value is: .html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a user-defined HTML header file for # each generated HTML page. If the tag is left blank doxygen will generate a # standard header. # # To get valid HTML the header file that includes any scripts and style sheets # that doxygen needs, which is dependent on the configuration options used (e.g. # the setting GENERATE_TREEVIEW). It is highly recommended to start with a # default header using # doxygen -w html new_header.html new_footer.html new_stylesheet.css # YourConfigFile # and then modify the file new_header.html. See also section "Doxygen usage" # for information on how to generate the default header that doxygen normally # uses. # Note: The header is subject to change so you typically have to regenerate the # default header when upgrading to a newer version of doxygen. For a description # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard # footer. See HTML_HEADER for more information on how to generate a default # footer and what special commands can be used inside the footer. See also # section "Doxygen usage" for information on how to generate the default footer # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of # the HTML output. If left blank doxygen will generate a default style sheet. # See also section "Doxygen usage" for information on how to generate the style # sheet that doxygen normally uses. # Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as # it is more robust and this tag (HTML_STYLESHEET) will in the future become # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the # standard style sheet and is therefore more robust against future updates. # Doxygen will copy the style sheet files to the output directory. # Note: The order of the extra style sheet files is of importance (e.g. the last # style sheet in the list overrules the setting of the previous ones in the # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the # $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these # files. In the HTML_STYLESHEET file, use the file name only. Also note that the # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see # http://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors # in the HTML output. For a value of 0 the output will use grayscales only. A # value of 255 will produce the most vivid colors. # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_SAT = 100 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the # luminance component of the colors in the HTML output. Values below 100 # gradually make the output lighter, whereas values above 100 make the output # darker. The value divided by 100 is the actual gamma applied, so 80 represents # a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not # change the gamma. # Minimum value: 40, maximum value: 240, default value: 80. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this # to YES can help to show when doxygen was last run and thus if the # documentation is up to date. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = NO # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_DYNAMIC_SECTIONS = NO # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries # shown in the various tree structured indices initially; the user can expand # and collapse entries dynamically later on. Doxygen will expand the tree to # such a level that at most the specified number of entries are visible (unless # a fully collapsed tree already exceeds this amount). So setting the number of # entries 1 will produce a full collapsed tree by default. 0 is a special value # representing an infinite number of entries and will result in a full expanded # tree by default. # Minimum value: 0, maximum value: 9999, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development # environment (see: http://developer.apple.com/tools/xcode/), introduced with # OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at # startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html # for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_DOCSET = NO # This tag determines the name of the docset feed. A documentation feed provides # an umbrella under which multiple documentation sets from a single provider # (such as a company or product suite) can be grouped. # The default value is: Doxygen generated docs. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_FEEDNAME = "Doxygen generated docs" # This tag specifies a string that should uniquely identify the documentation # set bundle. This should be a reverse domain-name style string, e.g. # com.mycompany.MyDocSet. Doxygen will append .docset to the name. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_BUNDLE_ID = org.doxygen.Project # The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify # the documentation publisher. This should be a reverse domain-name style # string, e.g. com.mycompany.MyDocSet.documentation. # The default value is: org.doxygen.Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_ID = org.doxygen.Publisher # The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. # The default value is: Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop # (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on # Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML # files are now used as the Windows 98 help format, and will replace the old # Windows help format (.hlp) on all Windows platforms in the future. Compressed # HTML files also contain an index, a table of contents, and you can search for # words in the documentation. The HTML workshop also contains a viewer for # compressed HTML files. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_HTMLHELP = NO # The CHM_FILE tag can be used to specify the file name of the resulting .chm # file. You can add a path in front of the file if the result should not be # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the master .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO # The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it # enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members to # the table of contents of the HTML help documentation and to the tree view. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that # can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help # (.qch) of the generated HTML documentation. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify # the file name of the resulting .qch file. The path specified is relative to # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace # (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual # Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- # folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To # install this plugin and make it available under the help contents menu in # Eclipse, the contents of the directory containing the HTML and XML files needs # to be copied into the plugins directory of eclipse. The name of the directory # within the plugins directory should be the same as the ECLIPSE_DOC_ID value. # After copying Eclipse needs to be restarted before the help appears. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_ECLIPSEHELP = NO # A unique identifier for the Eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have this # name. Each documentation set should have its own identifier. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. ECLIPSE_DOC_ID = org.doxygen.Project # If you want full control over the layout of the generated HTML pages it might # be necessary to disable the index and replace it with your own. The # DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top # of each HTML page. A value of NO enables the index and the value YES disables # it. Since the tabs in the index contain the same information as the navigation # tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. DISABLE_INDEX = NO # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. If the tag # value is set to YES, a side panel will be generated containing a tree-like # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the # HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can # further fine-tune the look of the index. As an example, the default style # sheet generated by doxygen has an example that shows how to put an image at # the root of the tree instead of the PROJECT_NAME. Since the tree basically has # the same information as the tab index, you could consider setting # DISABLE_INDEX to YES when enabling this option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_TREEVIEW = NO # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. # # Note that a value of 0 will completely suppress the enum values from appearing # in the overview section. # Minimum value: 0, maximum value: 20, default value: 4. # This tag requires that the tag GENERATE_HTML is set to YES. ENUM_VALUES_PER_LINE = 1 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used # to set the initial width (in pixels) of the frame in which the tree is shown. # Minimum value: 0, maximum value: 1500, default value: 250. # This tag requires that the tag GENERATE_HTML is set to YES. TREEVIEW_WIDTH = 250 # If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. EXT_LINKS_IN_WINDOW = NO # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML # output directory to force them to be regenerated. # Minimum value: 8, maximum value: 50, default value: 10. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_FONTSIZE = 10 # Use the FORMULA_TRANPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # # Note that when changing this option you need to delete any form_*.png files in # the HTML output directory before the changes have effect. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # http://www.mathjax.org) which uses client side Javascript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. USE_MATHJAX = NO # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: # http://docs.mathjax.org/en/latest/output.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_FORMAT = HTML-CSS # When MathJax is enabled you need to specify the location relative to the HTML # output directory using the MATHJAX_RELPATH option. The destination directory # should contain the MathJax.js script. For instance, if the mathjax directory # is located at the same level as the HTML output directory, then # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of # MathJax from http://www.mathjax.org before deployment. # The default value is: http://cdn.mathjax.org/mathjax/latest. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site # (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and # should work on any modern browser. Note that when using HTML help # (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) # there is already a search function so this one should typically be disabled. # For large projects the javascript based search engine can be slow, then # enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to # search using the keyboard; to jump to the search box use + S # (what the is depends on the OS and browser, but it is typically # , /