remote ortp and add it as a submodule instead.

This commit is contained in:
Simon Morlat 2010-01-20 11:35:20 +01:00
parent 4a0d7392cd
commit 967779a28c
107 changed files with 4 additions and 22757 deletions

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "linphone/oRTP"]
path = linphone/oRTP
url = git://git.linphone.org/ortp.git

1
linphone/oRTP Submodule

@ -0,0 +1 @@
Subproject commit 305f3368f583102d1f8a788592dbabb92798edf1

View file

@ -1,23 +0,0 @@
Makefile
Makefile.in
aclocal.m4
autom4te.cache
config.guess
config.log
config.status
config.sub
configure
depcomp
install-sh
libtool
ltmain.sh
missing
ortp-config.h
ortp-config.h.in
ortp.defs
ortp.pc
ortp.spec
stamp-h1
doc
ortp.doxygen
.settings

View file

@ -1,4 +0,0 @@
Simon MORLAT (simon dot morlat at linphone dot org) is the author the oRTP library.
Lovadina Nicola < lovadina dot nicola dot 10272 at unimo dot it > worked on RTCP support.

View file

@ -1,504 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 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.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
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 and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, 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 library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete 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 distribute a copy of this License along with the
Library.
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 Library or any portion
of it, thus forming a work based on the Library, 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) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
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 Library, 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 Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you 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.
If distribution of 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 satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be 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.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library 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.
9. 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 Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
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 with
this License.
11. 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 Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library 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 Library.
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.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library 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.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser 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 Library
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 Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
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
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "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
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. 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 LIBRARY 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
LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. 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.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; 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.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View file

@ -1,153 +0,0 @@
2007-07-26 Francois-Xavier Kowalski <fix@hp.com>
* pkg.list: 1.3
Do not run makewhatis when installing EPM-generated package.
2007-04-19 Francois-Xavier Kowalski <fix@hp.com>
* 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 <fix@hp.com>
* include/ortp/payloadtype.h: 1.28
Encompass every declaration (whether lvalue or not) under extern
"C".
2007-01-18 Francois-Xavier Kowalski <fix@hp.com>
* oRTP/Makefile.am: 1.24
Fix RPM package generattion to cope with
<https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=206841>
2006-10-24 Francois-Xavier 'FiX' KOWALSKI <fix@hp.com>
* 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 <ortp/port.h>
2006-07-10 Francois-Xavier 'FiX' KOWALSKI <fix@hp.com>
* 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 <fix@hp.com>
* 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 <fix@hp.com>
* 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 <fix@hp.com>
* 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.

View file

@ -1,229 +0,0 @@
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
cache files.)
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You only need
`configure.ac' if you want to change it or regenerate `configure' using
a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not support the `VPATH'
variable, you have to compile the package for one architecture at a
time in the source code directory. After you have installed the
package for one architecture, use `make distclean' before reconfiguring
for another architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the `--target=TYPE' option to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
will cause the specified gcc to be used as the C compiler (unless it is
overridden in the site shell script).
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

View file

@ -1,89 +0,0 @@
# linphone/oRTP/Makefile.am --
EXTRA_DIST = oRTP.prj ortp-config.h.in TODO pkg.list autogen.sh ortp.pc.in ortp.spec.in ortp.spec ortp.doxygen
SUBDIRS=src build include
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = ortp.pc
SOURCES=$(top_srcdir)/include/ortp/*.h $(top_srcdir)/src/*.c $(top_srcdir)/src/*.h
#html doc
if HAVE_DOXYGEN
# doxdir & pkgdocdir are not always defined by automake
docdir=$(datadir)/doc
pkgdocdir=$(docdir)/$(PACKAGE)-$(VERSION)
doc_htmldir=$(pkgdocdir)/html
doc_html_DATA = $(top_builddir)/doc/html/html.tar
$(doc_html_DATA): $(top_builddir)/doc/html/index.html
cd $(<D) && 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
# <https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=206841>
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 = $(shell 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
all-local: ortp.spec
ortp.spec: ortp.spec.in

View file

@ -1,51 +0,0 @@
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

View file

@ -1,58 +0,0 @@
What is it ?
************
oRTP is a LGPL licensed C library implementing the RTP protocol (rfc3550). It is available
for most unix clones (primilarly Linux and HP-UX), and Microsoft Windows.
What are the build prequisites ?
********************************
libc library and header files.
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.

View file

@ -1,2 +0,0 @@
* make statistics thread-safe.
* add a rtp_stats_display() func to display rtp_stats_t properly.

View file

@ -1,30 +0,0 @@
#!/bin/sh
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
if test -f /opt/local/bin/glibtoolize ; then
# darwin
LIBTOOLIZE=/opt/local/bin/glibtoolize
else
LIBTOOLIZE=libtoolize
fi
if test -d /opt/local/share/aclocal ; then
ACLOCAL_ARGS="-I /opt/local/share/aclocal"
fi
set -x
rm -rf config.cache autom4te.cache
$LIBTOOLIZE --copy --force
$ACLOCAL $ACLOCAL_ARGS
autoheader
$AUTOMAKE --add-missing --copy
autoconf

View file

@ -1,2 +0,0 @@
Makefile
Makefile.in

View file

@ -1 +0,0 @@
SUBDIRS= win32native wince winmob

View file

@ -1,2 +0,0 @@
Makefile.in
Makefile

View file

@ -1,2 +0,0 @@
EXTRA_DIST=oRTP.vcproj ortp.def

View file

@ -1,393 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="oRTP"
ProjectGUID="{4A07BB2B-F56E-4F1B-A719-D28B782AC128}"
RootNamespace="oRTP"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;..\..\..\win32-bin\include&quot;;&quot;..\..\include&quot;;&quot;..\..\include\ortp&quot;;&quot;..\..\src&quot;;&quot;..\..\build\win32native\include&quot;"
PreprocessorDefinitions="HAVE_OPENSSL_HMAC_H;HAVE_OPENSSL_MD5_H;_CRT_SECURE_NO_DEPRECATE;ORTP_INET6;WIN32;_DEBUG;_WINDOWS;_USRDLL;ORTP_EXPORTS;WINDOW_NATIVE;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libeay32.lib Ws2_32.lib libsrtp.lib Winmm.lib libcmtd.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;..\..\..\win32-bin\lib&quot;"
IgnoreAllDefaultLibraries="true"
ModuleDefinitionFile="oRTP.def"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/oRTP.pdb"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..\..\..\win32-bin\include&quot;;&quot;..\..\include&quot;;&quot;..\..\include\ortp&quot;;&quot;..\..\src&quot;;&quot;..\..\build\win32native\include&quot;"
PreprocessorDefinitions="HAVE_OPENSSL_HMAC_H;HAVE_OPENSSL_MD5_H;_CRT_SECURE_NO_DEPRECATE;ORTP_INET6;WIN32;NDEBUG;_WINDOWS;_USRDLL;ORTP_EXPORTS;WINDOW_NATIVE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="0"
CallingConvention="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libeay32.lib Ws2_32.lib libsrtp.lib Winmm.lib libcmt.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;..\..\..\win32-bin\lib&quot;"
IgnoreAllDefaultLibraries="true"
ModuleDefinitionFile="oRTP.def"
GenerateDebugInformation="false"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\src\avprofile.c"
>
</File>
<File
RelativePath="..\..\src\b64.c"
>
</File>
<File
RelativePath="..\..\src\dll_entry.c"
>
</File>
<File
RelativePath="..\..\src\event.c"
>
</File>
<File
RelativePath="..\..\src\jitterctl.c"
>
</File>
<File
RelativePath="..\..\src\ortp.c"
>
</File>
<File
RelativePath=".\ortp.def"
>
</File>
<File
RelativePath="..\..\src\payloadtype.c"
>
</File>
<File
RelativePath="..\..\src\port.c"
>
</File>
<File
RelativePath="..\..\src\posixtimer.c"
>
</File>
<File
RelativePath="..\..\src\rtcp.c"
>
</File>
<File
RelativePath="..\..\src\rtcpparse.c"
>
</File>
<File
RelativePath="..\..\src\rtpparse.c"
>
</File>
<File
RelativePath="..\..\src\rtpsession.c"
>
</File>
<File
RelativePath="..\..\src\rtpsession_inet.c"
>
</File>
<File
RelativePath="..\..\src\rtpsignaltable.c"
>
</File>
<File
RelativePath="..\..\src\rtptimer.c"
>
</File>
<File
RelativePath="..\..\src\scheduler.c"
>
</File>
<File
RelativePath="..\..\src\sessionset.c"
>
</File>
<File
RelativePath="..\..\src\srtp.c"
>
</File>
<File
RelativePath="..\..\src\str_utils.c"
>
</File>
<File
RelativePath="..\..\src\stun.c"
>
</File>
<File
RelativePath="..\..\src\stun_udp.c"
>
</File>
<File
RelativePath="..\..\src\telephonyevents.c"
>
</File>
<File
RelativePath="..\..\src\utils.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\include\ortp\b64.h"
>
</File>
<File
RelativePath="..\..\include\ortp\event.h"
>
</File>
<File
RelativePath="..\..\src\jitterctl.h"
>
</File>
<File
RelativePath="..\..\src\ortp-config-win32.h"
>
</File>
<File
RelativePath="..\..\include\ortp\ortp.h"
>
</File>
<File
RelativePath="..\..\include\ortp\payloadtype.h"
>
</File>
<File
RelativePath="..\..\include\ortp\port.h"
>
</File>
<File
RelativePath="..\..\include\ortp\rtcp.h"
>
</File>
<File
RelativePath="..\..\include\ortp\rtp.h"
>
</File>
<File
RelativePath="..\..\src\rtpmod.h"
>
</File>
<File
RelativePath="..\..\include\ortp\rtpsession.h"
>
</File>
<File
RelativePath="..\..\src\rtpsession_priv.h"
>
</File>
<File
RelativePath="..\..\include\ortp\rtpsignaltable.h"
>
</File>
<File
RelativePath="..\..\src\rtptimer.h"
>
</File>
<File
RelativePath="..\..\src\scheduler.h"
>
</File>
<File
RelativePath="..\..\include\ortp\sessionset.h"
>
</File>
<File
RelativePath="..\..\include\ortp\srtp.h"
>
</File>
<File
RelativePath="..\..\include\ortp\str_utils.h"
>
</File>
<File
RelativePath="..\..\include\ortp\stun.h"
>
</File>
<File
RelativePath="..\..\include\ortp\stun_udp.h"
>
</File>
<File
RelativePath="..\..\include\ortp\telephonyevents.h"
>
</File>
<File
RelativePath="..\..\src\utils.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View file

@ -1,203 +0,0 @@
LIBRARY ortp
EXPORTS
ortp_init
ortp_scheduler_init
ortp_exit
ortp_get_scheduler
ortp_set_log_file
ortp_set_log_level_mask
ortp_logv_out
ortp_set_log_handler
ortp_strdup_printf
ortp_logv
ortp_get_global_stats
ortp_global_stats_display
session_set_new
session_set_select
session_set_destroy
rtp_stats_display
rtp_session_get_stats
rtp_session_init
rtp_session_new
rtp_session_set_scheduling_mode
rtp_session_set_blocking_mode
rtp_session_set_profile
rtp_session_get_profile
rtp_session_set_data
rtp_session_signal_connect
rtp_session_signal_disconnect_by_callback
rtp_session_set_ssrc
rtp_session_set_seq_number
rtp_session_get_seq_number
rtp_session_set_jitter_compensation
rtp_session_set_local_addr
rtp_session_set_remote_addr
rtp_session_enable_adaptive_jitter_compensation
rtp_session_set_recv_buf_size
rtp_session_send_with_ts
rtp_session_sendm_with_ts
rtp_session_set_sockets
rtp_session_get_rtp_socket
rtp_session_get_rtcp_socket
rtp_session_set_payload_type
rtp_session_set_send_payload_type
rtp_session_get_send_payload_type
rtp_session_set_recv_payload_type
rtp_session_get_recv_payload_type
rtp_session_recv_with_ts
rtp_session_recvm_with_ts
rtp_session_create_packet
rtp_session_get_current_send_ts
rtp_session_get_current_recv_ts
rtp_session_reset
rtp_session_uninit
rtp_session_destroy
rtp_add_csrc
rtp_session_send_dtmf
rtp_session_add_telephone_event
rtp_session_create_telephone_event_packet
rtp_session_set_source_description
rtp_session_set_symmetric_rtp
rtp_profile_new
rtp_profile_set_payload
rtp_profile_clone_full
rtp_profile_destroy
rtp_profile_get_payload_from_rtpmap
payload_type_set_send_fmtp
payload_type_clone
fmtp_get_value
ortp_free
ortp_malloc
ortp_strdup
ortp_realloc
ortp_malloc0
freemsg
dupmsg
allocb
getq
putq
msgpullup
qinit
flushq
msgdsize
peekq
freeb
dupb
concatb
esballoc
WIN_thread_create
WIN_thread_join
WIN_cond_init
WIN_mutex_init
WIN_mutex_unlock
WIN_cond_wait
WIN_mutex_lock
WIN_cond_destroy
WIN_mutex_destroy
WIN_cond_signal
__ortp_log_mask
rtp_session_register_event_queue
rtp_session_unregister_event_queue
ortp_ev_queue_new
ortp_ev_queue_flush
ortp_ev_queue_get
ortp_ev_queue_destroy
ortp_event_get_type
ortp_event_get_data
ortp_event_destroy
stunParseHostName
stunParseServerName
sendMessage
stunEncodeMessage
stunBuildReqSimple
stunParseMessage
stunServerProcessMsg
stunNatType
stunTest
stunOpenSocket
stunOpenSocketPair
stunCalculateIntegrity_shortterm
stunCalculateIntegrity_longterm
stunCalculateFingerprint
getWinSocketError
rtp_session_set_transports
srtp_transport_new
ortp_srtp_init
ortp_srtp_create
ortp_srtp_dealloc
ortp_srtp_add_stream
rtp_session_set_dscp
rtp_session_compute_recv_bandwidth
rtp_session_compute_send_bandwidth
rtcp_next_packet
rtcp_is_SDES
rtcp_sdes_parse
rtcp_is_SR
rtcp_SR_get_ssrc
rtcp_SR_get_report_block
rtcp_SR_get_sender_info
rtcp_is_RR
rtcp_RR_get_ssrc
rtcp_RR_get_report_block
rtcp_is_BYE
rtcp_BYE_get_ssrc
rtcp_BYE_get_reason
rtcp_is_APP
rtcp_APP_get_subtype
rtcp_APP_get_ssrc
rtcp_APP_get_name
rtcp_APP_get_data
rtp_session_flush_sockets
rtp_session_resync
rtp_session_set_remote_addr_and_port
rtp_session_set_time_jump_limit
copymsg
rtp_session_enable_jitter_buffer
rtp_session_set_rtp_socket_recv_buffer_size
rtp_session_set_rtp_socket_send_buffer_size
rtp_session_set_jitter_buffer_params
rtp_get_payload
rtp_session_set_remote_addr_full
rtp_session_send_rtcp_APP
b64_decode
b64_encode
payload_type_set_recv_fmtp
rtp_session_get_local_port
rtp_session_get_jitter_buffer_params
copyb
turnAllocateSocketPair

View file

@ -1,2 +0,0 @@
Makefile
Makefile.in

View file

@ -1,2 +0,0 @@
EXTRA_DIST=oRTP.vcproj ortp.def

View file

@ -1,877 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="oRTP"
ProjectGUID="{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}"
RootNamespace="oRTP"
Keyword="MFCDLLProj"
>
<Platforms>
<Platform
Name="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
/>
<Platform
Name="Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
/>
<Platform
Name="Windows Mobile 6 Standard SDK (ARMV4I)"
/>
<Platform
Name="MP100_2P21 (ARMV4I)"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
OutputDirectory="$(PlatformName)\Debug"
IntermediateDirectory="$(PlatformName)\Debug"
ConfigurationType="2"
UseOfMFC="0"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="false"
/>
<Tool
Name="VCCLCompilerTool"
ExecutionBucket="7"
Optimization="2"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="..\..\include;..\..\..\osip\include"
PreprocessorDefinitions="ORTP_INET6;ORTP_EXPORT;AMD_HACK;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);POCKETPC2003_UI_MODEL;POCKETPC2003_UI_MODEL"
RuntimeLibrary="3"
TreatWChar_tAsBuiltInType="true"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(IntDir)/oRTP.pdb"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmtd.lib"
IgnoreAllDefaultLibraries="true"
ModuleDefinitionFile="oRTP.def"
GenerateDebugInformation="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCCodeSignTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
<DeploymentTool
ForceDirty="-1"
RemoteDirectory="%CSIDL_PROGRAM_FILES%\amsipua"
RegisterOutput="0"
AdditionalFiles=""
/>
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
OutputDirectory="$(PlatformName)\Debug"
IntermediateDirectory="$(PlatformName)\Debug"
ConfigurationType="2"
UseOfMFC="0"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="false"
/>
<Tool
Name="VCCLCompilerTool"
ExecutionBucket="7"
AdditionalIncludeDirectories="..\..\include;..\..\..\osip\include"
PreprocessorDefinitions="ORTP_INET6;ORTP_EXPORT;AMD_HACK;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);SMARTPHONE2003_UI_MODEL;SMARTPHONE2003_UI_MODEL"
RuntimeLibrary="3"
TreatWChar_tAsBuiltInType="true"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(IntDir)/oRTP.pdb"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmtd.lib"
IgnoreAllDefaultLibraries="true"
ModuleDefinitionFile="oRTP.def"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCCodeSignTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
<DeploymentTool
ForceDirty="-1"
RemoteDirectory="%CSIDL_PROGRAM_FILES%\amsipua"
RegisterOutput="0"
AdditionalFiles=""
/>
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Debug|Windows Mobile 6 Standard SDK (ARMV4I)"
OutputDirectory="Windows Mobile 6 Standard SDK (ARMV4I)\$(ConfigurationName)"
IntermediateDirectory="Windows Mobile 6 Standard SDK (ARMV4I)\$(ConfigurationName)"
ConfigurationType="2"
UseOfMFC="0"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
/>
<Tool
Name="VCCLCompilerTool"
ExecutionBucket="7"
Optimization="2"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="..\..\include;..\..\..\osip\include"
PreprocessorDefinitions="ORTP_INET6;ORTP_EXPORT;AMD_HACK;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_)"
RuntimeLibrary="3"
TreatWChar_tAsBuiltInType="true"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(IntDir)/oRTP.pdb"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmtd.lib"
IgnoreAllDefaultLibraries="true"
ModuleDefinitionFile="oRTP.def"
GenerateDebugInformation="true"
TargetMachine="0"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCCodeSignTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
<DeploymentTool
ForceDirty="-1"
RemoteDirectory="%CSIDL_PROGRAM_FILES%\amsipua"
RegisterOutput="0"
AdditionalFiles=""
/>
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Debug|MP100_2P21 (ARMV4I)"
OutputDirectory="MP100_2P21 (ARMV4I)\$(ConfigurationName)"
IntermediateDirectory="MP100_2P21 (ARMV4I)\$(ConfigurationName)"
ConfigurationType="2"
UseOfMFC="0"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
/>
<Tool
Name="VCCLCompilerTool"
ExecutionBucket="7"
Optimization="0"
FavorSizeOrSpeed="0"
AdditionalIncludeDirectories="..\..\include;..\..\..\osip\include"
PreprocessorDefinitions="ORTP_INET6;ORTP_EXPORT;AMD_HACK;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);POCKETPC2003_UI_MODEL;POCKETPC2003_UI_MODEL"
RuntimeLibrary="3"
TreatWChar_tAsBuiltInType="true"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(IntDir)/oRTP.pdb"
WarningLevel="3"
DebugInformationFormat="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /SUBSYSTEM:$(CESubsystem) /MACHINE:THUMB"
AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmtd.lib"
IgnoreAllDefaultLibraries="true"
ModuleDefinitionFile="oRTP.def"
GenerateDebugInformation="true"
TargetMachine="0"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCCodeSignTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
<DeploymentTool
ForceDirty="-1"
RemoteDirectory="%CSIDL_PROGRAM_FILES%\amsipua"
RegisterOutput="0"
AdditionalFiles=""
/>
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
OutputDirectory="$(PlatformName)\Release"
IntermediateDirectory="$(PlatformName)\Release"
ConfigurationType="2"
UseOfMFC="0"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="false"
/>
<Tool
Name="VCCLCompilerTool"
ExecutionBucket="7"
AdditionalIncludeDirectories="..\..\include;..\..\..\osip\include"
PreprocessorDefinitions="ORTP_INET6;ORTP_EXPORT;AMD_HACK;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);POCKETPC2003_UI_MODEL;POCKETPC2003_UI_MODEL"
RuntimeLibrary="2"
TreatWChar_tAsBuiltInType="true"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(IntDir)/oRTP.pdb"
WarningLevel="3"
DebugInformationFormat="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmt.lib"
IgnoreAllDefaultLibraries="true"
ModuleDefinitionFile="oRTP.def"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCCodeSignTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
<DeploymentTool
ForceDirty="-1"
RemoteDirectory="%CSIDL_PROGRAM_FILES%\amsipua"
RegisterOutput="0"
AdditionalFiles=""
/>
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
OutputDirectory="$(PlatformName)\Release"
IntermediateDirectory="$(PlatformName)\Release"
ConfigurationType="2"
UseOfMFC="0"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="false"
/>
<Tool
Name="VCCLCompilerTool"
ExecutionBucket="7"
AdditionalIncludeDirectories="..\..\include;..\..\..\osip\include"
PreprocessorDefinitions="ORTP_INET6;ORTP_EXPORT;AMD_HACK;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);SMARTPHONE2003_UI_MODEL;SMARTPHONE2003_UI_MODEL"
RuntimeLibrary="2"
TreatWChar_tAsBuiltInType="true"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(IntDir)/oRTP.pdb"
WarningLevel="3"
DebugInformationFormat="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmt.lib"
IgnoreAllDefaultLibraries="true"
ModuleDefinitionFile="oRTP.def"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCCodeSignTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
<DeploymentTool
ForceDirty="-1"
RemoteDirectory="%CSIDL_PROGRAM_FILES%\amsipua"
RegisterOutput="0"
AdditionalFiles=""
/>
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)"
OutputDirectory="Windows Mobile 6 Standard SDK (ARMV4I)\$(ConfigurationName)"
IntermediateDirectory="Windows Mobile 6 Standard SDK (ARMV4I)\$(ConfigurationName)"
ConfigurationType="2"
UseOfMFC="0"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
/>
<Tool
Name="VCCLCompilerTool"
ExecutionBucket="7"
AdditionalIncludeDirectories="..\..\include;..\..\..\osip\include"
PreprocessorDefinitions="ORTP_INET6;ORTP_EXPORT;AMD_HACK;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_)"
RuntimeLibrary="2"
TreatWChar_tAsBuiltInType="true"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(IntDir)/oRTP.pdb"
WarningLevel="3"
DebugInformationFormat="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmt.lib"
IgnoreAllDefaultLibraries="true"
ModuleDefinitionFile="oRTP.def"
TargetMachine="0"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCCodeSignTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
<DeploymentTool
ForceDirty="-1"
RemoteDirectory="%CSIDL_PROGRAM_FILES%\amsipua"
RegisterOutput="0"
AdditionalFiles=""
/>
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Release|MP100_2P21 (ARMV4I)"
OutputDirectory="MP100_2P21 (ARMV4I)\$(ConfigurationName)"
IntermediateDirectory="MP100_2P21 (ARMV4I)\$(ConfigurationName)"
ConfigurationType="2"
UseOfMFC="0"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
/>
<Tool
Name="VCCLCompilerTool"
ExecutionBucket="7"
Optimization="3"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="..\..\include;..\..\..\osip\include"
PreprocessorDefinitions="ORTP_INET6;ORTP_EXPORT;AMD_HACK;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);POCKETPC2003_UI_MODEL;POCKETPC2003_UI_MODEL"
RuntimeLibrary="2"
TreatWChar_tAsBuiltInType="true"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(IntDir)/oRTP.pdb"
WarningLevel="3"
DebugInformationFormat="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /SUBSYSTEM:$(CESubsystem) /MACHINE:THUMB"
AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmt.lib"
IgnoreAllDefaultLibraries="true"
ModuleDefinitionFile="oRTP.def"
TargetMachine="0"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCCodeSignTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
<DeploymentTool
ForceDirty="-1"
RemoteDirectory="%CSIDL_PROGRAM_FILES%\amsipua"
RegisterOutput="0"
AdditionalFiles=""
/>
<DebuggerTool
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\src\avprofile.c"
>
</File>
<File
RelativePath="..\..\src\b64.c"
>
</File>
<File
RelativePath="..\..\src\event.c"
>
</File>
<File
RelativePath="..\..\src\jitterctl.c"
>
</File>
<File
RelativePath="..\..\src\ortp.c"
>
</File>
<File
RelativePath="..\..\src\payloadtype.c"
>
</File>
<File
RelativePath="..\..\src\port.c"
>
</File>
<File
RelativePath="..\..\src\posixtimer.c"
>
</File>
<File
RelativePath="..\..\src\rtcp.c"
>
</File>
<File
RelativePath="..\..\src\rtcpparse.c"
>
</File>
<File
RelativePath="..\..\src\rtpparse.c"
>
</File>
<File
RelativePath="..\..\src\rtpsession.c"
>
</File>
<File
RelativePath="..\..\src\rtpsession_inet.c"
>
</File>
<File
RelativePath="..\..\src\rtpsignaltable.c"
>
</File>
<File
RelativePath="..\..\src\rtptimer.c"
>
</File>
<File
RelativePath="..\..\src\scheduler.c"
>
</File>
<File
RelativePath="..\..\src\sessionset.c"
>
</File>
<File
RelativePath="..\..\src\str_utils.c"
>
</File>
<File
RelativePath="..\..\src\stun.c"
>
</File>
<File
RelativePath="..\..\src\stun_udp.c"
>
</File>
<File
RelativePath="..\..\src\telephonyevents.c"
>
</File>
<File
RelativePath="..\..\src\utils.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\include\ortp\b64.h"
>
</File>
<File
RelativePath="..\..\include\ortp\event.h"
>
</File>
<File
RelativePath="..\..\src\jitterctl.h"
>
</File>
<File
RelativePath="..\..\src\ortp-config-win32.h"
>
</File>
<File
RelativePath="..\..\include\ortp\ortp.h"
>
</File>
<File
RelativePath="..\..\include\ortp\payloadtype.h"
>
</File>
<File
RelativePath="..\..\include\ortp\port.h"
>
</File>
<File
RelativePath="..\..\include\ortp\rtcp.h"
>
</File>
<File
RelativePath="..\..\include\ortp\rtp.h"
>
</File>
<File
RelativePath="..\..\include\ortp\rtpsession.h"
>
</File>
<File
RelativePath="..\..\src\rtpsession_priv.h"
>
</File>
<File
RelativePath="..\..\include\ortp\rtpsignaltable.h"
>
</File>
<File
RelativePath="..\..\src\rtptimer.h"
>
</File>
<File
RelativePath="..\..\src\scheduler.h"
>
</File>
<File
RelativePath="..\..\include\ortp\sessionset.h"
>
</File>
<File
RelativePath="..\..\include\ortp\str_utils.h"
>
</File>
<File
RelativePath="..\..\include\ortp\stun.h"
>
</File>
<File
RelativePath="..\..\include\ortp\stun_udp.h"
>
</File>
<File
RelativePath="..\..\include\ortp\telephonyevents.h"
>
</File>
<File
RelativePath="..\..\src\utils.h"
>
</File>
</Filter>
<File
RelativePath=".\ortp.def"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View file

@ -1,209 +0,0 @@
LIBRARY ortp
EXPORTS
ortp_init
ortp_scheduler_init
ortp_exit
ortp_get_scheduler
ortp_set_log_file
ortp_set_log_level_mask
ortp_logv_out
ortp_set_log_handler
ortp_strdup_printf
ortp_logv
ortp_get_global_stats
ortp_global_stats_display
session_set_new
session_set_select
session_set_destroy
rtp_stats_display
rtp_session_get_stats
rtp_session_init
rtp_session_new
rtp_session_set_scheduling_mode
rtp_session_set_blocking_mode
rtp_session_set_profile
rtp_session_get_profile
rtp_session_set_data
rtp_session_signal_connect
rtp_session_signal_disconnect_by_callback
rtp_session_set_ssrc
rtp_session_set_seq_number
rtp_session_get_seq_number
rtp_session_set_jitter_compensation
rtp_session_set_local_addr
rtp_session_set_remote_addr
rtp_session_enable_adaptive_jitter_compensation
rtp_session_set_recv_buf_size
rtp_session_send_with_ts
rtp_session_sendm_with_ts
rtp_session_set_sockets
rtp_session_get_rtp_socket
rtp_session_get_rtcp_socket
rtp_session_set_payload_type
rtp_session_set_send_payload_type
rtp_session_get_send_payload_type
rtp_session_set_recv_payload_type
rtp_session_get_recv_payload_type
rtp_session_recv_with_ts
rtp_session_recvm_with_ts
rtp_session_create_packet
rtp_session_get_current_send_ts
rtp_session_get_current_recv_ts
rtp_session_reset
rtp_session_uninit
rtp_session_destroy
rtp_add_csrc
rtp_session_send_dtmf
rtp_session_add_telephone_event
rtp_session_create_telephone_event_packet
rtp_session_set_source_description
rtp_session_set_symmetric_rtp
rtp_profile_new
rtp_profile_set_payload
rtp_profile_clone_full
rtp_profile_destroy
rtp_profile_get_payload_from_rtpmap
rtp_profile_get_payload_number_from_rtpmap
rtp_profile_get_payload_number_from_mime
payload_type_new
payload_type_set_send_fmtp
payload_type_append_send_fmtp
payload_type_clone
payload_type_destroy
fmtp_get_value
ortp_free
ortp_malloc
ortp_strdup
ortp_realloc
ortp_malloc0
freemsg
dupmsg
allocb
getq
putq
msgpullup
qinit
flushq
msgdsize
peekq
freeb
dupb
concatb
esballoc
WIN_thread_create
WIN_thread_join
WIN_cond_init
WIN_mutex_init
WIN_mutex_unlock
WIN_cond_wait
WIN_mutex_lock
WIN_cond_destroy
WIN_mutex_destroy
WIN_cond_signal
__ortp_log_mask
ortp_strdup_printf
ortp_strdup_vprintf
rtp_session_register_event_queue
rtp_session_unregister_event_queue
ortp_ev_queue_new
ortp_ev_queue_flush
ortp_ev_queue_get
ortp_ev_queue_destroy
ortp_event_get_type
ortp_event_get_data
ortp_event_destroy
stunParseHostName
stunParseServerName
sendMessage
stunEncodeMessage
stunBuildReqSimple
stunParseMessage
stunServerProcessMsg
stunNatType
stunTest
stunOpenSocket
stunOpenSocketPair
stunCalculateIntegrity_shortterm
stunCalculateIntegrity_longterm
stunCalculateFingerprint
getWinSocketError
close_socket
set_non_blocking_socket
ortp_strerror
gettimeofday
ortp_file_exist
rtp_session_set_dscp
rtp_session_compute_recv_bandwidth
rtp_session_compute_send_bandwidth
rtcp_next_packet
rtcp_is_SDES
rtcp_sdes_parse
rtcp_is_SR
rtcp_SR_get_ssrc
rtcp_SR_get_report_block
rtcp_SR_get_sender_info
rtcp_is_RR
rtcp_RR_get_ssrc
rtcp_RR_get_report_block
rtcp_is_BYE
rtcp_BYE_get_ssrc
rtcp_BYE_get_reason
rtcp_is_APP
rtcp_APP_get_subtype
rtcp_APP_get_ssrc
rtcp_APP_get_name
rtcp_APP_get_data
rtp_session_flush_sockets
rtp_session_resync
rtp_session_set_remote_addr_and_port
rtp_session_set_time_jump_limit
copymsg
rtp_session_enable_jitter_buffer
rtp_session_set_rtp_socket_recv_buffer_size
rtp_session_set_rtp_socket_send_buffer_size
rtp_session_set_jitter_buffer_params
rtp_get_payload
rtp_session_set_remote_addr_full
rtp_session_send_rtcp_APP
b64_decode
b64_encode
payload_type_set_recv_fmtp
rtp_session_get_local_port
rtp_session_get_jitter_buffer_params
copyb
turnAllocateSocketPair

View file

@ -1,3 +0,0 @@
EXTRA_DIST=oRTP.vcproj ortp.def oRTP.sln

View file

@ -1,46 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "oRTP", "oRTP.vcproj", "{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)
Debug|Windows Mobile 6 Professional SDK (ARMV4I) = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
Debug|Windows Mobile 6 Standard SDK (ARMV4I) = Debug|Windows Mobile 6 Standard SDK (ARMV4I)
Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)
Release|Windows Mobile 6 Professional SDK (ARMV4I) = Release|Windows Mobile 6 Professional SDK (ARMV4I)
Release|Windows Mobile 6 Standard SDK (ARMV4I) = Release|Windows Mobile 6 Standard SDK (ARMV4I)
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Standard SDK (ARMV4I)
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Standard SDK (ARMV4I)
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Standard SDK (ARMV4I)
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I)
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I)
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I)
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Release|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Standard SDK (ARMV4I)
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Release|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I)
{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}.Release|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I)
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View file

@ -1,916 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="oRTP"
ProjectGUID="{9FEA0683-C391-4C74-BCF6-2F9E4DE1B541}"
RootNamespace="oRTP"
Keyword="MFCDLLProj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
/>
<Platform
Name="Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
/>
<Platform
Name="Windows Mobile 6 Standard SDK (ARMV4I)"
/>
<Platform
Name="Windows Mobile 6 Professional SDK (ARMV4I)"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
OutputDirectory="$(PlatformName)\Debug"
IntermediateDirectory="$(PlatformName)\Debug"
ConfigurationType="2"
UseOfMFC="0"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="false"
/>
<Tool
Name="VCCLCompilerTool"
ExecutionBucket="7"
Optimization="2"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="..\..\include;..\..\..\osip\include"
PreprocessorDefinitions="ORTP_INET6;ORTP_EXPORT;AMD_HACK;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);POCKETPC2003_UI_MODEL;POCKETPC2003_UI_MODEL"
RuntimeLibrary="3"
TreatWChar_tAsBuiltInType="true"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(IntDir)/oRTP.pdb"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmtd.lib"
IgnoreAllDefaultLibraries="true"
ModuleDefinitionFile="oRTP.def"
GenerateDebugInformation="true"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCCodeSignTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
<DeploymentTool
ForceDirty="-1"
RemoteDirectory="%CSIDL_PROGRAM_FILES%\vbamsipua"
RegisterOutput="0"
AdditionalFiles=""
/>
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
OutputDirectory="$(PlatformName)\Debug"
IntermediateDirectory="$(PlatformName)\Debug"
ConfigurationType="2"
UseOfMFC="0"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="false"
/>
<Tool
Name="VCCLCompilerTool"
ExecutionBucket="7"
AdditionalIncludeDirectories="..\..\include;..\..\..\osip\include"
PreprocessorDefinitions="ORTP_INET6;ORTP_EXPORT;AMD_HACK;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);SMARTPHONE2003_UI_MODEL;SMARTPHONE2003_UI_MODEL"
RuntimeLibrary="3"
TreatWChar_tAsBuiltInType="true"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(IntDir)/oRTP.pdb"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmtd.lib"
IgnoreAllDefaultLibraries="true"
ModuleDefinitionFile="oRTP.def"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCCodeSignTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
<DeploymentTool
ForceDirty="-1"
RemoteDirectory="%CSIDL_PROGRAM_FILES%\vbamsipua"
RegisterOutput="0"
AdditionalFiles=""
/>
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Debug|Windows Mobile 6 Standard SDK (ARMV4I)"
OutputDirectory="Windows Mobile 6 Standard SDK (ARMV4I)\$(ConfigurationName)"
IntermediateDirectory="Windows Mobile 6 Standard SDK (ARMV4I)\$(ConfigurationName)"
ConfigurationType="2"
UseOfMFC="0"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
/>
<Tool
Name="VCCLCompilerTool"
ExecutionBucket="7"
Optimization="2"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="..\..\include;..\..\..\osip\include"
PreprocessorDefinitions="ORTP_INET6;ORTP_EXPORT;AMD_HACK;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_)"
RuntimeLibrary="3"
TreatWChar_tAsBuiltInType="true"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(IntDir)/oRTP.pdb"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmtd.lib"
IgnoreAllDefaultLibraries="true"
ModuleDefinitionFile="oRTP.def"
GenerateDebugInformation="true"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="0"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCCodeSignTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
<DeploymentTool
ForceDirty="-1"
RemoteDirectory="%CSIDL_PROGRAM_FILES%\amsipua"
RegisterOutput="0"
AdditionalFiles=""
/>
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)"
OutputDirectory="Windows Mobile 6 Professional SDK (ARMV4I)\$(ConfigurationName)"
IntermediateDirectory="Windows Mobile 6 Professional SDK (ARMV4I)\$(ConfigurationName)"
ConfigurationType="2"
UseOfMFC="0"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
/>
<Tool
Name="VCCLCompilerTool"
ExecutionBucket="7"
Optimization="2"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="..\..\include;..\..\..\osip\include"
PreprocessorDefinitions="ORTP_INET6;ORTP_EXPORT;AMD_HACK;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);POCKETPC2003_UI_MODEL"
RuntimeLibrary="3"
TreatWChar_tAsBuiltInType="true"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(IntDir)/oRTP.pdb"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmtd.lib"
IgnoreAllDefaultLibraries="true"
ModuleDefinitionFile="oRTP.def"
GenerateDebugInformation="true"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="0"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCCodeSignTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
<DeploymentTool
ForceDirty="-1"
RemoteDirectory="%CSIDL_PROGRAM_FILES%\linphone"
RegisterOutput="0"
AdditionalFiles=""
/>
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
OutputDirectory="$(PlatformName)\Release"
IntermediateDirectory="$(PlatformName)\Release"
ConfigurationType="2"
UseOfMFC="0"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="false"
/>
<Tool
Name="VCCLCompilerTool"
ExecutionBucket="7"
AdditionalIncludeDirectories="..\..\include;..\..\..\osip\include"
PreprocessorDefinitions="ORTP_INET6;ORTP_EXPORT;AMD_HACK;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);POCKETPC2003_UI_MODEL;POCKETPC2003_UI_MODEL"
RuntimeLibrary="2"
TreatWChar_tAsBuiltInType="true"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(IntDir)/oRTP.pdb"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmt.lib"
IgnoreAllDefaultLibraries="true"
ModuleDefinitionFile="oRTP.def"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCCodeSignTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
<DeploymentTool
ForceDirty="-1"
RemoteDirectory="\amsip"
RegisterOutput="0"
AdditionalFiles=""
/>
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
OutputDirectory="$(PlatformName)\Release"
IntermediateDirectory="$(PlatformName)\Release"
ConfigurationType="2"
UseOfMFC="0"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="false"
/>
<Tool
Name="VCCLCompilerTool"
ExecutionBucket="7"
AdditionalIncludeDirectories="..\..\include;..\..\..\osip\include"
PreprocessorDefinitions="ORTP_INET6;ORTP_EXPORT;AMD_HACK;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);SMARTPHONE2003_UI_MODEL;SMARTPHONE2003_UI_MODEL"
RuntimeLibrary="2"
TreatWChar_tAsBuiltInType="true"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(IntDir)/oRTP.pdb"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmt.lib"
IgnoreAllDefaultLibraries="true"
ModuleDefinitionFile="oRTP.def"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCCodeSignTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
<DeploymentTool
ForceDirty="-1"
RemoteDirectory="%CSIDL_PROGRAM_FILES%\vbamsipua"
RegisterOutput="0"
AdditionalFiles=""
/>
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)"
OutputDirectory="Windows Mobile 6 Standard SDK (ARMV4I)\$(ConfigurationName)"
IntermediateDirectory="Windows Mobile 6 Standard SDK (ARMV4I)\$(ConfigurationName)"
ConfigurationType="2"
UseOfMFC="0"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
/>
<Tool
Name="VCCLCompilerTool"
ExecutionBucket="7"
AdditionalIncludeDirectories="..\..\include;..\..\..\osip\include"
PreprocessorDefinitions="ORTP_INET6;ORTP_EXPORT;AMD_HACK;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_)"
RuntimeLibrary="2"
TreatWChar_tAsBuiltInType="true"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(IntDir)/oRTP.pdb"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmt.lib"
IgnoreAllDefaultLibraries="true"
ModuleDefinitionFile="oRTP.def"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="0"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCCodeSignTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
<DeploymentTool
ForceDirty="-1"
RemoteDirectory="%CSIDL_PROGRAM_FILES%\amsipua"
RegisterOutput="0"
AdditionalFiles=""
/>
<DebuggerTool
/>
</Configuration>
<Configuration
Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)"
OutputDirectory="Windows Mobile 6 Professional SDK (ARMV4I)\$(ConfigurationName)"
IntermediateDirectory="Windows Mobile 6 Professional SDK (ARMV4I)\$(ConfigurationName)"
ConfigurationType="2"
UseOfMFC="0"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
/>
<Tool
Name="VCCLCompilerTool"
ExecutionBucket="7"
AdditionalIncludeDirectories="..\..\include;..\..\..\osip\include"
PreprocessorDefinitions="ORTP_INET6;ORTP_EXPORT;AMD_HACK;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);POCKETPC2003_UI_MODEL;POCKETPC2003_UI_MODEL"
RuntimeLibrary="2"
TreatWChar_tAsBuiltInType="true"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(IntDir)/oRTP.pdb"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmt.lib"
IgnoreAllDefaultLibraries="true"
ModuleDefinitionFile="oRTP.def"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="0"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCCodeSignTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
<DeploymentTool
ForceDirty="-1"
RemoteDirectory=""
RegisterOutput="0"
AdditionalFiles=""
/>
<DebuggerTool
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\src\avprofile.c"
>
</File>
<File
RelativePath="..\..\src\b64.c"
>
</File>
<File
RelativePath="..\..\src\event.c"
>
</File>
<File
RelativePath="..\..\src\jitterctl.c"
>
</File>
<File
RelativePath="..\..\src\ortp.c"
>
</File>
<File
RelativePath="..\..\src\payloadtype.c"
>
</File>
<File
RelativePath="..\..\src\port.c"
>
</File>
<File
RelativePath="..\..\src\posixtimer.c"
>
</File>
<File
RelativePath="..\..\src\rtcp.c"
>
</File>
<File
RelativePath="..\..\src\rtcpparse.c"
>
</File>
<File
RelativePath="..\..\src\rtpparse.c"
>
</File>
<File
RelativePath="..\..\src\rtpsession.c"
>
</File>
<File
RelativePath="..\..\src\rtpsession_inet.c"
>
</File>
<File
RelativePath="..\..\src\rtpsignaltable.c"
>
</File>
<File
RelativePath="..\..\src\rtptimer.c"
>
</File>
<File
RelativePath="..\..\src\scheduler.c"
>
</File>
<File
RelativePath="..\..\src\sessionset.c"
>
</File>
<File
RelativePath="..\..\src\str_utils.c"
>
</File>
<File
RelativePath="..\..\src\stun.c"
>
</File>
<File
RelativePath="..\..\src\stun_udp.c"
>
</File>
<File
RelativePath="..\..\src\telephonyevents.c"
>
</File>
<File
RelativePath="..\..\src\utils.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\include\ortp\b64.h"
>
</File>
<File
RelativePath="..\..\include\ortp\event.h"
>
</File>
<File
RelativePath="..\..\src\jitterctl.h"
>
</File>
<File
RelativePath="..\..\src\ortp-config-win32.h"
>
</File>
<File
RelativePath="..\..\include\ortp\ortp.h"
>
</File>
<File
RelativePath="..\..\include\ortp\payloadtype.h"
>
</File>
<File
RelativePath="..\..\include\ortp\port.h"
>
</File>
<File
RelativePath="..\..\include\ortp\rtcp.h"
>
</File>
<File
RelativePath="..\..\include\ortp\rtp.h"
>
</File>
<File
RelativePath="..\..\include\ortp\rtpsession.h"
>
</File>
<File
RelativePath="..\..\src\rtpsession_priv.h"
>
</File>
<File
RelativePath="..\..\include\ortp\rtpsignaltable.h"
>
</File>
<File
RelativePath="..\..\src\rtptimer.h"
>
</File>
<File
RelativePath="..\..\src\scheduler.h"
>
</File>
<File
RelativePath="..\..\include\ortp\sessionset.h"
>
</File>
<File
RelativePath="..\..\include\ortp\str_utils.h"
>
</File>
<File
RelativePath="..\..\include\ortp\stun.h"
>
</File>
<File
RelativePath="..\..\include\ortp\stun_udp.h"
>
</File>
<File
RelativePath="..\..\include\ortp\telephonyevents.h"
>
</File>
<File
RelativePath="..\..\src\utils.h"
>
</File>
</Filter>
<File
RelativePath=".\ortp.def"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View file

@ -1,207 +0,0 @@
LIBRARY ortp
EXPORTS
ortp_init
ortp_scheduler_init
ortp_exit
ortp_get_scheduler
ortp_set_log_file
ortp_set_log_level_mask
ortp_logv_out
ortp_set_log_handler
ortp_strdup_printf
ortp_logv
ortp_get_global_stats
ortp_global_stats_display
session_set_new
session_set_select
session_set_destroy
rtp_stats_display
rtp_session_get_stats
rtp_session_init
rtp_session_new
rtp_session_set_scheduling_mode
rtp_session_set_blocking_mode
rtp_session_set_profile
rtp_session_get_profile
rtp_session_set_data
rtp_session_signal_connect
rtp_session_signal_disconnect_by_callback
rtp_session_set_ssrc
rtp_session_set_seq_number
rtp_session_get_seq_number
rtp_session_set_jitter_compensation
rtp_session_set_local_addr
rtp_session_set_remote_addr
rtp_session_enable_adaptive_jitter_compensation
rtp_session_set_recv_buf_size
rtp_session_send_with_ts
rtp_session_sendm_with_ts
rtp_session_set_sockets
rtp_session_get_rtp_socket
rtp_session_get_rtcp_socket
rtp_session_set_payload_type
rtp_session_set_send_payload_type
rtp_session_get_send_payload_type
rtp_session_set_recv_payload_type
rtp_session_get_recv_payload_type
rtp_session_recv_with_ts
rtp_session_recvm_with_ts
rtp_session_create_packet
rtp_session_get_current_send_ts
rtp_session_get_current_recv_ts
rtp_session_reset
rtp_session_uninit
rtp_session_destroy
rtp_add_csrc
rtp_session_send_dtmf
rtp_session_set_source_description
rtp_session_set_symmetric_rtp
rtp_profile_new
rtp_profile_set_payload
rtp_profile_clone_full
rtp_profile_destroy
rtp_profile_get_payload_from_rtpmap
rtp_profile_get_payload_number_from_rtpmap
rtp_profile_get_payload_number_from_mime
payload_type_new
payload_type_set_send_fmtp
payload_type_append_send_fmtp
payload_type_clone
payload_type_destroy
fmtp_get_value
ortp_free
ortp_malloc
ortp_strdup
ortp_realloc
ortp_malloc0
freemsg
dupmsg
allocb
getq
putq
msgpullup
qinit
flushq
msgdsize
peekq
freeb
dupb
concatb
esballoc
WIN_thread_create
WIN_thread_join
WIN_cond_init
WIN_mutex_init
WIN_mutex_unlock
WIN_cond_wait
WIN_mutex_lock
WIN_cond_destroy
WIN_mutex_destroy
WIN_cond_signal
__ortp_log_mask
ortp_strdup_printf
ortp_strdup_vprintf
rtp_session_register_event_queue
rtp_session_unregister_event_queue
ortp_ev_queue_new
ortp_ev_queue_flush
ortp_ev_queue_get
ortp_ev_queue_destroy
ortp_event_get_type
ortp_event_get_data
ortp_event_destroy
stunParseHostName
stunParseServerName
sendMessage
stunEncodeMessage
stunBuildReqSimple
stunParseMessage
stunServerProcessMsg
stunNatType
stunTest
stunOpenSocket
stunOpenSocketPair
stunCalculateIntegrity_shortterm
stunCalculateIntegrity_longterm
stunCalculateFingerprint
getWinSocketError
close_socket
set_non_blocking_socket
ortp_strerror
gettimeofday
ortp_file_exist
rtp_session_set_dscp
rtp_session_compute_recv_bandwidth
rtp_session_compute_send_bandwidth
rtcp_next_packet
rtcp_is_SDES
rtcp_sdes_parse
rtcp_is_SR
rtcp_SR_get_ssrc
rtcp_SR_get_report_block
rtcp_SR_get_sender_info
rtcp_is_RR
rtcp_RR_get_ssrc
rtcp_RR_get_report_block
rtcp_is_BYE
rtcp_BYE_get_ssrc
rtcp_BYE_get_reason
rtcp_is_APP
rtcp_APP_get_subtype
rtcp_APP_get_ssrc
rtcp_APP_get_name
rtcp_APP_get_data
rtp_session_flush_sockets
rtp_session_resync
rtp_session_set_remote_addr_and_port
rtp_session_set_time_jump_limit
copymsg
rtp_session_enable_jitter_buffer
rtp_session_set_rtp_socket_recv_buffer_size
rtp_session_set_rtp_socket_send_buffer_size
rtp_session_set_jitter_buffer_params
rtp_get_payload
rtp_session_set_remote_addr_full
rtp_session_send_rtcp_APP
b64_decode
b64_encode
payload_type_set_recv_fmtp
rtp_session_get_local_port
rtp_session_get_jitter_buffer_params
copyb
turnAllocateSocketPair

View file

@ -1,389 +0,0 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT([ortp],[0.16.1])
AC_CANONICAL_SYSTEM
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=8 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_VERSION)
AC_SUBST(ORTP_VERSION)
AC_SUBST(ORTP_PKGCONFIG_VERSION)
PACKAGE=ortp
AM_INIT_AUTOMAKE([tar-ustar])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
AC_CONFIG_HEADERS(ortp-config.h)
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])
AC_SUBST([mkdir_p])
AC_MSG_CHECKING([warning make an error on compilation])
AC_ARG_ENABLE(strict,
[ --enable-strict Enable error on compilation warning [default=yes]],
[wall_werror=$enableval],
[wall_werror=yes]
)
AC_ARG_ENABLE(perf,
[ --enable-perf Disable costly features to reduce cpu consumtion [default=no]],
[perf=$enableval],
[perf=no]
)
ORTP_DEFS=
dnl enable ipv6 support
AC_ARG_ENABLE(ipv6,
[ --enable-ipv6 Turn on ipv6 support],
[case "${enableval}" in
yes) ipv6=true;;
no) ipv6=false;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-ipv6) ;;
esac],[ipv6=true])
if test x$ipv6 = xtrue ; then
ORTP_DEFS="$ORTP_DEFS -DORTP_INET6"
fi
AC_ARG_ENABLE(mode64bit,
[ --enable-mode64bit=[yes/no] 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,
[ --enable-debug=[yes/no] enables 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"
build_tests=no
mingw_found=yes
;;
*mingw*)
CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0501 -DORTP_STATIC"
LIBS="$LIBS -lws2_32 -liphlpapi -lwinmm"
build_tests=no
;;
esac
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])
dnl Checks for programs.
AC_PROG_CC
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AC_ENABLE_SHARED(yes)
AC_ENABLE_STATIC(no)
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 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 operating system decide)])
dnl check for libsrtp support (secure rtp)
AC_ARG_WITH( srtp,
[ --with-srtp Set prefix where libsrtp can be found (ex:/usr or /usr/local)[default=/usr] ],
[ srtp_prefix=${withval}],[ srtp_prefix=/usr ])
if test "${srtp_prefix}" != "/usr" ; then
SRTP_CFLAGS="-I${srtp_prefix}/include"
SRTP_LIBS="-L${srtp_prefix}/lib"
fi
SRTP_LIBS="$SRTP_LIBS -lsrtp"
dnl check srtp headers
have_srtp=no
CPPFLAGS_save=$CPPFLAGS
CPPFLAGS=$SRTP_CFLAGS
AC_CHECK_HEADER([srtp/srtp.h],have_srtp_headers=yes)
CPPFLAGS=$CPPFLAGS_save
dnl check for srtp lib
LDFLAGS_save=$LDFLAGS
LDFLAGS=$SRTP_LIBS
LIBS_save=$LIBS
AC_CHECK_LIB(srtp,srtp_init,have_srtp_lib=yes)
LDFLAGS=$LDFLAGS_save
LIBS=$LIBS_save
if test "$have_srtp_headers$have_srtp_lib" = "yesyes" ; then
have_srtp=yes
AC_DEFINE(HAVE_SRTP, 1, [Defined when srtp support is compiled])
else
AC_MSG_NOTICE([Could not find libsrtp headers or lib, cryto transport disabled.])
SRTP_CFLAGS=
SRTP_LIBS=
fi
AC_SUBST(SRTP_CFLAGS)
AC_SUBST(SRTP_LIBS)
if test $debug_enabled = "yes"; then
ORTP_DEFS="$ORTP_DEFS -DORTP_DEBUG_MODE -g"
CFLAGS=`echo $CFLAGS | sed 's/-O.//'`
fi
AC_ARG_ENABLE(memcheck,
[ --enable-memcheck=[yes/no] enables 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
AC_ARG_ENABLE(so-reuseaddr,
[ --enable-so-reuseaddr=[yes/no] enables SO_REUSEADDR socket option in the rtp_session_set_local_addr() function.],
[case "${enableval}" in
yes) so_reuseaddr_enabled=yes;;
no) so_reuseaddr_enabled=no;;
*) AC_MSG_ERROR("Bad value for --enable-so-reuseaddr");;
esac],
[so_reuseaddr_enabled=yes])
if test "$so_reuseaddr_enabled" = "yes" ; then
AC_DEFINE(SO_REUSE_ADDR,1,[Defined when SO_REUSEADDR socket option in the rtp_session_set_local_addr() function is enabled])
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)
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
if test $GCC = yes && test $wall_werror = yes; then
CFLAGS="$CFLAGS -Werror "
fi
AC_ARG_ENABLE(ssl-hmac,
[ --enable-ssl-hmac=[yes/no] enables use of ssl/hmac for stun],
[case "${enableval}" in
yes) ssl_hmac_enabled=yes;;
no) ssl_hmac_enabled=no;;
*) AC_MSG_ERROR("Bad value for --enable-ssl-hmac");;
esac],
[ssl_hmac_enabled=yes])
if test "$ssl_hmac_enabled" = "yes" ; then
AC_CHECK_HEADERS(openssl/hmac.h openssl/md5.h)
AC_CHECK_LIB(ssl,SSL_CTX_new,[SSL_LIBS="-lssl"])
AC_CHECK_LIB(crypto,MD5,[SSL_LIBS="$SSL_LIBS -lcrypto"])
fi
AC_SUBST(SSL_LIBS)
ORTPDEPS_LIBS="$ORTPDEPS_LIBS $PTHREAD_LIBS $PTHREAD_LDFLAGS $SRTP_LIBS $SSL_LIBS"
ORTPDEPS_CFLAGS="$ORTPDEPS_CFLAGS $PTHREAD_CFLAGS $ORTP_DEFS $SRTP_CFLAGS"
CFLAGS="$CFLAGS $ORTP_DEFS"
echo "$ORTPDEPS_CFLAGS" > ortp.defs
dnl ##################################################
dnl # Check for doxygen
dnl ##################################################
AC_PATH_PROG(DOXYGEN,doxygen,false)
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)
AM_CONDITIONAL(BUILD_TESTS,test x$build_tests != xno)
# 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="An LGPL implementation of RTP - RFC3550"
AC_SUBST(SUMMARY)
PACKAGER=anonymous
AC_SUBST(PACKAGER)
LICENSE=LGPL
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
src/Makefile
src/tests/Makefile
src/tests/win_receiver/Makefile
src/tests/win_sender/Makefile
build/Makefile
build/win32native/Makefile
build/wince/Makefile
build/winmob/Makefile
ortp.pc
ortp.spec
ortp.doxygen
)
AC_MSG_WARN([ortp-0.15.0 breaks compatibility with older releases, because value returned by rtp_session_recvm_with_ts() has
changed. See the API documentation in doc/ for further readings.])

View file

@ -1,2 +0,0 @@
Makefile
Makefile.in

View file

@ -1,2 +0,0 @@
Makefile
Makefile.in

View file

@ -1 +0,0 @@
SUBDIRS=ortp

View file

@ -1,2 +0,0 @@
Makefile
Makefile.in

View file

@ -1,11 +0,0 @@
ortp_includedir=$(includedir)/ortp
ortp_include_HEADERS=str_utils.h rtpsession.h rtp.h port.h \
ortp.h telephonyevents.h sessionset.h payloadtype.h rtpsignaltable.h \
rtcp.h \
event.h stun.h stun_udp.h srtp.h \
b64.h
EXTRA_DIST=$(ortp_include_HEADERS)

View file

@ -1,420 +0,0 @@
/* /////////////////////////////////////////////////////////////////////////////
* 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 b64/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 <stddef.h>
/* /////////////////////////////////////////////////////////////////////////////
* 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
* <hr>
* \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()
*/
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
* <b>not</b> 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()
*/
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
* <b>not</b> 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 */
/* ////////////////////////////////////////////////////////////////////////// */

View file

@ -1,85 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; 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>
typedef mblk_t OrtpEvent;
typedef unsigned long OrtpEventType;
typedef struct RtpEndpoint{
#ifdef ORTP_INET6
struct sockaddr_storage addr;
#else
struct sockaddr addr;
#endif
socklen_t addrlen;
}RtpEndpoint;
struct _OrtpEventData{
mblk_t *packet; /* most events are associated to a received packet */
RtpEndpoint *ep;
union {
int telephone_event;
int payload_type;
} info;
};
typedef struct _OrtpEventData OrtpEventData;
#ifdef __cplusplus
extern "C"{
#endif
RtpEndpoint *rtp_endpoint_new(struct sockaddr *addr, socklen_t addrlen);
RtpEndpoint *rtp_endpoint_dup(const RtpEndpoint *ep);
OrtpEvent * ortp_event_new(OrtpEventType tp);
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
OrtpEventData * ortp_event_get_data(OrtpEvent *ev);
void ortp_event_destroy(OrtpEvent *ev);
OrtpEvent *ortp_event_dup(OrtpEvent *ev);
typedef struct OrtpEvQueue{
queue_t q;
ortp_mutex_t mutex;
} OrtpEvQueue;
OrtpEvQueue * ortp_ev_queue_new(void);
void ortp_ev_queue_destroy(OrtpEvQueue *q);
OrtpEvent * ortp_ev_queue_get(OrtpEvQueue *q);
void ortp_ev_queue_flush(OrtpEvQueue * qp);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,199 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; 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/rtpsession.h>
#include <ortp/sessionset.h>
#ifdef __cplusplus
extern "C"
{
#endif
bool_t ortp_min_version_required(int major, int minor, int micro);
void ortp_init(void);
void ortp_scheduler_init(void);
void ortp_exit(void);
/***************/
/* logging api */
/***************/
typedef enum {
ORTP_DEBUG=1,
ORTP_MESSAGE=1<<1,
ORTP_WARNING=1<<2,
ORTP_ERROR=1<<3,
ORTP_FATAL=1<<4,
ORTP_LOGLEV_END=1<<5
} OrtpLogLevel;
typedef void (*OrtpLogFunc)(OrtpLogLevel lev, const char *fmt, va_list args);
void ortp_set_log_file(FILE *file);
void ortp_set_log_handler(OrtpLogFunc func);
VAR_DECLSPEC OrtpLogFunc ortp_logv_out;
extern unsigned int __ortp_log_mask;
#define ortp_log_level_enabled(level) (__ortp_log_mask & (level))
#if !defined(WIN32) && !defined(_WIN32_WCE)
#define ortp_logv(level,fmt,args) \
{\
if (ortp_logv_out!=NULL && ortp_log_level_enabled(level)) \
ortp_logv_out(level,fmt,args);\
if ((level)==ORTP_FATAL) abort();\
}while(0)
#else
void ortp_logv(int level, const char *fmt, va_list args);
#endif
void ortp_set_log_level_mask(int levelmask);
#ifdef ORTP_DEBUG_MODE
static inline void ortp_debug(const char *fmt,...)
{
va_list args;
va_start (args, fmt);
ortp_logv(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 inline void ortp_log(OrtpLogLevel lev, const char *fmt,...){
va_list args;
va_start (args, fmt);
ortp_logv(lev, fmt, args);
va_end (args);
}
static inline void ortp_message(const char *fmt,...)
{
va_list args;
va_start (args, fmt);
ortp_logv(ORTP_MESSAGE, fmt, args);
va_end (args);
}
static inline void ortp_warning(const char *fmt,...)
{
va_list args;
va_start (args, fmt);
ortp_logv(ORTP_WARNING, fmt, args);
va_end (args);
}
#endif
static inline void ortp_error(const char *fmt,...)
{
va_list args;
va_start (args, fmt);
ortp_logv(ORTP_ERROR, fmt, args);
va_end (args);
}
static inline void ortp_fatal(const char *fmt,...)
{
va_list args;
va_start (args, fmt);
ortp_logv(ORTP_FATAL, fmt, args);
va_end (args);
}
/****************/
/*statistics api*/
/****************/
extern rtp_stats_t ortp_global_stats;
void ortp_global_stats_reset(void);
rtp_stats_t *ortp_get_global_stats(void);
void ortp_global_stats_display(void);
void rtp_stats_display(const rtp_stats_t *stats, const char *header);
void rtp_stats_reset(rtp_stats_t *stats);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,212 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
* \file payloadtype.h
* \brief Using and creating standart and custom RTP profiles
*
**/
#ifndef PAYLOADTYPE_H
#define PAYLOADTYPE_H
#include <ortp/port.h>
#ifdef __cplusplus
extern "C"{
#endif
/* flags for PayloadType::flags */
#define PAYLOAD_TYPE_ALLOCATED (1)
/* private flags for future use by ortp */
#define PAYLOAD_TYPE_PRIV1 (1<<1)
#define PAYLOAD_TYPE_PRIV2 (1<<2)
#define PAYLOAD_TYPE_PRIV3 (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)
/* ask for more if you need*/
#define PAYLOAD_AUDIO_CONTINUOUS 0
#define PAYLOAD_AUDIO_PACKETIZED 1
#define PAYLOAD_VIDEO 2
#define PAYLOAD_OTHER 3 /* ?? */
struct _PayloadType
{
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; /**<actually the submime, ex: pcm, pcma, gsm*/
int channels; /**< number of channels of audio */
char *recv_fmtp; /* various format parameters for the incoming stream */
char *send_fmtp; /* various format parameters for the outgoing stream */
int flags;
void *user_data;
};
#ifndef PayloadType_defined
#define PayloadType_defined
typedef struct _PayloadType PayloadType;
#endif
#define payload_type_set_flag(pt,flag) (pt)->flags|=((int)flag)
#define payload_type_unset_flag(pt,flag) (pt)->flags&=(~(int)flag)
#define payload_type_get_flags(pt) (pt)->flags
#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;
PayloadType *payload_type_new(void);
PayloadType *payload_type_clone(PayloadType *payload);
char *payload_type_get_rtpmap(PayloadType *pt);
void payload_type_destroy(PayloadType *pt);
void payload_type_set_recv_fmtp(PayloadType *pt, const char *fmtp);
void payload_type_set_send_fmtp(PayloadType *pt, const char *fmtp);
void payload_type_append_recv_fmtp(PayloadType *pt, const char *fmtp);
void payload_type_append_send_fmtp(PayloadType *pt, const char *fmtp);
bool_t fmtp_get_value(const char *fmtp, const char *param_name, char *result, size_t result_len);
VAR_DECLSPEC RtpProfile av_profile;
#define payload_type_set_user_data(pt,p) (pt)->user_data=(p)
#define payload_type_get_user_data(pt) ((pt)->user_data)
#define rtp_profile_get_name(profile) (const char*)((profile)->name)
void rtp_profile_set_payload(RtpProfile *prof, int idx, PayloadType *pt);
/**
* Set payload type number @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 @index in the profile.
*
*@param profile an RTP profile (a #RtpProfile object)
*@param index the payload type number
*@return the payload description (a PayloadType object)
**/
static inline PayloadType * rtp_profile_get_payload(RtpProfile *prof, int idx){
if (idx<0 || idx>=RTP_PROFILE_MAX_PAYLOADS) {
return NULL;
}
return prof->payload[idx];
}
void rtp_profile_clear_all(RtpProfile *prof);
void rtp_profile_set_name(RtpProfile *prof, const char *name);
PayloadType * rtp_profile_get_payload_from_mime(RtpProfile *profile,const char *mime);
PayloadType * rtp_profile_get_payload_from_rtpmap(RtpProfile *profile, const char *rtpmap);
int rtp_profile_get_payload_number_from_mime(RtpProfile *profile,const char *mime);
int rtp_profile_get_payload_number_from_rtpmap(RtpProfile *profile, const char *rtpmap);
int rtp_profile_find_payload_number(RtpProfile *prof,const char *mime,int rate, int channels);
PayloadType * rtp_profile_find_payload(RtpProfile *prof,const char *mime,int rate, int channels);
int rtp_profile_move_payload(RtpProfile *prof,int oldpos,int newpos);
RtpProfile * rtp_profile_new(const char *name);
/* clone a profile, payload are not cloned */
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) */
RtpProfile * rtp_profile_clone_full(RtpProfile *prof);
/* frees the profile and all its PayloadTypes*/
void rtp_profile_destroy(RtpProfile *prof);
/* some payload types */
/* audio */
VAR_DECLSPEC PayloadType payload_type_pcmu8000;
VAR_DECLSPEC PayloadType payload_type_pcma8000;
VAR_DECLSPEC PayloadType payload_type_pcm8000;
VAR_DECLSPEC PayloadType payload_type_l16_mono;
VAR_DECLSPEC PayloadType payload_type_l16_stereo;
VAR_DECLSPEC PayloadType payload_type_lpc1016;
VAR_DECLSPEC PayloadType payload_type_g729;
VAR_DECLSPEC PayloadType payload_type_g7231;
VAR_DECLSPEC PayloadType payload_type_g7221;
VAR_DECLSPEC PayloadType payload_type_g726_40;
VAR_DECLSPEC PayloadType payload_type_g726_32;
VAR_DECLSPEC PayloadType payload_type_g726_24;
VAR_DECLSPEC PayloadType payload_type_g726_16;
VAR_DECLSPEC PayloadType payload_type_gsm;
VAR_DECLSPEC PayloadType payload_type_lpc;
VAR_DECLSPEC PayloadType payload_type_lpc1015;
VAR_DECLSPEC PayloadType payload_type_speex_nb;
VAR_DECLSPEC PayloadType payload_type_speex_wb;
VAR_DECLSPEC PayloadType payload_type_speex_uwb;
VAR_DECLSPEC PayloadType payload_type_ilbc;
VAR_DECLSPEC PayloadType payload_type_amr;
VAR_DECLSPEC PayloadType payload_type_amrwb;
VAR_DECLSPEC PayloadType payload_type_truespeech;
VAR_DECLSPEC PayloadType payload_type_evrc0;
VAR_DECLSPEC PayloadType payload_type_evrcb0;
/* video */
VAR_DECLSPEC PayloadType payload_type_mpv;
VAR_DECLSPEC PayloadType payload_type_h261;
VAR_DECLSPEC PayloadType payload_type_h263;
VAR_DECLSPEC PayloadType payload_type_h263_1998;
VAR_DECLSPEC PayloadType payload_type_h263_2000;
VAR_DECLSPEC PayloadType payload_type_mp4v;
VAR_DECLSPEC PayloadType payload_type_theora;
VAR_DECLSPEC PayloadType payload_type_h264;
VAR_DECLSPEC PayloadType payload_type_x_snow;
VAR_DECLSPEC PayloadType payload_type_jpeg;
VAR_DECLSPEC PayloadType payload_type_t140;
/* non standard file transfer over UDP */
VAR_DECLSPEC PayloadType payload_type_x_udpftp;
/* telephone-event */
VAR_DECLSPEC PayloadType payload_type_telephone_event;
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,320 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; 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 !defined(WIN32) && !defined(_WIN32_WCE)
/********************************/
/* definitions for UNIX flavour */
/********************************/
#include <errno.h>
#include <sys/types.h>
#include <pthread.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#ifdef __linux
#include <stdint.h>
#endif
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#if defined(_XOPEN_SOURCE_EXTENDED) || !defined(__hpux)
#include <arpa/inet.h>
#endif
#include <sys/time.h>
#ifdef ORTP_INET6
#include <netdb.h>
#endif
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
#ifdef __cplusplus
extern "C"
{
#endif
int __ortp_thread_join(ortp_thread_t thread, void **ptr);
int __ortp_thread_create(pthread_t *thread, pthread_attr_t *attr, void * (*routine)(void*), void *arg);
#ifdef __cplusplus
}
#endif
#define ortp_thread_create __ortp_thread_create
#define ortp_thread_join __ortp_thread_join
#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_log10f(x) log10f(x)
#else
/*********************************/
/* definitions for WIN32 flavour */
/*********************************/
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#ifdef _MSC_VER
#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 <stdint.h> /*provided by mingw32*/
#endif
#define vsnprintf _vsnprintf
#define srandom srand
#define random rand
typedef SOCKET ortp_socket_t;
typedef HANDLE ortp_cond_t;
typedef HANDLE ortp_mutex_t;
typedef HANDLE ortp_thread_t;
#define ortp_thread_create WIN_thread_create
#define ortp_thread_join WIN_thread_join
#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
int WIN_mutex_init(ortp_mutex_t *m, void *attr_unused);
int WIN_mutex_lock(ortp_mutex_t *mutex);
int WIN_mutex_unlock(ortp_mutex_t *mutex);
int WIN_mutex_destroy(ortp_mutex_t *mutex);
int WIN_thread_create(ortp_thread_t *t, void *attr_unused, void *(*func)(void*), void *arg);
int WIN_thread_join(ortp_thread_t thread, void **unused);
int WIN_cond_init(ortp_cond_t *cond, void *attr_unused);
int WIN_cond_wait(ortp_cond_t * cond, ortp_mutex_t * mutex);
int WIN_cond_signal(ortp_cond_t * cond);
int WIN_cond_broadcast(ortp_cond_t * cond);
int WIN_cond_destroy(ortp_cond_t * cond);
#ifdef __cplusplus
}
#endif
#define SOCKET_OPTION_VALUE char *
#define 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
const char *getWinSocketError(int error);
#define getSocketErrorCode() WSAGetLastError()
#define getSocketError() getWinSocketError(WSAGetLastError())
#define snprintf _snprintf
#define strcasecmp _stricmp
#if 0
struct timeval {
long tv_sec; /* seconds */
long tv_usec; /* and microseconds */
};
#endif
int gettimeofday (struct timeval *tv, void* tz);
#ifdef _WORKAROUND_MINGW32_BUGS
char * WSAAPI gai_strerror(int errnum);
#endif
#endif
typedef unsigned char bool_t;
#undef TRUE
#undef FALSE
#define TRUE 1
#define FALSE 0
#ifdef __cplusplus
extern "C"{
#endif
void* ortp_malloc(size_t sz);
void ortp_free(void *ptr);
void* ortp_realloc(void *ptr, size_t sz);
void* ortp_malloc0(size_t sz);
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) ortp_malloc(sizeof(type)*(count))
#define ortp_new0(type,count) ortp_malloc0(sizeof(type)*(count))
int close_socket(ortp_socket_t sock);
int set_non_blocking_socket(ortp_socket_t sock);
char *ortp_strndup(const char *str,int n);
char *ortp_strdup_printf(const char *fmt,...);
char *ortp_strdup_vprintf(const char *fmt, va_list ap);
int ortp_file_exist(const char *pathname);
/* portable named pipes */
#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_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_pipe_t ortp_server_pipe_accept_client(ortp_pipe_t server);
int ortp_server_pipe_close(ortp_pipe_t spipe);
int ortp_server_pipe_close_client(ortp_pipe_t client);
ortp_pipe_t ortp_client_pipe_connect(const char *name);
int ortp_client_pipe_close(ortp_pipe_t sock);
int ortp_pipe_read(ortp_pipe_t p, uint8_t *buf, int len);
int ortp_pipe_write(ortp_pipe_t p, const uint8_t *buf, int len);
#endif
#ifdef __cplusplus
}
#endif
#if (defined(WIN32) || defined(_WIN32_WCE)) && !defined(ORTP_STATIC)
#ifdef ORTP_EXPORTS
#define VAR_DECLSPEC __declspec(dllexport)
#else
#define VAR_DECLSPEC __declspec(dllimport)
#endif
#else
#define VAR_DECLSPEC extern
#endif
#endif

View file

@ -1,252 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; 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 <ortp/port.h>
#define RTCP_MAX_RECV_BUFSIZE 1024
#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_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)
/* 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;
uint64_t sender_info_get_ntp_timestamp(const sender_info_t *si);
#define sender_info_get_rtp_timestamp(si) ((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;
#define report_block_get_ssrc(rb) \
ntohl((rb)->ssrc)
#define report_block_get_fraction_lost(rb) \
(((uint32_t)ntohl((rb)->fl_cnpl))>>24)
#define report_block_get_cum_packet_loss(rb) \
(((uint32_t)ntohl((rb)->fl_cnpl)) & 0xFFFFFF)
#define report_block_get_high_ext_seq(rb) \
ntohl(((report_block_t*)(rb))->ext_high_seq_num_rec)
#define report_block_get_interarrival_jitter(rb) \
ntohl(((report_block_t*)(rb))->interarrival_jitter)
#define report_block_get_last_SR_time(rb) \
ntohl(((report_block_t*)(rb))->lsr)
#define report_block_get_last_SR_delay(rb) \
ntohl(((report_block_t*)(rb))->delay_snc_last_sr)
#define report_block_set_fraction_lost(rb,fl)\
((rb)->fl_cnpl)=htonl( (ntohl((rb)->fl_cnpl) & 0xFFFFFF) | (((fl) & 0xFF)<<24))
#define report_block_set_cum_packet_lost(rb,cpl)\
((rb)->fl_cnpl)=htonl( (ntohl((rb)->fl_cnpl) & 0xFF000000) | (((cpl) & 0xFFFFFF)))
/* 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
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;
void rtp_session_rtcp_process_send(struct _RtpSession *s);
void rtp_session_rtcp_process_recv(struct _RtpSession *s);
#define RTCP_DEFAULT_REPORT_INTERVAL 5
/* packet parsing api */
/*in case of coumpound packet, set read pointer of m to the beginning of the next RTCP
packet */
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() */
void rtcp_rewind(mblk_t *m);
/* get common header*/
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 */
bool_t rtcp_is_SR(const mblk_t *m);
uint32_t rtcp_SR_get_ssrc(const mblk_t *m);
const sender_info_t * rtcp_SR_get_sender_info(const mblk_t *m);
const report_block_t * rtcp_SR_get_report_block(const mblk_t *m, int idx);
/*Receiver report accessors*/
bool_t rtcp_is_RR(const mblk_t *m);
uint32_t rtcp_RR_get_ssrc(const mblk_t *m);
const report_block_t * rtcp_RR_get_report_block(const mblk_t *m,int idx);
/*SDES accessors */
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);
void rtcp_sdes_parse(const mblk_t *m, SdesItemFoundCallback cb, void *user_data);
/*BYE accessors */
bool_t rtcp_is_BYE(const mblk_t *m);
bool_t rtcp_BYE_get_ssrc(const mblk_t *m, int idx, uint32_t *ssrc);
bool_t rtcp_BYE_get_reason(const mblk_t *m, const char **reason, int *reason_len);
/*APP accessors */
bool_t rtcp_is_APP(const mblk_t *m);
int rtcp_APP_get_subtype(const mblk_t *m);
uint32_t rtcp_APP_get_ssrc(const mblk_t *m);
/* name argument is supposed to be at least 4 characters (note: no '\0' written)*/
void rtcp_APP_get_name(const mblk_t *m, char *name);
/* retrieve the data. when returning, data points directly into the mblk_t */
void rtcp_APP_get_data(const mblk_t *m, uint8_t **data, int *len);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,115 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; 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 <ortp/port.h>
#include <ortp/str_utils.h>
#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;
uint64_t sent; /* bytes sent */
uint64_t recv; /* bytes of payload received and delivered in time to the application */
uint64_t hw_recv; /* bytes of payload received */
uint64_t packet_recv; /* number of packets received */
uint64_t unavaillable; /* packets not availlable when they were queried */
uint64_t outoftime; /* number of packets that were received too late */
uint64_t cum_packet_loss; /* cumulative number of packet lost */
uint64_t bad; /* packets that did not appear to be RTP */
uint64_t discarded; /* incoming packets discarded because the queue exceeds its max size */
} rtp_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 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)
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_markbit(mp) (((rtp_header_t*)((mp)->b_rptr))->markbit)
#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])
int rtp_get_payload(mblk_t *packet, unsigned char **start);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,380 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; 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 <ortp/port.h>
#include <ortp/rtp.h>
#include <ortp/payloadtype.h>
#include <ortp/sessionset.h>
#include <ortp/rtcp.h>
#include <ortp/str_utils.h>
#include <ortp/rtpsignaltable.h>
#include <ortp/event.h>
typedef enum {
RTP_SESSION_RECVONLY,
RTP_SESSION_SENDONLY,
RTP_SESSION_SENDRECV
} RtpSessionMode;
/*! Jitter buffer parameters
*/
typedef struct _JBParameters{
int min_size; /**< in milliseconds*/
int nom_size; /**< idem */
int max_size; /**< idem */
bool_t adaptive;
bool_t pad[3];
int max_packets; /**< max number of packets allowed to be queued in the jitter buffer */
} JBParameters;
typedef struct _JitterControl
{
int count;
int jitt_comp; /* the user jitt_comp in miliseconds*/
int jitt_comp_ts; /* the jitt_comp converted in rtp time (same unit as timestamp) */
int adapt_jitt_comp_ts;
int64_t slide;
int64_t prev_slide;
float jitter;
int olddiff;
float inter_jitter; /* interarrival jitter as defined in the RFC */
int corrective_step;
int corrective_slide;
bool_t adaptive;
bool_t enabled;
} JitterControl;
typedef struct _WaitPoint
{
ortp_mutex_t lock;
ortp_cond_t cond;
uint32_t time;
bool_t wakeup;
} WaitPoint;
typedef struct _RtpTransport
{
void *data;
ortp_socket_t (*t_getsocket)(struct _RtpTransport *t);
int (*t_sendto)(struct _RtpTransport *t, mblk_t *msg , int flags, const struct sockaddr *to, socklen_t tolen);
int (*t_recvfrom)(struct _RtpTransport *t, mblk_t *msg, int flags, struct sockaddr *from, socklen_t *fromlen);
struct _RtpSession *session;//<back pointer to the owning session, set by oRTP
} RtpTransport;
typedef struct _RtpStream
{
ortp_socket_t socket;
struct _RtpTransport *tr;
int sockfamily;
int max_rq_size;
int time_jump;
uint32_t ts_jump;
queue_t rq;
queue_t tev_rq;
mblk_t *cached_mp;
int loc_port;
#ifdef ORTP_INET6
struct sockaddr_storage rem_addr;
#else
struct sockaddr_in rem_addr;
#endif
int rem_addrlen;
JitterControl jittctl;
uint32_t snd_time_offset;/*the scheduler time when the application send its first timestamp*/
uint32_t snd_ts_offset; /* the first application timestamp sent by the application */
uint32_t snd_rand_offset; /* a random number added to the user offset to make the stream timestamp*/
uint32_t snd_last_ts; /* the last stream timestamp sended */
uint32_t rcv_time_offset; /*the scheduler time when the application ask for its first timestamp*/
uint32_t rcv_ts_offset; /* the first stream timestamp */
uint32_t rcv_query_ts_offset; /* the first user timestamp asked by the application */
uint32_t rcv_last_ts; /* the last stream timestamp got by the application */
uint32_t rcv_last_app_ts; /* the last application timestamp asked by the application */
uint32_t rcv_last_ret_ts; /* the timestamp of the last sample returned (only for continuous audio)*/
uint32_t hwrcv_extseq; /* last received on socket extended sequence number */
uint32_t hwrcv_seq_at_last_SR;
uint32_t hwrcv_since_last_SR;
uint32_t last_rcv_SR_ts; /* NTP timestamp (middle 32 bits) of last received SR */
struct timeval last_rcv_SR_time; /* time at which last SR was received */
uint16_t snd_seq; /* send sequence number */
uint32_t last_rtcp_report_snt_r; /* the time of the last rtcp report sent, in recv timestamp unit */
uint32_t last_rtcp_report_snt_s; /* the time of the last rtcp report sent, in send timestamp unit */
uint32_t rtcp_report_snt_interval; /* the interval in timestamp unit between rtcp report sent */
uint32_t last_rtcp_packet_count; /*the sender's octet count in the last sent RTCP SR*/
uint32_t sent_payload_bytes; /*used for RTCP sender reports*/
unsigned int sent_bytes; /* used for bandwidth estimation */
struct timeval send_bw_start; /* used for bandwidth estimation */
unsigned int recv_bytes; /* used for bandwidth estimation */
struct timeval recv_bw_start; /* used for bandwidth estimation */
rtp_stats_t stats;
int recv_errno;
int send_errno;
int snd_socket_size;
int rcv_socket_size;
}RtpStream;
typedef struct _RtcpStream
{
ortp_socket_t socket;
int sockfamily;
struct _RtpTransport *tr;
mblk_t *cached_mp;
#ifdef ORTP_INET6
struct sockaddr_storage rem_addr;
#else
struct sockaddr_in rem_addr;
#endif
int rem_addrlen;
bool_t enabled; /*tells whether we can send RTCP packets */
} RtcpStream;
typedef struct _RtpSession RtpSession;
/**
* An object representing a bi-directional RTP session.
* It holds sockets, jitter buffer, various counters (timestamp, sequence numbers...)
* Applications SHOULD NOT try to read things within the RtpSession object but use
* instead its public API (the rtp_session_* methods) where RtpSession is used as a
* pointer.
* rtp_session_new() allocates and initialize a RtpSession.
**/
struct _RtpSession
{
RtpSession *next; /* next RtpSession, when the session are enqueued by the scheduler */
int mask_pos; /* the position in the scheduler mask of RtpSession : do not move this field: it is part of the ABI since the session_set macros use it*/
struct {
RtpProfile *profile;
int pt;
unsigned int ssrc;
WaitPoint wp;
int telephone_events_pt; /* the payload type used for telephony events */
} snd,rcv;
unsigned int inc_ssrc_candidate;
int inc_same_ssrc_count;
int hw_recv_pt; /* recv payload type before jitter buffer */
int recv_buf_size;
RtpSignalTable on_ssrc_changed;
RtpSignalTable on_payload_type_changed;
RtpSignalTable on_telephone_event_packet;
RtpSignalTable on_telephone_event;
RtpSignalTable on_timestamp_jump;
RtpSignalTable on_network_error;
RtpSignalTable on_rtcp_bye;
struct _OList *signal_tables;
struct _OList *eventqs;
msgb_allocator_t allocator;
RtpStream rtp;
RtcpStream rtcp;
RtpSessionMode mode;
struct _RtpScheduler *sched;
uint32_t flags;
int dscp;
int multicast_ttl;
int multicast_loopback;
void * user_data;
/* FIXME: Should be a table for all session participants. */
struct timeval last_recv_time; /* Time of receiving the RTP/RTCP packet. */
mblk_t *pending;
/* telephony events extension */
mblk_t *current_tev; /* the pending telephony events */
mblk_t *sd;
queue_t contributing_sources;
bool_t symmetric_rtp;
bool_t permissive; /*use the permissive algorithm*/
bool_t use_connect; /* use connect() on the socket */
bool_t ssrc_set;
};
#ifdef __cplusplus
extern "C"
{
#endif
/* public API */
RtpSession *rtp_session_new(int mode);
void rtp_session_set_scheduling_mode(RtpSession *session, int yesno);
void rtp_session_set_blocking_mode(RtpSession *session, int yesno);
void rtp_session_set_profile(RtpSession *session, RtpProfile *profile);
void rtp_session_set_send_profile(RtpSession *session,RtpProfile *profile);
void rtp_session_set_recv_profile(RtpSession *session,RtpProfile *profile);
RtpProfile *rtp_session_get_profile(RtpSession *session);
RtpProfile *rtp_session_get_send_profile(RtpSession *session);
RtpProfile *rtp_session_get_recv_profile(RtpSession *session);
int rtp_session_signal_connect(RtpSession *session,const char *signal_name, RtpCallback cb, unsigned long user_data);
int rtp_session_signal_disconnect_by_callback(RtpSession *session,const char *signal_name, RtpCallback cb);
void rtp_session_set_ssrc(RtpSession *session, uint32_t ssrc);
void rtp_session_set_seq_number(RtpSession *session, uint16_t seq);
uint16_t rtp_session_get_seq_number(RtpSession *session);
void rtp_session_enable_jitter_buffer(RtpSession *session , bool_t enabled);
bool_t rtp_session_jitter_buffer_enabled(const RtpSession *session);
void rtp_session_set_jitter_buffer_params(RtpSession *session, const JBParameters *par);
void rtp_session_get_jitter_buffer_params(RtpSession *session, JBParameters *par);
/*deprecated jitter control functions*/
void rtp_session_set_jitter_compensation(RtpSession *session, int milisec);
void rtp_session_enable_adaptive_jitter_compensation(RtpSession *session, bool_t val);
bool_t rtp_session_adaptive_jitter_compensation_enabled(RtpSession *session);
void rtp_session_set_time_jump_limit(RtpSession *session, int miliseconds);
int rtp_session_set_local_addr(RtpSession *session,const char *addr, int port);
int rtp_session_get_local_port(const RtpSession *session);
int
rtp_session_set_remote_addr_full (RtpSession * session, const char * addr, int rtp_port, int rtcp_port);
/*same as previous function, old name:*/
int rtp_session_set_remote_addr_and_port (RtpSession * session, const char * addr, int rtp_port, int rtcp_port);
int rtp_session_set_remote_addr(RtpSession *session,const char *addr, int port);
/* alternatively to the set_remote_addr() and set_local_addr(), an application can give
a valid socket (potentially connect()ed )to be used by the RtpSession */
void rtp_session_set_sockets(RtpSession *session, int rtpfd, int rtcpfd);
void rtp_session_set_transports(RtpSession *session, RtpTransport *rtptr, RtpTransport *rtcptr);
/*those methods are provided for people who wants to send non-RTP messages using the RTP/RTCP sockets */
ortp_socket_t rtp_session_get_rtp_socket(const RtpSession *session);
ortp_socket_t rtp_session_get_rtcp_socket(const RtpSession *session);
/* QOS / DSCP */
int rtp_session_set_dscp(RtpSession *session, int dscp);
int rtp_session_get_dscp(const RtpSession *session);
/* Multicast methods */
int rtp_session_set_multicast_ttl(RtpSession *session, int ttl);
int rtp_session_get_multicast_ttl(RtpSession *session);
int rtp_session_set_multicast_loopback(RtpSession *session, int yesno);
int rtp_session_get_multicast_loopback(RtpSession *session);
int rtp_session_set_send_payload_type(RtpSession *session, int paytype);
int rtp_session_get_send_payload_type(const RtpSession *session);
int rtp_session_get_recv_payload_type(const RtpSession *session);
int rtp_session_set_recv_payload_type(RtpSession *session, int pt);
int rtp_session_set_payload_type(RtpSession *session, int pt);
void rtp_session_set_symmetric_rtp (RtpSession * session, bool_t yesno);
void rtp_session_set_connected_mode(RtpSession *session, bool_t yesno);
void rtp_session_enable_rtcp(RtpSession *session, bool_t yesno);
/*low level recv and send functions */
mblk_t * rtp_session_recvm_with_ts (RtpSession * session, uint32_t user_ts);
mblk_t * rtp_session_create_packet(RtpSession *session,int header_size, const uint8_t *payload, int payload_size);
mblk_t * rtp_session_create_packet_with_data(RtpSession *session, uint8_t *payload, int payload_size, void (*freefn)(void*));
mblk_t * rtp_session_create_packet_in_place(RtpSession *session,uint8_t *buffer, int size, void (*freefn)(void*) );
int rtp_session_sendm_with_ts (RtpSession * session, mblk_t *mp, uint32_t userts);
/* high level recv and send functions */
int rtp_session_recv_with_ts(RtpSession *session, uint8_t *buffer, int len, uint32_t ts, int *have_more);
int rtp_session_send_with_ts(RtpSession *session, const uint8_t *buffer, int len, uint32_t userts);
/* event API*/
void rtp_session_register_event_queue(RtpSession *session, OrtpEvQueue *q);
void rtp_session_unregister_event_queue(RtpSession *session, OrtpEvQueue *q);
/* IP bandwidth usage estimation functions, returning bits/s*/
float rtp_session_compute_send_bandwidth(RtpSession *session);
float rtp_session_compute_recv_bandwidth(RtpSession *session);
void rtp_session_send_rtcp_APP(RtpSession *session, uint8_t subtype, const char *name, const uint8_t *data, int datalen);
uint32_t rtp_session_get_current_send_ts(RtpSession *session);
uint32_t rtp_session_get_current_recv_ts(RtpSession *session);
void rtp_session_flush_sockets(RtpSession *session);
void rtp_session_release_sockets(RtpSession *session);
void rtp_session_resync(RtpSession *session);
void rtp_session_reset(RtpSession *session);
void rtp_session_destroy(RtpSession *session);
const rtp_stats_t * rtp_session_get_stats(const RtpSession *session);
void rtp_session_reset_stats(RtpSession *session);
void rtp_session_set_data(RtpSession *session, void *data);
void *rtp_session_get_data(const RtpSession *session);
void rtp_session_set_recv_buf_size(RtpSession *session, int bufsize);
void rtp_session_set_rtp_socket_send_buffer_size(RtpSession * session, unsigned int size);
void rtp_session_set_rtp_socket_recv_buffer_size(RtpSession * session, unsigned int size);
/* in use with the scheduler to convert a timestamp in scheduler time unit (ms) */
uint32_t rtp_session_ts_to_time(RtpSession *session,uint32_t timestamp);
uint32_t rtp_session_time_to_ts(RtpSession *session, int millisecs);
/* this function aims at simulating senders with "imprecise" clocks, resulting in
rtp packets sent with timestamp uncorrelated with the system clock .
This is only availlable to sessions working with the oRTP scheduler */
void rtp_session_make_time_distorsion(RtpSession *session, int milisec);
/*RTCP functions */
void rtp_session_set_source_description(RtpSession *session, const char *cname,
const char *name, const char *email, const char *phone,
const char *loc, const char *tool, const char *note);
void rtp_session_add_contributing_source(RtpSession *session, uint32_t csrc,
const char *cname, const char *name, const char *email, const char *phone,
const char *loc, const char *tool, const char *note);
void rtp_session_remove_contributing_sources(RtpSession *session, uint32_t csrc);
mblk_t* rtp_session_create_rtcp_sdes_packet(RtpSession *session);
void rtp_session_get_last_recv_time(RtpSession *session, struct timeval *tv);
int rtp_session_bye(RtpSession *session, const char *reason);
int rtp_session_get_last_send_error_code(RtpSession *session);
void rtp_session_clear_send_error_code(RtpSession *session);
int rtp_session_get_last_recv_error_code(RtpSession *session);
void rtp_session_clear_recv_error_code(RtpSession *session);
/*private */
void rtp_session_init(RtpSession *session, int mode);
#define rtp_session_set_flag(session,flag) (session)->flags|=(flag)
#define rtp_session_unset_flag(session,flag) (session)->flags&=~(flag)
void rtp_session_uninit(RtpSession *session);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,53 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; 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 *, ...);
struct _RtpSignalTable
{
RtpCallback callback[RTP_CALLBACK_TABLE_MAX_ENTRIES];
unsigned long 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, unsigned long user_data);
void rtp_signal_table_emit(RtpSignalTable *table);
/* emit but with a second arg */
void rtp_signal_table_emit2(RtpSignalTable *table, unsigned long arg);
/* emit but with a third arg */
void rtp_signal_table_emit3(RtpSignalTable *table, unsigned long arg1, unsigned long arg2);
int rtp_signal_table_remove_by_callback(RtpSignalTable *table,RtpCallback cb);
#endif

View file

@ -1,139 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; 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 <ortp/rtpsession.h>
#ifdef __cplusplus
extern "C"{
#endif
#if !defined(_WIN32) && !defined(_WIN32_WCE)
/* UNIX */
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#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)
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 (#SessionSet object)
*@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.
**/
void session_set_destroy(SessionSet *set);
int session_set_select(SessionSet *recvs, SessionSet *sends, SessionSet *errors);
int session_set_timedselect(SessionSet *recvs, SessionSet *sends, SessionSet *errors, struct timeval *timeout);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,44 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef ortp_srtp_h
#define ortp_srtp_h
#include <srtp/srtp.h>
#include <ortp/rtpsession.h>
#ifdef __cplusplus
extern "C"{
#endif
err_status_t ortp_srtp_init(void);
err_status_t ortp_srtp_create(srtp_t *session, const srtp_policy_t *policy);
err_status_t ortp_srtp_dealloc(srtp_t session);
err_status_t ortp_srtp_add_stream(srtp_t session, const srtp_policy_t *policy);
bool_t ortp_srtp_supported(void);
int srtp_transport_new(srtp_t srtp, RtpTransport **rtpt, RtpTransport **rtcpt );
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,131 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; 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 <ortp/port.h>
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;
} mblk_t;
typedef struct datab
{
unsigned char *db_base;
unsigned char *db_lim;
void (*db_freefn)(void*);
int db_ref;
} 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
void qinit(queue_t *q);
void putq(queue_t *q, mblk_t *m);
mblk_t * getq(queue_t *q);
void insq(queue_t *q,mblk_t *emp, mblk_t *mp);
void remq(queue_t *q, mblk_t *mp);
mblk_t * peekq(queue_t *q);
/* remove and free all messages in the q */
#define FLUSHALL 0
void flushq(queue_t *q, int how);
void mblk_init(mblk_t *mp);
/* allocates a mblk_t, that points to a datab_t, that points to a buffer of size size. */
mblk_t *allocb(int 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 */
mblk_t *esballoc(uint8_t *buf, int size, int pri, void (*freefn)(void*) );
/* frees a mblk_t, and if the datab ref_count is 0, frees it and the buffer too */
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 */
void freemsg(mblk_t *mp);
/* duplicates a mblk_t , buffer is not duplicated*/
mblk_t *dupb(mblk_t *m);
/* duplicates a complex mblk_t, buffer is not duplicated */
mblk_t *dupmsg(mblk_t* m);
/* returns the size of data of a message */
int msgdsize(const mblk_t *mp);
/* concatenates all fragment of a complex message*/
void msgpullup(mblk_t *mp,int len);
/* duplicates a single message, but with buffer included */
mblk_t *copyb(mblk_t *mp);
/* duplicates a complex message with buffer included */
mblk_t *copymsg(mblk_t *mp);
mblk_t * appendb(mblk_t *mp, const char *data, int size, bool_t pad);
void msgappend(mblk_t *mp, const char *data, int size, bool_t pad);
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;
void msgb_allocator_init(msgb_allocator_t *pa);
mblk_t *msgb_allocator_alloc(msgb_allocator_t *pa, int size);
void msgb_allocator_uninit(msgb_allocator_t *pa);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,550 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ====================================================================
* The Vovida Software License, Version 1.0
*
* Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
*
* 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 names "VOCAL", "Vovida Open Communication Application Library",
* and "Vovida Open Communication Application Library (VOCAL)" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact vocal@vovida.org.
*
* 4. Products derived from this software may not be called "VOCAL", nor
* may "VOCAL" appear in their name, without prior written
* permission of Vovida Networks, Inc.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
* NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
* NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
* IN EXCESS OF $1,000, NOR FOR ANY 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.
*
* ====================================================================
*
* This software consists of voluntary contributions made by Vovida
* Networks, Inc. and many individuals on behalf of Vovida Networks,
* Inc. For more information on Vovida Networks, Inc., please see
* <http://www.vovida.org/>.
*
*/
#ifndef __STUN_H__
#define __STUN_H__
#include <stdio.h>
#include <time.h>
#include <ortp/port.h>
#include <ortp/stun_udp.h>
#ifdef __APPLE__
#include "TargetConditionals.h"
#endif
#ifdef __cplusplus
extern "C"
{
#endif
/* if you change this version, change in makefile too */
#define STUN_VERSION "0.99"
#define STUN_MAX_STRING 256
#define STUN_MAX_UNKNOWN_ATTRIBUTES 8
#define STUN_MAX_MESSAGE_SIZE 2048
#define STUN_PORT 3478
/* define some basic types */
#if 0
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
#if defined(WIN32) || defined(_WIN32_WCE)
typedef unsigned __int64 uint64_t;
#else
typedef unsigned long long uint64_t;
#endif
#endif
typedef struct { unsigned char octet[12]; } UInt96;
/* define a structure to hold a stun address */
#define IPv4Family 0x01
#define IPv6Family 0x02
/* define flags */
#define ChangeIpFlag 0x04
#define ChangePortFlag 0x02
/* define stun attribute */
#define SA_MAPPEDADDRESS 0x0001
#define SA_RESPONSEADDRESS 0x0002 /** deprecated **/
#define SA_CHANGEREQUEST 0x0003 /** deprecated **/
#define SA_SOURCEADDRESS 0x0004 /** deprecated **/
#define SA_CHANGEDADDRESS 0x0005 /** deprecated **/
#define SA_USERNAME 0x0006
#define SA_PASSWORD 0x0007 /** deprecated **/
#define SA_MESSAGEINTEGRITY 0x0008
#define SA_ERRORCODE 0x0009
#define SA_UNKNOWNATTRIBUTE 0x000A
#define SA_REFLECTEDFROM 0x000B /** deprecated **/
#define SA_REALM 0x0014
#define SA_NONCE 0x0015
#define SA_XORMAPPEDADDRESS 0x0020
#define SA_XORMAPPEDADDRESS2 0x8020 /* Non standard extention */
#define SA_XORONLY 0x0021 /* deprecated */
#define SA_SECONDARYADDRESS 0x0050 /* Non standard extention */
#define SA_SOFTWARE 0x8022
#define SA_ALTERNATESERVER 0x8023
#define SA_FINGERPRINT 0x8028
/* define turn attribute */
#define TA_CHANNELNUMBER 0x000C
#define TA_LIFETIME 0x000D
#define TA_DEPRECATEDBANDWIDTH 0x0010
#define TA_XORPEERADDRESS 0x0012
#define TA_DATA 0x0013
#define TA_XORRELAYEDADDRESS 0x0016
#define TA_EVENPORT 0x0018
#define TA_REQUESTEDTRANSPORT 0x0019
#define TA_DONTFRAGMENT 0x001A
#define TA_DEPRECATEDTIMERVAL 0x0021
#define TA_RESERVATIONTOKEN 0x0022
#define ICEA_PRIORITY 0x0024
#define ICEA_USECANDIDATE 0x0025
#define ICEA_ICECONTROLLED 0x8029
#define ICEA_ICECONTROLLING 0x802a
#define STUN_REQUEST 0x0000
#define STUN_INDICATION 0x0010
#define STUN_SUCCESS_RESP 0x0100
#define STUN_ERR_RESP 0x0110
#define STUN_IS_REQUEST(msg_type) (((msg_type) & 0x0110) == 0x0000)
#define STUN_IS_INDICATION(msg_type) (((msg_type) & 0x0110) == 0x0010)
#define STUN_IS_SUCCESS_RESP(msg_type) (((msg_type) & 0x0110) == 0x0100)
#define STUN_IS_ERR_RESP(msg_type) (((msg_type) & 0x0110) == 0x0110)
/* define types for a stun message */
#define STUN_METHOD_BINDING 0x0001
#define TURN_MEDHOD_ALLOCATE 0x0003 //(only request/response semantics defined)
#define TURN_METHOD_REFRESH 0x0004 //(only request/response semantics defined)
#define TURN_METHOD_CREATEPERMISSION 0x0008 //(only request/response semantics defined
#define TURN_METHOD_CHANNELBIND 0x0009 //(only request/response semantics defined)
//#define BindResponseMsg 0x0101
//#define BindErrorResponseMsg 0x0111
#define SharedSecretRequestMsg 0x0002
#define SharedSecretResponseMsg 0x0102
#define SharedSecretErrorResponseMsg 0x0112
#define TURN_INDICATION_SEND 0x0006 //(only indication semantics defined)
#define TURN_INDICATION_DATA 0x0007 //(only indication semantics defined)
typedef struct
{
uint16_t msgType;
uint16_t msgLength;
uint32_t magic_cookie;
UInt96 tr_id;
} StunMsgHdr;
typedef struct
{
uint16_t type;
uint16_t length;
} StunAtrHdr;
typedef struct
{
uint16_t port;
uint32_t addr;
} StunAddress4;
typedef struct
{
uint8_t pad;
uint8_t family;
StunAddress4 ipv4;
} StunAtrAddress4;
typedef struct
{
uint32_t value;
} StunAtrChangeRequest;
typedef struct
{
uint16_t pad; /* all 0 */
uint8_t errorClass;
uint8_t number;
char reason[STUN_MAX_STRING];
uint16_t sizeReason;
} StunAtrError;
typedef struct
{
uint16_t attrType[STUN_MAX_UNKNOWN_ATTRIBUTES];
uint16_t numAttributes;
} StunAtrUnknown;
typedef struct
{
uint16_t channelNumber;
uint16_t rffu; /* Reserved For Future Use */
} TurnAtrChannelNumber;
typedef struct
{
uint32_t lifetime;
} TurnAtrLifetime;
typedef struct
{
char value[1500];
uint16_t sizeValue;
} TurnAtrData;
typedef struct
{
uint8_t proto;
uint8_t pad1;
uint8_t pad2;
uint8_t pad3;
} TurnAtrRequestedTransport;
typedef struct
{
uint64_t value;
} TurnAtrReservationToken;
typedef struct
{
uint32_t fingerprint;
} StunAtrFingerprint;
typedef struct
{
char value[STUN_MAX_STRING];
uint16_t sizeValue;
} StunAtrString;
typedef struct
{
uint32_t priority;
} IceAtrPriority;
typedef struct
{
uint64_t value;
} IceAtrIceControll;
typedef struct
{
char hash[20];
} StunAtrIntegrity;
typedef enum
{
HmacUnkown=0,
HmacOK,
HmacBadUserName,
HmacUnkownUserName,
HmacFailed
} StunHmacStatus;
typedef struct
{
uint16_t attrType[STUN_MAX_UNKNOWN_ATTRIBUTES];
uint16_t numAttributes;
} TurnAtrUnknown;
typedef struct
{
StunMsgHdr msgHdr;
bool_t hasMappedAddress;
StunAtrAddress4 mappedAddress;
bool_t hasResponseAddress;
StunAtrAddress4 responseAddress;
bool_t hasChangeRequest;
StunAtrChangeRequest changeRequest;
bool_t hasSourceAddress;
StunAtrAddress4 sourceAddress;
bool_t hasChangedAddress;
StunAtrAddress4 changedAddress;
bool_t hasUsername;
StunAtrString username;
bool_t hasPassword;
StunAtrString password;
bool_t hasMessageIntegrity;
StunAtrIntegrity messageIntegrity;
bool_t hasErrorCode;
StunAtrError errorCode;
bool_t hasUnknownAttributes;
StunAtrUnknown unknownAttributes;
bool_t hasReflectedFrom;
StunAtrAddress4 reflectedFrom;
bool_t hasRealm;
StunAtrString realmName;
bool_t hasNonce;
StunAtrString nonceName;
bool_t hasXorMappedAddress;
StunAtrAddress4 xorMappedAddress;
bool_t hasSoftware;
StunAtrString softwareName;
bool_t hasXorPeerAddress;
StunAtrAddress4 xorPeerAddress;
bool_t hasXorRelayedAddress;
StunAtrAddress4 xorRelayedAddress;
bool_t hasFingerprint;
StunAtrFingerprint fingerprint;
/* Turn elements */
bool_t hasChannelNumberAttributes;
TurnAtrChannelNumber channelNumberAttributes;
bool_t hasLifetimeAttributes;
TurnAtrLifetime lifetimeAttributes;
bool_t hasData;
TurnAtrData data;
bool_t hasRequestedTransport;
TurnAtrRequestedTransport requestedTransport;
bool_t hasDontFragment;
bool_t hasReservationToken;
TurnAtrReservationToken reservationToken;
bool_t hasPriority;
IceAtrPriority priority;
bool_t hasUseCandidate;
bool_t hasIceControlled;
IceAtrIceControll iceControlled;
bool_t hasIceControlling;
IceAtrIceControll iceControlling;
} StunMessage;
/* Define enum with different types of NAT */
typedef enum
{
StunTypeUnknown=0,
StunTypeOpen,
StunTypeConeNat,
StunTypeRestrictedNat,
StunTypePortRestrictedNat,
StunTypeSymNat,
StunTypeSymFirewall,
StunTypeBlocked,
StunTypeFailure
} NatType;
#define MAX_MEDIA_RELAYS 500
#define MAX_RTP_MSG_SIZE 1500
#define MEDIA_RELAY_TIMEOUT 3*60
typedef struct
{
int relayPort; /* media relay port */
int fd; /* media relay file descriptor */
StunAddress4 destination; /* NAT IP:port */
time_t expireTime; /* if no activity after time, close the socket */
} StunMediaRelay;
typedef struct
{
StunAddress4 myAddr;
StunAddress4 altAddr;
Socket myFd;
Socket altPortFd;
Socket altIpFd;
Socket altIpPortFd;
bool_t relay; /* true if media relaying is to be done */
StunMediaRelay relays[MAX_MEDIA_RELAYS];
} StunServerInfo;
void
stunCalculateIntegrity_longterm(char* hmac, const char* input, int length,
const char *username, const char *realm, const char *password);
void
stunCalculateIntegrity_shortterm(char* hmac, const char* input, int length, const char* key);
uint32_t
stunCalculateFingerprint(const char* input, int length);
bool_t
stunParseMessage( char* buf,
unsigned int bufLen,
StunMessage *message);
void
stunBuildReqSimple( StunMessage* msg,
const StunAtrString *username,
bool_t changePort, bool_t changeIp, unsigned int id );
unsigned int
stunEncodeMessage( const StunMessage *message,
char* buf,
unsigned int bufLen,
const StunAtrString *password);
void
stunCreateUserName(const StunAddress4 *addr, StunAtrString* username);
void
stunGetUserNameAndPassword( const StunAddress4 *dest,
StunAtrString* username,
StunAtrString* password);
void
stunCreatePassword(const StunAtrString *username, StunAtrString* password);
int
stunRand(void);
uint64_t
stunGetSystemTimeSecs(void);
/* find the IP address of a the specified stun server - return false is fails parse */
bool_t
stunParseServerName( const char* serverName, StunAddress4 *stunServerAddr);
bool_t
stunParseHostName( const char* peerName,
uint32_t *ip,
uint16_t *portVal,
uint16_t defaultPort );
/* return true if all is OK
Create a media relay and do the STERN thing if startMediaPort is non-zero */
bool_t
stunInitServer(StunServerInfo *info,
const StunAddress4 *myAddr,
const StunAddress4 *altAddr,
int startMediaPort);
void
stunStopServer(StunServerInfo *info);
/* returns number of address found - take array or addres */
int
stunFindLocalInterfaces(uint32_t* addresses, int maxSize );
int
stunTest( StunAddress4 *dest, int testNum, StunAddress4* srcAddr, StunAddress4 *sMappedAddr, StunAddress4* sChangedAddr);
NatType
stunNatType( StunAddress4 *dest,
bool_t* preservePort, /* if set, is return for if NAT preservers ports or not */
bool_t* hairpin , /* if set, is the return for if NAT will hairpin packets */
int port, /* port to use for the test, 0 to choose random port */
StunAddress4* sAddr /* NIC to use */
);
bool_t
stunServerProcessMsg( char* buf,
unsigned int bufLen,
StunAddress4 *from,
StunAddress4 *myAddr,
StunAddress4 *altAddr,
StunMessage *resp,
StunAddress4 *destination,
StunAtrString *hmacPassword,
bool_t* changePort,
bool_t* changeIp);
int
stunOpenSocket( StunAddress4 *dest,
StunAddress4* mappedAddr,
int port,
StunAddress4* srcAddr);
bool_t
stunOpenSocketPair(StunAddress4 *dest,
StunAddress4* mapAddr_rtp,
StunAddress4* mapAddr_rtcp,
int* fd1, int* fd2,
int srcPort, StunAddress4* srcAddr);
bool_t
turnAllocateSocketPair(StunAddress4 *dest,
StunAddress4* mapAddr_rtp,
StunAddress4* mapAddr_rtcp,
int* fd1, int* fd2,
int srcPort, StunAddress4* srcAddr);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,139 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ====================================================================
* The Vovida Software License, Version 1.0 * * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved. * * 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 names "VOCAL", "Vovida Open Communication Application Library", * and "Vovida Open Communication Application Library (VOCAL)" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact vocal@vovida.org. * * 4. Products derived from this software may not be called "VOCAL", nor * may "VOCAL" appear in their name, without prior written * permission of Vovida Networks, Inc. * * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES * IN EXCESS OF $1,000, NOR FOR ANY 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. * * ==================================================================== * * This software consists of voluntary contributions made by Vovida * Networks, Inc. and many individuals on behalf of Vovida Networks, * Inc. For more information on Vovida Networks, Inc., please see * <http://www.vovida.org/>.
*
*/
#ifndef __STUN_UDP_H__
#define __STUN_UDP_H__
#ifndef __cplusplus
//#define bool int
//#define false 0
//#define true 1
#endif
#ifdef __MACH__
#include <sys/socket.h>
#ifndef _SOCKLEN_T
typedef int socklen_t;
#endif
#endif
#include <ortp/port.h>
#if !defined(_WIN32_WCE)
#include <errno.h>
#endif
#if defined(WIN32) || defined(_WIN32_WCE)
#define snprintf _snprintf
#include <winsock2.h>
/* #include <io.h> */
typedef int socklen_t;
typedef SOCKET Socket;
#define EWOULDBLOCK WSAEWOULDBLOCK
#define EINPROGRESS WSAEINPROGRESS
#define EALREADY WSAEALREADY
#define ENOTSOCK WSAENOTSOCK
#define EDESTADDRREQ WSAEDESTADDRREQ
#define EMSGSIZE WSAEMSGSIZE
#define EPROTOTYPE WSAEPROTOTYPE
#define ENOPROTOOPT WSAENOPROTOOPT
#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
#define EOPNOTSUPP WSAEOPNOTSUPP
#define EPFNOSUPPORT WSAEPFNOSUPPORT
#define EAFNOSUPPORT WSAEAFNOSUPPORT
#define EADDRINUSE WSAEADDRINUSE
#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
#define ENETDOWN WSAENETDOWN
#define ENETUNREACH WSAENETUNREACH
#define ENETRESET WSAENETRESET
#define ECONNABORTED WSAECONNABORTED
#define ECONNRESET WSAECONNRESET
#define ENOBUFS WSAENOBUFS
#define EISCONN WSAEISCONN
#define ENOTCONN WSAENOTCONN
#define ESHUTDOWN WSAESHUTDOWN
#define ETOOMANYREFS WSAETOOMANYREFS
#define ETIMEDOUT WSAETIMEDOUT
#define ECONNREFUSED WSAECONNREFUSED
#define ELOOP WSAELOOP
#define EHOSTDOWN WSAEHOSTDOWN
#define EHOSTUNREACH WSAEHOSTUNREACH
#define EPROCLIM WSAEPROCLIM
#define EUSERS WSAEUSERS
#define EDQUOT WSAEDQUOT
#define ESTALE WSAESTALE
#define EREMOTE WSAEREMOTE
typedef LONGLONG Int64;
#else
typedef int Socket;
#define INVALID_SOCKET -1
#define SOCKET_ERROR -1
#define closesocket(fd) close(fd)
#define WSANOTINITIALISED EPROTONOSUPPORT
#endif
#ifdef __cplusplus
extern "C"{
#endif
int getErrno(void);
/* Open a UDP socket to receive on the given port - if port is 0, pick a a
port, if interfaceIp!=0 then use ONLY the interface specified instead of
all of them */
Socket
openPort( unsigned short port, unsigned int interfaceIp);
/* recive a UDP message */
bool_t
getMessage( Socket fd, char* buf, int* len,
unsigned int* srcIp, unsigned short* srcPort);
/* send a UDP message */
bool_t
sendMessage( Socket fd, char* msg, int len,
unsigned int dstIp, unsigned short dstPort);
/* set up network - does nothing in unix but needed for windows */
void
initNetwork(void);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,105 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; 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 <ortp/rtpsession.h>
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 */
int rtp_session_telephone_events_supported(RtpSession *session);
int rtp_session_send_telephone_events_supported(RtpSession *session);
int rtp_session_recv_telephone_events_supported(RtpSession *session);
mblk_t *rtp_session_create_telephone_event_packet(RtpSession *session, int start);
int rtp_session_add_telephone_event(RtpSession *session,
mblk_t *packet, uint8_t event, int end, uint8_t volume, uint16_t duration);
int rtp_session_read_telephone_event(RtpSession *session,
mblk_t *packet,telephone_event_t **tab);
/* high level functions*/
int rtp_session_send_dtmf(RtpSession *session, char dtmf, uint32_t userts);
int rtp_session_send_dtmf2(RtpSession *session, char dtmf, uint32_t userts, int duration);
/* for high level telephony event callback */
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

View file

@ -1,193 +0,0 @@
# Anjuta Version 1.1.97
Compatibility Level: 1
<PROJECT_DESCRIPTION_START>
Some description<PROJECT_DESCRIPTION_END>
<CONFIG_PROGS_START>
<CONFIG_PROGS_END>
<CONFIG_LIBS_START>
<CONFIG_LIBS_END>
<CONFIG_HEADERS_START>
<CONFIG_HEADERS_END>
<CONFIG_CHARACTERISTICS_START>
<CONFIG_CHARACTERISTICS_END>
<CONFIG_LIB_FUNCS_START>
<CONFIG_LIB_FUNCS_END>
<CONFIG_ADDITIONAL_START>
<CONFIG_ADDITIONAL_END>
<CONFIG_FILES_START>
<CONFIG_FILES_END>
<MAKEFILE_AM_START>
<MAKEFILE_AM_END>
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=

View file

@ -1,67 +0,0 @@
[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

View file

@ -1,225 +0,0 @@
# Doxyfile 1.5.1
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = oRTP
PROJECT_NUMBER = @ORTP_VERSION@
OUTPUT_DIRECTORY = doc
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
USE_WINDOWS_ENCODING = NO
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF =
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
BUILTIN_STL_SUPPORT = NO
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = NO
FILE_VERSION_FILTER =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = @srcdir@/src @srcdir@/include/ortp
FILE_PATTERNS = *.c *.h
RECURSIVE = NO
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXAMPLE_PATH = @srcdir@/src/tests
EXAMPLE_PATTERNS = *.c
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
REFERENCES_LINK_SOURCE = YES
USE_HTAGS = NO
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO

View file

@ -1,10 +0,0 @@
# This is a comment
prefix=@prefix@
exec_prefix=@exec_prefix@
includedir=@includedir@
Name: oRTP
Description: Implement the RFC3550 (RTP) with a easy to use API with high and low level access.
Version: @ORTP_PKGCONFIG_VERSION@
Libs: -L@libdir@ -lortp @ORTPDEPS_LIBS@
Cflags: -I@includedir@ @ORTPDEPS_CFLAGS@

View file

@ -1,83 +0,0 @@
# -*- rpm-spec -*-
#
# ortp -- Real-time Transport Protocol Stack
#
# Default is optimized for Pentium IV but will execute on Pentium II &
# later (i686).
%ifarch %ix86
%define ortp_cpu pentium4
%endif
Summary: Real-time Transport Protocol Stack
Name: ortp
Version: @ORTP_PKGCONFIG_VERSION@
Release: 1
License: LGPL
Group: Applications/Communications
URL: http://linphone.org/ortp/
Source0: %{name}-@ORTP_PKGCONFIG_VERSION@.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
%ifarch %ix86
BuildArch: i686
%endif
%description
oRTP is a LGPL licensed C library implementing the RTP protocol
(rfc1889). 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
Requires: %{name} = %{version}-%{release}
%description devel
oRTP is a LGPL 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 -mcpu=%{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 -fstrict-aliasing
%prep
%setup -q
%build
%configure \
--enable-shared \
--enable-static
%{__make} -j$RPM_BUILD_NCPUS CFLAGS="%ortp_cflags" CXXFLAGS="%ortp_cflags"
%install
rm -rf $RPM_BUILD_ROOT
%makeinstall
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING ChangeLog INSTALL NEWS README TODO
%{_libdir}/*.so.*
%files devel
%defattr(-,root,root,-)
%doc doc/html
%{_libdir}/*.la
%{_libdir}/*.a
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%{_includedir}
%changelog
* Tue Oct 25 2005 Francois-Xavier Kowalski <fix@hp.com>
- Add to oRTP distribution with "make rpm" target

View file

@ -1,38 +0,0 @@
# -*- rpm-spec -*- ############################################################
#
# EPM list file. See epm(1) and epm.list(5) for details
#
###############################################################################
%product ${SUMMARY}
%version ${VERSION}
%release ${RELEASE}
%description ${SUMMARY}
%vendor ${VENDOR}
%copyright ${LICENSE}
%license ${LICENSE}
%readme ${srcdir}/README
%packager ${PACKAGER}
%system linux
# Package all-in one: should be split later on...
%provides ortp-devel
%postinstall << EOF
ldconfig 2>&1 | logger -i -s -t ${PACKAGE}
EOF
%postremove << EOF
ldconfig 2>&1 | logger -i -s -t ${PACKAGE}
EOF
%system hpux
%system all
%include files.list
%provides ortp
%replaces ortp

View file

@ -1,15 +0,0 @@
*.lo
.deps
.libs
Makefile
Makefile.in
libortp.la
mrtprecv
mrtpsend
rtpmemtest
rtprecv
rtpsend
test_timer
tevmrtprecv
tevrtprecv
tevrtpsend

View file

@ -1,41 +0,0 @@
EXTRA_DIST=ortp-config-win32.h dll_entry.c
AM_CFLAGS= $(PTHREAD_CFLAGS) -I$(top_srcdir) $(TRUESPEECH_CFLAGS) $(SRTP_CFLAGS)
AM_LDFLAGS= $(PTHREAD_LDFLAGS)
INCLUDES=-I$(top_srcdir)/include/
lib_LTLIBRARIES = libortp.la
libortp_la_SOURCES= str_utils.c \
port.c \
rtpparse.c \
rtpsession.c \
rtpsession_inet.c \
rtpsession_priv.h \
jitterctl.c jitterctl.h \
rtpsignaltable.c \
rtptimer.c rtptimer.h \
posixtimer.c \
ortp.c \
scheduler.c scheduler.h \
avprofile.c \
sessionset.c \
telephonyevents.c \
payloadtype.c \
rtcp.c \
utils.c utils.h \
rtcpparse.c \
event.c \
stun.c stun_udp.c \
srtp.c \
b64.c
libortp_la_LIBADD= $(PTHREAD_LIBS) -lm $(SRTP_LIBS) $(SSL_LIBS)
libortp_la_LDFLAGS= -version-info $(LIBORTP_SO_VERSION) -no-undefined
SUBDIRS= . tests

View file

@ -1,516 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <ortp/payloadtype.h>
char offset127=127;
char offset0xD5=(char)0xD5;
char offset0[4] = {0x00, 0x00, 0x00, 0x00};
/*
* IMPORTANT : some compiler don't support the tagged-field syntax. Those
* macros are there to trap the problem This means that if you want to keep
* portability, payload types must be defined with their fields in the right
* order.
*/
#if defined(_ISOC99_SOURCE)
// ISO C99's tagged syntax
#define TYPE(val) .type=(val)
#define CLOCK_RATE(val) .clock_rate=(val)
#define BITS_PER_SAMPLE(val) .bits_per_sample=(val)
#define ZERO_PATTERN(val) .zero_pattern=(val)
#define PATTERN_LENGTH(val) .pattern_length=(val)
#define NORMAL_BITRATE(val) .normal_bitrate=(val)
#define MIME_TYPE(val) .mime_type=(val)
#define CHANNELS(val) .channels=(val)
#define FMTP(val) .FMTP=(val)
#elif defined(__GNUC__)
// GCC's legacy tagged syntax (even old versions have it)
#define TYPE(val) type: (val)
#define CLOCK_RATE(val) clock_rate: (val)
#define BITS_PER_SAMPLE(val) bits_per_sample: (val)
#define ZERO_PATTERN(val) zero_pattern: (val)
#define PATTERN_LENGTH(val) pattern_length: (val)
#define NORMAL_BITRATE(val) normal_bitrate: (val)
#define MIME_TYPE(val) mime_type: (val)
#define CHANNELS(val) channels: (val)
#define FMTP(val) FMTP: (val)
#else
// No tagged syntax supported
#define TYPE(val) (val)
#define CLOCK_RATE(val) (val)
#define BITS_PER_SAMPLE(val) (val)
#define ZERO_PATTERN(val) (val)
#define PATTERN_LENGTH(val) (val)
#define NORMAL_BITRATE(val) (val)
#define MIME_TYPE(val) (val)
#define CHANNELS(val) (val)
#define FMTP(val) (val)
#endif
PayloadType payload_type_pcmu8000={
TYPE( PAYLOAD_AUDIO_CONTINUOUS),
CLOCK_RATE( 8000),
BITS_PER_SAMPLE(8),
ZERO_PATTERN( &offset127),
PATTERN_LENGTH( 1),
NORMAL_BITRATE( 64000),
MIME_TYPE ("PCMU"),
CHANNELS(1)
};
PayloadType payload_type_pcma8000={
TYPE( PAYLOAD_AUDIO_CONTINUOUS),
CLOCK_RATE(8000),
BITS_PER_SAMPLE(8),
ZERO_PATTERN( &offset0xD5),
PATTERN_LENGTH( 1),
NORMAL_BITRATE( 64000),
MIME_TYPE ("PCMA"),
CHANNELS(1)
};
PayloadType payload_type_pcm8000={
TYPE( PAYLOAD_AUDIO_CONTINUOUS),
CLOCK_RATE(8000),
BITS_PER_SAMPLE(16),
ZERO_PATTERN( offset0),
PATTERN_LENGTH(1),
NORMAL_BITRATE( 128000),
MIME_TYPE ("PCM"),
CHANNELS(1)
};
PayloadType payload_type_l16_mono={
TYPE( PAYLOAD_AUDIO_CONTINUOUS),
CLOCK_RATE(44100),
BITS_PER_SAMPLE(16),
ZERO_PATTERN( offset0 ),
PATTERN_LENGTH(2),
NORMAL_BITRATE(705600), /* (44100 x 16bits per frame x 1 channel) */
MIME_TYPE ("L16"),
CHANNELS(1)
};
PayloadType payload_type_l16_stereo={
TYPE( PAYLOAD_AUDIO_CONTINUOUS),
CLOCK_RATE(44100),
BITS_PER_SAMPLE(32), /* 16bits x 2 channels */
ZERO_PATTERN( offset0 ),
PATTERN_LENGTH(4),
NORMAL_BITRATE(1411200), /* (44100 x 16bits per frame x 2 channels) */
MIME_TYPE ("L16"),
CHANNELS(2)
};
PayloadType payload_type_lpc1016={
TYPE( PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(8000),
BITS_PER_SAMPLE( 0),
ZERO_PATTERN( NULL),
PATTERN_LENGTH( 0),
NORMAL_BITRATE( 2400),
MIME_TYPE ("1016"),
CHANNELS(1)
};
PayloadType payload_type_gsm=
{
TYPE( PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(8000),
BITS_PER_SAMPLE( 0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH( 0),
NORMAL_BITRATE( 13500),
MIME_TYPE ("GSM"),
CHANNELS(1)
};
PayloadType payload_type_lpc=
{
TYPE( PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(8000),
BITS_PER_SAMPLE( 0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH( 0),
NORMAL_BITRATE( 5600), /* 20ms / 14 octets per frame */
MIME_TYPE ("LPC"),
CHANNELS(1)
};
PayloadType payload_type_g7231=
{
TYPE( PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(8000),
BITS_PER_SAMPLE( 0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH( 0),
NORMAL_BITRATE( 6300),
MIME_TYPE ("G723"),
CHANNELS(1)
};
PayloadType payload_type_g729={
TYPE( PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(8000),
BITS_PER_SAMPLE( 0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH( 0),
NORMAL_BITRATE( 8000),
MIME_TYPE ("G729"),
CHANNELS(1)
};
PayloadType payload_type_g7221={
TYPE( PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(16000),
BITS_PER_SAMPLE( 0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH( 0),
NORMAL_BITRATE( 24000),
MIME_TYPE ("G7221"),
CHANNELS(1)
};
PayloadType payload_type_g726_40={
TYPE( PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(8000),
BITS_PER_SAMPLE( 0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH( 0),
NORMAL_BITRATE( 8000),
MIME_TYPE ("G726-40"),
CHANNELS(1)
};
PayloadType payload_type_g726_32={
TYPE( PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(8000),
BITS_PER_SAMPLE( 0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH( 0),
NORMAL_BITRATE( 8000),
MIME_TYPE ("G726-32"),
CHANNELS(1)
};
PayloadType payload_type_g726_24={
TYPE( PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(8000),
BITS_PER_SAMPLE( 0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH( 0),
NORMAL_BITRATE( 8000),
MIME_TYPE ("G726-24"),
CHANNELS(1)
};
PayloadType payload_type_g726_16={
TYPE( PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(8000),
BITS_PER_SAMPLE( 0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH( 0),
NORMAL_BITRATE( 8000),
MIME_TYPE ("G726-16"),
CHANNELS(1)
};
PayloadType payload_type_mpv=
{
TYPE( PAYLOAD_VIDEO),
CLOCK_RATE(90000),
BITS_PER_SAMPLE(0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH(0),
NORMAL_BITRATE( 256000),
MIME_TYPE ("MPV"),
CHANNELS(0)
};
PayloadType payload_type_h261={
TYPE( PAYLOAD_VIDEO),
CLOCK_RATE(90000),
BITS_PER_SAMPLE(0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH(0),
NORMAL_BITRATE(0),
MIME_TYPE ("H261"),
CHANNELS(0)
};
PayloadType payload_type_h263={
TYPE( PAYLOAD_VIDEO),
CLOCK_RATE(90000),
BITS_PER_SAMPLE(0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH(0),
NORMAL_BITRATE(256000),
MIME_TYPE ("H263"),
CHANNELS(0)
};
PayloadType payload_type_truespeech=
{
TYPE( PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(8000),
BITS_PER_SAMPLE( 0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH( 0),
NORMAL_BITRATE(8536),
MIME_TYPE ("TSP0"),
CHANNELS(0)
};
#ifdef __cplusplus
extern "C"
{
#endif
RtpProfile av_profile;
#ifdef __cplusplus
}
#endif
void av_profile_init(RtpProfile *profile)
{
rtp_profile_clear_all(profile);
profile->name="AV profile";
rtp_profile_set_payload(profile,0,&payload_type_pcmu8000);
rtp_profile_set_payload(profile,1,&payload_type_lpc1016);
rtp_profile_set_payload(profile,3,&payload_type_gsm);
rtp_profile_set_payload(profile,7,&payload_type_lpc);
rtp_profile_set_payload(profile,4,&payload_type_g7231);
rtp_profile_set_payload(profile,8,&payload_type_pcma8000);
rtp_profile_set_payload(profile,10,&payload_type_l16_stereo);
rtp_profile_set_payload(profile,11,&payload_type_l16_mono);
rtp_profile_set_payload(profile,18,&payload_type_g729);
rtp_profile_set_payload(profile,31,&payload_type_h261);
rtp_profile_set_payload(profile,32,&payload_type_mpv);
rtp_profile_set_payload(profile,34,&payload_type_h263);
}
/* these are extra payload types that can be used dynamically */
PayloadType payload_type_lpc1015={
TYPE( PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(8000),
BITS_PER_SAMPLE(0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH(0),
NORMAL_BITRATE(2400),
MIME_TYPE ("1015"),
CHANNELS(1)
};
PayloadType payload_type_speex_nb={
TYPE( PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(8000),
BITS_PER_SAMPLE(0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH(0),
NORMAL_BITRATE(8000), /*not true: 8000 is the minimum*/
MIME_TYPE ("speex"),
CHANNELS(1)
};
PayloadType payload_type_speex_wb={
TYPE( PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(16000),
BITS_PER_SAMPLE(0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH(0),
NORMAL_BITRATE(28000),
MIME_TYPE ("speex"),
CHANNELS(1)
};
PayloadType payload_type_speex_uwb={
TYPE( PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(32000),
BITS_PER_SAMPLE(0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH(0),
NORMAL_BITRATE(28000),
MIME_TYPE ("speex"),
CHANNELS(1)
};
PayloadType payload_type_ilbc={
TYPE( PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(8000),
BITS_PER_SAMPLE(0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH(0),
NORMAL_BITRATE(13300), /* the minimum, with 30ms frames */
MIME_TYPE ("iLBC"),
CHANNELS(1),
};
PayloadType payload_type_amr={
TYPE(PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(8000),
BITS_PER_SAMPLE(0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH(0),
NORMAL_BITRATE(0),
MIME_TYPE ("AMR"),
CHANNELS(1)
};
PayloadType payload_type_amrwb={
TYPE(PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(16000),
BITS_PER_SAMPLE(0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH(0),
NORMAL_BITRATE(0),
MIME_TYPE ("AMR-WB"),
CHANNELS(1)
};
PayloadType payload_type_mp4v={
TYPE( PAYLOAD_VIDEO),
CLOCK_RATE(90000),
BITS_PER_SAMPLE(0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH(0),
NORMAL_BITRATE(0),
MIME_TYPE ("MP4V-ES"),
CHANNELS(0)
};
PayloadType payload_type_evrc0={
TYPE(PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(8000),
BITS_PER_SAMPLE(0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH(0),
NORMAL_BITRATE(0),
MIME_TYPE ("EVRC0"),
CHANNELS(1)
};
PayloadType payload_type_evrcb0={
TYPE(PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(8000),
BITS_PER_SAMPLE(0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH(0),
NORMAL_BITRATE(0),
MIME_TYPE ("EVRCB0"),
CHANNELS(1)
};
PayloadType payload_type_h263_1998={
TYPE( PAYLOAD_VIDEO),
CLOCK_RATE(90000),
BITS_PER_SAMPLE(0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH(0),
NORMAL_BITRATE(256000),
MIME_TYPE ("H263-1998"),
CHANNELS(0)
};
PayloadType payload_type_h263_2000={
TYPE( PAYLOAD_VIDEO),
CLOCK_RATE(90000),
BITS_PER_SAMPLE(0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH(0),
NORMAL_BITRATE(0),
MIME_TYPE ("H263-2000"),
CHANNELS(0)
};
PayloadType payload_type_theora={
TYPE( PAYLOAD_VIDEO),
CLOCK_RATE(90000),
BITS_PER_SAMPLE(0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH(0),
NORMAL_BITRATE(256000),
MIME_TYPE ("theora"),
CHANNELS(0)
};
PayloadType payload_type_h264={
TYPE( PAYLOAD_VIDEO),
CLOCK_RATE(90000),
BITS_PER_SAMPLE(0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH(0),
NORMAL_BITRATE(256000),
MIME_TYPE ("H264"),
CHANNELS(0)
};
PayloadType payload_type_x_snow={
TYPE( PAYLOAD_VIDEO),
CLOCK_RATE(90000),
BITS_PER_SAMPLE(0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH(0),
NORMAL_BITRATE(256000),
MIME_TYPE ("x-snow"),
CHANNELS(0)
};
PayloadType payload_type_jpeg={
TYPE( PAYLOAD_VIDEO),
CLOCK_RATE(90000),
BITS_PER_SAMPLE(0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH(0),
NORMAL_BITRATE(256000),
MIME_TYPE ("JPEG"),
CHANNELS(0)
};
PayloadType payload_type_t140={
PAYLOAD_AUDIO_PACKETIZED, /*type */
1000,
0,
NULL,
0,
0,
"t140",
0,
0
};
PayloadType payload_type_x_udpftp={
PAYLOAD_AUDIO_PACKETIZED, /*type */
1000,
0,
NULL,
0,
0,
"x-udpftp",
0,
0
};

View file

@ -1,607 +0,0 @@
/* /////////////////////////////////////////////////////////////////////////////
* File: b64.c
*
* Purpose: Implementation file for the b64 library
*
* Created: 18th October 2004
* Updated: 3rd May 2008
*
* 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 b64.c Implementation file for the b64 library
*/
/* /////////////////////////////////////////////////////////////////////////////
* Version information
*/
#ifndef B64_DOCUMENTATION_SKIP_SECTION
# define B64_VER_C_B64_MAJOR 1
# define B64_VER_C_B64_MINOR 2
# define B64_VER_C_B64_REVISION 3
# define B64_VER_C_B64_EDIT 17
#endif /* !B64_DOCUMENTATION_SKIP_SECTION */
/* /////////////////////////////////////////////////////////////////////////////
* Includes
*/
#include "ortp/b64.h"
#include <assert.h>
#include <string.h>
#include "ortp/port.h"
/* /////////////////////////////////////////////////////////////////////////////
* Constants and definitions
*/
#ifndef B64_DOCUMENTATION_SKIP_SECTION
# define NUM_PLAIN_DATA_BYTES (3)
# define NUM_ENCODED_DATA_BYTES (4)
#endif /* !B64_DOCUMENTATION_SKIP_SECTION */
/* /////////////////////////////////////////////////////////////////////////////
* Macros
*/
#ifndef NUM_ELEMENTS
# define NUM_ELEMENTS(x) (sizeof(x) / sizeof(x[0]))
#endif /* !NUM_ELEMENTS */
/* /////////////////////////////////////////////////////////////////////////////
* Warnings
*/
#if defined(_MSC_VER) && \
_MSC_VER < 1000
# pragma warning(disable : 4705)
#endif /* _MSC_VER < 1000 */
/* /////////////////////////////////////////////////////////////////////////////
* Data
*/
static const char b64_chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
static const signed char b64_indexes[] =
{
/* 0 - 31 / 0x00 - 0x1f */
-1, -1, -1, -1, -1, -1, -1, -1
, -1, -1, -1, -1, -1, -1, -1, -1
, -1, -1, -1, -1, -1, -1, -1, -1
, -1, -1, -1, -1, -1, -1, -1, -1
/* 32 - 63 / 0x20 - 0x3f */
, -1, -1, -1, -1, -1, -1, -1, -1
, -1, -1, -1, 62, -1, -1, -1, 63 /* ... , '+', ... '/' */
, 52, 53, 54, 55, 56, 57, 58, 59 /* '0' - '7' */
, 60, 61, -1, -1, -1, -1, -1, -1 /* '8', '9', ... */
/* 64 - 95 / 0x40 - 0x5f */
, -1, 0, 1, 2, 3, 4, 5, 6 /* ..., 'A' - 'G' */
, 7, 8, 9, 10, 11, 12, 13, 14 /* 'H' - 'O' */
, 15, 16, 17, 18, 19, 20, 21, 22 /* 'P' - 'W' */
, 23, 24, 25, -1, -1, -1, -1, -1 /* 'X', 'Y', 'Z', ... */
/* 96 - 127 / 0x60 - 0x7f */
, -1, 26, 27, 28, 29, 30, 31, 32 /* ..., 'a' - 'g' */
, 33, 34, 35, 36, 37, 38, 39, 40 /* 'h' - 'o' */
, 41, 42, 43, 44, 45, 46, 47, 48 /* 'p' - 'w' */
, 49, 50, 51, -1, -1, -1, -1, -1 /* 'x', 'y', 'z', ... */
, -1, -1, -1, -1, -1, -1, -1, -1
, -1, -1, -1, -1, -1, -1, -1, -1
, -1, -1, -1, -1, -1, -1, -1, -1
, -1, -1, -1, -1, -1, -1, -1, -1
, -1, -1, -1, -1, -1, -1, -1, -1
, -1, -1, -1, -1, -1, -1, -1, -1
, -1, -1, -1, -1, -1, -1, -1, -1
, -1, -1, -1, -1, -1, -1, -1, -1
, -1, -1, -1, -1, -1, -1, -1, -1
, -1, -1, -1, -1, -1, -1, -1, -1
, -1, -1, -1, -1, -1, -1, -1, -1
, -1, -1, -1, -1, -1, -1, -1, -1
, -1, -1, -1, -1, -1, -1, -1, -1
, -1, -1, -1, -1, -1, -1, -1, -1
, -1, -1, -1, -1, -1, -1, -1, -1
, -1, -1, -1, -1, -1, -1, -1, -1
};
/* /////////////////////////////////////////////////////////////////////////////
* Helper functions
*/
/** This function reads in 3 bytes at a time, and translates them into 4
* characters.
*/
static size_t b64_encode_( unsigned char const *src
, size_t srcSize
, char *const dest
, size_t destLen
, unsigned lineLen
, B64_RC *rc)
{
size_t total = ((srcSize + (NUM_PLAIN_DATA_BYTES - 1)) / NUM_PLAIN_DATA_BYTES) * NUM_ENCODED_DATA_BYTES;
assert(NULL != rc);
*rc = B64_RC_OK;
if(lineLen > 0)
{
size_t numLines = (total + (lineLen - 1)) / lineLen;
total += 2 * (numLines - 1);
}
if(NULL == dest)
{
return total;
}
else if(destLen < total)
{
*rc = B64_RC_INSUFFICIENT_BUFFER;
return 0;
}
else
{
char *p = dest;
char *end = dest + destLen;
size_t len = 0;
for(; NUM_PLAIN_DATA_BYTES <= srcSize; srcSize -= NUM_PLAIN_DATA_BYTES)
{
char characters[NUM_ENCODED_DATA_BYTES];
/*
*
* | 0 | 1 | 2 |
*
* | | | |
* | | | | | | |
* | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | | | | | | | | |
*
* | 0 | 1 | 2 | 3 |
*
*/
/* characters[0] is the 6 left-most bits of src[0] */
characters[0] = (char)((src[0] & 0xfc) >> 2);
/* characters[0] is the right-most 2 bits of src[0] and the left-most 4 bits of src[1] */
characters[1] = (char)(((src[0] & 0x03) << 4) + ((src[1] & 0xf0) >> 4));
/* characters[0] is the right-most 4 bits of src[1] and the 2 left-most bits of src[2] */
characters[2] = (char)(((src[1] & 0x0f) << 2) + ((src[2] & 0xc0) >> 6));
/* characters[3] is the right-most 6 bits of src[2] */
characters[3] = (char)(src[2] & 0x3f);
#ifndef __WATCOMC__
assert(characters[0] >= 0 && characters[0] < 64);
assert(characters[1] >= 0 && characters[1] < 64);
assert(characters[2] >= 0 && characters[2] < 64);
assert(characters[3] >= 0 && characters[3] < 64);
#endif /* __WATCOMC__ */
src += NUM_PLAIN_DATA_BYTES;
*p++ = b64_chars[(unsigned char)characters[0]];
assert(NULL != strchr(b64_chars, *(p-1)));
++len;
assert(len != lineLen);
*p++ = b64_chars[(unsigned char)characters[1]];
assert(NULL != strchr(b64_chars, *(p-1)));
++len;
assert(len != lineLen);
*p++ = b64_chars[(unsigned char)characters[2]];
assert(NULL != strchr(b64_chars, *(p-1)));
++len;
assert(len != lineLen);
*p++ = b64_chars[(unsigned char)characters[3]];
assert(NULL != strchr(b64_chars, *(p-1)));
if( ++len == lineLen &&
p != end)
{
*p++ = '\r';
*p++ = '\n';
len = 0;
}
}
if(0 != srcSize)
{
/* Deal with the overspill, by boosting it up to three bytes (using 0s)
* and then appending '=' for any missing characters.
*
* This is done into a temporary buffer, so we can call ourselves and
* have the output continue to be written direct to the destination.
*/
unsigned char dummy[NUM_PLAIN_DATA_BYTES];
size_t i;
for(i = 0; i < srcSize; ++i)
{
dummy[i] = *src++;
}
for(; i < NUM_PLAIN_DATA_BYTES; ++i)
{
dummy[i] = '\0';
}
b64_encode_(&dummy[0], NUM_PLAIN_DATA_BYTES, p, NUM_ENCODED_DATA_BYTES * (1 + 2), 0, rc);
for(p += 1 + srcSize; srcSize++ < NUM_PLAIN_DATA_BYTES; )
{
*p++ = '=';
}
}
return total;
}
}
/** This function reads in a character string in 4-character chunks, and writes
* out the converted form in 3-byte chunks to the destination.
*/
static size_t b64_decode_( char const *src
, size_t srcLen
, unsigned char *dest
, size_t destSize
, unsigned flags
, char const **badChar
, B64_RC *rc)
{
const size_t wholeChunks = (srcLen / NUM_ENCODED_DATA_BYTES);
const size_t remainderBytes = (srcLen % NUM_ENCODED_DATA_BYTES);
size_t maxTotal = (wholeChunks + (0 != remainderBytes)) * NUM_PLAIN_DATA_BYTES;
unsigned char *dest_ = dest;
((void)remainderBytes);
assert(NULL != badChar);
assert(NULL != rc);
*badChar = NULL;
*rc = B64_RC_OK;
if(NULL == dest)
{
return maxTotal;
}
else if(destSize < maxTotal)
{
*rc = B64_RC_INSUFFICIENT_BUFFER;
return 0;
}
else
{
/* Now we iterate through the src, collecting together four characters
* at a time from the Base-64 alphabet, until the end-point is reached.
*
*
*/
char const *begin = src;
char const *const end = begin + srcLen;
size_t currIndex = 0;
size_t numPads = 0;
signed char indexes[NUM_ENCODED_DATA_BYTES]; /* 4 */
for(; begin != end; ++begin)
{
const char ch = *begin;
if('=' == ch)
{
assert(currIndex < NUM_ENCODED_DATA_BYTES);
indexes[currIndex++] = '\0';
++numPads;
}
else
{
/* NOTE: Had to rename 'index' to 'ix', due to name clash with GCC on 64-bit Linux. */
signed char ix = b64_indexes[(unsigned char)ch];
if(-1 == ix)
{
switch(ch)
{
case ' ':
case '\t':
case '\b':
case '\v':
if(B64_F_STOP_ON_UNEXPECTED_WS & flags)
{
*rc = B64_RC_DATA_ERROR;
*badChar = begin;
return 0;
}
else
{
/* Fall through */
}
case '\r':
case '\n':
continue;
default:
if(B64_F_STOP_ON_UNKNOWN_CHAR & flags)
{
*rc = B64_RC_DATA_ERROR;
*badChar = begin;
return 0;
}
else
{
continue;
}
}
}
else
{
numPads = 0;
assert(currIndex < NUM_ENCODED_DATA_BYTES);
indexes[currIndex++] = ix;
}
}
if(NUM_ENCODED_DATA_BYTES == currIndex)
{
unsigned char bytes[NUM_PLAIN_DATA_BYTES]; /* 3 */
bytes[0] = (unsigned char)((indexes[0] << 2) + ((indexes[1] & 0x30) >> 4));
currIndex = 0;
*dest++ = bytes[0];
if(2 != numPads)
{
bytes[1] = (unsigned char)(((indexes[1] & 0xf) << 4) + ((indexes[2] & 0x3c) >> 2));
*dest++ = bytes[1];
if(1 != numPads)
{
bytes[2] = (unsigned char)(((indexes[2] & 0x3) << 6) + indexes[3]);
*dest++ = bytes[2];
}
}
if(0 != numPads)
{
break;
}
}
}
return (size_t)(dest - dest_);
}
}
/* /////////////////////////////////////////////////////////////////////////////
* API functions
*/
size_t b64_encode(void const *src, size_t srcSize, char *dest, size_t destLen)
{
/* Use Null Object (Variable) here for rc, so do not need to check
* elsewhere.
*/
B64_RC rc_;
return b64_encode_((unsigned char const*)src, srcSize, dest, destLen, 0, &rc_);
}
size_t b64_encode2( void const *src
, size_t srcSize
, char *dest
, size_t destLen
, unsigned flags
, int lineLen /* = -1 */
, B64_RC *rc /* = NULL */)
{
/* Use Null Object (Variable) here for rc, so do not need to check
* elsewhere
*/
B64_RC rc_;
if(NULL == rc)
{
rc = &rc_;
}
switch(B64_F_LINE_LEN_MASK & flags)
{
case B64_F_LINE_LEN_USE_PARAM:
if(lineLen >= 0)
{
break;
}
/* Fall through to 64 */
case B64_F_LINE_LEN_64:
lineLen = 64;
break;
case B64_F_LINE_LEN_76:
lineLen = 76;
break;
default:
/*the following assert makes a compiler error with icc*/
/*assert(!"Bad line length flag specified to b64_encode2()");*/
case B64_F_LINE_LEN_INFINITE:
lineLen = 0;
break;
}
assert(0 == (lineLen % 4));
return b64_encode_((unsigned char const*)src, srcSize, dest, destLen, (unsigned)lineLen, rc);
}
size_t b64_decode(char const *src, size_t srcLen, void *dest, size_t destSize)
{
/* Use Null Object (Variable) here for rc and badChar, so do not need to
* check elsewhere.
*/
char const *badChar_;
B64_RC rc_;
return b64_decode_(src, srcLen, (unsigned char*)dest, destSize, B64_F_STOP_ON_NOTHING, &badChar_, &rc_);
}
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 */)
{
char const *badChar_;
B64_RC rc_;
/* Use Null Object (Variable) here for rc and badChar, so do not need to
* check elsewhere.
*/
if(NULL == badChar)
{
badChar = &badChar_;
}
if(NULL == rc)
{
rc = &rc_;
}
return b64_decode_(src, srcLen, (unsigned char*)dest, destSize, flags, badChar, rc);
}
/* ////////////////////////////////////////////////////////////////////////// */
#ifdef B64_DOCUMENTATION_SKIP_SECTION
struct b64ErrorString_t_
#else /* !B64_DOCUMENTATION_SKIP_SECTION */
typedef struct b64ErrorString_t_ b64ErrorString_t_;
struct b64ErrorString_t_
#endif /* !B64_DOCUMENTATION_SKIP_SECTION */
{
int code; /*!< The error code. */
char const *str; /*!< The string. */
size_t len; /*!< The string length. */
};
#define SEVERITY_STR_DECL(rc, desc) \
\
static const char s_str##rc[] = desc; \
static const b64ErrorString_t_ s_rct##rc = { rc, s_str##rc, NUM_ELEMENTS(s_str##rc) - 1 }
#define SEVERITY_STR_ENTRY(rc) \
\
&s_rct##rc
static char const *b64_LookupCodeA_(int code, b64ErrorString_t_ const **mappings, size_t cMappings, size_t *len)
{
/* Use Null Object (Variable) here for len, so do not need to check
* elsewhere.
*/
size_t len_;
if(NULL == len)
{
len = &len_;
}
/* Checked, indexed search. */
if( code >= 0 &&
code < B64_max_RC_value)
{
if(code == mappings[code]->code)
{
return (*len = mappings[code]->len, mappings[code]->str);
}
}
/* Linear search. Should only be needed if order in
* b64_LookupErrorStringA_() messed up.
*/
{ size_t i; for(i = 0; i < cMappings; ++i)
{
if(code == mappings[i]->code)
{
return (*len = mappings[i]->len, mappings[i]->str);
}
}}
return (*len = 0, "");
}
static char const *b64_LookupErrorStringA_(int error, size_t *len)
{
SEVERITY_STR_DECL(B64_RC_OK , "Operation was successful" );
SEVERITY_STR_DECL(B64_RC_INSUFFICIENT_BUFFER , "The given translation buffer was not of sufficient size" );
SEVERITY_STR_DECL(B64_RC_TRUNCATED_INPUT , "The input did not represent a fully formed stream of octet couplings" );
SEVERITY_STR_DECL(B64_RC_DATA_ERROR , "Invalid data" );
static const b64ErrorString_t_ *s_strings[] =
{
SEVERITY_STR_ENTRY(B64_RC_OK),
SEVERITY_STR_ENTRY(B64_RC_INSUFFICIENT_BUFFER),
SEVERITY_STR_ENTRY(B64_RC_TRUNCATED_INPUT),
SEVERITY_STR_ENTRY(B64_RC_DATA_ERROR),
};
return b64_LookupCodeA_(error, s_strings, NUM_ELEMENTS(s_strings), len);
}
char const *b64_getErrorString(B64_RC code)
{
return b64_LookupErrorStringA_((int)code, NULL);
}
size_t b64_getErrorStringLength(B64_RC code)
{
size_t len;
return (b64_LookupErrorStringA_((int)code, &len), len);
}
/* ////////////////////////////////////////////////////////////////////////// */

View file

@ -1,147 +0,0 @@
#ifdef WIN32
#include "ortp-config-win32.h"
#else
#include "ortp-config.h"
#endif
#include "ortp/ortp.h"
typedef struct __STRUCT_SHARED_DATA__
{
DWORD m_nReference;
DWORD m_dwStartTime;
BOOL m_bInitialize;
} SHARED_DATA, * LPSHARED_DATA;
#ifdef EXTERNAL_LOGGER
#include "logger.h"
#else
#define RegisterLog(logVar, logString);
#define UnregisterLog(logVar, logString);
#endif
extern DWORD dwoRTPLogLevel;
#define SHMEMSIZE sizeof(SHARED_DATA)
static LPSHARED_DATA lpSharedData;
static HANDLE hMapObject = NULL; // handle to file mapping
BOOL WINAPI DllMain(
HINSTANCE hinstDLL, // handle to DLL module
DWORD fdwReason, // reason for calling function
LPVOID lpReserved // reserved
)
{
BOOL fInit = FALSE;
WORD wVersionRequested;
WSADATA wsaData;
// Perform actions based on the reason for calling.
switch( fdwReason )
{
case DLL_PROCESS_ATTACH:
OutputDebugString("--> dll_entry.c - oRTP.dll - DLL_PROCESS_ATTACH()\n");
wVersionRequested = MAKEWORD( 1, 0 );
if (WSAStartup(wVersionRequested,&wsaData)!=0)
{
return FALSE;
}
// Create a named file mapping object.
hMapObject = CreateFileMapping( INVALID_HANDLE_VALUE, // use paging file
NULL, // default security attributes
PAGE_READWRITE, // read/write access
0, // size: high 32-bits
SHMEMSIZE, // size: low 32-bits
"oRTPSharedMemory"); // name of map object
if (hMapObject == NULL)
return FALSE;
// The first process to attach initializes memory.
fInit = (GetLastError() != ERROR_ALREADY_EXISTS);
// Get a pointer to the file-mapped shared memory.
lpSharedData = (LPSHARED_DATA) MapViewOfFile( hMapObject, // object to map view of
FILE_MAP_WRITE, // read/write access
0, // high offset: map from
0, // low offset: beginning
0); // default: map entire file
if (lpSharedData == NULL)
return FALSE;
// Initialize memory if this is the first process.
if (fInit)
{
OutputDebugString("--> dll_entry.c - oRTP.dll - Initializing module\n");
lpSharedData->m_dwStartTime = GetTickCount();
lpSharedData->m_nReference = 1;
lpSharedData->m_bInitialize = FALSE;
// Register the log
RegisterLog(&dwoRTPLogLevel, "LOG_ORTP");
}
else
{
OutputDebugString("--> dll_entry.c - oRTP.dll - Binding\n");
lpSharedData->m_nReference++;
}
break;
case DLL_THREAD_ATTACH:
if (lpSharedData != NULL)
{
if (lpSharedData->m_bInitialize == FALSE)
{
// Initialize oRTP
ortp_init();
// Start the scheduler
//ortp_scheduler_init();
lpSharedData->m_bInitialize = TRUE;
}
}
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
if (lpSharedData != NULL)
{
OutputDebugString("--> dll_entry.c - oRTP.dll - Binding\n");
lpSharedData->m_nReference--;
if (lpSharedData->m_nReference == 0)
{
OutputDebugString("--> dll_entry.c - oRTP.dll - Detaching\n");
ortp_exit();
UnregisterLog(&dwoRTPLogLevel, "LOG_ORTP");
// Unmap shared memory from the process's address space.
UnmapViewOfFile(lpSharedData);
lpSharedData = NULL;
// Close the process's handle to the file-mapping object.
CloseHandle(hMapObject);
hMapObject = INVALID_HANDLE_VALUE;
}
}
break;
}
return TRUE; // Successful DLL_PROCESS_ATTACH.
}

View file

@ -1,116 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "ortp/event.h"
#include "ortp/ortp.h"
RtpEndpoint *rtp_endpoint_new(struct sockaddr *addr, socklen_t addrlen){
RtpEndpoint *ep=ortp_new(RtpEndpoint,1);
if (sizeof(ep->addr)<addrlen){
ortp_free(ep);
ortp_fatal("Bad socklen_t size !");
return NULL;
}
memcpy(&ep->addr,addr,addrlen);
ep->addrlen=addrlen;
return ep;
}
void rtp_endpoint_destroy(RtpEndpoint *ep){
ortp_free(ep);
}
RtpEndpoint *rtp_endpoint_dup(const RtpEndpoint *ep){
return rtp_endpoint_new((struct sockaddr*)&ep->addr,ep->addrlen);
}
OrtpEvent * ortp_event_new(unsigned long type){
const int size=sizeof(OrtpEventType)+sizeof(OrtpEventData);
mblk_t *m=allocb(size,0);
memset(m->b_wptr,0,size);
*((OrtpEventType*)m->b_wptr)=type;
return m;
}
OrtpEvent *ortp_event_dup(OrtpEvent *ev){
#if 0
OrtpEvent *nev=dupb(ev);
#else
OrtpEvent *nev = ortp_event_new(ortp_event_get_type(ev));
OrtpEventData * ed = ortp_event_get_data(ev);
OrtpEventData * edv = ortp_event_get_data(nev);
if (ed->ep) edv->ep = rtp_endpoint_dup(ed->ep);
if (ed->packet) edv->packet = copymsg(ed->packet);
edv->info.telephone_event = ed->info.telephone_event;
#endif
return nev;
}
OrtpEventType ortp_event_get_type(const OrtpEvent *ev){
return ((OrtpEventType*)ev->b_rptr)[0];
}
OrtpEventData * ortp_event_get_data(OrtpEvent *ev){
return (OrtpEventData*)(ev->b_rptr+sizeof(OrtpEventType));
}
void ortp_event_destroy(OrtpEvent *ev){
OrtpEventData *d=ortp_event_get_data(ev);
if (ev->b_datap->db_ref==1){
if (d->packet) freemsg(d->packet);
if (d->ep) rtp_endpoint_destroy(d->ep);
}
freemsg(ev);
}
OrtpEvQueue * ortp_ev_queue_new(){
OrtpEvQueue *q=ortp_new(OrtpEvQueue,1);
qinit(&q->q);
ortp_mutex_init(&q->mutex,NULL);
return q;
}
void ortp_ev_queue_flush(OrtpEvQueue * qp){
OrtpEvent *ev;
while((ev=ortp_ev_queue_get(qp))!=NULL){
ortp_event_destroy(ev);
}
}
OrtpEvent * ortp_ev_queue_get(OrtpEvQueue *q){
OrtpEvent *ev;
ortp_mutex_lock(&q->mutex);
ev=getq(&q->q);
ortp_mutex_unlock(&q->mutex);
return ev;
}
void ortp_ev_queue_destroy(OrtpEvQueue * qp){
ortp_ev_queue_flush(qp);
ortp_mutex_destroy(&qp->mutex);
ortp_free(qp);
}
void ortp_ev_queue_put(OrtpEvQueue *q, OrtpEvent *ev){
ortp_mutex_lock(&q->mutex);
putq(&q->q,ev);
ortp_mutex_unlock(&q->mutex);
}

View file

@ -1,182 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/***************************************************************************
* jitterctl.c
*
* Mon Nov 8 11:53:21 2004
* Copyright 2004 Simon MORLAT
* Email simon.morlat@linphone.org
****************************************************************************/
#include "ortp/rtpsession.h"
#include "ortp/payloadtype.h"
#include "ortp/ortp.h"
#include "utils.h"
#include "rtpsession_priv.h"
#include <math.h>
#define JC_BETA 0.01
#define JC_GAMMA (JC_BETA)
#include "jitterctl.h"
void jitter_control_init(JitterControl *ctl, int base_jiitt_time, PayloadType *payload){
ctl->count=0;
ctl->slide=0;
ctl->prev_slide=0;
ctl->jitter=0;
ctl->inter_jitter=0;
ctl->slide=0;
if (base_jiitt_time!=-1) ctl->jitt_comp = base_jiitt_time;
/* convert in timestamp unit: */
if (payload!=NULL){
jitter_control_set_payload(ctl,payload);
}
ctl->adapt_jitt_comp_ts=ctl->jitt_comp_ts;
ctl->corrective_slide=0;
}
void jitter_control_enable_adaptive(JitterControl *ctl, bool_t val){
ctl->adaptive=val;
}
void jitter_control_set_payload(JitterControl *ctl, PayloadType *pt){
ctl->jitt_comp_ts =
(int) (((double) ctl->jitt_comp / 1000.0) * (pt->clock_rate));
ctl->corrective_step=(160 * 8000 )/pt->clock_rate; /* This formula got to me after some beers */
ctl->adapt_jitt_comp_ts=ctl->jitt_comp_ts;
}
void jitter_control_dump_stats(JitterControl *ctl){
ortp_message("JitterControl:\n\tslide=%g,jitter=%g,count=%i",
(double)ctl->slide,ctl->jitter, ctl->count);
}
/*the goal of this method is to compute "corrective_slide": a timestamp unit'd value to be added
to recv timestamp to make them reflect the instant they are delivered by the jitter buffer. */
void jitter_control_update_corrective_slide(JitterControl *ctl){
int tmp;
tmp=(int)(ctl->slide)-ctl->prev_slide;
if (tmp>ctl->corrective_step) {
ctl->corrective_slide+=ctl->corrective_step;
ctl->prev_slide=ctl->slide+ctl->corrective_step;
}
else if (tmp<-ctl->corrective_step) {
ctl->corrective_slide-=ctl->corrective_step;
ctl->prev_slide=ctl->slide-ctl->corrective_step;
}
}
/*
The algorithm computes two values:
slide: an average of difference between the expected and the socket-received timestamp
jitter: an average of the absolute value of the difference between socket-received timestamp and slide.
slide is used to make clock-slide detection and correction.
jitter is added to the initial jitt_comp_time value. It compensates bursty packets arrival (packets
not arriving at regular interval ).
*/
void jitter_control_new_packet(JitterControl *ctl, uint32_t packet_ts, uint32_t cur_str_ts){
int64_t diff=(int64_t)packet_ts - (int64_t)cur_str_ts;
double gap,slide;
int d;
//printf("diff=%g\n",diff);
if (ctl->count==0){
slide=ctl->slide=ctl->prev_slide=diff;
ctl->olddiff=diff;
ctl->jitter=0;
}else{
slide=((double)ctl->slide*(1-JC_BETA)) + ((double)diff*JC_BETA);
}
gap=(double)diff - slide;
gap=gap<0 ? -gap : 0; /*compute only for late packets*/
ctl->jitter=(float) ((ctl->jitter*(1-JC_GAMMA)) + (gap*JC_GAMMA));
d=diff-ctl->olddiff;
ctl->inter_jitter=(float) (ctl->inter_jitter+ (( (float)abs(d) - ctl->inter_jitter)*(1/16.0)));
ctl->olddiff=diff;
ctl->count++;
if (ctl->adaptive){
if (ctl->count%50==0) {
ctl->adapt_jitt_comp_ts=(int) MAX(ctl->jitt_comp_ts,2*ctl->jitter);
/*jitter_control_dump_stats(ctl);*/
}
ctl->slide=slide;
}else {
/*ctl->slide and jitter size are not updated*/
}
return ;
}
/**
*rtp_session_set_jitter_compensation:
*@session: a RtpSession
*@milisec: the time interval in milisec to be jitter compensed.
*
* Sets the time interval for which packet are buffered instead of being delivered to the
* application.
**/
void
rtp_session_set_jitter_compensation (RtpSession * session, int milisec)
{
PayloadType *payload=NULL;
if (session->rcv.pt!=-1) {
payload = rtp_profile_get_payload (session->rcv.profile,session->rcv.pt);
}/*else not set yet */
jitter_control_init(&session->rtp.jittctl,milisec,payload);
}
void rtp_session_enable_adaptive_jitter_compensation(RtpSession *session, bool_t val){
jitter_control_enable_adaptive(&session->rtp.jittctl,val);
}
bool_t rtp_session_adaptive_jitter_compensation_enabled(RtpSession *session){
return session->rtp.jittctl.adaptive;
}
void rtp_session_enable_jitter_buffer(RtpSession *session, bool_t enabled){
session->rtp.jittctl.enabled=enabled;
session->flags|=RTP_SESSION_RECV_SYNC;
}
bool_t rtp_session_jitter_buffer_enabled(const RtpSession *session){
return session->rtp.jittctl.enabled;
}
void rtp_session_set_jitter_buffer_params(RtpSession *session, const JBParameters *par){
/* FIXME min_size and max_size to be implemented */
rtp_session_set_jitter_compensation(session,par->nom_size);
jitter_control_enable_adaptive(&session->rtp.jittctl,par->adaptive);
session->rtp.max_rq_size=par->max_packets;
}
void rtp_session_get_jitter_buffer_params(RtpSession *session, JBParameters *par){
int nom_size=session->rtp.jittctl.jitt_comp;
par->min_size=nom_size;
par->nom_size=nom_size;
par->max_size=-1;
par->adaptive=session->rtp.jittctl.adaptive;
par->max_packets=session->rtp.max_rq_size;
}

View file

@ -1,41 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/***************************************************************************
* jitterctl.c
*
* Mon Nov 8 11:53:21 2004
* Copyright 2004 Simon MORLAT
* Email simon.morlat@linphone.org
****************************************************************************/
#ifndef JITTERCTL_H
#define JITTERCTL_H
void jitter_control_init(JitterControl *ctl, int base_jiitt_time, PayloadType *pt);
void jitter_control_enable_adaptive(JitterControl *ctl, bool_t val);
void jitter_control_new_packet(JitterControl *ctl, uint32_t packet_ts, uint32_t cur_str_ts);
#define jitter_control_adaptive_enabled(ctl) ((ctl)->adaptive)
void jitter_control_set_payload(JitterControl *ctl, PayloadType *pt);
void jitter_control_update_corrective_slide(JitterControl *ctl);
static inline uint32_t jitter_control_get_compensated_timestamp(JitterControl *obj , uint32_t user_ts){
return user_ts+obj->slide-obj->adapt_jitt_comp_ts;
}
#endif

View file

@ -1,33 +0,0 @@
*############################################################
*#
*# $Header: /sources/linphone/linphone/oRTP/src/master,v 1.1 2002/02/25 08:41:53 smorlat Exp $
*#
*# $Source: /sources/linphone/linphone/oRTP/src/master,v $
*# $Revision: 1.1 $
*# $Locker: $
*#
*############################################################
$VERSION
1
$$$
$DRIVER_INSTALL
oRTP -1 -1
$$$
$LOADABLE
$$$
$INTERFACE
base
$$$
$DRIVER_DEPENDENCY
$$$
$TYPE
oRTP wsio_class pseudo pmi -1 -1
$$$
$TUNABLE
$$$

View file

@ -1,34 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc1889) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ortp-config-win32.h. Generated manually... */
#define ORTP_VERSION "0.8.2"
#define ORTP_MAJOR_VERSION 0
#define ORTP_MINOR_VERSION 8
#define ORTP_MICRO_VERSION 2
#define ORTP_EXTRA_VERSION
/* define the debug mode */
#define RTP_DEBUG 1
#define HAVE_SRTP 1
/* enables SO_REUSEADDR socket option in the rtp_session_set_local_addr() function */
#define SO_REUSE_ADDR 1

View file

@ -1,379 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#if defined(WIN32) || defined(_WIN32_WCE)
#include "ortp-config-win32.h"
#else
#include "ortp-config.h"
#endif
#include "ortp/ortp.h"
#include "scheduler.h"
rtp_stats_t ortp_global_stats;
#ifdef ENABLE_MEMCHECK
int ortp_allocations=0;
#endif
RtpScheduler *__ortp_scheduler;
extern void av_profile_init(RtpProfile *profile);
static void init_random_number_generator(){
struct timeval t;
gettimeofday(&t,NULL);
srandom(t.tv_usec+t.tv_sec);
}
#ifdef WIN32
static bool_t win32_init_sockets(void){
WORD wVersionRequested;
WSADATA wsaData;
int i;
wVersionRequested = MAKEWORD(2,0);
if( (i = WSAStartup(wVersionRequested, &wsaData))!=0)
{
ortp_error("Unable to initialize windows socket api, reason: %d (%s)",i,getWinSocketError(i));
return FALSE;
}
return TRUE;
}
#endif
/**
* Initialize the oRTP library. You should call this function first before using
* oRTP API.
**/
void ortp_init()
{
static bool_t initialized=FALSE;
if (initialized) return;
initialized=TRUE;
#ifdef WIN32
win32_init_sockets();
#endif
av_profile_init(&av_profile);
ortp_global_stats_reset();
init_random_number_generator();
ortp_message("oRTP-" ORTP_VERSION " initialized.");
}
/**
* Initialize the oRTP scheduler. You only have to do that if you intend to use the
* scheduled mode of the #RtpSession in your application.
*
**/
void ortp_scheduler_init()
{
static bool_t initialized=FALSE;
if (initialized) return;
initialized=TRUE;
#ifdef __hpux
/* on hpux, we must block sigalrm on the main process, because signal delivery
is ?random?, well, sometimes the SIGALRM goes to both the main thread and the
scheduler thread */
sigset_t set;
sigemptyset(&set);
sigaddset(&set,SIGALRM);
sigprocmask(SIG_BLOCK,&set,NULL);
#endif /* __hpux */
__ortp_scheduler=rtp_scheduler_new();
rtp_scheduler_start(__ortp_scheduler);
//sleep(1);
}
/**
* Gracefully uninitialize the library, including shutdowning the scheduler if it was started.
*
**/
void ortp_exit()
{
if (__ortp_scheduler!=NULL)
{
rtp_scheduler_destroy(__ortp_scheduler);
__ortp_scheduler=NULL;
}
}
RtpScheduler * ortp_get_scheduler()
{
if (__ortp_scheduler==NULL) ortp_error("Cannot use the scheduled mode: the scheduler is not "
"started. Call ortp_scheduler_init() at the begginning of the application.");
return __ortp_scheduler;
}
static FILE *__log_file=0;
/**
*@param file a FILE pointer where to output the ortp logs.
*
**/
void ortp_set_log_file(FILE *file)
{
__log_file=file;
}
static void __ortp_logv_out(OrtpLogLevel lev, const char *fmt, va_list args);
OrtpLogFunc ortp_logv_out=__ortp_logv_out;
/**
*@param func: your logging function, compatible with the OrtpLogFunc prototype.
*
**/
void ortp_set_log_handler(OrtpLogFunc func){
ortp_logv_out=func;
}
unsigned int __ortp_log_mask=ORTP_WARNING|ORTP_ERROR|ORTP_FATAL;
/**
* @ param levelmask a mask of ORTP_DEBUG, ORTP_MESSAGE, ORTP_WARNING, ORTP_ERROR
* ORTP_FATAL .
**/
void ortp_set_log_level_mask(int levelmask){
__ortp_log_mask=levelmask;
}
char * ortp_strdup_vprintf(const char *fmt, va_list ap)
{
/* Guess we need no more than 100 bytes. */
int n, size = 200;
char *p,*np;
#ifdef __linux
va_list cap;/*copy of our argument list: a va_list cannot be re-used (SIGSEGV on linux 64 bits)*/
#endif
if ((p = (char *) ortp_malloc (size)) == NULL)
return NULL;
while (1)
{
/* Try to print in the allocated space. */
#ifdef __linux
va_copy(cap,ap);
n = vsnprintf (p, size, fmt, cap);
va_end(cap);
#else
/*this works on 32 bits, luckily*/
n = vsnprintf (p, size, fmt, ap);
#endif
/* If that worked, return the string. */
if (n > -1 && n < size)
return p;
//printf("Reallocing space.\n");
/* Else try again with more space. */
if (n > -1) /* glibc 2.1 */
size = n + 1; /* precisely what is needed */
else /* glibc 2.0 */
size *= 2; /* twice the old size */
if ((np = (char *) ortp_realloc (p, size)) == NULL)
{
free(p);
return NULL;
}
else
{
p = np;
}
}
}
char *ortp_strdup_printf(const char *fmt,...){
char *ret;
va_list args;
va_start (args, fmt);
ret=ortp_strdup_vprintf(fmt, args);
va_end (args);
return ret;
}
#if defined(WIN32) || defined(_WIN32_WCE)
#define ENDLINE "\r\n"
#else
#define ENDLINE "\n"
#endif
#if defined(WIN32) || defined(_WIN32_WCE)
void ortp_logv(int level, const char *fmt, va_list args)
{
if (ortp_logv_out!=NULL && ortp_log_level_enabled(level))
ortp_logv_out(level,fmt,args);
#if !defined(_WIN32_WCE)
if ((level)==ORTP_FATAL) abort();
#endif
}
#endif
static void __ortp_logv_out(OrtpLogLevel lev, const char *fmt, va_list args){
const char *lname="undef";
char *msg;
if (__log_file==NULL) __log_file=stderr;
switch(lev){
case ORTP_DEBUG:
lname="debug";
break;
case ORTP_MESSAGE:
lname="message";
break;
case ORTP_WARNING:
lname="warning";
break;
case ORTP_ERROR:
lname="error";
break;
case ORTP_FATAL:
lname="fatal";
break;
default:
ortp_fatal("Bad level !");
}
msg=ortp_strdup_vprintf(fmt,args);
#if defined(_MSC_VER) && !defined(_WIN32_WCE)
OutputDebugString(msg);
OutputDebugString("\r\n");
#else
fprintf(__log_file,"ortp-%s-%s" ENDLINE,lname,msg);
fflush(__log_file);
#endif
ortp_free(msg);
}
/**
* Display global statistics (cumulative for all RtpSession)
**/
void ortp_global_stats_display()
{
rtp_stats_display(&ortp_global_stats,"Global statistics");
#ifdef ENABLE_MEMCHECK
printf("Unfreed allocations: %i\n",ortp_allocations);
#endif
}
/**
* Print RTP statistics.
**/
void rtp_stats_display(const rtp_stats_t *stats, const char *header)
{
#ifndef WIN32
ortp_log(ORTP_MESSAGE,
"oRTP-stats:\n %s :",
header);
ortp_log(ORTP_MESSAGE,
" number of rtp packet sent=%lld",
(long long)stats->packet_sent);
ortp_log(ORTP_MESSAGE,
" number of rtp bytes sent=%lld bytes",
(long long)stats->sent);
ortp_log(ORTP_MESSAGE,
" number of rtp packet received=%lld",
(long long)stats->packet_recv);
ortp_log(ORTP_MESSAGE,
" number of rtp bytes received=%lld bytes",
(long long)stats->hw_recv);
ortp_log(ORTP_MESSAGE,
" number of incoming rtp bytes successfully delivered to the application=%lld ",
(long long)stats->recv);
ortp_log(ORTP_MESSAGE,
" number of times the application queried a packet that didn't exist=%lld ",
(long long)stats->unavaillable);
ortp_log(ORTP_MESSAGE,
" number of rtp packet lost=%lld",
(long long) stats->cum_packet_loss);
ortp_log(ORTP_MESSAGE,
" number of rtp packets received too late=%lld",
(long long)stats->outoftime);
ortp_log(ORTP_MESSAGE,
" number of bad formatted rtp packets=%lld",
(long long)stats->bad);
ortp_log(ORTP_MESSAGE,
" number of packet discarded because of queue overflow=%lld",
(long long)stats->discarded);
#else
ortp_log(ORTP_MESSAGE,
"oRTP-stats:\n %s :",
header);
ortp_log(ORTP_MESSAGE,
" number of rtp packet sent=%I64d",
(uint64_t)stats->packet_sent);
ortp_log(ORTP_MESSAGE,
" number of rtp bytes sent=%I64d bytes",
(uint64_t)stats->sent);
ortp_log(ORTP_MESSAGE,
" number of rtp packet received=%I64d",
(uint64_t)stats->packet_recv);
ortp_log(ORTP_MESSAGE,
" number of rtp bytes received=%I64d bytes",
(uint64_t)stats->hw_recv);
ortp_log(ORTP_MESSAGE,
" number of incoming rtp bytes successfully delivered to the application=%I64d ",
(uint64_t)stats->recv);
ortp_log(ORTP_MESSAGE,
" number of times the application queried a packet that didn't exist=%I64d ",
(uint64_t)stats->unavaillable);
ortp_log(ORTP_MESSAGE,
" number of rtp packet lost=%I64d",
(uint64_t) stats->cum_packet_loss);
ortp_log(ORTP_MESSAGE,
" number of rtp packets received too late=%I64d",
(uint64_t)stats->outoftime);
ortp_log(ORTP_MESSAGE,
" number of bad formatted rtp packets=%I64d",
(uint64_t)stats->bad);
ortp_log(ORTP_MESSAGE,
" number of packet discarded because of queue overflow=%I64d",
(uint64_t)stats->discarded);
#endif
}
void ortp_global_stats_reset(){
memset(&ortp_global_stats,0,sizeof(rtp_stats_t));
}
rtp_stats_t *ortp_get_global_stats(){
return &ortp_global_stats;
}
void rtp_stats_reset(rtp_stats_t *stats){
memset((void*)stats,0,sizeof(rtp_stats_t));
}
/**
* This function give the opportunity to programs to check if the libortp they link to
* has the minimum version number they need.
*
* Returns: true if ortp has a version number greater or equal than the required one.
**/
bool_t ortp_min_version_required(int major, int minor, int micro){
return ((major*1000000) + (minor*1000) + micro) <=
((ORTP_MAJOR_VERSION*1000000) + (ORTP_MINOR_VERSION*1000) + ORTP_MICRO_VERSION);
}

View file

@ -1,363 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "ortp/ortp.h"
#include "ortp/payloadtype.h"
#include "utils.h"
char *payload_type_get_rtpmap(PayloadType *pt)
{
int len=(int)strlen(pt->mime_type)+15;
char *rtpmap=(char *) ortp_malloc(len);
if (pt->channels>0)
snprintf(rtpmap,len,"%s/%i/%i",pt->mime_type,pt->clock_rate,pt->channels);
else
snprintf(rtpmap,len,"%s/%i",pt->mime_type,pt->clock_rate);
return rtpmap;
}
PayloadType *payload_type_new()
{
PayloadType *newpayload=(PayloadType *)ortp_new0(PayloadType,1);
newpayload->flags|=PAYLOAD_TYPE_ALLOCATED;
return newpayload;
}
PayloadType *payload_type_clone(PayloadType *payload)
{
PayloadType *newpayload=(PayloadType *)ortp_new0(PayloadType,1);
memcpy(newpayload,payload,sizeof(PayloadType));
newpayload->mime_type=ortp_strdup(payload->mime_type);
if (payload->recv_fmtp!=NULL) {
newpayload->recv_fmtp=ortp_strdup(payload->recv_fmtp);
}
if (payload->send_fmtp!=NULL){
newpayload->send_fmtp=ortp_strdup(payload->send_fmtp);
}
newpayload->flags|=PAYLOAD_TYPE_ALLOCATED;
return newpayload;
}
static bool_t canWrite(PayloadType *pt){
if (!(pt->flags & PAYLOAD_TYPE_ALLOCATED)) {
ortp_error("Cannot change parameters of statically defined payload types: make your"
" own copy using payload_type_clone() first.");
return FALSE;
}
return TRUE;
}
/**
* Sets a recv parameters (fmtp) for the PayloadType.
* This method is provided for applications using RTP with SDP, but
* actually the ftmp information is not used for RTP processing.
**/
void payload_type_set_recv_fmtp(PayloadType *pt, const char *fmtp){
if (canWrite(pt)){
if (pt->recv_fmtp!=NULL) ortp_free(pt->recv_fmtp);
if (fmtp!=NULL) pt->recv_fmtp=ortp_strdup(fmtp);
else pt->recv_fmtp=NULL;
}
}
/**
* Sets a send parameters (fmtp) for the PayloadType.
* This method is provided for applications using RTP with SDP, but
* actually the ftmp information is not used for RTP processing.
**/
void payload_type_set_send_fmtp(PayloadType *pt, const char *fmtp){
if (canWrite(pt)){
if (pt->send_fmtp!=NULL) ortp_free(pt->send_fmtp);
if (fmtp!=NULL) pt->send_fmtp=ortp_strdup(fmtp);
else pt->send_fmtp=NULL;
}
}
void payload_type_append_recv_fmtp(PayloadType *pt, const char *fmtp){
if (canWrite(pt)){
if (pt->recv_fmtp==NULL)
pt->recv_fmtp=ortp_strdup(fmtp);
else{
char *tmp=ortp_strdup_printf("%s;%s",pt->recv_fmtp,fmtp);
ortp_free(pt->recv_fmtp);
pt->recv_fmtp=tmp;
}
}
}
void payload_type_append_send_fmtp(PayloadType *pt, const char *fmtp){
if (canWrite(pt)){
if (pt->send_fmtp==NULL)
pt->send_fmtp=ortp_strdup(fmtp);
else{
char *tmp=ortp_strdup_printf("%s;%s",pt->send_fmtp,fmtp);
ortp_free(pt->send_fmtp);
pt->send_fmtp=tmp;
}
}
}
/**
* Frees a PayloadType.
**/
void payload_type_destroy(PayloadType *pt)
{
if (pt->mime_type) ortp_free(pt->mime_type);
if (pt->recv_fmtp) ortp_free(pt->recv_fmtp);
if (pt->send_fmtp) ortp_free(pt->send_fmtp);
ortp_free(pt);
}
/**
* Parses a fmtp string such as "profile=0;level=10", finds the value matching
* parameter param_name, and writes it into result.
* Despite fmtp strings are not used anywhere within oRTP, this function can
* be useful for people using RTP streams described from SDP.
* @param fmtp the fmtp line (format parameters)
* @param param_name the parameter to search for
* @param result the value given for the parameter (if found)
* @param result_len the size allocated to hold the result string
* @return TRUE if the parameter was found, else FALSE.
**/
bool_t fmtp_get_value(const char *fmtp, const char *param_name, char *result, size_t result_len){
const char *pos=strstr(fmtp,param_name);
memset(result, '\0', result_len);
if (pos){
const char *equal=strchr(pos,'=');
if (equal){
int copied;
const char *end=strchr(equal+1,';');
if (end==NULL) end=fmtp+strlen(fmtp); /*assuming this is the last param */
copied=MIN(result_len-1,end-(equal+1));
strncpy(result,equal+1,copied);
result[copied]='\0';
return TRUE;
}
}
return FALSE;
}
int rtp_profile_get_payload_number_from_mime(RtpProfile *profile,const char *mime)
{
PayloadType *pt;
int i;
for (i=0;i<RTP_PROFILE_MAX_PAYLOADS;i++)
{
pt=rtp_profile_get_payload(profile,i);
if (pt!=NULL)
{
if (strcasecmp(pt->mime_type,mime)==0){
return i;
}
}
}
return -1;
}
int rtp_profile_find_payload_number(RtpProfile*profile,const char *mime,int rate,int channels)
{
int i;
PayloadType *pt;
for (i=0;i<RTP_PROFILE_MAX_PAYLOADS;i++)
{
pt=rtp_profile_get_payload(profile,i);
if (pt!=NULL)
{
if (strcasecmp(pt->mime_type,mime)==0 &&
pt->clock_rate==rate &&
(pt->channels==channels || channels<=0 || pt->channels<=0)) {
/*we don't look at channels if it is undefined
ie a negative or zero value*/
return i;
}
}
}
return -1;
}
int rtp_profile_get_payload_number_from_rtpmap(RtpProfile *profile,const char *rtpmap)
{
int clock_rate, channels, ret;
char* subtype = ortp_strdup( rtpmap );
char* rate_str = NULL;
char* chan_str = NULL;
/* find the slash after the subtype */
rate_str = strchr(subtype, '/');
if (rate_str && strlen(rate_str)>1) {
*rate_str = 0;
rate_str++;
/* Look for another slash */
chan_str = strchr(rate_str, '/');
if (chan_str && strlen(chan_str)>1) {
*chan_str = 0;
chan_str++;
} else {
chan_str = NULL;
}
} else {
rate_str = NULL;
}
// Use default clock rate if none given
if (rate_str) clock_rate = atoi(rate_str);
else clock_rate = 8000;
// Use default number of channels if none given
if (chan_str) channels = atoi(chan_str);
else channels = -1;
//printf("Searching for payload %s at freq %i with %i channels\n",subtype,clock_rate,ch1annels);
ret=rtp_profile_find_payload_number(profile,subtype,clock_rate,channels);
ortp_free(subtype);
return ret;
}
PayloadType * rtp_profile_find_payload(RtpProfile *prof,const char *mime,int rate,int channels)
{
int i;
i=rtp_profile_find_payload_number(prof,mime,rate,channels);
if (i>=0) return rtp_profile_get_payload(prof,i);
return NULL;
}
PayloadType * rtp_profile_get_payload_from_mime(RtpProfile *profile,const char *mime)
{
int pt;
pt=rtp_profile_get_payload_number_from_mime(profile,mime);
if (pt==-1) return NULL;
else return rtp_profile_get_payload(profile,pt);
}
PayloadType * rtp_profile_get_payload_from_rtpmap(RtpProfile *profile, const char *rtpmap)
{
int pt = rtp_profile_get_payload_number_from_rtpmap(profile,rtpmap);
if (pt==-1) return NULL;
else return rtp_profile_get_payload(profile,pt);
}
int rtp_profile_move_payload(RtpProfile *prof,int oldpos,int newpos){
prof->payload[newpos]=prof->payload[oldpos];
prof->payload[oldpos]=NULL;
return 0;
}
RtpProfile * rtp_profile_new(const char *name)
{
RtpProfile *prof=(RtpProfile*)ortp_new0(RtpProfile,1);
rtp_profile_set_name(prof,name);
return prof;
}
/**
* Assign payload type number index to payload type desribed in pt for the RTP profile profile.
* @param profile a RTP profile
* @param idx the payload type number
* @param pt the payload type description
*
**/
void rtp_profile_set_payload(RtpProfile *prof, int idx, PayloadType *pt){
if (idx<0 || idx>=RTP_PROFILE_MAX_PAYLOADS) {
ortp_error("Bad index %i",idx);
return;
}
prof->payload[idx]=pt;
}
/**
* Initialize the profile to the empty profile (all payload type are unassigned).
*@param profile a RTP profile
*
**/
void rtp_profile_clear_all(RtpProfile *obj){
int i;
for (i=0;i<RTP_PROFILE_MAX_PAYLOADS;i++){
obj->payload[i]=0;
}
}
/**
* Set a name to the rtp profile. (This is not required)
* @param profile a rtp profile object
* @param nm a string
*
**/
void rtp_profile_set_name(RtpProfile *obj, const char *name){
if (obj->name!=NULL) ortp_free(obj->name);
obj->name=ortp_strdup(name);
}
/* ! payload are not cloned*/
RtpProfile * rtp_profile_clone(RtpProfile *prof)
{
int i;
PayloadType *pt;
RtpProfile *newprof=rtp_profile_new(prof->name);
for (i=0;i<RTP_PROFILE_MAX_PAYLOADS;i++){
pt=rtp_profile_get_payload(prof,i);
if (pt!=NULL){
rtp_profile_set_payload(newprof,i,pt);
}
}
return newprof;
}
/*clone a profile and its payloads */
RtpProfile * rtp_profile_clone_full(RtpProfile *prof)
{
int i;
PayloadType *pt;
RtpProfile *newprof=rtp_profile_new(prof->name);
for (i=0;i<RTP_PROFILE_MAX_PAYLOADS;i++){
pt=rtp_profile_get_payload(prof,i);
if (pt!=NULL){
rtp_profile_set_payload(newprof,i,payload_type_clone(pt));
}
}
return newprof;
}
void rtp_profile_destroy(RtpProfile *prof)
{
int i;
PayloadType *payload;
if (prof->name) {
ortp_free(prof->name);
prof->name = NULL;
}
for (i=0;i<RTP_PROFILE_MAX_PAYLOADS;i++)
{
payload=rtp_profile_get_payload(prof,i);
if (payload!=NULL && (payload->flags & PAYLOAD_TYPE_ALLOCATED))
payload_type_destroy(payload);
}
ortp_free(prof);
}

View file

@ -1,532 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#if defined(WIN32) || defined(_WIN32_WCE)
#include "ortp-config-win32.h"
#else
#include "ortp-config.h"
#endif
#include "ortp/port.h"
#include "ortp/ortp.h"
#include "utils.h"
#if defined(_WIN32) && !defined(_WIN32_WCE)
#include <process.h>
#endif
static void *ortp_libc_malloc(size_t sz){
return malloc(sz);
}
static void *ortp_libc_realloc(void *ptr, size_t sz){
return realloc(ptr,sz);
}
static void ortp_libc_free(void*ptr){
free(ptr);
}
static bool_t allocator_used=FALSE;
static OrtpMemoryFunctions ortp_allocator={
ortp_libc_malloc,
ortp_libc_realloc,
ortp_libc_free
};
void ortp_set_memory_functions(OrtpMemoryFunctions *functions){
if (allocator_used){
ortp_fatal("ortp_set_memory_functions() must be called before "
"first use of ortp_malloc or ortp_realloc");
return;
}
ortp_allocator=*functions;
}
void* ortp_malloc(size_t sz){
allocator_used=TRUE;
return ortp_allocator.malloc_fun(sz);
}
void* ortp_realloc(void *ptr, size_t sz){
allocator_used=TRUE;
return ortp_allocator.realloc_fun(ptr,sz);
}
void ortp_free(void* ptr){
ortp_allocator.free_fun(ptr);
}
void * ortp_malloc0(size_t size){
void *ptr=ortp_malloc(size);
memset(ptr,0,size);
return ptr;
}
char * ortp_strdup(const char *tmp){
size_t sz;
char *ret;
if (tmp==NULL)
return NULL;
sz=strlen(tmp)+1;
ret=(char*)ortp_malloc(sz);
strcpy(ret,tmp);
ret[sz-1]='\0';
return ret;
}
/*
* this method is an utility method that calls fnctl() on UNIX or
* ioctlsocket on Win32.
* int retrun the result of the system method
*/
int set_non_blocking_socket (ortp_socket_t sock)
{
#if !defined(_WIN32) && !defined(_WIN32_WCE)
return fcntl (sock, F_SETFL, O_NONBLOCK);
#else
unsigned long nonBlock = 1;
return ioctlsocket(sock, FIONBIO , &nonBlock);
#endif
}
/*
* this method is an utility method that calls close() on UNIX or
* closesocket on Win32.
* int retrun the result of the system method
*/
int close_socket(ortp_socket_t sock){
#if !defined(_WIN32) && !defined(_WIN32_WCE)
return close (sock);
#else
return closesocket(sock);
#endif
}
#if defined (_WIN32_WCE) || defined(_MSC_VER)
int ortp_file_exist(const char *pathname) {
FILE* fd;
if (pathname==NULL) return -1;
fd=fopen(pathname,"r");
if (fd==NULL) {
return -1;
} else {
fclose(fd);
return 0;
}
}
#else
int ortp_file_exist(const char *pathname) {
return access(pathname,F_OK);
}
#endif /*_WIN32_WCE*/
#if !defined(_WIN32) && !defined(_WIN32_WCE)
/* Use UNIX inet_aton method */
#else
int inet_aton (const char * cp, struct in_addr * addr)
{
unsigned long retval;
retval = inet_addr (cp);
if (retval == INADDR_NONE)
{
return -1;
}
else
{
addr->S_un.S_addr = retval;
return 1;
}
}
#endif
char *ortp_strndup(const char *str,int n){
int min=MIN((int)strlen(str),n)+1;
char *ret=(char*)ortp_malloc(min);
strncpy(ret,str,n);
ret[min-1]='\0';
return ret;
}
#if !defined(_WIN32) && !defined(_WIN32_WCE)
int __ortp_thread_join(ortp_thread_t thread, void **ptr){
int err=pthread_join(thread,ptr);
if (err!=0) {
ortp_error("pthread_join error: %s",strerror(err));
}
return err;
}
int __ortp_thread_create(pthread_t *thread, pthread_attr_t *attr, void * (*routine)(void*), void *arg){
pthread_attr_t my_attr;
pthread_attr_init(&my_attr);
if (attr)
my_attr = *attr;
#ifdef ORTP_DEFAULT_THREAD_STACK_SIZE
if (ORTP_DEFAULT_THREAD_STACK_SIZE!=0)
pthread_attr_setstacksize(&my_attr, ORTP_DEFAULT_THREAD_STACK_SIZE);
#endif
return pthread_create(thread, &my_attr, routine, arg);
}
#endif
#if defined(_WIN32) || defined(_WIN32_WCE)
int WIN_mutex_init(ortp_mutex_t *mutex, void *attr)
{
*mutex=CreateMutex(NULL, FALSE, NULL);
return 0;
}
int WIN_mutex_lock(ortp_mutex_t * hMutex)
{
WaitForSingleObject(*hMutex, INFINITE); /* == WAIT_TIMEOUT; */
return 0;
}
int WIN_mutex_unlock(ortp_mutex_t * hMutex)
{
ReleaseMutex(*hMutex);
return 0;
}
int WIN_mutex_destroy(ortp_mutex_t * hMutex)
{
CloseHandle(*hMutex);
return 0;
}
typedef struct thread_param{
void * (*func)(void *);
void * arg;
}thread_param_t;
static unsigned WINAPI thread_starter(void *data){
thread_param_t *params=(thread_param_t*)data;
void *ret=params->func(params->arg);
ortp_free(data);
return (DWORD)ret;
}
#if defined _WIN32_WCE
# define _beginthreadex CreateThread
# define _endthreadex ExitThread
#endif
int WIN_thread_create(ortp_thread_t *th, void *attr, void * (*func)(void *), void *data)
{
thread_param_t *params=ortp_new(thread_param_t,1);
params->func=func;
params->arg=data;
*th=(HANDLE)_beginthreadex( NULL, 0, (LPTHREAD_START_ROUTINE)thread_starter, params, 0, NULL);
return 0;
}
int WIN_thread_join(ortp_thread_t thread_h, void **unused)
{
if (thread_h!=NULL)
{
WaitForSingleObject(thread_h, INFINITE);
CloseHandle(thread_h);
}
return 0;
}
int WIN_cond_init(ortp_cond_t *cond, void *attr)
{
*cond=CreateEvent(NULL, FALSE, FALSE, NULL);
return 0;
}
int WIN_cond_wait(ortp_cond_t* hCond, ortp_mutex_t * hMutex)
{
//gulp: this is not very atomic ! bug here ?
WIN_mutex_unlock(hMutex);
WaitForSingleObject(*hCond, INFINITE);
WIN_mutex_lock(hMutex);
return 0;
}
int WIN_cond_signal(ortp_cond_t * hCond)
{
SetEvent(*hCond);
return 0;
}
int WIN_cond_broadcast(ortp_cond_t * hCond)
{
WIN_cond_signal(hCond);
return 0;
}
int WIN_cond_destroy(ortp_cond_t * hCond)
{
CloseHandle(*hCond);
return 0;
}
#if defined(_WIN32_WCE)
#include <time.h>
const char * ortp_strerror(DWORD value) {
static TCHAR msgBuf[256];
FormatMessage(
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
value,
0, // Default language
(LPTSTR) &msgBuf,
0,
NULL
);
return (const char *)msgBuf;
}
int
gettimeofday (struct timeval *tv, void *tz)
{
DWORD timemillis = GetTickCount();
tv->tv_sec = timemillis/1000;
tv->tv_usec = (timemillis - (tv->tv_sec*1000)) * 1000;
return 0;
}
#else
int gettimeofday (struct timeval *tv, void* tz)
{
union
{
__int64 ns100; /*time since 1 Jan 1601 in 100ns units */
FILETIME fileTime;
} now;
GetSystemTimeAsFileTime (&now.fileTime);
tv->tv_usec = (long) ((now.ns100 / 10LL) % 1000000LL);
tv->tv_sec = (long) ((now.ns100 - 116444736000000000LL) / 10000000LL);
return (0);
}
#endif
const char *getWinSocketError(int error)
{
static char buf[80];
switch (error)
{
case WSANOTINITIALISED: return "Windows sockets not initialized : call WSAStartup";
case WSAEADDRINUSE: return "Local Address already in use";
case WSAEADDRNOTAVAIL: return "The specified address is not a valid address for this machine";
case WSAEINVAL: return "The socket is already bound to an address.";
case WSAENOBUFS: return "Not enough buffers available, too many connections.";
case WSAENOTSOCK: return "The descriptor is not a socket.";
case WSAECONNRESET: return "Connection reset by peer";
default :
sprintf(buf, "Error code : %d", error);
return buf;
break;
}
return buf;
}
#ifdef _WORKAROUND_MINGW32_BUGS
char * WSAAPI gai_strerror(int errnum){
return (char*)getWinSocketError(errnum);
}
#endif
#endif
#ifndef WIN32
#include <sys/socket.h>
#include <netdb.h>
#include <sys/un.h>
#include <sys/stat.h>
static char *make_pipe_name(const char *name){
return ortp_strdup_printf("/tmp/%s",name);
}
/* portable named pipes */
ortp_socket_t ortp_server_pipe_create(const char *name){
struct sockaddr_un sa;
char *pipename=make_pipe_name(name);
ortp_socket_t sock;
sock=socket(AF_UNIX,SOCK_STREAM,0);
sa.sun_family=AF_UNIX;
strncpy(sa.sun_path,pipename,sizeof(sa.sun_path)-1);
unlink(pipename);/*in case we didn't finished properly previous time */
ortp_free(pipename);
fchmod(sock,S_IRUSR|S_IWUSR);
if (bind(sock,(struct sockaddr*)&sa,sizeof(sa))!=0){
ortp_error("Failed to bind command unix socket: %s",strerror(errno));
return -1;
}
listen(sock,1);
return sock;
}
ortp_socket_t ortp_server_pipe_accept_client(ortp_socket_t server){
struct sockaddr_un su;
socklen_t ssize=sizeof(su);
ortp_socket_t client_sock=accept(server,(struct sockaddr*)&su,&ssize);
return client_sock;
}
int ortp_server_pipe_close_client(ortp_socket_t client){
return close(client);
}
int ortp_server_pipe_close(ortp_socket_t spipe){
return close(spipe);
}
ortp_socket_t ortp_client_pipe_connect(const char *name){
struct sockaddr_un sa;
char *pipename=make_pipe_name(name);
ortp_socket_t sock=socket(AF_UNIX,SOCK_STREAM,0);
sa.sun_family=AF_UNIX;
strncpy(sa.sun_path,pipename,sizeof(sa.sun_path)-1);
ortp_free(pipename);
if (connect(sock,(struct sockaddr*)&sa,sizeof(sa))!=0){
close(sock);
return -1;
}
return sock;
}
int ortp_pipe_read(ortp_socket_t p, uint8_t *buf, int len){
return read(p,buf,len);
}
int ortp_pipe_write(ortp_socket_t p, const uint8_t *buf, int len){
return write(p,buf,len);
}
int ortp_client_pipe_close(ortp_socket_t sock){
return close(sock);
}
#elif defined(WIN32) && !defined(_WIN32_WCE)
static char *make_pipe_name(const char *name){
return ortp_strdup_printf("\\\\.\\pipe\\%s",name);
}
static HANDLE event=NULL;
/* portable named pipes */
ortp_pipe_t ortp_server_pipe_create(const char *name){
ortp_pipe_t h;
char *pipename=make_pipe_name(name);
h=CreateNamedPipe(pipename,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_MESSAGE|PIPE_WAIT,1,
32768,32768,0,NULL);
ortp_free(pipename);
if (h==INVALID_HANDLE_VALUE){
ortp_error("Fail to create named pipe %s",pipename);
}
if (event==NULL) event=CreateEvent(NULL,TRUE,FALSE,NULL);
return h;
}
/*this function is a bit complex because we need to wakeup someday
even if nobody connects to the pipe.
ortp_server_pipe_close() makes this function to exit.
*/
ortp_pipe_t ortp_server_pipe_accept_client(ortp_pipe_t server){
OVERLAPPED ol;
DWORD undef;
HANDLE handles[2];
memset(&ol,0,sizeof(ol));
ol.hEvent=CreateEvent(NULL,TRUE,FALSE,NULL);
ConnectNamedPipe(server,&ol);
handles[0]=ol.hEvent;
handles[1]=event;
WaitForMultipleObjects(2,handles,FALSE,INFINITE);
if (GetOverlappedResult(server,&ol,&undef,FALSE)){
CloseHandle(ol.hEvent);
return server;
}
CloseHandle(ol.hEvent);
return INVALID_HANDLE_VALUE;
}
int ortp_server_pipe_close_client(ortp_pipe_t server){
return DisconnectNamedPipe(server)==TRUE ? 0 : -1;
}
int ortp_server_pipe_close(ortp_pipe_t spipe){
SetEvent(event);
//CancelIoEx(spipe,NULL); /*vista only*/
return CloseHandle(spipe);
}
ortp_pipe_t ortp_client_pipe_connect(const char *name){
char *pipename=make_pipe_name(name);
ortp_pipe_t hpipe = CreateFile(
pipename, // pipe name
GENERIC_READ | // read and write access
GENERIC_WRITE,
0, // no sharing
NULL, // default security attributes
OPEN_EXISTING, // opens existing pipe
0, // default attributes
NULL); // no template file
ortp_free(pipename);
return hpipe;
}
int ortp_pipe_read(ortp_pipe_t p, uint8_t *buf, int len){
DWORD ret=0;
if (ReadFile(p,buf,len,&ret,NULL))
return ret;
/*ortp_error("Could not read from pipe: %s",strerror(GetLastError()));*/
return -1;
}
int ortp_pipe_write(ortp_pipe_t p, const uint8_t *buf, int len){
DWORD ret=0;
if (WriteFile(p,buf,len,&ret,NULL))
return ret;
/*ortp_error("Could not write to pipe: %s",strerror(GetLastError()));*/
return -1;
}
int ortp_client_pipe_close(ortp_pipe_t sock){
return CloseHandle(sock);
}
#endif

View file

@ -1,177 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc1889) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#if defined(WIN32) || defined(_WIN32_WCE)
#include "ortp-config-win32.h"
#else
#include "ortp-config.h"
#endif
#include "ortp/ortp.h"
#include "rtptimer.h"
#if !defined(_WIN32) && !defined(_WIN32_WCE)
#ifdef __linux__
#include <sys/select.h>
#endif
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
static struct timeval orig,cur;
static uint32_t posix_timer_time=0; /*in milisecond */
void posix_timer_init()
{
posix_timer.state=RTP_TIMER_RUNNING;
gettimeofday(&orig,NULL);
posix_timer_time=0;
}
void posix_timer_do()
{
int diff,time;
struct timeval tv;
gettimeofday(&cur,NULL);
time=((cur.tv_usec-orig.tv_usec)/1000 ) + ((cur.tv_sec-orig.tv_sec)*1000 );
if ( (diff=time-posix_timer_time)>50){
ortp_warning("Must catchup %i miliseconds.",diff);
}
while((diff = posix_timer_time-time) > 0)
{
tv.tv_sec = diff/1000;
tv.tv_usec = (diff%1000)*1000;
#if defined(_WIN32) || defined(_WIN32_WCE)
/* this kind of select is not supported on windows */
Sleep(tv.tv_usec/1000 + tv.tv_sec * 1000);
#else
select(0,NULL,NULL,NULL,&tv);
#endif
gettimeofday(&cur,NULL);
time=((cur.tv_usec-orig.tv_usec)/1000 ) + ((cur.tv_sec-orig.tv_sec)*1000 );
}
posix_timer_time+=POSIXTIMER_INTERVAL/1000;
}
void posix_timer_uninit()
{
posix_timer.state=RTP_TIMER_STOPPED;
}
RtpTimer posix_timer={ 0,
posix_timer_init,
posix_timer_do,
posix_timer_uninit,
{0,POSIXTIMER_INTERVAL}};
#else //WIN32
#include <windows.h>
#include <mmsystem.h>
MMRESULT timerId;
HANDLE TimeEvent;
int late_ticks;
static DWORD posix_timer_time;
static DWORD offset_time;
#define TIME_INTERVAL 50
#define TIME_RESOLUTION 10
#define TIME_TIMEOUT 100
void CALLBACK timerCb(UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2)
{
// Check timerId
if (timerId == uID)
{
SetEvent(TimeEvent);
posix_timer_time += TIME_INTERVAL;
}
}
void win_timer_init(void)
{
timerId = timeSetEvent(TIME_INTERVAL,10,timerCb,0,TIME_PERIODIC | TIME_CALLBACK_FUNCTION);
TimeEvent = CreateEvent(NULL,FALSE,FALSE,NULL);
late_ticks = 0;
offset_time = GetTickCount();
posix_timer_time=0;
}
void win_timer_do(void)
{
DWORD diff;
// If timer have expired while we where out of this method
// Try to run after lost time.
if (late_ticks > 0)
{
late_ticks--;
posix_timer_time+=TIME_INTERVAL;
return;
}
diff = GetTickCount() - posix_timer_time - offset_time;
if( diff>TIME_INTERVAL && (diff<(1<<31)))
{
late_ticks = diff/TIME_INTERVAL;
ortp_warning("we must catchup %i ticks.",late_ticks);
return;
}
WaitForSingleObject(TimeEvent,TIME_TIMEOUT);
return;
}
void win_timer_close(void)
{
timeKillEvent(timerId);
}
RtpTimer toto;
RtpTimer posix_timer={ 0,
win_timer_init,
win_timer_do,
win_timer_close,
{0,TIME_INTERVAL * 1000}};
#endif // _WIN32

View file

@ -1,412 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/***************************************************************************
* rtcp.c
*
* Wed Dec 1 11:45:30 2004
* Copyright 2004 Simon Morlat
* Email simon dot morlat at linphone dot org
****************************************************************************/
#include "ortp/ortp.h"
#include "ortp/rtpsession.h"
#include "ortp/rtcp.h"
#include "utils.h"
#include "rtpsession_priv.h"
#define rtcp_bye_set_ssrc(b,pos,ssrc) (b)->ssrc[pos]=htonl(ssrc)
#define rtcp_bye_get_ssrc(b,pos) ntohl((b)->ssrc[pos])
void rtcp_common_header_init(rtcp_common_header_t *ch, RtpSession *s,int type, int rc, int bytes_len){
rtcp_common_header_set_version(ch,2);
rtcp_common_header_set_padbit(ch,0);
rtcp_common_header_set_packet_type(ch,type);
rtcp_common_header_set_rc(ch,rc); /* as we don't yet support multi source receiving */
rtcp_common_header_set_length(ch,(bytes_len/4)-1);
}
static mblk_t *sdes_chunk_new(uint32_t ssrc){
mblk_t *m=allocb(RTCP_SDES_CHUNK_DEFAULT_SIZE,0);
sdes_chunk_t *sc=(sdes_chunk_t*)m->b_rptr;
sc->csrc=htonl(ssrc);
m->b_wptr+=sizeof(sc->csrc);
return m;
}
static mblk_t * sdes_chunk_append_item(mblk_t *m, rtcp_sdes_type_t sdes_type, const char *content)
{
if ( content )
{
sdes_item_t si;
si.item_type=sdes_type;
si.len=(uint8_t) MIN(strlen(content),RTCP_SDES_MAX_STRING_SIZE);
m=appendb(m,(char*)&si,RTCP_SDES_ITEM_HEADER_SIZE,FALSE);
m=appendb(m,content,si.len,FALSE);
}
return m;
}
static void sdes_chunk_set_ssrc(mblk_t *m, uint32_t ssrc){
sdes_chunk_t *sc=(sdes_chunk_t*)m->b_rptr;
sc->csrc=htonl(ssrc);
}
#define sdes_chunk_get_ssrc(m) ntohl(((sdes_chunk_t*)((m)->b_rptr))->csrc)
static mblk_t * sdes_chunk_pad(mblk_t *m){
return appendb(m,"",1,TRUE);
}
/**
* Set session's SDES item for automatic sending of RTCP compound packets.
* If some items are not specified, use NULL.
**/
void rtp_session_set_source_description(RtpSession *session,
const char *cname, const char *name, const char *email, const char *phone,
const char *loc, const char *tool, const char *note){
mblk_t *chunk = sdes_chunk_new(session->snd.ssrc);
mblk_t *m=chunk;
const char *_cname=cname;
if (_cname==NULL)
{
_cname="Unknown";
}
chunk=sdes_chunk_append_item(chunk, RTCP_SDES_CNAME, _cname);
chunk=sdes_chunk_append_item(chunk, RTCP_SDES_NAME, name);
chunk=sdes_chunk_append_item(chunk, RTCP_SDES_EMAIL, email);
chunk=sdes_chunk_append_item(chunk, RTCP_SDES_PHONE, phone);
chunk=sdes_chunk_append_item(chunk, RTCP_SDES_LOC, loc);
chunk=sdes_chunk_append_item(chunk, RTCP_SDES_TOOL, tool);
chunk=sdes_chunk_append_item(chunk, RTCP_SDES_NOTE, note);
chunk=sdes_chunk_pad(chunk);
if (session->sd!=NULL) freemsg(session->sd);
session->sd=m;
}
void
rtp_session_add_contributing_source(RtpSession *session, uint32_t csrc,
const char *cname, const char *name, const char *email, const char *phone,
const char *loc, const char *tool, const char *note)
{
mblk_t *chunk = sdes_chunk_new(csrc);
mblk_t *m=chunk;
char *_cname=(char*)cname;
if (_cname==NULL)
{
_cname="toto";
}
chunk=sdes_chunk_append_item(chunk, RTCP_SDES_CNAME, cname);
chunk=sdes_chunk_append_item(chunk, RTCP_SDES_NAME, name);
chunk=sdes_chunk_append_item(chunk, RTCP_SDES_EMAIL, email);
chunk=sdes_chunk_append_item(chunk, RTCP_SDES_PHONE, phone);
chunk=sdes_chunk_append_item(chunk, RTCP_SDES_LOC, loc);
chunk=sdes_chunk_append_item(chunk, RTCP_SDES_TOOL, tool);
chunk=sdes_chunk_append_item(chunk, RTCP_SDES_NOTE, note);
chunk=sdes_chunk_pad(chunk);
putq(&session->contributing_sources,m);
}
mblk_t* rtp_session_create_rtcp_sdes_packet(RtpSession *session)
{
mblk_t *mp=allocb(sizeof(rtcp_common_header_t),0);
rtcp_common_header_t *rtcp;
mblk_t *tmp,*m=mp;
queue_t *q;
int rc=0;
rtcp = (rtcp_common_header_t*)mp->b_wptr;
mp->b_wptr+=sizeof(rtcp_common_header_t);
/* concatenate all sdes chunks */
sdes_chunk_set_ssrc(session->sd,session->snd.ssrc);
m=concatb(m,dupmsg(session->sd));
rc++;
q=&session->contributing_sources;
for (tmp=qbegin(q); !qend(q,tmp); tmp=qnext(q,mp)){
m=concatb(m,dupmsg(tmp));
rc++;
}
rtcp_common_header_init(rtcp,session,RTCP_SDES,rc,msgdsize(mp));
return mp;
}
mblk_t *rtcp_create_simple_bye_packet(uint32_t ssrc, const char *reason)
{
int packet_size;
int strsize = 0;
int strpadding = 0;
mblk_t *mp;
rtcp_bye_t *rtcp;
packet_size = RTCP_BYE_HEADER_SIZE;
if (reason!=NULL) {
strsize=(int)MIN(strlen(reason),RTCP_BYE_REASON_MAX_STRING_SIZE);
if (strsize > 0) {
strpadding = 3 - (strsize % 4);
packet_size += 1 + strsize + strpadding;
}
}
mp = allocb(packet_size, 0);
rtcp = (rtcp_bye_t*)mp->b_rptr;
rtcp_common_header_init(&rtcp->ch,NULL,RTCP_BYE,1,packet_size);
rtcp->ssrc[0] = htonl(ssrc);
mp->b_wptr += RTCP_BYE_HEADER_SIZE;
/* append the reason if any*/
if (reason!=NULL) {
const char pad[] = {0, 0, 0};
unsigned char strsize_octet = (unsigned char)strsize;
appendb(mp, (const char*)&strsize_octet, 1, FALSE);
appendb(mp, reason,strsize, FALSE);
appendb(mp, pad,strpadding, FALSE);
}
return mp;
}
void rtp_session_remove_contributing_sources(RtpSession *session, uint32_t ssrc)
{
queue_t *q=&session->contributing_sources;
mblk_t *tmp;
for (tmp=qbegin(q); !qend(q,tmp); tmp=qnext(q,tmp)){
uint32_t csrc=sdes_chunk_get_ssrc(tmp);
if (csrc==ssrc) {
remq(q,tmp);
break;
}
}
tmp=rtcp_create_simple_bye_packet(ssrc, NULL);
rtp_session_rtcp_send(session,tmp);
}
static void sender_info_init(sender_info_t *info, RtpSession *session){
struct timeval tv;
uint32_t tmp;
gettimeofday(&tv,NULL);
info->ntp_timestamp_msw=htonl(tv.tv_sec + 0x83AA7E80); /* 0x83AA7E80 is the number of seconds from 1900 to 1970 */
#if defined(_WIN32_WCE)
tmp=(uint32_t)((double)tv.tv_usec*(double)(((uint64_t)1)<<32)*1.0e-6);
#else
tmp=(uint32_t)((double)tv.tv_usec*(double)(1LL<<32)*1.0e-6);
#endif
info->ntp_timestamp_lsw=htonl(tmp);
info->rtp_timestamp=htonl(session->rtp.snd_last_ts);
info->senders_packet_count=(uint32_t) htonl((u_long) session->rtp.stats.packet_sent);
info->senders_octet_count=(uint32_t) htonl((u_long) session->rtp.sent_payload_bytes);
session->rtp.last_rtcp_packet_count=session->rtp.stats.packet_sent;
}
static void report_block_init(report_block_t *b, RtpSession *session){
int packet_loss=0;
uint8_t loss_fraction=0;
RtpStream *stream=&session->rtp;
uint32_t delay_snc_last_sr=0;
uint32_t fl_cnpl;
/* compute the statistics */
/*printf("hwrcv_extseq.one=%u, hwrcv_seq_at_last_SR=%u hwrcv_since_last_SR=%u\n",
stream->hwrcv_extseq.one,
stream->hwrcv_seq_at_last_SR,
stream->hwrcv_since_last_SR
);*/
if (stream->hwrcv_seq_at_last_SR!=0){
packet_loss=(stream->hwrcv_extseq - stream->hwrcv_seq_at_last_SR) - stream->hwrcv_since_last_SR;
if (packet_loss<0)
packet_loss=0;
stream->stats.cum_packet_loss+=packet_loss;
loss_fraction=(int)(256.0*(float)packet_loss/(float)stream->hwrcv_since_last_SR);
}
/* reset them */
stream->hwrcv_since_last_SR=0;
stream->hwrcv_seq_at_last_SR=stream->hwrcv_extseq;
if (stream->last_rcv_SR_time.tv_sec!=0){
struct timeval now;
float delay;
gettimeofday(&now,NULL);
delay=(float) ((now.tv_sec-stream->last_rcv_SR_time.tv_sec)*1e6 ) + (now.tv_usec-stream->last_rcv_SR_time.tv_usec);
delay=(float) (delay*65536*1e-6);
delay_snc_last_sr=(uint32_t) delay;
}
b->ssrc=htonl(session->rcv.ssrc);
fl_cnpl=((loss_fraction&0xFF)<<24) | (stream->stats.cum_packet_loss & 0xFFFFFF);
b->fl_cnpl=htonl(fl_cnpl);
b->interarrival_jitter=htonl((uint32_t) stream->jittctl.inter_jitter);
b->ext_high_seq_num_rec=htonl(stream->hwrcv_extseq);
b->lsr=htonl(stream->last_rcv_SR_ts);
b->delay_snc_last_sr=htonl(delay_snc_last_sr);
}
static int rtcp_sr_init(RtpSession *session, uint8_t *buf, int size){
rtcp_sr_t *sr=(rtcp_sr_t*)buf;
int rr=(session->rtp.stats.packet_recv>0);
int sr_size=sizeof(rtcp_sr_t)-sizeof(report_block_t)+(rr*sizeof(report_block_t));
if (size<sr_size) return 0;
rtcp_common_header_init(&sr->ch,session,RTCP_SR,rr,sr_size);
sr->ssrc=htonl(session->snd.ssrc);
sender_info_init(&sr->si,session);
/*only include a report block if packets were received*/
if (rr)
report_block_init(&sr->rb[0],session);
return sr_size;
}
static int rtcp_rr_init(RtpSession *session, uint8_t *buf, int size){
rtcp_rr_t *rr=(rtcp_rr_t*)buf;
if (size<sizeof(rtcp_rr_t)) return 0;
rtcp_common_header_init(&rr->ch,session,RTCP_RR,1,sizeof(rtcp_rr_t));
rr->ssrc=htonl(session->snd.ssrc);
report_block_init(&rr->rb[0],session);
return sizeof(rtcp_rr_t);
}
static int rtcp_app_init(RtpSession *session, uint8_t *buf, uint8_t subtype, const char *name, int size){
rtcp_app_t *app=(rtcp_app_t*)buf;
if (size<sizeof(rtcp_app_t)) return 0;
rtcp_common_header_init(&app->ch,session,RTCP_APP,subtype,size);
app->ssrc=htonl(session->snd.ssrc);
memset(app->name,0,4);
strncpy(app->name,name,4);
return sizeof(rtcp_app_t);
}
static mblk_t * make_rr(RtpSession *session){
mblk_t *cm=NULL;
mblk_t *sdes=NULL;
cm=allocb(sizeof(rtcp_sr_t),0);
cm->b_wptr+=rtcp_rr_init(session,cm->b_wptr,sizeof(rtcp_rr_t));
/* make a SDES packet */
if (session->sd!=NULL)
sdes=rtp_session_create_rtcp_sdes_packet(session);
/* link them */
cm->b_cont=sdes;
return cm;
}
static mblk_t * make_sr(RtpSession *session){
mblk_t *cm=NULL;
mblk_t *sdes=NULL;
cm=allocb(sizeof(rtcp_sr_t),0);
cm->b_wptr+=rtcp_sr_init(session,cm->b_wptr,sizeof(rtcp_sr_t));
/* make a SDES packet */
if (session->sd!=NULL)
sdes=rtp_session_create_rtcp_sdes_packet(session);
/* link them */
cm->b_cont=sdes;
return cm;
}
void rtp_session_rtcp_process_send(RtpSession *session){
RtpStream *st=&session->rtp;
mblk_t *m;
if (st->rcv_last_app_ts - st->last_rtcp_report_snt_r > st->rtcp_report_snt_interval
|| st->snd_last_ts - st->last_rtcp_report_snt_s > st->rtcp_report_snt_interval){
st->last_rtcp_report_snt_r=st->rcv_last_app_ts;
st->last_rtcp_report_snt_s=st->snd_last_ts;
m=make_sr(session);
/* send the compound packet */
rtp_session_rtcp_send(session,m);
ortp_debug("Rtcp compound message sent.");
}
}
void rtp_session_rtcp_process_recv(RtpSession *session){
RtpStream *st=&session->rtp;
mblk_t *m=NULL;
if (st->rcv_last_app_ts - st->last_rtcp_report_snt_r > st->rtcp_report_snt_interval
|| st->snd_last_ts - st->last_rtcp_report_snt_s > st->rtcp_report_snt_interval){
st->last_rtcp_report_snt_r=st->rcv_last_app_ts;
st->last_rtcp_report_snt_s=st->snd_last_ts;
if (session->rtp.last_rtcp_packet_count<session->rtp.stats.packet_sent){
m=make_sr(session);
session->rtp.last_rtcp_packet_count=session->rtp.stats.packet_sent;
}else if (session->rtp.stats.packet_recv>0){
/*don't send RR when no packet are received yet*/
m=make_rr(session);
}
if (m!=NULL){
/* send the compound packet */
rtp_session_rtcp_send(session,m);
ortp_debug("Rtcp compound message sent.");
}
}
}
void rtp_session_send_rtcp_APP(RtpSession *session, uint8_t subtype, const char *name, const uint8_t *data, int datalen){
mblk_t *h=allocb(sizeof(rtcp_app_t),0);
mblk_t *d;
h->b_wptr+=rtcp_app_init(session,h->b_wptr,subtype,name,datalen+sizeof(rtcp_app_t));
d=esballoc((uint8_t*)data,datalen,0,NULL);
h->b_cont=d;
rtp_session_rtcp_send(session,h);
}
/**
* Sends a RTCP bye packet.
*@param session RtpSession
*@param reason the reason phrase.
**/
int
rtp_session_bye(RtpSession *session, const char *reason)
{
mblk_t *cm;
mblk_t *sdes = NULL;
mblk_t *bye = NULL;
int ret;
/* Make a BYE packet (will be on the end of the compund packet). */
bye = rtcp_create_simple_bye_packet(session->snd.ssrc, reason);
/* SR or RR is determined by the fact whether stream was sent*/
if (session->rtp.stats.packet_sent>0)
{
cm = allocb(sizeof(rtcp_sr_t), 0);
cm->b_wptr += rtcp_sr_init(session,cm->b_wptr, sizeof(rtcp_sr_t));
/* make a SDES packet */
sdes = rtp_session_create_rtcp_sdes_packet(session);
/* link them */
concatb(concatb(cm, sdes), bye);
} else if (session->rtp.stats.packet_recv>0){
/* make a RR packet */
cm = allocb(sizeof(rtcp_rr_t), 0);
cm->b_wptr += rtcp_rr_init(session, cm->b_wptr, sizeof(rtcp_rr_t));
/* link them */
cm->b_cont = bye;
}else cm=bye;
/* Send compound packet. */
ret = rtp_session_rtcp_send(session, cm);
return ret;
}

View file

@ -1,541 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "ortp/ortp.h"
#include "utils.h"
/*in case of coumpound packet, set read pointer of m to the beginning of the next RTCP
packet */
bool_t rtcp_next_packet(mblk_t *m){
const rtcp_common_header_t *ch=rtcp_get_common_header(m);
if (ch){
int nextlen=sizeof(rtcp_common_header_t)+
(rtcp_common_header_get_length(ch)*4);
if (m->b_rptr+nextlen<m->b_wptr){
m->b_rptr+=nextlen;
return TRUE;
}
}
return FALSE;
}
void rtcp_rewind(mblk_t *m){
m->b_rptr=m->b_datap->db_base;
}
/* get common header; this function will also check the sanity of the packet*/
const rtcp_common_header_t * rtcp_get_common_header(const mblk_t *m){
int size=msgdsize(m);
rtcp_common_header_t *ch;
if (m->b_cont!=NULL){
ortp_fatal("RTCP parser does not work on fragmented mblk_t. Use msgpullup() before to re-assemble the packet.");
return NULL;
}
if (size<sizeof(rtcp_common_header_t)){
ortp_warning("Bad RTCP packet, too short.");
return NULL;
}
ch=(rtcp_common_header_t*)m->b_rptr;
return ch;
}
bool_t rtcp_is_SR(const mblk_t *m){
const rtcp_common_header_t *ch=rtcp_get_common_header(m);
if (ch!=NULL && rtcp_common_header_get_packet_type(ch)==RTCP_SR){
if (msgdsize(m)<sizeof(rtcp_sr_t)){
ortp_warning("Too short RTCP SR packet.");
return FALSE;
}
return TRUE;
}
return FALSE;
}
/*Sender Report accessors */
uint32_t rtcp_SR_get_ssrc(const mblk_t *m){
rtcp_sr_t *sr=(rtcp_sr_t*)m->b_rptr;
return ntohl(sr->ssrc);
}
const sender_info_t * rtcp_SR_get_sender_info(const mblk_t *m){
rtcp_sr_t *sr=(rtcp_sr_t*)m->b_rptr;
return &sr->si;
}
const report_block_t * rtcp_SR_get_report_block(const mblk_t *m, int idx){
rtcp_sr_t *sr=(rtcp_sr_t*)m->b_rptr;
report_block_t *rb=&sr->rb[idx];
int size=sizeof(rtcp_common_header_t)+(4*rtcp_common_header_get_length(&sr->ch));
if ( ( (uint8_t*)rb)+sizeof(report_block_t) <= m->b_rptr + size ) {
return rb;
}else{
if (idx<rtcp_common_header_get_rc(&sr->ch)){
ortp_warning("RTCP packet should include a report_block_t at pos %i but has no space for it.",idx);
}
}
return NULL;
}
/*Receiver report accessors*/
bool_t rtcp_is_RR(const mblk_t *m){
const rtcp_common_header_t *ch=rtcp_get_common_header(m);
if (ch!=NULL && rtcp_common_header_get_packet_type(ch)==RTCP_RR){
if (msgdsize(m)<sizeof(rtcp_rr_t)){
ortp_warning("Too short RTCP RR packet.");
return FALSE;
}
return TRUE;
}
return FALSE;
}
uint32_t rtcp_RR_get_ssrc(const mblk_t *m){
rtcp_rr_t *rr=(rtcp_rr_t*)m->b_rptr;
return ntohl(rr->ssrc);
}
const report_block_t * rtcp_RR_get_report_block(const mblk_t *m,int idx){
rtcp_rr_t *rr=(rtcp_rr_t*)m->b_rptr;
report_block_t *rb=&rr->rb[idx];
int size=sizeof(rtcp_common_header_t)+(4*rtcp_common_header_get_length(&rr->ch));
if ( ( (uint8_t*)rb)+sizeof(report_block_t) <= (m->b_rptr + size ) ){
return rb;
}else{
if (idx<rtcp_common_header_get_rc(&rr->ch)){
ortp_warning("RTCP packet should include a report_block_t at pos %i but has no space for it.",idx);
}
}
return NULL;
}
/*SDES accessors */
bool_t rtcp_is_SDES(const mblk_t *m){
const rtcp_common_header_t *ch=rtcp_get_common_header(m);
if (ch && rtcp_common_header_get_packet_type(ch)==RTCP_SDES){
if (msgdsize(m)<sizeof(rtcp_common_header_t)+
(4*rtcp_common_header_get_length(ch))){
ortp_warning("Too short RTCP SDES packet.");
return FALSE;
}
return TRUE;
}
return FALSE;
}
void rtcp_sdes_parse(const mblk_t *m, SdesItemFoundCallback cb, void *user_data){
uint8_t *rptr=(uint8_t*)m->b_rptr+sizeof(rtcp_common_header_t);
const rtcp_common_header_t *ch=(rtcp_common_header_t*)m->b_rptr;
uint8_t *end=rptr+sizeof(rtcp_common_header_t)+
(4*rtcp_common_header_get_length(ch));
uint32_t ssrc=0;
int nchunk=0;
bool_t chunk_start=TRUE;
if (end>(uint8_t*)m->b_wptr) end=(uint8_t*)m->b_wptr;
while(rptr<end){
if (chunk_start){
if (rptr+4<=end){
ssrc=ntohl(*(uint32_t*)rptr);
rptr+=4;
}else{
ortp_warning("incorrect chunk start in RTCP SDES");
break;
}
chunk_start=FALSE;
}else{
if (rptr+2<=end){
uint8_t type=rptr[0];
uint8_t len=rptr[1];
if (type==RTCP_SDES_END){
/* pad to next 32bit boundary*/
rptr=(uint8_t*)(((unsigned long)rptr+4) & ~0x3);
nchunk++;
if (nchunk<rtcp_common_header_get_rc(ch)){
chunk_start=TRUE;
continue;
}else break;
}
rptr+=2;
if (rptr+len<=end){
cb(user_data,ssrc,type,(char*)rptr,len);
rptr+=len;
}else{
ortp_warning("bad item length in RTCP SDES");
break;
}
}else{
/*end of packet */
break;
}
}
}
}
/*BYE accessors */
bool_t rtcp_is_BYE(const mblk_t *m){
const rtcp_common_header_t *ch=rtcp_get_common_header(m);
if (ch && rtcp_common_header_get_packet_type(ch)==RTCP_BYE){
if (msgdsize(m)<sizeof(rtcp_common_header_t)+
rtcp_common_header_get_length(ch)){
ortp_warning("Too short RTCP BYE packet.");
return FALSE;
}
return TRUE;
}
return FALSE;
}
bool_t rtcp_BYE_get_ssrc(const mblk_t *m, int idx, uint32_t *ssrc){
rtcp_bye_t *bye=(rtcp_bye_t*)m->b_rptr;
int rc=rtcp_common_header_get_rc(&bye->ch);
int len=rtcp_common_header_get_length(&bye->ch);
if (idx<rc){
if ((uint8_t*)&bye->ssrc[idx]<=(m->b_rptr
+sizeof(rtcp_common_header_t)+len-4)) {
*ssrc=ntohl(bye->ssrc[idx]);
return TRUE;
}else{
ortp_warning("RTCP BYE should contain %i ssrc, but there is not enough room for it.");
}
}
return FALSE;
}
bool_t rtcp_BYE_get_reason(const mblk_t *m, const char **reason, int *reason_len){
rtcp_bye_t *bye=(rtcp_bye_t*)m->b_rptr;
int rc=rtcp_common_header_get_rc(&bye->ch);
int len=rtcp_common_header_get_length(&bye->ch);
uint8_t *rptr=(uint8_t*)m->b_rptr+sizeof(rtcp_common_header_t)+rc*4;
uint8_t *end=(uint8_t*)(m->b_rptr+sizeof(rtcp_common_header_t)+len);
if (rptr<end){
uint8_t content_len=rptr[0];
if (rptr+1+content_len<=end){
*reason=(char*)rptr+1;
*reason_len=content_len;
return TRUE;
}else{
ortp_warning("RTCP BYE has not enough space for reason phrase.");
return FALSE;
}
}
return FALSE;
}
/*APP accessors */
bool_t rtcp_is_APP(const mblk_t *m){
const rtcp_common_header_t *ch=rtcp_get_common_header(m);
if (ch!=NULL && rtcp_common_header_get_packet_type(ch)==RTCP_APP){
if (msgdsize(m)<sizeof(rtcp_common_header_t)+
rtcp_common_header_get_length(ch)){
ortp_warning("Too short RTCP APP packet.");
return FALSE;
}
if (sizeof(rtcp_common_header_t)+rtcp_common_header_get_length(ch)
< sizeof(rtcp_app_t)){
ortp_warning("Bad RTCP APP packet.");
return FALSE;
}
return TRUE;
}
return FALSE;
}
int rtcp_APP_get_subtype(const mblk_t *m){
rtcp_app_t *app=(rtcp_app_t*)m->b_rptr;
return rtcp_common_header_get_rc(&app->ch);
}
uint32_t rtcp_APP_get_ssrc(const mblk_t *m){
rtcp_app_t *app=(rtcp_app_t*)m->b_rptr;
return ntohl(app->ssrc);
}
/* name argument is supposed to be at least 4 characters (note: no '\0' written)*/
void rtcp_APP_get_name(const mblk_t *m, char *name){
rtcp_app_t *app=(rtcp_app_t*)m->b_rptr;
memcpy(name,app->name,4);
}
/* retrieve the data. when returning, data points directly into the mblk_t */
void rtcp_APP_get_data(const mblk_t *m, uint8_t **data, int *len){
rtcp_app_t *app=(rtcp_app_t*)m->b_rptr;
int datalen=sizeof(rtcp_common_header_t)+rtcp_common_header_get_length(&app->ch)-8;
if (datalen>0){
*data=(uint8_t*)m->b_rptr+sizeof(rtcp_app_t);
*len=datalen;
}else{
*len=0;
*data=NULL;
}
}
/*old functions: deprecated, but some useful code parts can be reused */
/* Start from now this source code file was written by Nicola Baldo as an extension of
the oRTP library. Copyright (C) 2005 Nicola Baldo nicola@baldo.biz*/
void report_block_parse(RtpSession *session, report_block_t *rb, struct timeval rcv_time_tv)
{
rb->ssrc = ntohl(rb->ssrc);
if ( rb->ssrc != session->snd.ssrc )
{
ortp_debug("Received rtcp report block related to unknown ssrc (not from us)... discarded");
return;
}
else
{
uint32_t rcv_time_msw;
uint32_t rcv_time_lsw;
uint32_t rcv_time;
double rtt;
rcv_time_msw = rcv_time_tv.tv_sec;
#if defined(_WIN32_WCE)
rcv_time_lsw = (uint32_t) ((double)rcv_time_tv.tv_usec*(double)(((uint64_t)1)<<32)*1.0e-6);
#else
rcv_time_lsw = (uint32_t) ((double)rcv_time_tv.tv_usec*(double)(1LL<<32)*1.0e-6);
#endif
rcv_time = (rcv_time_msw<<16) | (rcv_time_lsw >> 16);
/*
rb->cum_num_packet_lost = ntoh24(rb->cum_num_packet_lost);
rb->ext_high_seq_num_rec = ntohl(rb->ext_high_seq_num_rec);
rb->interarrival_jitter = ntohl(rb->interarrival_jitter);
rb->lsr = ntohl(rb->lsr);
rb->delay_snc_last_sr = ntohl(rb->delay_snc_last_sr);
*/
/* calculating Round Trip Time*/
if (rb->lsr != 0)
{
rtt = (double) (rcv_time - rb->delay_snc_last_sr - rb->lsr);
rtt = rtt/65536;
//printf("RTT = %f s\n",rtt);
}
}
}
void rtp_session_rtcp_parse(RtpSession *session, mblk_t *mp)
{
rtcp_common_header_t *rtcp;
int msgsize;
int rtcp_pk_size;
RtpStream *rtpstream=&session->rtp;
struct timeval rcv_time_tv;
gettimeofday(&rcv_time_tv,NULL);
return_if_fail(mp!=NULL);
msgsize=(int) (mp->b_wptr-mp->b_rptr);
if (msgsize < RTCP_COMMON_HEADER_SIZE)
{
ortp_debug("Receiving too short rtcp packet... discarded");
return;
}
rtcp=(rtcp_common_header_t *)mp->b_rptr;
/* compound rtcp packet can be composed by more than one rtcp message */
while (msgsize >= RTCP_COMMON_HEADER_SIZE)
{
if (rtcp->version!=2)
{
ortp_debug("Receiving rtcp packet with version number !=2...discarded");
return;
}
/* convert header data from network order to host order */
rtcp->length = ntohs(rtcp->length);
/* compute length */
rtcp_pk_size = (rtcp->length + 1) * 4;
/* Sanity check of simple RTCP packet length. */
if (rtcp_pk_size > msgsize)
{
ortp_debug("Receiving rtcp packet shorter than the specified length.. discared");
return;
}
switch (rtcp->packet_type)
{
case RTCP_SR:
{
rtcp_sr_t *sr = (rtcp_sr_t *) rtcp;
report_block_t *rb;
int i;
if ( ntohl(sr->ssrc) != session->rcv.ssrc )
{
ortp_debug("Receiving rtcp sr packet from unknown ssrc.. discarded");
return;
}
if (msgsize < RTCP_COMMON_HEADER_SIZE + RTCP_SSRC_FIELD_SIZE + RTCP_SENDER_INFO_SIZE + (RTCP_REPORT_BLOCK_SIZE*sr->ch.rc))
{
ortp_debug("Receiving too short rtcp sr packet... discarded");
return;
}
/* parsing RTCP Sender Info */
sr->si.ntp_timestamp_msw = ntohl(sr->si.ntp_timestamp_msw);
sr->si.ntp_timestamp_lsw = ntohl(sr->si.ntp_timestamp_lsw);
sr->si.rtp_timestamp = ntohl(sr->si.rtp_timestamp);
sr->si.senders_packet_count = ntohl(sr->si.senders_packet_count);
sr->si.senders_octet_count = ntohl(sr->si.senders_octet_count);
/* saving data to fill LSR and DLSR field in next RTCP report to be transmitted */
rtpstream->last_rcv_SR_ts = (sr->si.ntp_timestamp_msw << 16) | (sr->si.ntp_timestamp_lsw >> 16);
rtpstream->last_rcv_SR_time.tv_usec = rcv_time_tv.tv_usec;
rtpstream->last_rcv_SR_time.tv_sec = rcv_time_tv.tv_sec;
/* parsing all RTCP report blocks */
for (i=0; i<sr->ch.rc; i++)
{
rb = &(sr->rb[i]);
report_block_parse(session, rb, rcv_time_tv);
}
}
break;
case RTCP_RR:
{
rtcp_rr_t *rr = (rtcp_rr_t *) rtcp;
report_block_t *rb;
int i;
if (session->rcv.ssrc == 0)
{
/* rcv.ssrc is not set, so we adopt the incoming one */
session->rcv.ssrc = ntohl(rr->ssrc);
}
else if ( ntohl(rr->ssrc) != session->rcv.ssrc )
{
ortp_debug("Receiving rtcp rr packet from unknown ssrc.. discarded");
return;
}
if (msgsize < RTCP_COMMON_HEADER_SIZE + RTCP_SSRC_FIELD_SIZE + (RTCP_REPORT_BLOCK_SIZE*rr->ch.rc))
{
ortp_debug("Receiving too short rtcp sr packet... discarded");
return;
}
/* parsing all RTCP report blocks */
for (i=0; i<rr->ch.rc; i++)
{
rb = &(rr->rb[i]);
report_block_parse(session, rb, rcv_time_tv);
}
}
break;
case RTCP_SDES:
/* to be implemented */
break;
case RTCP_BYE:
{
rtcp_bye_t *bye = (rtcp_bye_t *) rtcp;
unsigned sclen = bye->ch.rc * 4;
int reason_space_len = rtcp_pk_size
- sizeof (rtcp_common_header_t)
- sclen;
int i;
char *reason = NULL;
bool_t rcv_ssrc_match = FALSE;
if (reason_space_len < 0) {
ortp_debug("Receiving too short RTCP BYE packet... discarded");
return;
}
for (i = 0; i < bye->ch.rc; i++) {
if (ntohl(bye->ssrc[i]) == session->rcv.ssrc) {
rcv_ssrc_match = TRUE;
break;
}
}
if (rcv_ssrc_match) {
if (session->on_rtcp_bye.count > 0) {
/* Get reason. */
if (reason_space_len > 1) {
uint8_t *reasonbuf = (uint8_t *) rtcp
+ sizeof (rtcp_common_header_t)
+ sclen;
if (reasonbuf[0] <= reason_space_len-1)
reason = ortp_strndup((char *)(reasonbuf+1), reasonbuf[0]);
else
ortp_debug("Incorrect RTCP BYE reason length");
}
rtp_signal_table_emit2(&session->on_rtcp_bye,
(long)reason);
if (reason)
ortp_free(reason);
} else {
ortp_debug("Got RTCP BYE without RTCP BYE handler");
}
} else {
ortp_debug("No SSRC in the BYE packet matched our rcv.ssrc.");
}
break;
}
case RTCP_APP:
/* to be implemented */
break;
default:
ortp_debug("Receiving unknown rtcp packet type... discarded");
return;
}
msgsize -= rtcp_pk_size; /* size of unparsed portion of UDP packet, in octets */
rtcp = (rtcp_common_header_t *) (rtcp_pk_size + (char *) rtcp); /* pointer to next RTCP packet in current UDP packet */
}
/* The function did not failed sanity checks, write down the RTPC/RTCP
reception time. */
session->last_recv_time = rcv_time_tv;
}

View file

@ -1,236 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <ortp/ortp.h>
#include "jitterctl.h"
#include "utils.h"
#include "rtpsession_priv.h"
#define SSRC_CHANGED_THRESHOLD 50
static void queue_packet(queue_t *q, int maxrqsz, mblk_t *mp, rtp_header_t *rtp, int *discarded)
{
mblk_t *tmp;
int header_size;
*discarded=0;
header_size=RTP_FIXED_HEADER_SIZE+ (4*rtp->cc);
if ((mp->b_wptr - mp->b_rptr)==header_size){
ortp_debug("Rtp packet contains no data.");
(*discarded)++;
freemsg(mp);
return;
}
/* and then add the packet to the queue */
rtp_putq(q,mp);
/* make some checks: q size must not exceed RtpStream::max_rq_size */
while (q->q_mcount > maxrqsz)
{
/* remove the oldest mblk_t */
tmp=getq(q);
if (mp!=NULL)
{
ortp_debug("rtp_putq: Queue is full. Discarding message with ts=%i",((rtp_header_t*)mp->b_rptr)->timestamp);
freemsg(tmp);
(*discarded)++;
}
}
}
void rtp_session_rtp_parse(RtpSession *session, mblk_t *mp, uint32_t local_str_ts, struct sockaddr *addr, socklen_t addrlen)
{
int i;
rtp_header_t *rtp;
int msgsize;
RtpStream *rtpstream=&session->rtp;
rtp_stats_t *stats=&rtpstream->stats;
msgsize=mp->b_wptr-mp->b_rptr;
if (msgsize<RTP_FIXED_HEADER_SIZE){
ortp_warning("Packet too small to be a rtp packet (%i)!",msgsize);
rtpstream->stats.bad++;
ortp_global_stats.bad++;
freemsg(mp);
return;
}
rtp=(rtp_header_t*)mp->b_rptr;
if (rtp->version!=2)
{
/* try to see if it is a STUN packet */
uint16_t stunlen=*((uint16_t*)(mp->b_rptr + sizeof(uint16_t)));
stunlen = ntohs(stunlen);
if (stunlen+20==mp->b_wptr-mp->b_rptr){
/* this looks like a stun packet */
if (session->eventqs!=NULL){
OrtpEvent *ev=ortp_event_new(ORTP_EVENT_STUN_PACKET_RECEIVED);
OrtpEventData *ed=ortp_event_get_data(ev);
ed->packet=mp;
ed->ep=rtp_endpoint_new(addr,addrlen);
rtp_session_dispatch_event(session,ev);
return;
}
}
/* discard in two case: the packet is not stun OR nobody is interested by STUN (no eventqs) */
ortp_debug("Receiving rtp packet with version number !=2...discarded");
stats->bad++;
ortp_global_stats.bad++;
freemsg(mp);
return;
}
/* only count non-stun packets. */
ortp_global_stats.packet_recv++;
stats->packet_recv++;
ortp_global_stats.hw_recv+=msgsize;
stats->hw_recv+=msgsize;
session->rtp.hwrcv_since_last_SR++;
/* convert all header data from network order to host order */
rtp->seq_number=ntohs(rtp->seq_number);
rtp->timestamp=ntohl(rtp->timestamp);
rtp->ssrc=ntohl(rtp->ssrc);
/* convert csrc if necessary */
if (rtp->cc*sizeof(uint32_t) > (uint32_t) (msgsize-RTP_FIXED_HEADER_SIZE)){
ortp_debug("Receiving too short rtp packet.");
stats->bad++;
ortp_global_stats.bad++;
freemsg(mp);
return;
}
#ifndef PERF
/* Write down the last RTP/RTCP packet reception time. */
gettimeofday(&session->last_recv_time, NULL);
#endif
for (i=0;i<rtp->cc;i++)
rtp->csrc[i]=ntohl(rtp->csrc[i]);
/*the goal of the following code is to lock on an incoming SSRC to avoid
receiving "mixed streams"*/
if (session->ssrc_set){
/*the ssrc is set, so we must check it */
if (session->rcv.ssrc!=rtp->ssrc){
if (session->inc_ssrc_candidate==rtp->ssrc){
session->inc_same_ssrc_count++;
}else{
session->inc_same_ssrc_count=0;
session->inc_ssrc_candidate=rtp->ssrc;
}
if (session->inc_same_ssrc_count>SSRC_CHANGED_THRESHOLD){
/* store the sender rtp address to do symmetric RTP */
if (!session->use_connect){
if (session->rtp.socket>0 && session->symmetric_rtp){
/* store the sender rtp address to do symmetric RTP */
memcpy(&session->rtp.rem_addr,addr,addrlen);
session->rtp.rem_addrlen=addrlen;
}
}
session->rtp.rcv_last_ts = rtp->timestamp;
session->rcv.ssrc=rtp->ssrc;
rtp_signal_table_emit(&session->on_ssrc_changed);
}else{
/*discard the packet*/
ortp_debug("Receiving packet with unknown ssrc.");
stats->bad++;
ortp_global_stats.bad++;
freemsg(mp);
return;
}
}
else{
/* The SSRC change must not happen if we still receive
ssrc from the initial source. */
session->inc_same_ssrc_count=0;
}
}else{
session->ssrc_set=TRUE;
session->rcv.ssrc=rtp->ssrc;
if (!session->use_connect){
if (session->rtp.socket>0 && session->symmetric_rtp){
/* store the sender rtp address to do symmetric RTP */
memcpy(&session->rtp.rem_addr,addr,addrlen);
session->rtp.rem_addrlen=addrlen;
}
}
}
/* update some statistics */
{
poly32_t *extseq=(poly32_t*)&rtpstream->hwrcv_extseq;
if (rtp->seq_number>extseq->split.lo){
extseq->split.lo=rtp->seq_number;
}else if (rtp->seq_number<200 && extseq->split.lo>((1<<16) - 200)){
/* this is a check for sequence number looping */
extseq->split.lo=rtp->seq_number;
extseq->split.hi++;
}
}
/* check for possible telephone events */
if (rtp->paytype==session->rcv.telephone_events_pt){
queue_packet(&session->rtp.tev_rq,session->rtp.max_rq_size,mp,rtp,&i);
stats->discarded+=i;
ortp_global_stats.discarded+=i;
return;
}
/* check for possible payload type change, in order to update accordingly our clock-rate dependant
parameters */
if (session->hw_recv_pt!=rtp->paytype){
rtp_session_update_payload_type(session,rtp->paytype);
}
jitter_control_new_packet(&session->rtp.jittctl,rtp->timestamp,local_str_ts);
if (session->flags & RTP_SESSION_FIRST_PACKET_DELIVERED) {
/* detect timestamp important jumps in the future, to workaround stupid rtp senders */
if (RTP_TIMESTAMP_IS_NEWER_THAN(rtp->timestamp,session->rtp.rcv_last_ts+session->rtp.ts_jump)){
ortp_debug("rtp_parse: timestamp jump ?");
rtp_signal_table_emit2(&session->on_timestamp_jump,(long)&rtp->timestamp);
}
else if (RTP_TIMESTAMP_IS_STRICTLY_NEWER_THAN(session->rtp.rcv_last_ts,rtp->timestamp)){
/* don't queue packets older than the last returned packet to the application*/
/* Call timstamp jumb in case of
* large negative Ts jump or if ts is set to 0
*/
if ( RTP_TIMESTAMP_IS_STRICTLY_NEWER_THAN(session->rtp.rcv_last_ts, rtp->timestamp + session->rtp.ts_jump) ){
ortp_warning("rtp_parse: negative timestamp jump");
rtp_signal_table_emit2(&session->on_timestamp_jump,
(long)&rtp->timestamp);
}
ortp_debug("rtp_parse: discarding too old packet (ts=%i)",rtp->timestamp);
freemsg(mp);
stats->outoftime++;
ortp_global_stats.outoftime++;
return;
}
}
queue_packet(&session->rtp.rq,session->rtp.max_rq_size,mp,rtp,&i);
stats->discarded+=i;
ortp_global_stats.discarded+=i;
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,54 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef rtpsession_priv_h
#define rtpsession_priv_h
#include "ortp/rtpsession.h"
typedef enum {
RTP_SESSION_RECV_SYNC=1, /* the rtp session is synchronising in the incoming stream */
RTP_SESSION_FIRST_PACKET_DELIVERED=1<<1,
RTP_SESSION_SCHEDULED=1<<2,/* the scheduler controls this session*/
RTP_SESSION_BLOCKING_MODE=1<<3, /* in blocking mode */
RTP_SESSION_RECV_NOT_STARTED=1<<4, /* the application has not started to try to recv */
RTP_SESSION_SEND_NOT_STARTED=1<<5, /* the application has not started to send something */
RTP_SESSION_IN_SCHEDULER=1<<6, /* the rtp session is in the scheduler list */
RTP_SESSION_USING_EXT_SOCKETS=1<<7, /* the session is using externaly supplied sockets */
RTP_SOCKET_CONNECTED=1<<8,
RTCP_SOCKET_CONNECTED=1<<9,
RTP_SESSION_USING_TRANSPORT=1<<10
}RtpSessionFlags;
#define rtp_session_using_transport(s, stream) (((s)->flags & RTP_SESSION_USING_TRANSPORT) && (s->stream.tr != 0))
void rtp_session_update_payload_type(RtpSession * session, int pt);
void rtp_putq(queue_t *q, mblk_t *mp);
mblk_t * rtp_getq(queue_t *q, uint32_t ts, int *rejected);
int rtp_session_rtp_recv(RtpSession * session, uint32_t ts);
int rtp_session_rtcp_recv(RtpSession * session);
int rtp_session_rtp_send (RtpSession * session, mblk_t * m);
int rtp_session_rtcp_send (RtpSession * session, mblk_t * m);
void rtp_session_rtp_parse(RtpSession *session, mblk_t *mp, uint32_t local_str_ts, struct sockaddr *addr, socklen_t addrlen);
void rtp_session_rtcp_parse(RtpSession *session, mblk_t *mp);
void rtp_session_dispatch_event(RtpSession *session, OrtpEvent *ev);
#endif

View file

@ -1,98 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc1889) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <ortp/rtpsession.h>
#include "utils.h"
void rtp_signal_table_init(RtpSignalTable *table,RtpSession *session, const char *signal_name)
{
memset(table,0,sizeof(RtpSignalTable));
table->session=session;
table->signal_name=signal_name;
session->signal_tables=o_list_append(session->signal_tables,(void*)table);
}
int rtp_signal_table_add(RtpSignalTable *table,RtpCallback cb, unsigned long user_data)
{
int i;
for (i=0;i<RTP_CALLBACK_TABLE_MAX_ENTRIES;i++){
if (table->callback[i]==NULL){
table->callback[i]=cb;
table->user_data[i]=user_data;
table->count++;
return 0;
}
}
return -1;
}
void rtp_signal_table_emit(RtpSignalTable *table)
{
int i,c;
for (i=0,c=0;c<table->count;i++){
if (table->callback[i]!=NULL){
c++; /*I like it*/
table->callback[i](table->session,table->user_data[i]);
}
}
}
void rtp_signal_table_emit2(RtpSignalTable *table,unsigned long arg)
{
int i,c;
for (i=0,c=0;c<table->count;i++){
if (table->callback[i]!=NULL){
c++; /*I like it*/
table->callback[i](table->session,arg,table->user_data[i]);
}
}
}
void rtp_signal_table_emit3(RtpSignalTable *table, unsigned long arg1, unsigned long arg2)
{
int i,c;
for (i=0,c=0;c<table->count;i++){
if (table->callback[i]!=NULL){
c++; /*I like it*/
table->callback[i](table->session,arg1,arg2,table->user_data[i]);
}
}
}
int rtp_signal_table_remove_by_callback(RtpSignalTable *table,RtpCallback cb)
{
int i;
for (i=0;i<RTP_CALLBACK_TABLE_MAX_ENTRIES;i++){
if (table->callback[i]==cb){
table->callback[i]=NULL;
table->user_data[i]=0;
table->count--;
return 0;
}
}
return -1;
}

View file

@ -1,33 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc1889) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "ortp/ortp.h"
#include "rtptimer.h"
void rtp_timer_set_interval(RtpTimer *timer, struct timeval *interval)
{
if (timer->state==RTP_TIMER_RUNNING){
ortp_warning("Cannot change timer interval while it is running.\n");
return;
}
timer->interval.tv_sec=interval->tv_sec;
timer->interval.tv_usec=interval->tv_usec;
}

View file

@ -1,52 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef RTPTIMER_H
#define RTPTIMER_H
#if !defined(_WIN32) && !defined(_WIN32_WCE)
#include <sys/time.h>
#else
#include <time.h>
#include "winsock2.h"
#endif
#include <ortp/port.h>
typedef void (*RtpTimerFunc)(void);
struct _RtpTimer
{
int state;
#define RTP_TIMER_RUNNING 1
#define RTP_TIMER_STOPPED 0
RtpTimerFunc timer_init;
RtpTimerFunc timer_do;
RtpTimerFunc timer_uninit;
struct timeval interval;
};
typedef struct _RtpTimer RtpTimer;
void rtp_timer_set_interval(RtpTimer *timer, struct timeval *interval);
extern RtpTimer posix_timer;
#endif

View file

@ -1,212 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc1889) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <ortp/ortp.h>
#include "utils.h"
#include "scheduler.h"
#include "rtpsession_priv.h"
// To avoid warning during compile
extern void rtp_session_process (RtpSession * session, uint32_t time, RtpScheduler *sched);
void rtp_scheduler_init(RtpScheduler *sched)
{
sched->list=0;
sched->time_=0;
/* default to the posix timer */
rtp_scheduler_set_timer(sched,&posix_timer);
ortp_mutex_init(&sched->lock,NULL);
ortp_cond_init(&sched->unblock_select_cond,NULL);
sched->max_sessions=sizeof(SessionSet)*8;
session_set_init(&sched->all_sessions);
sched->all_max=0;
session_set_init(&sched->r_sessions);
sched->r_max=0;
session_set_init(&sched->w_sessions);
sched->w_max=0;
session_set_init(&sched->e_sessions);
sched->e_max=0;
}
RtpScheduler * rtp_scheduler_new()
{
RtpScheduler *sched=(RtpScheduler *) ortp_malloc(sizeof(RtpScheduler));
memset(sched,0,sizeof(RtpScheduler));
rtp_scheduler_init(sched);
return sched;
}
void rtp_scheduler_set_timer(RtpScheduler *sched,RtpTimer *timer)
{
if (sched->thread_running){
ortp_warning("Cannot change timer while the scheduler is running !!");
return;
}
sched->timer=timer;
/* report the timer increment */
sched->timer_inc=(timer->interval.tv_usec/1000) + (timer->interval.tv_sec*1000);
}
void rtp_scheduler_start(RtpScheduler *sched)
{
if (sched->thread_running==0){
sched->thread_running=1;
ortp_mutex_lock(&sched->lock);
ortp_thread_create(&sched->thread, NULL, rtp_scheduler_schedule,(void*)sched);
ortp_cond_wait(&sched->unblock_select_cond,&sched->lock);
ortp_mutex_unlock(&sched->lock);
}
else ortp_warning("Scheduler thread already running.");
}
void rtp_scheduler_stop(RtpScheduler *sched)
{
if (sched->thread_running==1)
{
sched->thread_running=0;
ortp_thread_join(sched->thread, NULL);
}
else ortp_warning("Scheduler thread is not running.");
}
void rtp_scheduler_destroy(RtpScheduler *sched)
{
if (sched->thread_running) rtp_scheduler_stop(sched);
ortp_mutex_destroy(&sched->lock);
//g_mutex_free(sched->unblock_select_mutex);
ortp_cond_destroy(&sched->unblock_select_cond);
ortp_free(sched);
}
void * rtp_scheduler_schedule(void * psched)
{
RtpScheduler *sched=(RtpScheduler*) psched;
RtpTimer *timer=sched->timer;
RtpSession *current;
/* take this lock to prevent the thread to start until g_thread_create() returns
because we need sched->thread to be initialized */
ortp_mutex_lock(&sched->lock);
ortp_cond_signal(&sched->unblock_select_cond); /* unblock the starting thread */
ortp_mutex_unlock(&sched->lock);
timer->timer_init();
while(sched->thread_running)
{
/* do the processing here: */
ortp_mutex_lock(&sched->lock);
current=sched->list;
/* processing all scheduled rtp sessions */
while (current!=NULL)
{
ortp_debug("scheduler: processing session=0x%x.\n",current);
rtp_session_process(current,sched->time_,sched);
current=current->next;
}
/* wake up all the threads that are sleeping in _select() */
ortp_cond_broadcast(&sched->unblock_select_cond);
ortp_mutex_unlock(&sched->lock);
/* now while the scheduler is going to sleep, the other threads can compute their
result mask and see if they have to leave, or to wait for next tick*/
//ortp_message("scheduler: sleeping.");
timer->timer_do();
sched->time_+=sched->timer_inc;
}
/* when leaving the thread, stop the timer */
timer->timer_uninit();
return NULL;
}
void rtp_scheduler_add_session(RtpScheduler *sched, RtpSession *session)
{
RtpSession *oldfirst;
int i;
if (session->flags & RTP_SESSION_IN_SCHEDULER){
/* the rtp session is already scheduled, so return silently */
return;
}
rtp_scheduler_lock(sched);
/* enqueue the session to the list of scheduled sessions */
oldfirst=sched->list;
sched->list=session;
session->next=oldfirst;
if (sched->max_sessions==0){
ortp_error("rtp_scheduler_add_session: max_session=0 !");
}
/* find a free pos in the session mask*/
for (i=0;i<sched->max_sessions;i++){
if (!ORTP_FD_ISSET(i,&sched->all_sessions.rtpset)){
session->mask_pos=i;
session_set_set(&sched->all_sessions,session);
/* make a new session scheduled not blockable if it has not started*/
if (session->flags & RTP_SESSION_RECV_NOT_STARTED)
session_set_set(&sched->r_sessions,session);
if (session->flags & RTP_SESSION_SEND_NOT_STARTED)
session_set_set(&sched->w_sessions,session);
if (i>sched->all_max){
sched->all_max=i;
}
break;
}
}
rtp_session_set_flag(session,RTP_SESSION_IN_SCHEDULER);
rtp_scheduler_unlock(sched);
}
void rtp_scheduler_remove_session(RtpScheduler *sched, RtpSession *session)
{
RtpSession *tmp;
int cond=1;
return_if_fail(session!=NULL);
if (!(session->flags & RTP_SESSION_IN_SCHEDULER)){
/* the rtp session is not scheduled, so return silently */
return;
}
rtp_scheduler_lock(sched);
tmp=sched->list;
if (tmp==session){
sched->list=tmp->next;
rtp_session_unset_flag(session,RTP_SESSION_IN_SCHEDULER);
session_set_clr(&sched->all_sessions,session);
rtp_scheduler_unlock(sched);
return;
}
/* go the position of session in the list */
while(cond){
if (tmp!=NULL){
if (tmp->next==session){
tmp->next=tmp->next->next;
cond=0;
}
else tmp=tmp->next;
}else {
/* the session was not found ! */
ortp_warning("rtp_scheduler_remove_session: the session was not found in the scheduler list!");
cond=0;
}
}
rtp_session_unset_flag(session,RTP_SESSION_IN_SCHEDULER);
/* delete the bit in the mask */
session_set_clr(&sched->all_sessions,session);
rtp_scheduler_unlock(sched);
}

View file

@ -1,69 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef SCHEDULER_H
#define SCHEDULER_H
#include "ortp/rtpsession.h"
#include "ortp/sessionset.h"
#include "rtptimer.h"
struct _RtpScheduler {
RtpSession *list; /* list of scheduled sessions*/
SessionSet all_sessions; /* mask of scheduled sessions */
int all_max; /* the highest pos in the all mask */
SessionSet r_sessions; /* mask of sessions that have a recv event */
int r_max;
SessionSet w_sessions; /* mask of sessions that have a send event */
int w_max;
SessionSet e_sessions; /* mask of session that have error event */
int e_max;
int max_sessions; /* the number of position in the masks */
/* GMutex *unblock_select_mutex; */
ortp_cond_t unblock_select_cond;
ortp_mutex_t lock;
ortp_thread_t thread;
int thread_running;
struct _RtpTimer *timer;
uint32_t time_; /*number of miliseconds elapsed since the start of the thread */
uint32_t timer_inc; /* the timer increment in milisec */
};
typedef struct _RtpScheduler RtpScheduler;
RtpScheduler * rtp_scheduler_new(void);
void rtp_scheduler_set_timer(RtpScheduler *sched,RtpTimer *timer);
void rtp_scheduler_start(RtpScheduler *sched);
void rtp_scheduler_stop(RtpScheduler *sched);
void rtp_scheduler_destroy(RtpScheduler *sched);
void rtp_scheduler_add_session(RtpScheduler *sched, RtpSession *session);
void rtp_scheduler_remove_session(RtpScheduler *sched, RtpSession *session);
void * rtp_scheduler_schedule(void * sched);
#define rtp_scheduler_lock(sched) ortp_mutex_lock(&(sched)->lock)
#define rtp_scheduler_unlock(sched) ortp_mutex_unlock(&(sched)->lock)
/* void rtp_scheduler_add_set(RtpScheduler *sched, SessionSet *set); */
RtpScheduler * ortp_get_scheduler(void);
#endif

View file

@ -1,204 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc1889) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <ortp/ortp.h>
#include <ortp/sessionset.h>
#include "scheduler.h"
/**
* Allocates and initialize a new empty session set.
*
* @return the empty session set.
**/
SessionSet * session_set_new()
{
SessionSet *set=(SessionSet *) ortp_malloc(sizeof(SessionSet));
session_set_init(set);
return set;
}
/**
* Destroys a session set.
*
**/
void session_set_destroy(SessionSet *set)
{
ortp_free(set);
}
int session_set_and(SessionSet *sched_set, int maxs, SessionSet *user_set, SessionSet *result_set)
{
uint32_t *mask1,*mask2,*mask3;
int i=0;
int j,ret=0;
mask1=(uint32_t*)(void*)&sched_set->rtpset;
mask2=(uint32_t*)(void*)&user_set->rtpset;
mask3=(uint32_t*)(void*)&result_set->rtpset;
while(i<maxs+1){
*mask3=(*mask1) & (*mask2); /* computes the AND between the two masks*/
/* and unset the sessions that have been found from the sched_set */
*mask1=(*mask1) & (~(*mask3));
if ((*mask3)!=0){
for (j=0;j<32;j++){
if ( ((*mask3)>>j) & 1){
ret++;
}
}
}
i+=32;
mask1++;
mask2++;
mask3++;
}
//printf("session_set_and: ret=%i\n",ret);
return ret;
}
/**
* This function performs similarly as libc select() function, but performs on #RtpSession
* instead of file descriptors.
* session_set_select() suspends the calling process until some events arrive on one of the
* three sets passed in argument. Two of the sets can be NULL.
* The first set @recvs is interpreted as a set of RtpSession waiting for receive events:
* a new buffer (perhaps empty) is availlable on one or more sessions of the set, or the last
* receive operation with rtp_session_recv_with_ts() would have finished if it were in
* blocking mode.
* The second set is interpreted as a set of RtpSession waiting for send events, i.e. the last
* rtp_session_send_with_ts() call on a session would have finished if it were in blocking mode.
*
* When some events arrived on some of sets, then the function returns and sets are changed
* to indicate the sessions where events happened.
* Sessions can be added to sets using session_set_set(), a session has to be tested to be
* part of a set using session_set_is_set().
*
* @param recvs a set of rtp sessions to be watched for read events
* @param sends a set of rtp sessions to be watched for write events
* @param errors a set of rtp sessions to be watched for errors
* @return: the number of sessions on which the selected events happened.
**/
int session_set_select(SessionSet *recvs, SessionSet *sends, SessionSet *errors)
{
int ret=0,bits;
SessionSet temp;
RtpScheduler *sched=ortp_get_scheduler();
/*lock the scheduler to not read the masks while they are being modified by the scheduler*/
rtp_scheduler_lock(sched);
while(1){
/* computes the SessionSet intersection (in the other words mask intersection) between
the mask given by the user and scheduler masks */
if (recvs!=NULL){
session_set_init(&temp);
bits=session_set_and(&sched->r_sessions,sched->all_max,recvs,&temp);
ret+=bits;
/* copy the result set in the given user set (might be empty) */
if (ret>0) session_set_copy(recvs,&temp);
}
if (sends!=NULL){
session_set_init(&temp);
bits=session_set_and(&sched->w_sessions,sched->all_max,sends,&temp);
ret+=bits;
if (ret>0){
/* copy the result set in the given user set (might be empty)*/
session_set_copy(sends,&temp);
}
}
if (errors!=NULL){
session_set_init(&temp);
bits=session_set_and(&sched->e_sessions,sched->all_max,errors,&temp);
ret+=bits;
if (ret>0){
/* copy the result set in the given user set */
session_set_copy(errors,&temp);
}
}
if (ret>0){
/* there are set file descriptors, return immediately */
//printf("There are %i sessions set, returning.\n",ret);
rtp_scheduler_unlock(sched);
return ret;
}
//printf("There are %i sessions set.\n",ret);
/* else we wait until the next loop of the scheduler*/
ortp_cond_wait(&sched->unblock_select_cond,&sched->lock);
}
return -1;
}
int session_set_timedselect(SessionSet *recvs, SessionSet *sends, SessionSet *errors, struct timeval *timeout)
{
int ret=0,bits;
int remainingTime; // duration in ms
SessionSet temp;
RtpScheduler *sched;
if (timeout==NULL)
return session_set_select(recvs, sends, errors);
sched=ortp_get_scheduler();
remainingTime = timeout->tv_usec/1000 + timeout->tv_sec*1000;
/*lock the scheduler to not read the masks while they are being modified by the scheduler*/
rtp_scheduler_lock(sched);
do {
/* computes the SessionSet intersection (in the other words mask intersection) between
the mask given by the user and scheduler masks */
if (recvs!=NULL){
session_set_init(&temp);
bits=session_set_and(&sched->r_sessions,sched->all_max,recvs,&temp);
ret+=bits;
/* copy the result set in the given user set (might be empty) */
if (ret>0) session_set_copy(recvs,&temp);
}
if (sends!=NULL){
session_set_init(&temp);
bits=session_set_and(&sched->w_sessions,sched->all_max,sends,&temp);
ret+=bits;
if (ret>0){
/* copy the result set in the given user set (might be empty)*/
session_set_copy(sends,&temp);
}
}
if (errors!=NULL){
session_set_init(&temp);
bits=session_set_and(&sched->e_sessions,sched->all_max,errors,&temp);
ret+=bits;
if (ret>0){
/* copy the result set in the given user set */
session_set_copy(errors,&temp);
}
}
if (ret>0){
/* there are set file descriptors, return immediately */
//printf("There are %i sessions set, returning.\n",ret);
rtp_scheduler_unlock(sched);
return ret;
}
//printf("There are %i sessions set.\n",ret);
/* else we wait until the next loop of the scheduler*/
ortp_cond_wait(&sched->unblock_select_cond,&sched->lock);
remainingTime -= sched->timer_inc;
} while (remainingTime>0);
return -1;
}

View file

@ -1,203 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#if defined(_MSC_VER) && (defined(WIN32) || defined(_WIN32_WCE))
#include "ortp-config-win32.h"
#else
#include "ortp-config.h"
#endif
#include "ortp/ortp.h"
#ifdef HAVE_SRTP
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
#include "ortp/srtp.h"
#define SRTP_PAD_BYTES 64 /*?? */
static int srtp_sendto(RtpTransport *t, mblk_t *m, int flags, const struct sockaddr *to, socklen_t tolen){
srtp_t srtp=(srtp_t)t->data;
int slen;
err_status_t err;
/* enlarge the buffer for srtp to write its data */
msgpullup(m,msgdsize(m)+SRTP_PAD_BYTES);
slen=m->b_wptr-m->b_rptr;
err=srtp_protect(srtp,m->b_rptr,&slen);
if (err==err_status_ok){
return sendto(t->session->rtp.socket,m->b_rptr,slen,flags,to,tolen);
}
ortp_error("srtp_protect() failed");
return -1;
}
static int srtp_recvfrom(RtpTransport *t, mblk_t *m, int flags, struct sockaddr *from, socklen_t *fromlen){
srtp_t srtp=(srtp_t)t->data;
int err;
int slen;
err=recvfrom(t->session->rtp.socket,m->b_wptr,m->b_datap->db_lim-m->b_datap->db_base,flags,from,fromlen);
if (err>0){
/* keep NON-RTP data unencrypted */
rtp_header_t *rtp;
if (err>=RTP_FIXED_HEADER_SIZE)
{
rtp = (rtp_header_t*)m->b_wptr;
if (rtp->version!=2)
{
return err;
}
}
slen=err;
if (srtp_unprotect(srtp,m->b_wptr,&slen)==err_status_ok)
return slen;
else {
ortp_error("srtp_unprotect() failed");
return -1;
}
}
return err;
}
static int srtcp_sendto(RtpTransport *t, mblk_t *m, int flags, const struct sockaddr *to, socklen_t tolen){
srtp_t srtp=(srtp_t)t->data;
int slen;
/* enlarge the buffer for srtp to write its data */
msgpullup(m,msgdsize(m)+SRTP_PAD_BYTES);
slen=m->b_wptr-m->b_rptr;
if (srtp_protect_rtcp(srtp,m->b_rptr,&slen)==err_status_ok){
return sendto(t->session->rtcp.socket,m->b_rptr,slen,flags,to,tolen);
}
ortp_error("srtp_protect_rtcp() failed");
return -1;
}
static int srtcp_recvfrom(RtpTransport *t, mblk_t *m, int flags, struct sockaddr *from, socklen_t *fromlen){
srtp_t srtp=(srtp_t)t->data;
int err;
int slen;
err=recvfrom(t->session->rtcp.socket,m->b_wptr,m->b_datap->db_lim-m->b_datap->db_base,flags,from,fromlen);
if (err>0){
slen=err;
if (srtp_unprotect_rtcp(srtp,m->b_wptr,&slen)==err_status_ok)
return slen;
else {
ortp_error("srtp_unprotect_rtcp() failed");
return -1;
}
}
return err;
}
ortp_socket_t
srtp_getsocket(RtpTransport *t)
{
return t->session->rtp.socket;
}
ortp_socket_t
srtcp_getsocket(RtpTransport *t)
{
return t->session->rtcp.socket;
}
/**
* Creates a pair of Secure-RTP/Secure-RTCP RtpTransport's.
* oRTP relies on libsrtp (see http://srtp.sf.net ) for secure RTP encryption.
* This function creates a RtpTransport object to be used to the RtpSession using
* rtp_session_set_transport().
* @srtp: the srtp_t session to be used
*
**/
int srtp_transport_new(srtp_t srtp, RtpTransport **rtpt, RtpTransport **rtcpt ){
if (rtpt) {
(*rtpt)=ortp_new(RtpTransport,1);
(*rtpt)->data=srtp;
(*rtpt)->t_getsocket=srtp_getsocket;
(*rtpt)->t_sendto=srtp_sendto;
(*rtpt)->t_recvfrom=srtp_recvfrom;
}
if (rtcpt) {
(*rtcpt)=ortp_new(RtpTransport,1);
(*rtcpt)->data=srtp;
(*rtcpt)->t_getsocket=srtcp_getsocket;
(*rtcpt)->t_sendto=srtcp_sendto;
(*rtcpt)->t_recvfrom=srtcp_recvfrom;
}
return 0;
}
err_status_t ortp_srtp_init(void)
{
return srtp_init();
}
err_status_t ortp_srtp_create(srtp_t *session, const srtp_policy_t *policy)
{
int i;
i = srtp_create(session, policy);
return i;
}
err_status_t ortp_srtp_dealloc(srtp_t session)
{
return srtp_dealloc(session);
}
err_status_t ortp_srtp_add_stream(srtp_t session, const srtp_policy_t *policy)
{
return srtp_add_stream(session, policy);
}
bool_t ortp_srtp_supported(void){
return TRUE;
}
#else
int srtp_transport_new(void *i, RtpTransport **rtpt, RtpTransport **rtcpt ){
ortp_error("srtp_transport_new: oRTP has not been compiled with SRTP support.");
return -1;
}
bool_t ortp_srtp_supported(void){
return FALSE;
}
int ortp_srtp_create(void *i, const void *policy)
{
return -1;
}
int ortp_srtp_dealloc(void *session)
{
return -1;
}
int ortp_srtp_add_stream(void *session, const void *policy)
{
return -1;
}
#endif

View file

@ -1,339 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc1889) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "ortp/ortp.h"
#include "ortp/rtp.h"
#include "ortp/str_utils.h"
#include "utils.h"
void qinit(queue_t *q){
mblk_init(&q->_q_stopper);
q->_q_stopper.b_next=&q->_q_stopper;
q->_q_stopper.b_prev=&q->_q_stopper;
q->q_mcount=0;
}
void mblk_init(mblk_t *mp)
{
mp->b_cont=mp->b_prev=mp->b_next=NULL;
mp->b_rptr=mp->b_wptr=NULL;
mp->reserved1=0;
mp->reserved2=0;
}
dblk_t *datab_alloc(int size){
dblk_t *db;
int total_size=sizeof(dblk_t)+size;
db=(dblk_t *) ortp_malloc(total_size);
db->db_base=(uint8_t*)db+sizeof(dblk_t);
db->db_lim=db->db_base+size;
db->db_ref=1;
db->db_freefn=NULL; /* the buffer pointed by db_base must never be freed !*/
return db;
}
static inline void datab_ref(dblk_t *d){
d->db_ref++;
}
static inline void datab_unref(dblk_t *d){
d->db_ref--;
if (d->db_ref==0){
if (d->db_freefn!=NULL)
d->db_freefn(d->db_base);
ortp_free(d);
}
}
mblk_t *allocb(int size, int pri)
{
mblk_t *mp;
dblk_t *datab;
mp=(mblk_t *) ortp_malloc(sizeof(mblk_t));
mblk_init(mp);
datab=datab_alloc(size);
mp->b_datap=datab;
mp->b_rptr=mp->b_wptr=datab->db_base;
mp->b_next=mp->b_prev=mp->b_cont=NULL;
return mp;
}
mblk_t *esballoc(uint8_t *buf, int size, int pri, void (*freefn)(void*) )
{
mblk_t *mp;
dblk_t *datab;
mp=(mblk_t *) ortp_malloc(sizeof(mblk_t));
mblk_init(mp);
datab=(dblk_t *) ortp_malloc(sizeof(dblk_t));
datab->db_base=buf;
datab->db_lim=buf+size;
datab->db_ref=1;
datab->db_freefn=freefn;
mp->b_datap=datab;
mp->b_rptr=mp->b_wptr=buf;
mp->b_next=mp->b_prev=mp->b_cont=NULL;
return mp;
}
void freeb(mblk_t *mp)
{
return_if_fail(mp->b_datap!=NULL);
return_if_fail(mp->b_datap->db_base!=NULL);
datab_unref(mp->b_datap);
ortp_free(mp);
}
void freemsg(mblk_t *mp)
{
mblk_t *tmp1,*tmp2;
tmp1=mp;
while(tmp1!=NULL)
{
tmp2=tmp1->b_cont;
freeb(tmp1);
tmp1=tmp2;
}
}
mblk_t *dupb(mblk_t *mp)
{
mblk_t *newm;
return_val_if_fail(mp->b_datap!=NULL,NULL);
return_val_if_fail(mp->b_datap->db_base!=NULL,NULL);
datab_ref(mp->b_datap);
newm=(mblk_t *) ortp_malloc(sizeof(mblk_t));
mblk_init(newm);
newm->reserved1=mp->reserved1;
newm->reserved2=mp->reserved2;
newm->b_datap=mp->b_datap;
newm->b_rptr=mp->b_rptr;
newm->b_wptr=mp->b_wptr;
return newm;
}
/* duplicates a complex mblk_t */
mblk_t *dupmsg(mblk_t* m)
{
mblk_t *newm=NULL,*mp,*prev;
prev=newm=dupb(m);
m=m->b_cont;
while (m!=NULL){
mp=dupb(m);
prev->b_cont=mp;
prev=mp;
m=m->b_cont;
}
return newm;
}
void putq(queue_t *q,mblk_t *mp)
{
q->_q_stopper.b_prev->b_next=mp;
mp->b_prev=q->_q_stopper.b_prev;
mp->b_next=&q->_q_stopper;
q->_q_stopper.b_prev=mp;
q->q_mcount++;
}
mblk_t *getq(queue_t *q)
{
mblk_t *tmp;
tmp=q->_q_stopper.b_next;
if (tmp==&q->_q_stopper) return NULL;
q->_q_stopper.b_next=tmp->b_next;
tmp->b_next->b_prev=&q->_q_stopper;
tmp->b_prev=NULL;
tmp->b_next=NULL;
q->q_mcount--;
return tmp;
}
mblk_t * peekq(queue_t *q){
mblk_t *tmp;
tmp=q->_q_stopper.b_next;
if (tmp==&q->_q_stopper) return NULL;
return tmp;
}
/* insert mp in q just before emp */
void insq(queue_t *q,mblk_t *emp, mblk_t *mp)
{
if (emp==NULL){
putq(q,mp);
return;
}
q->q_mcount++;
emp->b_prev->b_next=mp;
mp->b_prev=emp->b_prev;
emp->b_prev=mp;
mp->b_next=emp;
}
void remq(queue_t *q, mblk_t *mp){
q->q_mcount--;
mp->b_prev->b_next=mp->b_next;
mp->b_next->b_prev=mp->b_prev;
mp->b_next=NULL;
mp->b_prev=NULL;
}
/* remove and free all messages in the q */
void flushq(queue_t *q, int how)
{
mblk_t *mp;
while ((mp=getq(q))!=NULL)
{
freemsg(mp);
}
}
int msgdsize(const mblk_t *mp)
{
int msgsize=0;
while(mp!=NULL){
msgsize+=(int) (mp->b_wptr-mp->b_rptr);
mp=mp->b_cont;
}
return msgsize;
}
void msgpullup(mblk_t *mp,int len)
{
mblk_t *firstm=mp;
dblk_t *db;
int wlen=0;
if (mp->b_cont==NULL && len==-1) return; /*nothing to do, message is not fragmented */
if (len==-1) len=msgdsize(mp);
db=datab_alloc(len);
while(wlen<len && mp!=NULL){
int remain=len-wlen;
int mlen=mp->b_wptr-mp->b_rptr;
if (mlen<=remain){
memcpy(&db->db_base[wlen],mp->b_rptr,mlen);
wlen+=mlen;
mp=mp->b_cont;
}else{
memcpy(&db->db_base[wlen],mp->b_rptr,remain);
wlen+=remain;
}
}
/*set firstm to point to the new datab */
freemsg(firstm->b_cont);
firstm->b_cont=NULL;
datab_unref(firstm->b_datap);
firstm->b_datap=db;
firstm->b_rptr=db->db_base;
firstm->b_wptr=firstm->b_rptr+wlen;
}
mblk_t *copyb(mblk_t *mp)
{
mblk_t *newm;
int len=(int) (mp->b_wptr-mp->b_rptr);
newm=allocb(len,BPRI_MED);
memcpy(newm->b_wptr,mp->b_rptr,len);
newm->b_wptr+=len;
return newm;
}
mblk_t *copymsg(mblk_t *mp)
{
mblk_t *newm=0,*m;
m=newm=copyb(mp);
mp=mp->b_cont;
while(mp!=NULL){
m->b_cont=copyb(mp);
m=m->b_cont;
mp=mp->b_cont;
}
return newm;
}
mblk_t * appendb(mblk_t *mp, const char *data, int size, bool_t pad){
int padcnt=0;
int i;
if (pad){
padcnt= (int)(4L-( (long)(((long)mp->b_wptr)+size) % 4L)) % 4L;
}
if ((mp->b_wptr + size +padcnt) > mp->b_datap->db_lim){
/* buffer is not large enough: append a new block (with the same size ?)*/
int plen=(int)((char*)mp->b_datap->db_lim - (char*) mp->b_datap->db_base);
mp->b_cont=allocb(MAX(plen,size),0);
mp=mp->b_cont;
}
if (size) memcpy(mp->b_wptr,data,size);
mp->b_wptr+=size;
for (i=0;i<padcnt;i++){
mp->b_wptr[0]=0;
mp->b_wptr++;
}
return mp;
}
void msgappend(mblk_t *mp, const char *data, int size, bool_t pad){
while(mp->b_cont!=NULL) mp=mp->b_cont;
appendb(mp,data,size,pad);
}
mblk_t *concatb(mblk_t *mp, mblk_t *newm){
while (mp->b_cont!=NULL) mp=mp->b_cont;
mp->b_cont=newm;
while(newm->b_cont!=NULL) newm=newm->b_cont;
return newm;
}
void msgb_allocator_init(msgb_allocator_t *a){
qinit(&a->q);
}
mblk_t *msgb_allocator_alloc(msgb_allocator_t *a, int size){
queue_t *q=&a->q;
mblk_t *m,*found=NULL;
/*lookup for an unused msgb (data block with ref count ==1)*/
for(m=qbegin(q);!qend(q,m);m=qnext(q,m)){
if (m->b_datap->db_ref==1 && m->b_datap->db_lim-m->b_datap->db_base>=size){
found=m;
break;
}
}
if (found==NULL){
found=allocb(size,0);
putq(q,found);
}
return dupb(found);
}
void msgb_allocator_uninit(msgb_allocator_t *a){
flushq(&a->q,-1);
}

File diff suppressed because it is too large Load diff

View file

@ -1,473 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ====================================================================
* The Vovida Software License, Version 1.0
*
* Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
*
* 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 names "VOCAL", "Vovida Open Communication Application Library",
* and "Vovida Open Communication Application Library (VOCAL)" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact vocal@vovida.org.
*
* 4. Products derived from this software may not be called "VOCAL", nor
* may "VOCAL" appear in their name, without prior written
* permission of Vovida Networks, Inc.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
* NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
* NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
* IN EXCESS OF $1,000, NOR FOR ANY 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.
*
* ====================================================================
*
* This software consists of voluntary contributions made by Vovida
* Networks, Inc. and many individuals on behalf of Vovida Networks,
* Inc. For more information on Vovida Networks, Inc., please see
* <http://www.vovida.org/>.
*
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#if !defined(WIN32) && !defined(_WIN32_WCE)
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <fcntl.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
#include <net/if.h>
#endif
#include <assert.h>
#include <time.h>
#if defined(WIN32) || defined(_WIN32_WCE)
#include <winsock2.h>
#include <stdlib.h>
/* #include <io.h> */
#else
#include <arpa/inet.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netdb.h>
#include <string.h>
#include <unistd.h>
#endif
#include <string.h>
#include "ortp/stun_udp.h"
#include "ortp/ortp.h"
#if !defined(WIN32) && !defined(_WIN32_WCE)
int getErrno() { return errno; }
#else
int getErrno() { return WSAGetLastError(); }
#endif
Socket
openPort( unsigned short port, unsigned int interfaceIp )
{
struct sockaddr_in addr;
Socket fd;
fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
if ( fd == INVALID_SOCKET )
{
ortp_error("stun_udp: Could not create a UDP socket");
return INVALID_SOCKET;
}
memset((char*) &(addr),0, sizeof((addr)));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl(INADDR_ANY);
addr.sin_port = htons(port);
if ( (interfaceIp != 0) &&
( interfaceIp != 0x100007f ) )
{
addr.sin_addr.s_addr = htonl(interfaceIp);
//ortp_debug("Binding to interface 0x%lu\n",(unsigned long) htonl(interfaceIp));
}
if ( bind( fd,(struct sockaddr*)&addr, sizeof(addr)) != 0 )
{
int e = getErrno();
switch (e)
{
case 0:
{
ortp_error("stun_udp: Could not bind socket");;
return INVALID_SOCKET;
}
case EADDRINUSE:
{
ortp_error("stun_udp: Port %i for receiving UDP is in use", port);
return INVALID_SOCKET;
}
break;
case EADDRNOTAVAIL:
{
ortp_error("stun_udp: Cannot assign requested address");
return INVALID_SOCKET;
}
break;
default:
{
#if !defined(_WIN32_WCE)
ortp_error("stun_udp: Could not bind UDP receive port Error=%i %s",
e, strerror(e));
#else
ortp_error("stun_udp: Could not bind UDP receive port Error=%i",
e);
#endif
return INVALID_SOCKET;
}
break;
}
}
ortp_debug("stun: opened port %i with fd %i\n", port, fd);
/* assert( fd != INVALID_SOCKET ); */
return fd;
}
bool_t
getMessage( Socket fd, char* buf, int* len,
unsigned int* srcIp, unsigned short* srcPort)
{
/* assert( fd != INVALID_SOCKET ); */
int originalSize = *len;
struct sockaddr_in from;
int fromLen = sizeof(from);
int err;
struct timeval tv;
fd_set fdSet;
#if defined(WIN32) || defined(_WIN32_WCE)
unsigned int fdSetSize;
#else
int fdSetSize;
#endif
if (originalSize <= 0)
{
return FALSE;
}
tv.tv_sec=1;
tv.tv_usec=0; /* 150 ms */
FD_ZERO(&fdSet); fdSetSize=0;
FD_SET(fd,&fdSet); fdSetSize = fd+1;
err = select(fdSetSize, &fdSet, NULL, NULL, &tv);
if ( err == SOCKET_ERROR )
{
int e = getErrno();
switch (e)
{
case ENOTSOCK:
ortp_error("stun_udp: Error fd not a socket");
break;
case ECONNRESET:
ortp_error("stun_udp: Error connection reset - host not reachable");
break;
default:
ortp_error("stun_udp: Socket Error=%i", e);
}
return FALSE;
}
if (err==0)
{
ortp_error("stun_udp: Connection timeout with stun server!");
*len = 0;
return FALSE;
}
if (FD_ISSET (fd, &fdSet))
{
*len = recvfrom(fd,
buf,
originalSize,
0,
(struct sockaddr *)&from,
(socklen_t*)&fromLen);
if ( *len == SOCKET_ERROR )
{
int e = getErrno();
switch (e)
{
case ENOTSOCK:
ortp_error("stun_udp: Error fd not a socket");
break;
case ECONNRESET:
ortp_error("stun_udp: Error connection reset - host not reachable");
break;
default:
ortp_error("stun_udp: Socket Error=%i", e);
}
return FALSE;
}
if ( *len < 0 )
{
ortp_error("stun_udp: socket closed? negative len");
return FALSE;
}
if ( *len == 0 )
{
ortp_error("stun_udp: socket closed? zero len");
return FALSE;
}
*srcPort = ntohs(from.sin_port);
*srcIp = ntohl(from.sin_addr.s_addr);
if ( (*len)+1 >= originalSize )
{
ortp_error("stun_udp: Received a message that was too large");
return FALSE;
}
buf[*len]=0;
return TRUE;
}
return FALSE;
}
bool_t
sendMessage( Socket fd, char* buf, int l,
unsigned int dstIp, unsigned short dstPort)
{
int s;
if (fd == INVALID_SOCKET)
return FALSE;
if ( dstPort == 0 )
{
/* sending on a connected port */
s = send(fd,buf,l,0);
}
else
{
struct sockaddr_in to;
int toLen = sizeof(to);
if (dstIp == 0)
{
ortp_error("stun_udp: invalid IP provided (dstIP==0)");
return FALSE;
}
memset(&to,0,toLen);
to.sin_family = AF_INET;
to.sin_port = htons(dstPort);
to.sin_addr.s_addr = htonl(dstIp);
s = sendto(fd, buf, l, 0,(struct sockaddr*)&to, toLen);
}
if ( s == SOCKET_ERROR )
{
int e = getErrno();
switch (e)
{
case ECONNREFUSED:
case EHOSTDOWN:
case EHOSTUNREACH:
{
/* quietly ignore this */
}
break;
case EAFNOSUPPORT:
{
ortp_error("stun_udp: err EAFNOSUPPORT in send");
}
break;
default:
{
#if !defined(_WIN32_WCE)
ortp_error("stun_udp: err %i %s in send", e, strerror(e));
#else
ortp_error("stun_udp: err %i in send", e);
#endif
}
}
return FALSE;
}
if ( s == 0 )
{
ortp_error("stun_udp: no data sent in send");
return FALSE;
}
if ( s != l )
{
ortp_error("stun_udp: only %i out of %i bytes sent", s, l);
return FALSE;
}
return TRUE;
}
void
initNetwork()
{
#if defined(WIN32) || defined(_WIN32_WCE)
WORD wVersionRequested = MAKEWORD( 2, 2 );
WSADATA wsaData;
int err;
err = WSAStartup( wVersionRequested, &wsaData );
if ( err != 0 )
{
/* could not find a usable WinSock DLL */
ortp_error("stun_udp: Could not load winsock");
}
/* Confirm that the WinSock DLL supports 2.2.*/
/* Note that if the DLL supports versions greater */
/* than 2.2 in addition to 2.2, it will still return */
/* 2.2 in wVersion since that is the version we */
/* requested. */
if ( LOBYTE( wsaData.wVersion ) != 2 ||
HIBYTE( wsaData.wVersion ) != 2 )
{
/* Tell the user that we could not find a usable */
/* WinSock DLL. */
WSACleanup( );
ortp_error("stun_udp: Wrong winsock (!= 2.2) version");
}
#endif
}
/* ====================================================================
* The Vovida Software License, Version 1.0
*
* Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
*
* 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 names "VOCAL", "Vovida Open Communication Application Library",
* and "Vovida Open Communication Application Library (VOCAL)" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact vocal@vovida.org.
*
* 4. Products derived from this software may not be called "VOCAL", nor
* may "VOCAL" appear in their name, without prior written
* permission of Vovida Networks, Inc.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
* NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
* NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
* IN EXCESS OF $1,000, NOR FOR ANY 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.
*
* ====================================================================
*
* This software consists of voluntary contributions made by Vovida
* Networks, Inc. and many individuals on behalf of Vovida Networks,
* Inc. For more information on Vovida Networks, Inc., please see
* <http://www.vovida.org/>.
*
*/
/* Local Variables:
mode:c
c-file-style:"ellemtel"
c-file-offsets:((case-label . +))
indent-tabs-mode:nil
End:
*/

View file

@ -1,15 +0,0 @@
*############################################################
*#
*# $Header: /sources/linphone/linphone/oRTP/src/system,v 1.1 2002/02/25 08:41:53 smorlat Exp $
*#
*# $Source: /sources/linphone/linphone/oRTP/src/system,v $
*# $Revision: 1.1 $
*# $Locker: $
*#
*############################################################
$VERSION 1
$CONFIGURE Y
$LOADABLE Y
$TUNABLE
$$$

View file

@ -1,421 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc1889) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <ortp/telephonyevents.h>
#include "utils.h"
#include "rtpsession_priv.h"
#include <ortp/ortp.h>
PayloadType payload_type_telephone_event={
PAYLOAD_AUDIO_PACKETIZED, /*type */
8000, /*clock rate */
0, /* bytes per sample N/A */
NULL, /* zero pattern N/A*/
0, /*pattern_length N/A */
0, /* normal_bitrate */
"telephone-event", /* MIME subtype */
0, /* Audio Channels N/A */
0 /*flags */
};
/**
* Tells whether telephony events payload type is supported within the
* context of the rtp session.
* @param session a rtp session
*
* @return the payload type number used for telephony events if found, -1 if not found.
**/
int rtp_session_telephone_events_supported(RtpSession *session)
{
/* search for a telephony event payload in the current profile */
session->snd.telephone_events_pt=rtp_profile_get_payload_number_from_mime(session->snd.profile,"telephone-event");
session->rcv.telephone_events_pt=rtp_profile_get_payload_number_from_mime(session->rcv.profile,"telephone-event");
/*printf("Telephone event pt is %i\n",session->telephone_events_pt);*/
return session->snd.telephone_events_pt;
}
/**
* Tells whether telephone event payload type is supported for send within the
* context of the rtp session.
* @param session a rtp session
*
* @return the payload type number used for telephony events if found, -1 if not found.
**/
int rtp_session_send_telephone_events_supported(RtpSession *session)
{
/* search for a telephony event payload in the current profile */
session->snd.telephone_events_pt=rtp_profile_get_payload_number_from_mime(session->snd.profile,"telephone-event");
/*printf("Telephone event pt is %i\n",session->telephone_events_pt);*/
return session->snd.telephone_events_pt;
}
/**
* Tells whether telephone event payload type is supported for receiving within the
* context of the rtp session.
* @param session a rtp session
*
* @return the payload type number used for telephony events if found, -1 if not found.
**/int rtp_session_recv_telephone_events_supported(RtpSession *session)
{
/* search for a telephony event payload in the current profile */
session->rcv.telephone_events_pt=rtp_profile_get_payload_number_from_mime(session->rcv.profile,"telephone-event");
/*printf("Telephone event pt is %i\n",session->telephone_events_pt);*/
return session->snd.telephone_events_pt;
}
/**
* Allocates a new rtp packet to be used to add named telephony events. The application can use
* then rtp_session_add_telephone_event() to add named events to the packet.
* Finally the packet has to be sent with rtp_session_sendm_with_ts().
*
* @param session a rtp session.
* @param start boolean to indicate if the marker bit should be set.
*
* @return a message block containing the rtp packet if successfull, NULL if the rtp session
*cannot support telephony event (because the rtp profile it is bound to does not include
*a telephony event payload type).
**/
mblk_t *rtp_session_create_telephone_event_packet(RtpSession *session, int start)
{
mblk_t *mp;
rtp_header_t *rtp;
return_val_if_fail(session->snd.telephone_events_pt!=-1,NULL);
mp=allocb(RTP_FIXED_HEADER_SIZE+TELEPHONY_EVENTS_ALLOCATED_SIZE,BPRI_MED);
if (mp==NULL) return NULL;
rtp=(rtp_header_t*)mp->b_rptr;
rtp->version = 2;
rtp->markbit=start;
rtp->padbit = 0;
rtp->extbit = 0;
rtp->cc = 0;
rtp->ssrc = session->snd.ssrc;
/* timestamp set later, when packet is sended */
/*seq number set later, when packet is sended */
/*set the payload type */
rtp->paytype=session->snd.telephone_events_pt;
/*copy the payload */
mp->b_wptr+=RTP_FIXED_HEADER_SIZE;
return mp;
}
/**
*@param session a rtp session.
*@param packet a rtp packet as a mblk_t
*@param event the event type as described in rfc2833, ie one of the TEV_* macros.
*@param end a boolean to indicate if the end bit should be set. (end of tone)
*@param volume the volume of the telephony tone, as described in rfc2833
*@param duration the duration of the telephony tone, in timestamp unit.
*
* Adds a named telephony event to a rtp packet previously allocated using
* rtp_session_create_telephone_event_packet().
*
*@return 0 on success.
**/
int rtp_session_add_telephone_event(RtpSession *session,
mblk_t *packet, uint8_t event, int end, uint8_t volume, uint16_t duration)
{
mblk_t *mp=packet;
telephone_event_t *event_hdr;
/* find the place where to add the new telephony event to the packet */
while(mp->b_cont!=NULL) mp=mp->b_cont;
/* see if we need to allocate a new mblk_t */
if ( ( mp->b_wptr) >= (mp->b_datap->db_lim)){
mblk_t *newm=allocb(TELEPHONY_EVENTS_ALLOCATED_SIZE,BPRI_MED);
mp->b_cont=newm;
mp=mp->b_cont;
}
if (mp==NULL) return -1;
event_hdr=(telephone_event_t*)mp->b_wptr;
event_hdr->event=event;
event_hdr->R=0;
event_hdr->E=end;
event_hdr->volume=volume;
event_hdr->duration=htons(duration);
mp->b_wptr+=sizeof(telephone_event_t);
return 0;
}
/**
* This functions creates telephony events packets for dtmf and sends them.
* It uses rtp_session_create_telephone_event_packet() and
* rtp_session_add_telephone_event() to create them and finally
* rtp_session_sendm_with_ts() to send them.
*
* @param session a rtp session
* @param dtmf a character meaning the dtmf (ex: '1', '#' , '9' ...)
* @param userts the timestamp
* @return 0 if successfull, -1 if the session cannot support telephony events or if the dtmf given as argument is not valid.
**/
int rtp_session_send_dtmf(RtpSession *session, char dtmf, uint32_t userts)
{
return rtp_session_send_dtmf2(session, dtmf, userts, 480);
}
/**
* A variation of rtp_session_send_dtmf() with duration specified.
*
* @param session a rtp session
* @param dtmf a character meaning the dtmf (ex: '1', '#' , '9' ...)
* @param userts the timestamp
* @param duration duration of the dtmf in timestamp units
* @return 0 if successfull, -1 if the session cannot support telephony events or if the dtmf given as argument is not valid.
**/
int rtp_session_send_dtmf2(RtpSession *session, char dtmf, uint32_t userts, int duration)
{
mblk_t *m1,*m2,*m3;
int tev_type;
int durationtier = duration/3;
/* create the first telephony event packet */
switch (dtmf){
case '1':
tev_type=TEV_DTMF_1;
break;
case '2':
tev_type=TEV_DTMF_2;
break;
case '3':
tev_type=TEV_DTMF_3;
break;
case '4':
tev_type=TEV_DTMF_4;
break;
case '5':
tev_type=TEV_DTMF_5;
break;
case '6':
tev_type=TEV_DTMF_6;
break;
case '7':
tev_type=TEV_DTMF_7;
break;
case '8':
tev_type=TEV_DTMF_8;
break;
case '9':
tev_type=TEV_DTMF_9;
break;
case '*':
tev_type=TEV_DTMF_STAR;
break;
case '0':
tev_type=TEV_DTMF_0;
break;
case '#':
tev_type=TEV_DTMF_POUND;
break;
case 'A':
case 'a':
tev_type=TEV_DTMF_A;
break;
case 'B':
case 'b':
tev_type=TEV_DTMF_B;
break;
case 'C':
case 'c':
tev_type=TEV_DTMF_C;
break;
case 'D':
case 'd':
tev_type=TEV_DTMF_D;
break;
case '!':
tev_type=TEV_FLASH;
break;
default:
ortp_warning("Bad dtmf: %c.",dtmf);
return -1;
}
m1=rtp_session_create_telephone_event_packet(session,1);
if (m1==NULL) return -1;
rtp_session_add_telephone_event(session,m1,tev_type,0,10,durationtier);
/* create a second packet */
m2=rtp_session_create_telephone_event_packet(session,0);
if (m2==NULL) return -1;
rtp_session_add_telephone_event(session,m2,tev_type,0,10, durationtier+durationtier);
/* create a third and final packet */
m3=rtp_session_create_telephone_event_packet(session,0);
if (m3==NULL) return -1;
rtp_session_add_telephone_event(session,m3,tev_type,1,10,duration);
/* and now sends them */
rtp_session_sendm_with_ts(session,m1,userts);
rtp_session_sendm_with_ts(session,m2,userts);
/* the last packet is sent three times in order to improve reliability*/
m1=copymsg(m3);
m2=copymsg(m3);
/* NOTE: */
/* we need to copymsg() instead of dupmsg() because the buffers are modified when
the packet is sended because of the host-to-network conversion of timestamp,ssrc, csrc, and
seq number.
*/
rtp_session_sendm_with_ts(session,m3,userts);
session->rtp.snd_seq--;
rtp_session_sendm_with_ts(session,m1,userts);
session->rtp.snd_seq--;
rtp_session_sendm_with_ts(session,m2,userts);
return 0;
}
/**
* Reads telephony events from a rtp packet. *@tab points to the beginning of the event buffer.
*
* @param session a rtp session from which telephony events are received.
* @param packet a rtp packet as a mblk_t.
* @param tab the address of a pointer.
* @return the number of events in the packet if successfull, 0 if the packet did not contain telephony events.
**/
int rtp_session_read_telephone_event(RtpSession *session,
mblk_t *packet,telephone_event_t **tab)
{
int datasize;
int num;
int i;
telephone_event_t *tev;
rtp_header_t *hdr=(rtp_header_t*)packet->b_rptr;
unsigned char *payload;
if (hdr->paytype!=session->rcv.telephone_events_pt) return 0; /* this is not tel ev.*/
datasize=rtp_get_payload(packet,&payload);
tev=*tab=(telephone_event_t*)payload;
/* convert from network to host order what should be */
num=datasize/sizeof(telephone_event_t);
for (i=0;i<num;i++)
{
tev[i].duration=ntohs(tev[i].duration);
}
return num;
}
static void notify_tev(RtpSession *session, telephone_event_t *event){
OrtpEvent *ev;
OrtpEventData *evd;
rtp_signal_table_emit2(&session->on_telephone_event,(long)(long)event[0].event);
if (session->eventqs!=NULL){
ev=ortp_event_new(ORTP_EVENT_TELEPHONE_EVENT);
evd=ortp_event_get_data(ev);
evd->packet=dupmsg(session->current_tev);
evd->info.telephone_event=event[0].event;
rtp_session_dispatch_event(session,ev);
}
}
static void notify_events_ended(RtpSession *session, telephone_event_t *events, int num){
int i;
for (i=0;i<num;i++){
if (events[i].E==1){
notify_tev(session, &events[i]);
}
}
}
/* for high level telephony event callback */
void rtp_session_check_telephone_events(RtpSession *session, mblk_t *m0)
{
telephone_event_t *events,*evbuf;
int num,num2;
int i;
rtp_header_t *hdr;
mblk_t *cur_tev;
unsigned char *payload;
int datasize;
hdr=(rtp_header_t*)m0->b_rptr;
datasize=rtp_get_payload(m0,&payload);
num=datasize/sizeof(telephone_event_t);
events=(telephone_event_t*)payload;
if (hdr->markbit==1)
{
/* this is a start of new events. Store the event buffer for later use*/
if (session->current_tev!=NULL) {
freemsg(session->current_tev);
session->current_tev=NULL;
}
session->current_tev=copymsg(m0);
/* handle the case where the events are short enough to end within the packet that has the marker bit*/
notify_events_ended(session,events,num);
}
/* whatever there is a markbit set or not, we parse the packet and compare it to previously received one */
cur_tev=session->current_tev;
if (cur_tev!=NULL)
{
/* first compare timestamp, they must be identical */
if (((rtp_header_t*)cur_tev->b_rptr)->timestamp==
((rtp_header_t*)m0->b_rptr)->timestamp)
{
datasize=rtp_get_payload(cur_tev,&payload);
num2=datasize/sizeof(telephone_event_t);
evbuf=(telephone_event_t*)payload;
for (i=0;i<MIN(num,num2);i++)
{
if (events[i].E==1)
{
/* update events that have ended */
if (evbuf[i].E==0){
evbuf[i].E=1;
/* this is a end of event, report it */
notify_tev(session,&events[i]);
}
}
}
}
else
{
/* timestamp are not identical: this is not the same events*/
if (session->current_tev!=NULL) {
freemsg(session->current_tev);
session->current_tev=NULL;
}
session->current_tev=copymsg(m0);
notify_events_ended(session,events,num);
}
}
else
{
/* there is no pending events, but we did not received marked bit packet
either the sending implementation is not compliant, either it has been lost,
we must deal with it anyway.*/
session->current_tev=copymsg(m0);
/* inform the application if there are tone ends */
notify_events_ended(session,events,num);
}
}

View file

@ -1,16 +0,0 @@
Makefile
Makefile.in
.deps
.libs
*.lo
*.la
mrtprecv
mrtpsend
rtpmemtest
rtprecv
rtpsend
test_timer
tevmrtprecv
tevrtprecv
tevrtpsend
rtpsend_stupid

View file

@ -1,32 +0,0 @@
SUBDIRS=win_receiver win_sender
if BUILD_TESTS
noinst_PROGRAMS= rtpsend rtprecv mrtpsend mrtprecv test_timer rtpmemtest tevrtpsend tevrtprecv tevmrtprecv rtpsend_stupid
rtpsend_SOURCES= rtpsend.c
rtprecv_SOURCES= rtprecv.c
mrtpsend_SOURCES= mrtpsend.c
mrtprecv_SOURCES= mrtprecv.c
rtpmemtest_SOURCES= rtpmemtest.c
test_timer_SOURCES= test_timer.c
tevrtpsend_SOURCES= tevrtpsend.c
tevrtprecv_SOURCES= tevrtprecv.c
tevmrtprecv_SOURCES= tevmrtprecv.c
rtpsend_stupid_SOURCES=rtpsend_stupid.c
endif
AM_CFLAGS= -D_ORTP_SOURCE $(PTHREAD_CFLAGS)
AM_LDFLAGS= $(PTHREAD_LDFLAGS)
LDADD=$(top_builddir)/src/libortp.la $(SRTP_LIBS) $(SSL_LIBS)
INCLUDES=-I$(top_srcdir)/include/

View file

@ -1,159 +0,0 @@
/*
The oRTP LinPhone RTP library intends to provide basics for a RTP stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* this program shows how to receive streams in paralel using the SessionSet api
and two threads only. */
#include <ortp/ortp.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <fcntl.h>
#ifndef _WIN32
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
#endif
int runcond=1;
void stophandler(int signum)
{
runcond=0;
}
static char *help="usage: mrtprecv file_prefix local_port number_of_streams \n"
"Receives multiples rtp streams on local_port+2*k, k={0..number_of_streams}\n";
#define STREAMS_COUNT 1000
/* malloc'd in order to detect buffer overflows with efence */
static uint8_t* recvbuf=0;
int rtp2disk(RtpSession *session,uint32_t ts, int fd)
{
int err,havemore=1;
while (havemore){
err=rtp_session_recv_with_ts(session,recvbuf,160,ts,&havemore);
if (havemore) printf("warning: havemore=%i!\n",havemore);
if (err>0){
rtp_session_set_data(session,(void*)1);
/* to indicate that (for the application) the stream has started, so we can start
recording on disk */
}
if (session->user_data != NULL) {
size_t ret = write(fd,recvbuf,err);
assert( ret == err );
}
}
return 0;
}
int main(int argc, char *argv[])
{
RtpSession *session[STREAMS_COUNT];
int i;
int filefd[STREAMS_COUNT];
int port;
uint32_t user_ts=0;
int channels;
SessionSet *set;
char *filename;
if (argc<4){
printf("%s",help);
return -1;
}
channels=atoi(argv[3]);
if (channels==0){
printf("%s",help);
return -1;
}
ortp_init();
ortp_scheduler_init();
port=atoi(argv[2]);
recvbuf=ortp_malloc(160);
for (i=0;i<channels;i++){
session[i]=rtp_session_new(RTP_SESSION_RECVONLY);
rtp_session_set_scheduling_mode(session[i],1);
rtp_session_set_blocking_mode(session[i],0);
rtp_session_set_local_addr(session[i],"0.0.0.0",port);
rtp_session_set_payload_type(session[i],0);
rtp_session_enable_adaptive_jitter_compensation(session[i], TRUE);
rtp_session_set_recv_buf_size(session[i],256);
port+=2;
}
filename=ortp_malloc(strlen(argv[1])+15);
for (i=0;i<channels;i++){
sprintf(filename,"%s%4.4d.dat",argv[1],i);
#ifndef _WIN32
filefd[i]=open(filename,O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
#else
filefd[i]=open(filename,_O_BINARY | O_WRONLY | O_CREAT | O_TRUNC);
#endif
if (filefd[i]<0) ortp_error("Could not open %s for writing: %s",filename,strerror(errno));
}
signal(SIGINT,stophandler);
/* create a set */
set=session_set_new();
while(runcond)
{
int k;
for (k=0;k<channels;k++){
/* add the session to the set */
session_set_set(set,session[k]);
//printf("session_set_set %d\n", k);
}
/* and then suspend the process by selecting() */
k=session_set_select(set,NULL,NULL);
if (k==0) printf("warning: session_set_select() is returning 0...\n");
for (k=0;k<channels;k++){
if (session_set_is_set(set,session[k])){
rtp2disk(session[k],user_ts,filefd[k]);
//printf("session_set_is_set %d\n", k);
} else {
//printf("warning: session %i is not set !\n",k);
}
}
user_ts+=160;
}
printf("Exiting\n");
for (i=0;i<channels;i++){
close(filefd[i]);
rtp_session_destroy(session[i]);
}
session_set_destroy(set);
ortp_free(filename);
ortp_exit();
ortp_global_stats_display();
ortp_free(recvbuf);
return 0;
}

View file

@ -1,175 +0,0 @@
/*
The oRTP LinPhone RTP library intends to provide basics for a RTP stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* this program shows how to send streams in paralel using the SessionSet api
and two threads only. */
#include <ortp/ortp.h>
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
#ifndef _WIN32
#include <sys/types.h>
#include <sys/time.h>
#endif
int runcond=1;
void stophandler(int signum)
{
runcond=0;
}
static char *help="usage: mrtpsend filename ip port nstreams [--packet-size size] [--ts-inc value]\n";
#define STREAMS_COUNT 1000
int main(int argc, char *argv[])
{
RtpSession *session[STREAMS_COUNT];
unsigned char *buffer;
int packet_size=160;
int ts_inc=160;
int i;
FILE *infile;
char *ssrc;
int port;
uint32_t user_ts=0;
int channels;
SessionSet *set;
if (argc<5){
printf("%s",help);
return -1;
}
channels=atoi(argv[4]);
if (channels==0){
printf("%s",help);
return -1;
}
/* look at command line options */
for (i=5;i<argc;i++)
{
if (strcmp(argv[i],"--packet-size")==0)
{
if ( i+1 < argc ){
packet_size=atoi(argv[i+1]);
}
else {
printf("%s",help);
return -1;
}
if (packet_size==0) {
printf("Packet size can't be %s.\n",argv[i+1]);
return -1;
}
i+=1;
}
else if (strcmp(argv[i],"--ts-inc")==0)
{
if ( i+1 < argc ){
ts_inc=atoi(argv[i+1]);
}
else {
printf("%s",help);
return -1;
}
if (ts_inc==0) {
printf("Timestanp increment can't be %s.\n",argv[i+1]);
return -1;
}
i+=1;
}
}
printf("Timestamp increment will be %i\n",ts_inc);
printf("Packet size will be %i\n",packet_size);
buffer=ortp_malloc(packet_size);
ortp_init();
ortp_scheduler_init();
printf("scheduler initialized\n");
ssrc=getenv("SSRC");
port=atoi(argv[3]);
for (i=0;i<channels;i++){
printf("channel %d\n", i);
session[i]=rtp_session_new(RTP_SESSION_SENDONLY);
rtp_session_set_scheduling_mode(session[i],1);
rtp_session_set_blocking_mode(session[i],0);
rtp_session_set_remote_addr(session[i],argv[2],port);
rtp_session_set_payload_type(session[i],0);
if (ssrc!=NULL) rtp_session_set_ssrc(session[i],atoi(ssrc));
port+=2;
}
#ifndef _WIN32
infile=fopen(argv[1],"r");
#else
infile=fopen(argv[1],"rb");
#endif
if (infile==NULL) {
perror("Cannot open file");
return -1;
}
printf("open file\n");
signal(SIGINT,stophandler);
/* create a set */
set=session_set_new();
while( ((i=fread(buffer,1,packet_size,infile))>0) && (runcond) )
{
int k;
//ortp_message("Sending packet.");
for (k=0;k<channels;k++){
/* add the session to the set */
session_set_set(set,session[k]);
}
/* and then suspend the process by selecting() */
session_set_select(NULL,set,NULL);
for (k=0;k<channels;k++){
/* this is stupid to do this test, because all session work the same way,
as the same user_ts is used for all sessions, here. */
if (session_set_is_set(set,session[k])){
rtp_session_send_with_ts(session[k],buffer,i,user_ts);
//ortp_message("packet sended !");
}
}
user_ts+=ts_inc;
}
fclose(infile);
printf("close file\n");
/*sleep a little to wait last packets to be sent */
#ifndef _WIN32
sleep(1);
#else
Sleep(1);
#endif
for (i=0;i<channels;i++)
rtp_session_destroy(session[i]);
session_set_destroy(set);
ortp_free(buffer);
ortp_exit();
ortp_global_stats_display();
return 0;
}

View file

@ -1,152 +0,0 @@
/*
The oRTP LinPhone RTP library intends to provide basics for a RTP stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* this program shows how to receive streams in paralel using the SessionSet api
and two threads only. */
#include <ortp/ortp.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#ifndef _WIN32
#include <signal.h>
#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#else
//#include <time.h>
#endif
int runcond=1;
void stophandler(int signum)
{
runcond=0;
}
static char *help="usage: mrtprecv file_prefix local_port number_of_streams \n"
"Receives multiples rtp streams on local_port+2*k, k={0..number_of_streams}\n";
#define STREAMS_COUNT 1000
int rtp2disk(RtpSession *session,uint32_t ts, int fd)
{
unsigned char buffer[160];
int err,havemore=1;
while (havemore){
err=rtp_session_recv_with_ts(session,buffer,160,ts,&havemore);
if (err>0){
rtp_session_set_data(session,(void*)1);
/* to indicate that (for the application) the stream has started, so we can start
recording on disk */
}
if (session->user_data != NULL) {
size_t ret = write(fd,buffer,err);
assert( ret == err );
}
}
return 0;
}
int main(int argc, char *argv[])
{
RtpSession *session[STREAMS_COUNT];
int i;
int filefd[STREAMS_COUNT];
int port;
uint32_t user_ts=0;
int channels;
SessionSet *set;
char *filename;
argc=4;
argv[1]="/tmp/output";
argv[2]="8000";
argv[3]="100";
if (argc<4){
printf("%s",help);
return -1;
}
channels=atoi(argv[3]);
if (channels==0){
printf("%s",help);
return -1;
}
ortp_init();
ortp_scheduler_init();
port=atoi(argv[2]);
for (i=0;i<channels;i++){
session[i]=rtp_session_new(RTP_SESSION_RECVONLY);
rtp_session_set_scheduling_mode(session[i],1);
rtp_session_set_blocking_mode(session[i],0);
#ifdef ORTP_INET6
rtp_session_set_local_addr(session[i],"::",port);
#else
rtp_session_set_local_addr(session[i],"0.0.0.0",port);
#endif
rtp_session_set_payload_type(session[i],0);
rtp_session_set_recv_buf_size(session[i],256);
port+=2;
}
filename=ortp_malloc(strlen(argv[1])+8);
for (i=0;i<channels;i++){
sprintf(filename,"%s%4.4d.dat",argv[1],i);
filefd[i]=open(filename,O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
if (filefd[i]<0) ortp_error("Could not open %s for writing: %s",filename,strerror(errno));
}
ortp_free(filename);
signal(SIGINT,stophandler);
/* create a set */
set=session_set_new();
while(runcond)
{
int k;
for (k=0;k<channels;k++){
/* add the session to the set */
session_set_set(set,session[k]);
//printf("session[k]->setflags=%i\n",session[k]->setflags);
}
/* and then suspend the process by selecting() */
session_set_select(set,NULL,NULL);
for (k=0;k<channels;k++){
if (session_set_is_set(set,session[k])){
rtp2disk(session[k],user_ts,filefd[k]);
}
}
user_ts+=160;
}
for (i=0;i<channels;i++){
close(filefd[i]);
rtp_session_destroy(session[i]);
}
session_set_destroy(set);
ortp_global_stats_display();
ortp_exit();
return 0;
}

View file

@ -1,180 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack..
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <ortp/ortp.h>
#include <signal.h>
#include <stdlib.h>
#ifndef _WIN32
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
#endif
int cond=1;
void stop_handler(int signum)
{
cond=0;
}
void ssrc_cb(RtpSession *session)
{
printf("hey, the ssrc has changed !\n");
}
static char *help="usage: rtprecv filename loc_port [--format format] [--soundcard] [--noadapt] [--with-jitter <milliseconds>]\n";
#define MULAW 0
#define ALAW 1
#if defined(__hpux) && HAVE_SYS_AUDIO_H
#include <sys/audio.h>
int sound_init(int format)
{
int fd;
fd=open("/dev/audio",O_WRONLY);
if (fd<0){
perror("Can't open /dev/audio");
return -1;
}
ioctl(fd,AUDIO_RESET,0);
ioctl(fd,AUDIO_SET_SAMPLE_RATE,8000);
ioctl(fd,AUDIO_SET_CHANNELS,1);
if (format==MULAW)
ioctl(fd,AUDIO_SET_DATA_FORMAT,AUDIO_FORMAT_ULAW);
else ioctl(fd,AUDIO_SET_DATA_FORMAT,AUDIO_FORMAT_ALAW);
return fd;
}
#else
int sound_init(int format)
{
return -1;
}
#endif
int main(int argc, char*argv[])
{
RtpSession *session;
unsigned char buffer[160];
int err;
uint32_t ts=0;
int stream_received=0;
FILE *outfile;
int local_port;
int have_more;
int i;
int format=0;
int soundcard=0;
int sound_fd=0;
int jittcomp=40;
bool_t adapt=TRUE;
/* init the lib */
if (argc<3){
printf("%s",help);
return -1;
}
local_port=atoi(argv[2]);
if (local_port<=0) {
printf("%s",help);
return -1;
}
for (i=3;i<argc;i++)
{
if (strcmp(argv[i],"--noadapt")==0) adapt=FALSE;
if (strcmp(argv[i],"--format")==0){
i++;
if (i<argc){
if (strcmp(argv[i],"mulaw")==0){
format=MULAW;
}else
if (strcmp(argv[i],"alaw")==0){
format=ALAW;
}else{
printf("Unsupported format %s\n",argv[i]);
return -1;
}
}
}
else if (strcmp(argv[i],"--soundcard")==0){
soundcard=1;
}
else if (strcmp(argv[i],"--with-jitter")==0){
i++;
if (i<argc){
jittcomp=atoi(argv[i]);
printf("Using a jitter buffer of %i milliseconds.\n",jittcomp);
}
}
}
outfile=fopen(argv[1],"wb");
if (outfile==NULL) {
perror("Cannot open file for writing");
return -1;
}
if (soundcard){
sound_fd=sound_init(format);
}
ortp_init();
ortp_scheduler_init();
ortp_set_log_level_mask(ORTP_DEBUG|ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR);
signal(SIGINT,stop_handler);
session=rtp_session_new(RTP_SESSION_RECVONLY);
rtp_session_set_scheduling_mode(session,1);
rtp_session_set_blocking_mode(session,1);
rtp_session_set_local_addr(session,"0.0.0.0",atoi(argv[2]));
rtp_session_set_connected_mode(session,TRUE);
rtp_session_set_symmetric_rtp(session,TRUE);
rtp_session_enable_adaptive_jitter_compensation(session,adapt);
rtp_session_set_jitter_compensation(session,jittcomp);
rtp_session_set_payload_type(session,0);
rtp_session_signal_connect(session,"ssrc_changed",(RtpCallback)ssrc_cb,0);
rtp_session_signal_connect(session,"ssrc_changed",(RtpCallback)rtp_session_reset,0);
while(cond)
{
have_more=1;
while (have_more){
err=rtp_session_recv_with_ts(session,buffer,160,ts,&have_more);
if (err>0) stream_received=1;
/* this is to avoid to write to disk some silence before the first RTP packet is returned*/
if ((stream_received) && (err>0)) {
size_t ret = fwrite(buffer,1,err,outfile);
if (sound_fd>0)
ret = write(sound_fd,buffer,err);
}
}
ts+=160;
//ortp_message("Receiving packet.");
}
rtp_session_destroy(session);
ortp_exit();
ortp_global_stats_display();
return 0;
}

View file

@ -1,128 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <ortp/ortp.h>
#include <signal.h>
#include <stdlib.h>
#ifndef _WIN32
#include <sys/types.h>
#include <sys/time.h>
#include <stdio.h>
#endif
int runcond=1;
void stophandler(int signum)
{
runcond=0;
}
static const char *help="usage: rtpsend filename dest_ip4addr dest_port [ --with-clockslide <value> ] [ --with-jitter <milliseconds>]\n";
int main(int argc, char *argv[])
{
RtpSession *session;
unsigned char buffer[160];
int i;
FILE *infile;
char *ssrc;
uint32_t user_ts=0;
int clockslide=0;
int jitter=0;
if (argc<4){
printf("%s", help);
return -1;
}
for(i=4;i<argc;i++){
if (strcmp(argv[i],"--with-clockslide")==0){
i++;
if (i>=argc) {
printf("%s", help);
return -1;
}
clockslide=atoi(argv[i]);
ortp_message("Using clockslide of %i milisecond every 50 packets.",clockslide);
}else if (strcmp(argv[i],"--with-jitter")==0){
ortp_message("Jitter will be added to outgoing stream.");
i++;
if (i>=argc) {
printf("%s", help);
return -1;
}
jitter=atoi(argv[i]);
}
}
ortp_init();
ortp_scheduler_init();
ortp_set_log_level_mask(ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR);
session=rtp_session_new(RTP_SESSION_SENDONLY);
rtp_session_set_scheduling_mode(session,1);
rtp_session_set_blocking_mode(session,1);
rtp_session_set_connected_mode(session,TRUE);
rtp_session_set_remote_addr(session,argv[2],atoi(argv[3]));
rtp_session_set_payload_type(session,0);
ssrc=getenv("SSRC");
if (ssrc!=NULL) {
printf("using SSRC=%i.\n",atoi(ssrc));
rtp_session_set_ssrc(session,atoi(ssrc));
}
#ifndef _WIN32
infile=fopen(argv[1],"r");
#else
infile=fopen(argv[1],"rb");
#endif
if (infile==NULL) {
perror("Cannot open file");
return -1;
}
signal(SIGINT,stophandler);
while( ((i=fread(buffer,1,160,infile))>0) && (runcond) )
{
rtp_session_send_with_ts(session,buffer,i,user_ts);
user_ts+=160;
if (clockslide!=0 && user_ts%(160*50)==0){
ortp_message("Clock sliding of %i miliseconds now",clockslide);
rtp_session_make_time_distorsion(session,clockslide);
}
/*this will simulate a burst of late packets */
if (jitter && (user_ts%(8000)==0)) {
struct timespec pausetime, remtime;
ortp_message("Simulating late packets now (%i milliseconds)",jitter);
pausetime.tv_sec=jitter/1000;
pausetime.tv_nsec=(jitter%1000)*1000000;
while(nanosleep(&pausetime,&remtime)==-1 && errno==EINTR){
pausetime=remtime;
}
}
}
fclose(infile);
rtp_session_destroy(session);
ortp_exit();
ortp_global_stats_display();
return 0;
}

View file

@ -1,126 +0,0 @@
/*
The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <ortp/ortp.h>
#include <signal.h>
#include <stdlib.h>
#ifndef _WIN32
#include <sys/types.h>
#include <sys/time.h>
#include <stdio.h>
#endif
/*defined in library, but not declared in public headers (this method is only useful for tests)*/
extern int __rtp_session_sendm_with_ts(RtpSession *session, mblk_t *packet, uint32_t packet_ts, uint32_t send_ts);
int runcond=1;
void stophandler(int signum)
{
runcond=0;
}
static char *help="usage: rtpsend filename dest_ip4addr dest_port [ --with-clockslide <value> ] [ --with-ptime <milliseconds>]\n";
int main(int argc, char *argv[])
{
RtpSession *session;
unsigned char buffer[160];
int i;
FILE *infile;
char *ssrc;
uint32_t packet_ts=0,send_ts=0;
uint32_t send_ts_inc=160;
int clockslide=0;
int jitter=0;
if (argc<4){
printf("%s",help);
return -1;
}
for(i=4;i<argc;i++){
if (strcmp(argv[i],"--with-clockslide")==0){
i++;
if (i>=argc) {
printf("%s",help);
return -1;
}
clockslide=atoi(argv[i]);
ortp_message("Using clockslide of %i milisecond every 50 packets.",clockslide);
}else if (strcmp(argv[i],"--with-ptime")==0){
ortp_message("Ptime related jitter will be added to outgoing stream.");
i++;
if (i>=argc) {
printf("%s",help);
return -1;
}
jitter=atoi(argv[i]);
send_ts_inc=jitter*8;
}
}
ortp_init();
ortp_scheduler_init();
ortp_set_log_level_mask(ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR);
session=rtp_session_new(RTP_SESSION_SENDONLY);
rtp_session_set_scheduling_mode(session,1);
rtp_session_set_blocking_mode(session,1);
rtp_session_set_connected_mode(session,TRUE);
rtp_session_set_remote_addr(session,argv[2],atoi(argv[3]));
rtp_session_set_payload_type(session,0);
ssrc=getenv("SSRC");
if (ssrc!=NULL) {
printf("using SSRC=%i.\n",atoi(ssrc));
rtp_session_set_ssrc(session,atoi(ssrc));
}
#ifndef _WIN32
infile=fopen(argv[1],"r");
#else
infile=fopen(argv[1],"rb");
#endif
if (infile==NULL) {
perror("Cannot open file");
return -1;
}
signal(SIGINT,stophandler);
while( ((i=fread(buffer,1,160,infile))>0) && (runcond) )
{
mblk_t *m=rtp_session_create_packet(session,RTP_FIXED_HEADER_SIZE,buffer,i);
__rtp_session_sendm_with_ts(session,m,packet_ts,send_ts);
packet_ts+=160;
if ((send_ts+send_ts_inc)<=packet_ts){
send_ts+=send_ts_inc;
}
if (clockslide!=0 && send_ts%(160*50)==0){
ortp_message("Clock sliding of %i miliseconds now",clockslide);
rtp_session_make_time_distorsion(session,clockslide);
}
}
fclose(infile);
rtp_session_destroy(session);
ortp_exit();
ortp_global_stats_display();
return 0;
}

View file

@ -1,43 +0,0 @@
/*
The oRTP LinPhone RTP library intends to provide basics for a RTP stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../rtptimer.h"
#include <stdio.h>
int main(int argc, char *argv[])
{
RtpTimer *timer=&posix_timer;
int i;
struct timeval interval;
interval.tv_sec=0;
interval.tv_usec=500000;
rtp_timer_set_interval(timer,&interval);
timer->timer_init();
for (i=0;i<10;i++)
{
printf("doing something...\n");
timer->timer_do();
}
timer->timer_uninit();
return 0;
}

View file

@ -1,175 +0,0 @@
/*
The oRTP LinPhone RTP library intends to provide basics for a RTP stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* this program shows how to receive streams in paralel using the SessionSet api
and two threads only. */
#include <ortp/ortp.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#ifndef _WIN32
#include <signal.h>
#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#else
//#include <time.h>
#endif
#include <ortp/telephonyevents.h>
int runcond=1;
void stophandler(int signum)
{
runcond=0;
}
static int dtmf_tab[16]={'0','1','2','3','4','5','6','7','8','9','*','#','A','B','C','D'};
static int *p_channel_id;
int dtmf_count=0;
static char *help="usage: tevmrtprecv file_prefix local_port number_of_streams \n"
"Receives multiples rtp streams with telephone events on local_port+2*k, k={0..number_of_streams}\n";
#define STREAMS_COUNT 1000
void recv_tev_cb(RtpSession *session,int type,long user_data)
{
//printf("Receiving telephony event:%i\n",type);
if (type<16) printf("This is dtmf %c on channel %d\n",dtmf_tab[type],*(int *)user_data);
dtmf_count++;
}
int rtp2disk(RtpSession *session,uint32_t ts, int fd)
{
unsigned char buffer[160];
int err,havemore=1;
while (havemore){
err=rtp_session_recv_with_ts(session,buffer,160,ts,&havemore);
if (err>0){
rtp_session_set_data(session,(void*)1);
/* to indicate that (for the application) the stream has started, so we can start
recording on disk */
}
if (session->user_data != NULL) {
size_t ret = write(fd,buffer,err);
assert( ret == err );
}
}
return 0;
}
int main(int argc, char *argv[])
{
RtpSession *session[STREAMS_COUNT];
int i;
int filefd[STREAMS_COUNT];
int port;
uint32_t user_ts=0;
int channels;
SessionSet *set;
char *filename;
if (argc<4){
printf("%s",help);
return -1;
}
channels=atoi(argv[3]);
if (channels==0){
printf("%s",help);
return -1;
}
ortp_init();
ortp_scheduler_init();
/* set the telephony event payload type to 96 in the av profile.*/
rtp_profile_set_payload(&av_profile,96,&payload_type_telephone_event);
port=atoi(argv[2]);
p_channel_id = (int *)ortp_malloc(channels*sizeof(int));
for (i=0;i<channels;i++){
session[i]=rtp_session_new(RTP_SESSION_RECVONLY);
rtp_session_set_scheduling_mode(session[i],1);
rtp_session_set_blocking_mode(session[i],0);
rtp_session_set_local_addr(session[i],"0.0.0.0",port);
rtp_session_set_recv_payload_type(session[i],0);
rtp_session_set_recv_buf_size(session[i],256);
p_channel_id[i] = i;
/* register for telephony events */
rtp_session_signal_connect(session[i],"telephone-event",(RtpCallback)recv_tev_cb,(long)&p_channel_id[i]);
port+=2;
}
filename=ortp_malloc(strlen(argv[1])+8);
for (i=0;i<channels;i++){
sprintf(filename,"%s%4.4d.dat",argv[1],i);
#ifndef _WIN32
filefd[i]=open(filename,O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
#else
filefd[i]=open(filename,_O_BINARY | O_WRONLY | O_CREAT | O_TRUNC);
#endif
if (filefd[i]<0) ortp_error("Could not open %s for writing: %s",filename,strerror(errno));
}
signal(SIGINT,stophandler);
/* create a set */
set=session_set_new();
while(runcond)
{
int k;
for (k=0;k<channels;k++){
/* add the session to the set */
session_set_set(set,session[k]);
}
/* and then suspend the process by selecting() */
session_set_select(set,NULL,NULL);
for (k=0;k<channels;k++){
if (session_set_is_set(set,session[k])){
rtp2disk(session[k],user_ts,filefd[k]);
}
}
user_ts+=160;
}
for (i=0;i<channels;i++){
close(filefd[i]);
rtp_session_destroy(session[i]);
}
session_set_destroy(set);
ortp_free(p_channel_id);
ortp_free(filename);
ortp_exit();
ortp_global_stats_display();
return 0;
}

View file

@ -1,108 +0,0 @@
/*
The oRTP LinPhone RTP library intends to provide basics for a RTP stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <ortp/ortp.h>
#include <ortp/telephonyevents.h>
#include <signal.h>
#include <stdlib.h>
#include <assert.h>
#include <sys/types.h>
#ifndef _WIN32
#include <sys/time.h>
#else
#include <time.h>
#endif
#include <stdio.h>
int runcond=1;
static int dtmf_tab[16]={'0','1','2','3','4','5','6','7','8','9','*','#','A','B','C','D'};
void stophandler(int signum)
{
runcond=0;
}
static char *help="usage: test_tevrecv filename loc_port\n";
int dtmf_count=0;
void recv_tev_cb(RtpSession *session,int type,long user_data)
{
printf("Receiving telephony event:%i\n",type);
if (type<16) printf("This is dtmf %c\n",dtmf_tab[type]);
dtmf_count++;
}
int main(int argc, char *argv[])
{
RtpSession *session;
unsigned char buffer[160];
int err;
FILE *outfile;
uint32_t ts=0;
int have_more;
if (argc<3){
printf("%s",help);
return -1;
}
ortp_init();
ortp_scheduler_init();
/* set the telephony event payload type to 96 in the av profile.*/
rtp_profile_set_payload(&av_profile,96,&payload_type_telephone_event);
session=rtp_session_new(RTP_SESSION_RECVONLY);
rtp_session_set_scheduling_mode(session,1);
rtp_session_set_blocking_mode(session,1);
rtp_session_set_local_addr(session,"0.0.0.0",atoi(argv[2]));
rtp_session_set_payload_type(session,0);
/* register for telephony events */
rtp_session_signal_connect(session,"telephone-event",(RtpCallback)recv_tev_cb,0);
outfile=fopen(argv[1],"wb");
if (outfile==NULL) {
perror("Cannot open file");
return -1;
}
signal(SIGINT,stophandler);
while(runcond)
{
have_more=1;
while (have_more){
err=rtp_session_recv_with_ts(session,buffer,160,ts,&have_more);
if (err>0) {
size_t ret = fwrite(buffer,1,err,outfile);
assert( ret == err );
}
}
ts+=160;
//ortp_message("Receiving packet.");
}
fclose(outfile);
rtp_session_destroy(session);
ortp_exit();
ortp_global_stats_display();
printf("Total dtmf events received: %i\n",dtmf_count);
return 0;
}

View file

@ -1,99 +0,0 @@
/*
The oRTP LinPhone RTP library intends to provide basics for a RTP stack.
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <ortp/ortp.h>
#include <ortp/telephonyevents.h>
#include <signal.h>
#include <stdlib.h>
#include <sys/types.h>
#ifndef _WIN32
#include <sys/time.h>
#else
#include <time.h>
#endif
#include <stdio.h>
int runcond=1;
void stophandler(int signum)
{
runcond=0;
}
static char *help="usage: test_tevsend filename dest_ip4addr dest_port\n";
int main(int argc, char *argv[])
{
RtpSession *session;
unsigned char buffer[160];
int i;
FILE *infile;
char *ssrc;
uint32_t user_ts=0;
int tel=0;
if (argc<4){
printf("%s",help);
return -1;
}
ortp_init();
ortp_scheduler_init();
/* set the telephony event payload type to 96 in the av profile.*/
rtp_profile_set_payload(&av_profile,96,&payload_type_telephone_event);
session=rtp_session_new(RTP_SESSION_SENDONLY);
rtp_session_set_scheduling_mode(session,1);
rtp_session_set_blocking_mode(session,1);
rtp_session_set_remote_addr(session,argv[2],atoi(argv[3]));
rtp_session_set_send_payload_type(session,0);
ssrc=getenv("SSRC");
if (ssrc!=NULL) {
printf("using SSRC=%i.\n",atoi(ssrc));
rtp_session_set_ssrc(session,atoi(ssrc));
}
infile=fopen(argv[1],"rb");
if (infile==NULL) {
perror("Cannot open file");
return -1;
}
signal(SIGINT,stophandler);
while( ((i=fread(buffer,1,160,infile))>0) && (runcond) )
{
//ortp_message("Sending packet.");
rtp_session_send_with_ts(session,buffer,i,user_ts);
user_ts+=160;
tel++;
if (tel==50){
tel=0;
ortp_message("Sending telephony event packet.");
rtp_session_send_dtmf(session,'*',user_ts);
user_ts+=160+160+160; /* the duration of the dtmf */
}
}
fclose(infile);
rtp_session_destroy(session);
ortp_exit();
ortp_global_stats_display();
return 0;
}

View file

@ -1,2 +0,0 @@
Makefile.in
Makefile

View file

@ -1,2 +0,0 @@
EXTRA_DIST=RTPReceiver.cpp RTPReceiver.vcproj

View file

@ -1,236 +0,0 @@
#include <ortp/ortp.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#define STREAMS_COUNT 1000
BOOL m_bExit = FALSE;
static char *help="usage: mrtprecv file_prefix local_port number_of_streams \n"
"Receives multiples rtp streams on local_port+2*k, k={0..number_of_streams}\n";
void ProductVersion()
{
char strBuffer[255];
printf("====================================\n");
printf("Author : Simon Morlat =\n");
printf("Porting : Yann STEPHAN =\n");
printf("====================================\n");
memset(&strBuffer, 0x0, sizeof(strBuffer));
sprintf((char *) &strBuffer, "= RTPReceiver V1.0 - Date : %s - %s\n", __DATE__, __TIME__);
printf(strBuffer);
printf("====================================\n");
}
BOOL ctrlHandlerFunction(DWORD fdwCtrlType)
{
switch (fdwCtrlType)
{
// Handle the CTRL+C signal.
// CTRL+CLOSE: confirm that the user wants to exit.
case CTRL_C_EVENT:
case CTRL_CLOSE_EVENT:
case CTRL_BREAK_EVENT:
case CTRL_LOGOFF_EVENT:
case CTRL_SHUTDOWN_EVENT:
m_bExit = TRUE;
return TRUE;
default:
return FALSE;
}
}
int rtp2disk(RtpSession *session,uint32_t ts, FILE * fd)
{
char buffer[160];
int err,havemore=1;
while (havemore)
{
err=rtp_session_recv_with_ts(session,buffer,160,ts,&havemore);
if (havemore)
printf("==> Warning: havemore=1!\n");
if (err>0)
{
rtp_session_set_data(session,(void*)1);
/* to indicate that (for the application) the stream has started, so we can start
recording on disk */
}
if (session->user_data != NULL)
{
fwrite(&buffer,1,160, fd);
}
}
return 0;
}
int GetSystemInformation()
{
SYSTEM_INFO SystemInfo;
GetSystemInfo(&SystemInfo);
return SystemInfo.dwNumberOfProcessors;
}
int __cdecl main(int argc, char *argv[])
{
RtpSession * session[STREAMS_COUNT];
FILE * filefd[STREAMS_COUNT];
SessionSet * set;
uint32_t user_ts = 0;
int port = 0;
int channels = 0;
int i = 0;
int nCPUCount = 0;
int nSchedulerCPU = 2;
char strFilename[MAX_PATH];
ProductVersion();
if (argc<4)
{
printf(help);
return -1;
}
channels=atoi(argv[3]);
if (channels==0){
printf(help);
return -1;
}
// Now it's time to use the power of multiple CPUs
nCPUCount = GetSystemInformation();
printf("==> # of CPU detected : %d\n", nCPUCount);
ortp_init();
ortp_scheduler_init();
if (nCPUCount > 1)
{
if (nCPUCount > 2)
{
nSchedulerCPU = 3;
}
/* if (ortp_bind_scheduler_to_cpu(nSchedulerCPU) != -1)
{
printf("==> Scheduler has been binded to CPU %d\n", nSchedulerCPU);
}
else
{
printf("==> Scheduler still binded to CPU 1\n");
}
*/
}
port=atoi(argv[2]);
for (i=0;i<channels;i++)
{
session[i]=rtp_session_new(RTP_SESSION_RECVONLY);
rtp_session_set_scheduling_mode(session[i],1);
rtp_session_set_blocking_mode(session[i],0);
rtp_session_set_local_addr(session[i],"0.0.0.0",port);
rtp_session_set_send_payload_type(session[i],0);
rtp_session_enable_adaptive_jitter_compensation(session[i], TRUE);
rtp_session_set_recv_buf_size(session[i],256);
port+=2;
}
memset(strFilename, 0x0, sizeof(strFilename));
for (i=0;i<channels;i++)
{
sprintf(strFilename,"%s%4.4d.dat",argv[1],i);
filefd[i]=fopen(strFilename, "wb");
if (filefd[i]<0)
{
printf("Could not open %s for writing: %s",strFilename,strerror(errno));
}
}
// =============== INSTALL THE CONTROL HANDLER ===============
if (SetConsoleCtrlHandler( (PHANDLER_ROUTINE) ctrlHandlerFunction, TRUE) == 0)
{
printf("==> Cannot handle the CTRL-C...\n");
}
/* create a set */
set=session_set_new();
printf("==> RTP Receiver started\n");
while(m_bExit == FALSE)
{
int k;
for (k=0;k<channels;k++){
/* add the session to the set */
session_set_set(set,session[k]);
//printf("session_set_set %d\n", k);
}
/* and then suspend the process by selecting() */
k=session_set_select(set,NULL,NULL);
//printf("session_set_select\n");
if (k==0)
{
printf("==> Warning: session_set_select() is returning 0...\n");
}
for (k=0;k<channels;k++){
if (session_set_is_set(set,session[k]))
{
rtp2disk(session[k],user_ts,filefd[k]);
//printf("==> Session_set_is_set %d\n", k);
}
else
{
//printf("warning: session %i is not set !\n",k);
}
}
user_ts+=160;
}
printf("==> Exiting\n");
for (i=0;i<channels;i++)
{
fclose(filefd[i]);
rtp_session_destroy(session[i]);
}
session_set_destroy(set);
ortp_exit();
ortp_global_stats_display();
printf("Waiting for exit : ");
for (i = 0; i < 4*5; i++)
{
printf(".");
Sleep(250);
}
return 0;
}

Some files were not shown because too many files have changed in this diff Show more