From 967779a28c83b332046f896777e282b63da201f5 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 20 Jan 2010 11:35:20 +0100 Subject: [PATCH 1/6] remote ortp and add it as a submodule instead. --- .gitmodules | 3 + linphone/oRTP | 1 + linphone/oRTP/.gitignore | 23 - linphone/oRTP/AUTHORS | 4 - linphone/oRTP/COPYING | 504 --- linphone/oRTP/ChangeLog | 153 - linphone/oRTP/INSTALL | 229 -- linphone/oRTP/Makefile.am | 89 - linphone/oRTP/NEWS | 51 - linphone/oRTP/README | 58 - linphone/oRTP/TODO | 2 - linphone/oRTP/autogen.sh | 30 - linphone/oRTP/build/.gitignore | 2 - linphone/oRTP/build/Makefile.am | 1 - linphone/oRTP/build/win32native/.gitignore | 2 - linphone/oRTP/build/win32native/Makefile.am | 2 - linphone/oRTP/build/win32native/oRTP.vcproj | 393 --- linphone/oRTP/build/win32native/ortp.def | 203 -- linphone/oRTP/build/wince/.gitignore | 2 - linphone/oRTP/build/wince/Makefile.am | 2 - linphone/oRTP/build/wince/oRTP.vcproj | 877 ----- linphone/oRTP/build/wince/ortp.def | 209 -- linphone/oRTP/build/winmob/Makefile.am | 3 - linphone/oRTP/build/winmob/oRTP.sln | 46 - linphone/oRTP/build/winmob/oRTP.vcproj | 916 ------ linphone/oRTP/build/winmob/ortp.def | 207 -- linphone/oRTP/configure.ac | 389 --- linphone/oRTP/docs/.gitignore | 2 - linphone/oRTP/include/.gitignore | 2 - linphone/oRTP/include/Makefile.am | 1 - linphone/oRTP/include/ortp/.gitignore | 2 - linphone/oRTP/include/ortp/Makefile.am | 11 - linphone/oRTP/include/ortp/b64.h | 420 --- linphone/oRTP/include/ortp/event.h | 85 - linphone/oRTP/include/ortp/ortp.h | 199 -- linphone/oRTP/include/ortp/payloadtype.h | 212 -- linphone/oRTP/include/ortp/port.h | 320 -- linphone/oRTP/include/ortp/rtcp.h | 252 -- linphone/oRTP/include/ortp/rtp.h | 115 - linphone/oRTP/include/ortp/rtpsession.h | 380 --- linphone/oRTP/include/ortp/rtpsignaltable.h | 53 - linphone/oRTP/include/ortp/sessionset.h | 139 - linphone/oRTP/include/ortp/srtp.h | 44 - linphone/oRTP/include/ortp/str_utils.h | 131 - linphone/oRTP/include/ortp/stun.h | 550 ---- linphone/oRTP/include/ortp/stun_udp.h | 139 - linphone/oRTP/include/ortp/telephonyevents.h | 105 - linphone/oRTP/oRTP.prj | 193 -- linphone/oRTP/oRTP.pws | 67 - linphone/oRTP/ortp.doxygen.in | 225 -- linphone/oRTP/ortp.pc.in | 10 - linphone/oRTP/ortp.spec.in | 83 - linphone/oRTP/pkg.list | 38 - linphone/oRTP/src/.gitignore | 15 - linphone/oRTP/src/Makefile.am | 41 - linphone/oRTP/src/avprofile.c | 516 --- linphone/oRTP/src/b64.c | 607 ---- linphone/oRTP/src/dll_entry.c | 147 - linphone/oRTP/src/event.c | 116 - linphone/oRTP/src/jitterctl.c | 182 -- linphone/oRTP/src/jitterctl.h | 41 - linphone/oRTP/src/master | 33 - linphone/oRTP/src/ortp-config-win32.h | 34 - linphone/oRTP/src/ortp.c | 379 --- linphone/oRTP/src/payloadtype.c | 363 --- linphone/oRTP/src/port.c | 532 --- linphone/oRTP/src/posixtimer.c | 177 - linphone/oRTP/src/rtcp.c | 412 --- linphone/oRTP/src/rtcpparse.c | 541 ---- linphone/oRTP/src/rtpparse.c | 236 -- linphone/oRTP/src/rtpsession.c | 1608 --------- linphone/oRTP/src/rtpsession_inet.c | 1034 ------ linphone/oRTP/src/rtpsession_priv.h | 54 - linphone/oRTP/src/rtpsignaltable.c | 98 - linphone/oRTP/src/rtptimer.c | 33 - linphone/oRTP/src/rtptimer.h | 52 - linphone/oRTP/src/scheduler.c | 212 -- linphone/oRTP/src/scheduler.h | 69 - linphone/oRTP/src/sessionset.c | 204 -- linphone/oRTP/src/srtp.c | 203 -- linphone/oRTP/src/str_utils.c | 339 -- linphone/oRTP/src/stun.c | 2884 ----------------- linphone/oRTP/src/stun_udp.c | 473 --- linphone/oRTP/src/system | 15 - linphone/oRTP/src/telephonyevents.c | 421 --- linphone/oRTP/src/tests/.gitignore | 16 - linphone/oRTP/src/tests/Makefile.am | 32 - linphone/oRTP/src/tests/mrtprecv.c | 159 - linphone/oRTP/src/tests/mrtpsend.c | 175 - linphone/oRTP/src/tests/rtpmemtest.c | 152 - linphone/oRTP/src/tests/rtprecv.c | 180 - linphone/oRTP/src/tests/rtpsend.c | 128 - linphone/oRTP/src/tests/rtpsend_stupid.c | 126 - linphone/oRTP/src/tests/test_timer.c | 43 - linphone/oRTP/src/tests/tevmrtprecv.c | 175 - linphone/oRTP/src/tests/tevrtprecv.c | 108 - linphone/oRTP/src/tests/tevrtpsend.c | 99 - .../oRTP/src/tests/win_receiver/.gitignore | 2 - .../oRTP/src/tests/win_receiver/Makefile.am | 2 - .../src/tests/win_receiver/RTPReceiver.cpp | 236 -- .../src/tests/win_receiver/RTPReceiver.vcproj | 216 -- linphone/oRTP/src/tests/win_sender/.gitignore | 2 - .../oRTP/src/tests/win_sender/Makefile.am | 2 - .../oRTP/src/tests/win_sender/RTPSender.cpp | 265 -- .../src/tests/win_sender/RTPSender.vcproj | 216 -- linphone/oRTP/src/utils.c | 86 - linphone/oRTP/src/utils.h | 91 - 107 files changed, 4 insertions(+), 22757 deletions(-) create mode 100644 .gitmodules create mode 160000 linphone/oRTP delete mode 100644 linphone/oRTP/.gitignore delete mode 100644 linphone/oRTP/AUTHORS delete mode 100644 linphone/oRTP/COPYING delete mode 100644 linphone/oRTP/ChangeLog delete mode 100644 linphone/oRTP/INSTALL delete mode 100644 linphone/oRTP/Makefile.am delete mode 100644 linphone/oRTP/NEWS delete mode 100644 linphone/oRTP/README delete mode 100644 linphone/oRTP/TODO delete mode 100755 linphone/oRTP/autogen.sh delete mode 100644 linphone/oRTP/build/.gitignore delete mode 100644 linphone/oRTP/build/Makefile.am delete mode 100644 linphone/oRTP/build/win32native/.gitignore delete mode 100644 linphone/oRTP/build/win32native/Makefile.am delete mode 100644 linphone/oRTP/build/win32native/oRTP.vcproj delete mode 100755 linphone/oRTP/build/win32native/ortp.def delete mode 100644 linphone/oRTP/build/wince/.gitignore delete mode 100644 linphone/oRTP/build/wince/Makefile.am delete mode 100644 linphone/oRTP/build/wince/oRTP.vcproj delete mode 100644 linphone/oRTP/build/wince/ortp.def delete mode 100644 linphone/oRTP/build/winmob/Makefile.am delete mode 100644 linphone/oRTP/build/winmob/oRTP.sln delete mode 100644 linphone/oRTP/build/winmob/oRTP.vcproj delete mode 100644 linphone/oRTP/build/winmob/ortp.def delete mode 100644 linphone/oRTP/configure.ac delete mode 100644 linphone/oRTP/docs/.gitignore delete mode 100644 linphone/oRTP/include/.gitignore delete mode 100644 linphone/oRTP/include/Makefile.am delete mode 100644 linphone/oRTP/include/ortp/.gitignore delete mode 100644 linphone/oRTP/include/ortp/Makefile.am delete mode 100644 linphone/oRTP/include/ortp/b64.h delete mode 100644 linphone/oRTP/include/ortp/event.h delete mode 100644 linphone/oRTP/include/ortp/ortp.h delete mode 100644 linphone/oRTP/include/ortp/payloadtype.h delete mode 100644 linphone/oRTP/include/ortp/port.h delete mode 100644 linphone/oRTP/include/ortp/rtcp.h delete mode 100644 linphone/oRTP/include/ortp/rtp.h delete mode 100644 linphone/oRTP/include/ortp/rtpsession.h delete mode 100644 linphone/oRTP/include/ortp/rtpsignaltable.h delete mode 100644 linphone/oRTP/include/ortp/sessionset.h delete mode 100644 linphone/oRTP/include/ortp/srtp.h delete mode 100644 linphone/oRTP/include/ortp/str_utils.h delete mode 100644 linphone/oRTP/include/ortp/stun.h delete mode 100644 linphone/oRTP/include/ortp/stun_udp.h delete mode 100644 linphone/oRTP/include/ortp/telephonyevents.h delete mode 100644 linphone/oRTP/oRTP.prj delete mode 100644 linphone/oRTP/oRTP.pws delete mode 100644 linphone/oRTP/ortp.doxygen.in delete mode 100644 linphone/oRTP/ortp.pc.in delete mode 100644 linphone/oRTP/ortp.spec.in delete mode 100644 linphone/oRTP/pkg.list delete mode 100644 linphone/oRTP/src/.gitignore delete mode 100644 linphone/oRTP/src/Makefile.am delete mode 100644 linphone/oRTP/src/avprofile.c delete mode 100644 linphone/oRTP/src/b64.c delete mode 100644 linphone/oRTP/src/dll_entry.c delete mode 100644 linphone/oRTP/src/event.c delete mode 100644 linphone/oRTP/src/jitterctl.c delete mode 100644 linphone/oRTP/src/jitterctl.h delete mode 100644 linphone/oRTP/src/master delete mode 100644 linphone/oRTP/src/ortp-config-win32.h delete mode 100644 linphone/oRTP/src/ortp.c delete mode 100644 linphone/oRTP/src/payloadtype.c delete mode 100644 linphone/oRTP/src/port.c delete mode 100644 linphone/oRTP/src/posixtimer.c delete mode 100644 linphone/oRTP/src/rtcp.c delete mode 100644 linphone/oRTP/src/rtcpparse.c delete mode 100644 linphone/oRTP/src/rtpparse.c delete mode 100644 linphone/oRTP/src/rtpsession.c delete mode 100644 linphone/oRTP/src/rtpsession_inet.c delete mode 100644 linphone/oRTP/src/rtpsession_priv.h delete mode 100644 linphone/oRTP/src/rtpsignaltable.c delete mode 100644 linphone/oRTP/src/rtptimer.c delete mode 100644 linphone/oRTP/src/rtptimer.h delete mode 100644 linphone/oRTP/src/scheduler.c delete mode 100644 linphone/oRTP/src/scheduler.h delete mode 100644 linphone/oRTP/src/sessionset.c delete mode 100644 linphone/oRTP/src/srtp.c delete mode 100644 linphone/oRTP/src/str_utils.c delete mode 100644 linphone/oRTP/src/stun.c delete mode 100644 linphone/oRTP/src/stun_udp.c delete mode 100644 linphone/oRTP/src/system delete mode 100644 linphone/oRTP/src/telephonyevents.c delete mode 100644 linphone/oRTP/src/tests/.gitignore delete mode 100644 linphone/oRTP/src/tests/Makefile.am delete mode 100644 linphone/oRTP/src/tests/mrtprecv.c delete mode 100644 linphone/oRTP/src/tests/mrtpsend.c delete mode 100644 linphone/oRTP/src/tests/rtpmemtest.c delete mode 100644 linphone/oRTP/src/tests/rtprecv.c delete mode 100644 linphone/oRTP/src/tests/rtpsend.c delete mode 100644 linphone/oRTP/src/tests/rtpsend_stupid.c delete mode 100644 linphone/oRTP/src/tests/test_timer.c delete mode 100644 linphone/oRTP/src/tests/tevmrtprecv.c delete mode 100644 linphone/oRTP/src/tests/tevrtprecv.c delete mode 100644 linphone/oRTP/src/tests/tevrtpsend.c delete mode 100644 linphone/oRTP/src/tests/win_receiver/.gitignore delete mode 100644 linphone/oRTP/src/tests/win_receiver/Makefile.am delete mode 100644 linphone/oRTP/src/tests/win_receiver/RTPReceiver.cpp delete mode 100644 linphone/oRTP/src/tests/win_receiver/RTPReceiver.vcproj delete mode 100644 linphone/oRTP/src/tests/win_sender/.gitignore delete mode 100644 linphone/oRTP/src/tests/win_sender/Makefile.am delete mode 100644 linphone/oRTP/src/tests/win_sender/RTPSender.cpp delete mode 100644 linphone/oRTP/src/tests/win_sender/RTPSender.vcproj delete mode 100644 linphone/oRTP/src/utils.c delete mode 100644 linphone/oRTP/src/utils.h diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..fb753dd0f --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "linphone/oRTP"] + path = linphone/oRTP + url = git://git.linphone.org/ortp.git diff --git a/linphone/oRTP b/linphone/oRTP new file mode 160000 index 000000000..305f3368f --- /dev/null +++ b/linphone/oRTP @@ -0,0 +1 @@ +Subproject commit 305f3368f583102d1f8a788592dbabb92798edf1 diff --git a/linphone/oRTP/.gitignore b/linphone/oRTP/.gitignore deleted file mode 100644 index 8babbdc96..000000000 --- a/linphone/oRTP/.gitignore +++ /dev/null @@ -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 diff --git a/linphone/oRTP/AUTHORS b/linphone/oRTP/AUTHORS deleted file mode 100644 index 6e305d120..000000000 --- a/linphone/oRTP/AUTHORS +++ /dev/null @@ -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. diff --git a/linphone/oRTP/COPYING b/linphone/oRTP/COPYING deleted file mode 100644 index b1e3f5a26..000000000 --- a/linphone/oRTP/COPYING +++ /dev/null @@ -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. - - - Copyright (C) - - 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. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/linphone/oRTP/ChangeLog b/linphone/oRTP/ChangeLog deleted file mode 100644 index 8276cdffa..000000000 --- a/linphone/oRTP/ChangeLog +++ /dev/null @@ -1,153 +0,0 @@ -2007-07-26 Francois-Xavier Kowalski - - * pkg.list: 1.3 - Do not run makewhatis when installing EPM-generated package. - -2007-04-19 Francois-Xavier Kowalski - - * ortp.spec.in (Requires): 1.4 - Adapt to new documentation generation change from gtk-doc to - Doxygen. - - * Makefile.am (docdir): 1.27 - automake's docdir is not always defined & is generally not - package specific, so we manually define docdir & pkgdocdir. - -2007-03-01 Francois-Xavier Kowalski - - * include/ortp/payloadtype.h: 1.28 - Encompass every declaration (whether lvalue or not) under extern - "C". - -2007-01-18 Francois-Xavier Kowalski - - * oRTP/Makefile.am: 1.24 - Fix RPM package generattion to cope with - - -2006-10-24 Francois-Xavier 'FiX' KOWALSKI - - * include/ortp/port.h: 1.21 - * src/scheduler.h (ortp_get_scheduler): 1.13 - Disable some Intel C/C++ warnings to build with icc. - - * include/ortp/stun_udp.h (__STUN_UDP_H__): 1.6 - * include/ortp/stun.h: 1.6 - Use - -2006-07-10 Francois-Xavier 'FiX' KOWALSKI - - * configure.ac: 1.89 - * gtk-doc.make (dist-check-gtkdoc): 1.1 - Non-fatal but incomplete "make dist" when gtk-doc is not - installed. - -2006-07-07 Francois-Xavier 'FiX' KOWALSKI - - * src/avprofile.c (NORMAL_BITRATE): 1.27 - Use ISO C/99 tagged struct syntax rather than GCC's legacy one. - -2006-07-07 Francois-Xavier Kowalski - - * src/rtpsession.c (RTP_SEQ_IS_GREATER): 1.132 - Fix comment content (using <>) that breaks gtkdoc SGML - generation. - - * include/ortp/event.h: 1.3 - OrtpEventData cannot be a type a s struct at the same time. - - * ortp.spec.in (Requires): 1.2 - Drop glib option - - * gtk-doc.make: - * docs/Makefile.am (#DOC_MAIN_SGML_FILE): 1.7 - * Makefile.am - Use slightly modified gtkdocize. - - * ortp.spec.in (Requires): 1.2 - Force build of gtk-doc, as the default choice that comes with - GTK_DOC_CHECK m4 macro is "no". - -2006-07-06 Francois-Xavier Kowalski - - * src/payloadtype.c (rtp_profile_destroy): 1.20 - avoid double-free - - * configure.ac: 1.88 - ortp-0.10.1.1 - -Friday March 10 2006 : ortp-0.9.1 - - fix package name (was 0.9.0.) - -Wednesday March 8 2006 : ortp-0.9.0 - - a lot of cleanups, glib dropped, win32 port reactivated - -Tuesday December 20 2005 : ortp-0.8.1 - - change session's clockrate dependant parameters upon payload type changed events at socket level - - rtp_session_set_recv_buf_size() added. - - bugfix in rtp_session_set_remote_addr() - - memory leak fixed in rtp_profile_destroy() - -Wednesday December 07 2005: ortp-0.8.0 - - make package modifications - - make rpm added - - add support for different payload types for incoming and outgoing stream (which breaks api compatibility) - - prefix all PayloadType with payload_type_* to avoid naming conflicts - -Wednesday August 24 2005: ortp-0.7.1 - - added patch for pkgconfig support from Jean-Philippe Barrette-LaPierre - -Monday August 8 2005: ortp-0.7.1pre5 - - adaptive jitter buffer improvements - - timestamp compensated packets returned by rtp_session_recvm_with_ts - - new payload definitions. - -Tuesday August 2 2005: ortp-0.7.1pre4 - - adaptive jitter buffer cleanups. - - hton24 utility function added for RTCP - -Tuesday July 4 2005: ortp-0.7.1pre3 - - improve automatic jitter buffer: no more closed-loop; just estimation. - - merge patch for multicast from Samuel Thibault - - merge patch for parsing of rtcp packets from Nicola Baldo - - add static payload definitions for g723.1 and g729. - -Wednesday November 17 2004: ortp-0.7.0 series starts - - add automatic jitter buffer: - * compensate clock slides - * estimate the jitter and sets the minimum jitter compensation delay accordingly - - posix timer simplified - - less system calls: use non blocking recv() and don't use select() or poll() - - add new functions for optimized packet sending - - recv() and send() are always made within the rtp_session_recv..() and rtp_session_send..() - functions. That means that scheduled non blocking mode does no more work as it worked before, ie - that packet will be sent immediately rather than being sent on time by the scheduler as it was before. - - HPUX kernel target removed. - - scheduler always built. - -Tuesday August 12 2003 : ortp-0.6.3 - - some improvements by Aymeric Moizard for Win32 build - - some bug fixes concerning ipv6 support. - -Thursday August 7 2003 : ortp-0.6.2 - - just some minor improvements for using oRTP in a C++ environment. - -Wednesday January 8 2003: ortp-0.6.0 - - many bug fixes by Telisma: the most important bug concerned the windows port. - - some new functionnalities concerning the RTP profiles and payload management. - - ported to glib-2.0 . - -Monday September 23 2002: ortp-0.5.0 - - ortp has been ported to the Microsoft Windows OS (version 2000 and later) by Eloquant - (http://www.eloquant.com) - - some bug fixes and improvements of the windows port have been made by Telisma - (http://www.telisma.com) - -Wednesday June 5 2002: ortp-0.4.4 - - Some crashing bugs fixed. - -Wednesday May 15 2002: ortp-0.4.3 - - Install include files properly. - -Tuesday May 7 2002: ortp-0.4.2 - - First official and public release of oRTP. diff --git a/linphone/oRTP/INSTALL b/linphone/oRTP/INSTALL deleted file mode 100644 index 54caf7c19..000000000 --- a/linphone/oRTP/INSTALL +++ /dev/null @@ -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. - diff --git a/linphone/oRTP/Makefile.am b/linphone/oRTP/Makefile.am deleted file mode 100644 index 5fea49152..000000000 --- a/linphone/oRTP/Makefile.am +++ /dev/null @@ -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 $( - 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 - diff --git a/linphone/oRTP/NEWS b/linphone/oRTP/NEWS deleted file mode 100644 index f3a081082..000000000 --- a/linphone/oRTP/NEWS +++ /dev/null @@ -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 diff --git a/linphone/oRTP/README b/linphone/oRTP/README deleted file mode 100644 index be6a82033..000000000 --- a/linphone/oRTP/README +++ /dev/null @@ -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. - - diff --git a/linphone/oRTP/TODO b/linphone/oRTP/TODO deleted file mode 100644 index ade9114db..000000000 --- a/linphone/oRTP/TODO +++ /dev/null @@ -1,2 +0,0 @@ -* make statistics thread-safe. -* add a rtp_stats_display() func to display rtp_stats_t properly. diff --git a/linphone/oRTP/autogen.sh b/linphone/oRTP/autogen.sh deleted file mode 100755 index 99302cbe4..000000000 --- a/linphone/oRTP/autogen.sh +++ /dev/null @@ -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 - diff --git a/linphone/oRTP/build/.gitignore b/linphone/oRTP/build/.gitignore deleted file mode 100644 index 282522db0..000000000 --- a/linphone/oRTP/build/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/linphone/oRTP/build/Makefile.am b/linphone/oRTP/build/Makefile.am deleted file mode 100644 index 30b1fe2e8..000000000 --- a/linphone/oRTP/build/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS= win32native wince winmob diff --git a/linphone/oRTP/build/win32native/.gitignore b/linphone/oRTP/build/win32native/.gitignore deleted file mode 100644 index 3dda72986..000000000 --- a/linphone/oRTP/build/win32native/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile.in -Makefile diff --git a/linphone/oRTP/build/win32native/Makefile.am b/linphone/oRTP/build/win32native/Makefile.am deleted file mode 100644 index 3a96a0bac..000000000 --- a/linphone/oRTP/build/win32native/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -EXTRA_DIST=oRTP.vcproj ortp.def - diff --git a/linphone/oRTP/build/win32native/oRTP.vcproj b/linphone/oRTP/build/win32native/oRTP.vcproj deleted file mode 100644 index 7c8b7d61f..000000000 --- a/linphone/oRTP/build/win32native/oRTP.vcproj +++ /dev/null @@ -1,393 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/linphone/oRTP/build/win32native/ortp.def b/linphone/oRTP/build/win32native/ortp.def deleted file mode 100755 index 4b418e029..000000000 --- a/linphone/oRTP/build/win32native/ortp.def +++ /dev/null @@ -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 diff --git a/linphone/oRTP/build/wince/.gitignore b/linphone/oRTP/build/wince/.gitignore deleted file mode 100644 index 282522db0..000000000 --- a/linphone/oRTP/build/wince/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/linphone/oRTP/build/wince/Makefile.am b/linphone/oRTP/build/wince/Makefile.am deleted file mode 100644 index 3a96a0bac..000000000 --- a/linphone/oRTP/build/wince/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -EXTRA_DIST=oRTP.vcproj ortp.def - diff --git a/linphone/oRTP/build/wince/oRTP.vcproj b/linphone/oRTP/build/wince/oRTP.vcproj deleted file mode 100644 index c64f9a2ce..000000000 --- a/linphone/oRTP/build/wince/oRTP.vcproj +++ /dev/null @@ -1,877 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/linphone/oRTP/build/wince/ortp.def b/linphone/oRTP/build/wince/ortp.def deleted file mode 100644 index e7e4c7ea6..000000000 --- a/linphone/oRTP/build/wince/ortp.def +++ /dev/null @@ -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 diff --git a/linphone/oRTP/build/winmob/Makefile.am b/linphone/oRTP/build/winmob/Makefile.am deleted file mode 100644 index b3208113b..000000000 --- a/linphone/oRTP/build/winmob/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -EXTRA_DIST=oRTP.vcproj ortp.def oRTP.sln - - diff --git a/linphone/oRTP/build/winmob/oRTP.sln b/linphone/oRTP/build/winmob/oRTP.sln deleted file mode 100644 index e481bdf21..000000000 --- a/linphone/oRTP/build/winmob/oRTP.sln +++ /dev/null @@ -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 diff --git a/linphone/oRTP/build/winmob/oRTP.vcproj b/linphone/oRTP/build/winmob/oRTP.vcproj deleted file mode 100644 index fdfc895e1..000000000 --- a/linphone/oRTP/build/winmob/oRTP.vcproj +++ /dev/null @@ -1,916 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/linphone/oRTP/build/winmob/ortp.def b/linphone/oRTP/build/winmob/ortp.def deleted file mode 100644 index 4f43d85be..000000000 --- a/linphone/oRTP/build/winmob/ortp.def +++ /dev/null @@ -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 diff --git a/linphone/oRTP/configure.ac b/linphone/oRTP/configure.ac deleted file mode 100644 index addc9ca25..000000000 --- a/linphone/oRTP/configure.ac +++ /dev/null @@ -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.]) diff --git a/linphone/oRTP/docs/.gitignore b/linphone/oRTP/docs/.gitignore deleted file mode 100644 index 282522db0..000000000 --- a/linphone/oRTP/docs/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/linphone/oRTP/include/.gitignore b/linphone/oRTP/include/.gitignore deleted file mode 100644 index 282522db0..000000000 --- a/linphone/oRTP/include/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/linphone/oRTP/include/Makefile.am b/linphone/oRTP/include/Makefile.am deleted file mode 100644 index ca785d102..000000000 --- a/linphone/oRTP/include/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS=ortp diff --git a/linphone/oRTP/include/ortp/.gitignore b/linphone/oRTP/include/ortp/.gitignore deleted file mode 100644 index 282522db0..000000000 --- a/linphone/oRTP/include/ortp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/linphone/oRTP/include/ortp/Makefile.am b/linphone/oRTP/include/ortp/Makefile.am deleted file mode 100644 index c8f0133f1..000000000 --- a/linphone/oRTP/include/ortp/Makefile.am +++ /dev/null @@ -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) diff --git a/linphone/oRTP/include/ortp/b64.h b/linphone/oRTP/include/ortp/b64.h deleted file mode 100644 index f2ce4578a..000000000 --- a/linphone/oRTP/include/ortp/b64.h +++ /dev/null @@ -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 - -/* ///////////////////////////////////////////////////////////////////////////// - * Namespace - */ - -#if !defined(B64_NO_NAMESPACE) && \ - !defined(__cplusplus) -# define B64_NO_NAMESPACE -#endif /* !B64_NO_NAMESPACE && !__cplusplus */ - -#ifdef B64_NAMESPACE -# undef B64_NAMESPACE -#endif /* B64_NAMESPACE */ - -#ifdef B64_NAMESPACE_QUALIFIER -# undef B64_NAMESPACE_QUALIFIER -#endif /* B64_NAMESPACE_QUALIFIER */ - - -#ifndef B64_NO_NAMESPACE - -# ifdef B64_CUSTOM_NAMESPACE -# define B64_NAMESPACE B64_CUSTOM_NAMESPACE -# else /* ? B64_CUSTOM_NAMESPACE */ -# define B64_NAMESPACE b64 -# endif /* B64_CUSTOM_NAMESPACE */ - -# if defined(B64_CUSTOM_NAMESPACE) && \ - defined(B64_CUSTOM_NAMESPACE_QUALIFIER) -# define B64_NAMESPACE_QUALIFIER B64_CUSTOM_NAMESPACE_QUALIFIER -# else /* B64_CUSTOM_NAMESPACE && B64_CUSTOM_NAMESPACE_QUALIFIER */ -# define B64_NAMESPACE_QUALIFIER ::B64_NAMESPACE -# endif /* B64_CUSTOM_NAMESPACE && B64_CUSTOM_NAMESPACE_QUALIFIER */ - - -/** \brief [C/C++] The b64 namespace, within which the core library types and functions - * reside in C++ compilation. In C compilation, they all reside in the global - * namespace. - * - * \htmlonly - *
- * \endhtmlonly - */ -namespace B64_NAMESPACE -{ -#endif /* !B64_NO_NAMESPACE */ - -/* ///////////////////////////////////////////////////////////////////////////// - * Enumerations - */ - -/** \brief Return codes (from b64_encode2() / b64_decode2()) - */ -enum B64_RC -{ - B64_RC_OK = 0 /*!< Operation was successful. */ - , B64_RC_INSUFFICIENT_BUFFER = 1 /*!< The given translation buffer was not of sufficient size. */ - , B64_RC_TRUNCATED_INPUT = 2 /*!< The input did not represent a fully formed stream of octet couplings. */ - , B64_RC_DATA_ERROR = 3 /*!< Invalid data. */ -#ifndef B64_DOCUMENTATION_SKIP_SECTION - , B64_max_RC_value -#endif /* !B64_DOCUMENTATION_SKIP_SECTION */ -}; - -#ifndef __cplusplus -typedef enum B64_RC B64_RC; -#endif /* !__cplusplus */ - -/** \brief Coding behaviour modification flags (for b64_encode2() / b64_decode2()) - */ -enum B64_FLAGS -{ - B64_F_LINE_LEN_USE_PARAM = 0x0000 /*!< Uses the lineLen parameter to b64_encode2(). Ignored by b64_decode2(). */ - , B64_F_LINE_LEN_INFINITE = 0x0001 /*!< Ignores the lineLen parameter to b64_encode2(). Line length is infinite. Ignored by b64_decode2(). */ - , B64_F_LINE_LEN_64 = 0x0002 /*!< Ignores the lineLen parameter to b64_encode2(). Line length is 64. Ignored by b64_decode2(). */ - , B64_F_LINE_LEN_76 = 0x0003 /*!< Ignores the lineLen parameter to b64_encode2(). Line length is 76. Ignored by b64_decode2(). */ - , B64_F_LINE_LEN_MASK = 0x000f /*!< Mask for testing line length flags to b64_encode2(). Ignored by b64_encode2(). */ - , B64_F_STOP_ON_NOTHING = 0x0000 /*!< Decoding ignores all invalid characters in the input data. Ignored by b64_encode2(). */ - , B64_F_STOP_ON_UNKNOWN_CHAR = 0x0100 /*!< Causes decoding to break if any non-Base-64 [a-zA-Z0-9=+/], non-whitespace character is encountered. Ignored by b64_encode2(). */ - , B64_F_STOP_ON_UNEXPECTED_WS = 0x0200 /*!< Causes decoding to break if any unexpected whitespace is encountered. Ignored by b64_encode2(). */ - , B64_F_STOP_ON_BAD_CHAR = 0x0300 /*!< Causes decoding to break if any non-Base-64 [a-zA-Z0-9=+/] character is encountered. Ignored by b64_encode2(). */ -}; - -#ifndef __cplusplus -typedef enum B64_FLAGS B64_FLAGS; -#endif /* !__cplusplus */ - -/* ///////////////////////////////////////////////////////////////////////////// - * Functions - */ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** \brief Encodes a block of binary data into Base-64 - * - * \param src Pointer to the block to be encoded. May not be NULL, except when - * \c dest is NULL, in which case it is ignored. - * \param srcSize Length of block to be encoded - * \param dest Pointer to the buffer into which the result is to be written. May - * be NULL, in which case the function returns the required length - * \param destLen Length of the buffer into which the result is to be written. Must - * be at least as large as that indicated by the return value from - * \link b64::b64_encode b64_encode(NULL, srcSize, NULL, 0)\endlink. - * - * \return 0 if the size of the buffer was insufficient, or the length of the - * converted buffer was longer than \c destLen - * - * \note The function returns the required length if \c dest is NULL - * - * \note The function returns the required length if \c dest is NULL. The returned size - * might be larger than the actual required size, but will never be smaller. - * - * \note Threading: The function is fully re-entrant. - * - * \see b64::encode() - */ -size_t b64_encode(void const *src, size_t srcSize, char *dest, size_t destLen); - -/** \brief Encodes a block of binary data into Base-64 - * - * \param src Pointer to the block to be encoded. May not be NULL, except when - * \c dest is NULL, in which case it is ignored. - * \param srcSize Length of block to be encoded - * \param dest Pointer to the buffer into which the result is to be written. May - * be NULL, in which case the function returns the required length - * \param destLen Length of the buffer into which the result is to be written. Must - * be at least as large as that indicated by the return value from - * \link b64::b64_encode2 b64_encode2(NULL, srcSize, NULL, 0, flags, lineLen, rc)\endlink. - * \param flags A combination of the B64_FLAGS enumeration, that moderate the - * behaviour of the function - * \param lineLen If the flags parameter contains B64_F_LINE_LEN_USE_PARAM, then - * this parameter represents the length of the lines into which the encoded form is split, - * with a hard line break ('\\r\\n'). If this value is 0, then the line is not - * split. If it is <0, then the RFC-1113 recommended line length of 64 is used - * \param rc The return code representing the status of the operation. May be NULL. - * - * \return 0 if the size of the buffer was insufficient, or the length of the - * converted buffer was longer than \c destLen - * - * \note The function returns the required length if \c dest is NULL. The returned size - * might be larger than the actual required size, but will never be smaller. - * - * \note Threading: The function is fully re-entrant. - * - * \see b64::encode() - */ -size_t b64_encode2( void const *src - , size_t srcSize - , char *dest - , size_t destLen - , unsigned flags - , int lineLen /* = 0 */ - , B64_RC *rc /* = NULL */); - -/** \brief Decodes a sequence of Base-64 into a block of binary data - * - * \param src Pointer to the Base-64 block to be decoded. May not be NULL, except when - * \c dest is NULL, in which case it is ignored. If \c dest is NULL, and \c src is - * not NULL, then the returned value is calculated exactly, otherwise a value - * is returned that is guaranteed to be large enough to hold the decoded block. - * - * \param srcLen Length of block to be encoded. Must be an integral of 4, the Base-64 - * encoding quantum, otherwise the Base-64 block is assumed to be invalid - * \param dest Pointer to the buffer into which the result is to be written. May - * be NULL, in which case the function returns the required length - * \param destSize Length of the buffer into which the result is to be written. Must - * be at least as large as that indicated by the return value from - * \c b64_decode(src, srcSize, NULL, 0), even in the case where the encoded form - * contains a number of characters that will be ignored, resulting in a lower total - * length of converted form. - * - * \return 0 if the size of the buffer was insufficient, or the length of the - * converted buffer was longer than \c destSize - * - * \note The function returns the required length if \c dest is NULL. The returned size - * might be larger than the actual required size, but will never be smaller. - * - * \note \anchor anchor__4_characters The behaviour of both - * \link b64::b64_encode2 b64_encode2()\endlink - * and - * \link b64::b64_decode2 b64_decode2()\endlink - * are undefined if the line length is not a multiple of 4. - * - * \note Threading: The function is fully re-entrant. - * - * \see b64::decode() - */ -size_t b64_decode(char const *src, size_t srcLen, void *dest, size_t destSize); - -/** \brief Decodes a sequence of Base-64 into a block of binary data - * - * \param src Pointer to the Base-64 block to be decoded. May not be NULL, except when - * \c dest is NULL, in which case it is ignored. If \c dest is NULL, and \c src is - * not NULL, then the returned value is calculated exactly, otherwise a value - * is returned that is guaranteed to be large enough to hold the decoded block. - * - * \param srcLen Length of block to be encoded. Must be an integral of 4, the Base-64 - * encoding quantum, otherwise the Base-64 block is assumed to be invalid - * \param dest Pointer to the buffer into which the result is to be written. May - * be NULL, in which case the function returns the required length - * \param destSize Length of the buffer into which the result is to be written. Must - * be at least as large as that indicated by the return value from - * \c b64_decode(src, srcSize, NULL, 0), even in the case where the encoded form - * contains a number of characters that will be ignored, resulting in a lower total - * length of converted form. - * \param flags A combination of the B64_FLAGS enumeration, that moderate the - * behaviour of the function. - * \param rc The return code representing the status of the operation. May be NULL. - * \param badChar If the flags parameter does not contain B64_F_STOP_ON_NOTHING, this - * parameter specifies the address of a pointer that will be set to point to any - * character in the sequence that stops the parsing, as dictated by the flags - * parameter. May be NULL. - * - * \return 0 if the size of the buffer was insufficient, or the length of the - * converted buffer was longer than \c destSize, or a bad character stopped parsing. - * - * \note The function returns the required length if \c dest is NULL. The returned size - * might be larger than the actual required size, but will never be smaller. - * - * \note The behaviour of both - * \link b64::b64_encode2 b64_encode2()\endlink - * and - * \link b64::b64_decode2 b64_decode2()\endlink - * are undefined if the line length is not a multiple of 4. - * - * \note Threading: The function is fully re-entrant. - * - * \see b64::decode() - */ -size_t b64_decode2( char const *src - , size_t srcLen - , void *dest - , size_t destSize - , unsigned flags - , char const **badChar /* = NULL */ - , B64_RC *rc /* = NULL */); - - -/** \brief Returns the textual description of the error - * - * \param code The \link b64::B64_RC error code\endlink - */ -char const *b64_getErrorString(B64_RC code); - -/** \brief Returns the length of the textual description of the error - * - * \see b64_getErrorString() - * - * \param code The \link b64::B64_RC error code\endlink - */ -size_t b64_getErrorStringLength(B64_RC code); - - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - -/* ///////////////////////////////////////////////////////////////////////////// - * Namespace - */ - -#ifndef B64_NO_NAMESPACE -} /* namespace B64_NAMESPACE */ - -# ifndef B64_DOCUMENTATION_SKIP_SECTION - -namespace stlsoft -{ - - inline char const *c_str_data_a( B64_NAMESPACE_QUALIFIER::B64_RC code) - { - return B64_NAMESPACE_QUALIFIER::b64_getErrorString(code); - } - inline char const *c_str_data( B64_NAMESPACE_QUALIFIER::B64_RC code) - { - return B64_NAMESPACE_QUALIFIER::b64_getErrorString(code); - } - - inline size_t c_str_len_a( B64_NAMESPACE_QUALIFIER::B64_RC code) - { - return B64_NAMESPACE_QUALIFIER::b64_getErrorStringLength(code); - } - inline size_t c_str_len( B64_NAMESPACE_QUALIFIER::B64_RC code) - { - return B64_NAMESPACE_QUALIFIER::b64_getErrorStringLength(code); - } - - inline char const *c_str_ptr_a( B64_NAMESPACE_QUALIFIER::B64_RC code) - { - return B64_NAMESPACE_QUALIFIER::b64_getErrorString(code); - } - inline char const *c_str_ptr( B64_NAMESPACE_QUALIFIER::B64_RC code) - { - return B64_NAMESPACE_QUALIFIER::b64_getErrorString(code); - } - -} /* namespace stlsoft */ - -# endif /* !B64_DOCUMENTATION_SKIP_SECTION */ - -#endif /* !B64_NO_NAMESPACE */ - -/* ////////////////////////////////////////////////////////////////////////// */ - -#endif /* B64_INCL_B64_H_B64 */ - -/* ////////////////////////////////////////////////////////////////////////// */ diff --git a/linphone/oRTP/include/ortp/event.h b/linphone/oRTP/include/ortp/event.h deleted file mode 100644 index 071d417d6..000000000 --- a/linphone/oRTP/include/ortp/event.h +++ /dev/null @@ -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 - -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 - diff --git a/linphone/oRTP/include/ortp/ortp.h b/linphone/oRTP/include/ortp/ortp.h deleted file mode 100644 index 8176af523..000000000 --- a/linphone/oRTP/include/ortp/ortp.h +++ /dev/null @@ -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 -#include - -#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 diff --git a/linphone/oRTP/include/ortp/payloadtype.h b/linphone/oRTP/include/ortp/payloadtype.h deleted file mode 100644 index 0d9849956..000000000 --- a/linphone/oRTP/include/ortp/payloadtype.h +++ /dev/null @@ -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 - -#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; /**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 diff --git a/linphone/oRTP/include/ortp/port.h b/linphone/oRTP/include/ortp/port.h deleted file mode 100644 index b8a32bb40..000000000 --- a/linphone/oRTP/include/ortp/port.h +++ /dev/null @@ -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 -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef __linux -#include -#endif - - -#include -#include -#include -#if defined(_XOPEN_SOURCE_EXTENDED) || !defined(__hpux) -#include -#endif - - - -#include - -#ifdef ORTP_INET6 -#include -#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 -#include -#include -#include -#include - - -#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 /*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 - - diff --git a/linphone/oRTP/include/ortp/rtcp.h b/linphone/oRTP/include/ortp/rtcp.h deleted file mode 100644 index 950179764..000000000 --- a/linphone/oRTP/include/ortp/rtcp.h +++ /dev/null @@ -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 - -#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 diff --git a/linphone/oRTP/include/ortp/rtp.h b/linphone/oRTP/include/ortp/rtp.h deleted file mode 100644 index 5ecd95def..000000000 --- a/linphone/oRTP/include/ortp/rtp.h +++ /dev/null @@ -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 -#include - -#define IPMAXLEN 20 -#define UDP_MAX_SIZE 1500 -#define RTP_FIXED_HEADER_SIZE 12 -#define RTP_DEFAULT_JITTER_TIME 80 /*miliseconds*/ -#define RTP_DEFAULT_MULTICAST_TTL 5 /*hops*/ -#define RTP_DEFAULT_MULTICAST_LOOPBACK 0 /*false*/ -#define RTP_DEFAULT_DSCP 0x00 /*best effort*/ - - - -typedef struct rtp_header -{ -#ifdef ORTP_BIGENDIAN - uint16_t version:2; - uint16_t padbit:1; - uint16_t extbit:1; - uint16_t cc:4; - uint16_t markbit:1; - uint16_t paytype:7; -#else - uint16_t cc:4; - uint16_t extbit:1; - uint16_t padbit:1; - uint16_t version:2; - uint16_t paytype:7; - uint16_t markbit:1; -#endif - uint16_t seq_number; - uint32_t timestamp; - uint32_t ssrc; - uint32_t csrc[16]; -} rtp_header_t; - - - - -typedef struct rtp_stats -{ - uint64_t packet_sent; - 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 diff --git a/linphone/oRTP/include/ortp/rtpsession.h b/linphone/oRTP/include/ortp/rtpsession.h deleted file mode 100644 index 5b127d9ca..000000000 --- a/linphone/oRTP/include/ortp/rtpsession.h +++ /dev/null @@ -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 -#include -#include -#include -#include -#include -#include -#include - - - -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;//flags|=(flag) -#define rtp_session_unset_flag(session,flag) (session)->flags&=~(flag) -void rtp_session_uninit(RtpSession *session); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/linphone/oRTP/include/ortp/rtpsignaltable.h b/linphone/oRTP/include/ortp/rtpsignaltable.h deleted file mode 100644 index fb74e8ddc..000000000 --- a/linphone/oRTP/include/ortp/rtpsignaltable.h +++ /dev/null @@ -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 - diff --git a/linphone/oRTP/include/ortp/sessionset.h b/linphone/oRTP/include/ortp/sessionset.h deleted file mode 100644 index 028167361..000000000 --- a/linphone/oRTP/include/ortp/sessionset.h +++ /dev/null @@ -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 - -#ifdef __cplusplus -extern "C"{ -#endif - - -#if !defined(_WIN32) && !defined(_WIN32_WCE) -/* UNIX */ -#include -#include -#include - -#define ORTP_FD_SET(d, s) FD_SET(d, s) -#define ORTP_FD_CLR(d, s) FD_CLR(d, s) -#define ORTP_FD_ISSET(d, s) FD_ISSET(d, s) -#define ORTP_FD_ZERO(s) FD_ZERO(s) - -typedef fd_set ortp_fd_set; - - -#else -/* WIN32 */ - -#define ORTP_FD_ZERO(s) \ - do { \ - unsigned int __i; \ - ortp_fd_set *__arr = (s); \ - for (__i = 0; __i < sizeof (ortp_fd_set) / sizeof (ortp__fd_mask); ++__i) \ - ORTP__FDS_BITS (__arr)[__i] = 0; \ - } while (0) -#define ORTP_FD_SET(d, s) (ORTP__FDS_BITS (s)[ORTP__FDELT(d)] |= ORTP__FDMASK(d)) -#define ORTP_FD_CLR(d, s) (ORTP__FDS_BITS (s)[ORTP__FDELT(d)] &= ~ORTP__FDMASK(d)) -#define ORTP_FD_ISSET(d, s) ((ORTP__FDS_BITS (s)[ORTP__FDELT(d)] & ORTP__FDMASK(d)) != 0) - - - -/* The fd_set member is required to be an array of longs. */ -typedef long int ortp__fd_mask; - - -/* Number of bits per word of `fd_set' (some code assumes this is 32). */ -#define ORTP__FD_SETSIZE 1024 - -/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */ -#define ORTP__NFDBITS (8 * sizeof (ortp__fd_mask)) -#define ORTP__FDELT(d) ((d) / ORTP__NFDBITS) -#define ORTP__FDMASK(d) ((ortp__fd_mask) 1 << ((d) % ORTP__NFDBITS)) - - -/* fd_set for select and pselect. */ -typedef struct - { - ortp__fd_mask fds_bits[ORTP__FD_SETSIZE / ORTP__NFDBITS]; -# define ORTP__FDS_BITS(set) ((set)->fds_bits) - } ortp_fd_set; - - -#endif /*end WIN32*/ - -struct _SessionSet -{ - ortp_fd_set rtpset; -}; - - -typedef struct _SessionSet SessionSet; - -#define session_set_init(ss) ORTP_FD_ZERO(&(ss)->rtpset) - -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 diff --git a/linphone/oRTP/include/ortp/srtp.h b/linphone/oRTP/include/ortp/srtp.h deleted file mode 100644 index f6dae3874..000000000 --- a/linphone/oRTP/include/ortp/srtp.h +++ /dev/null @@ -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 -#include - -#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 diff --git a/linphone/oRTP/include/ortp/str_utils.h b/linphone/oRTP/include/ortp/str_utils.h deleted file mode 100644 index ae073dd5b..000000000 --- a/linphone/oRTP/include/ortp/str_utils.h +++ /dev/null @@ -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 - - -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 diff --git a/linphone/oRTP/include/ortp/stun.h b/linphone/oRTP/include/ortp/stun.h deleted file mode 100644 index 42b6ce3b9..000000000 --- a/linphone/oRTP/include/ortp/stun.h +++ /dev/null @@ -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 - * . - * - */ - - -#ifndef __STUN_H__ -#define __STUN_H__ - -#include -#include -#include -#include - -#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 - diff --git a/linphone/oRTP/include/ortp/stun_udp.h b/linphone/oRTP/include/ortp/stun_udp.h deleted file mode 100644 index e510a2e08..000000000 --- a/linphone/oRTP/include/ortp/stun_udp.h +++ /dev/null @@ -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 * . - * - */ - -#ifndef __STUN_UDP_H__ -#define __STUN_UDP_H__ - -#ifndef __cplusplus -//#define bool int -//#define false 0 -//#define true 1 -#endif - -#ifdef __MACH__ -#include -#ifndef _SOCKLEN_T -typedef int socklen_t; -#endif -#endif - -#include - -#if !defined(_WIN32_WCE) -#include -#endif - -#if defined(WIN32) || defined(_WIN32_WCE) -#define snprintf _snprintf - -#include -/* #include */ - -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 diff --git a/linphone/oRTP/include/ortp/telephonyevents.h b/linphone/oRTP/include/ortp/telephonyevents.h deleted file mode 100644 index 284e097ee..000000000 --- a/linphone/oRTP/include/ortp/telephonyevents.h +++ /dev/null @@ -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 - - -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 diff --git a/linphone/oRTP/oRTP.prj b/linphone/oRTP/oRTP.prj deleted file mode 100644 index 1c406516d..000000000 --- a/linphone/oRTP/oRTP.prj +++ /dev/null @@ -1,193 +0,0 @@ -# Anjuta Version 1.1.97 -Compatibility Level: 1 - - -Some description - - - - - - - - - - - - - - - - - -props.file.type=project - -anjuta.version=1.1.97 -anjuta.compatibility.level=1 - -project.name=oRTP -project.type=GENERIC -project.target.type=EXECUTABLE -project.version=0.99 -project.author=Simon Morlat -project.source.target=Rtp stack -project.has.gettext=0 -project.gui.command= -project.programming.language=C -project.excluded.modules=intl - -project.config.extra.modules.before= -project.config.extra.modules.after= -project.config.blocked=1 -project.config.disable.overwriting=1 1 1 1 1 1 1 1 1 - -project.menu.entry=oRTP Version 0.99 -project.menu.group=Application -project.menu.comment=oRTP Version 0.99 -project.menu.icon= -project.menu.need.terminal=0 - -project.configure.options= -anjuta.program.arguments= -preferences.build.option.jobs=0 -preferences.build.option.silent=0 -preferences.build.option.autosave=1 -preferences.anjuta.make.options=-k -preferences.make=make -preferences.build.option.keep.going=1 -preferences.build.option.warn.undef=0 -preferences.autoformat.custom.style= -i8 -sc -bli0 -bl0 -cbi0 -ss -preferences.autoformat.style=Style of Kangleipak -preferences.indent.opening=0 -preferences.autoformat.disable=0 -preferences.indent.automatic=1 -preferences.use.tabs=1 -preferences.indent.size=4 -preferences.tabsize=4 -preferences.indent.closing=0 - -module.include.name=. -module.include.type= -module.include.files=\ - src/errno-win32.h\ - src/export.h\ - src/ortp-config-win32.h\ - src/ortp.h\ - src/payloadtype.h\ - src/port_fct.h\ - src/rtp.h\ - src/rtpmod.h\ - src/rtpport.h\ - src/rtpsession.h\ - src/rtpsignaltable.h\ - src/rtptimer.h\ - src/scheduler.h\ - src/sessionset.h\ - src/str_utils.h\ - src/telephonyevents.h\ - src/rtcp.h\ - ortp-config.h - -module.source.name=. -module.source.type= -module.source.files=\ - src/avprofile.c\ - src/export.c\ - src/mrtprecv.c\ - src/mrtpsend.c\ - src/ortp.c\ - src/ortpdlkm.c\ - src/payloadtype.c\ - src/port_fct.c\ - src/posixtimer.c\ - src/rtpmemtest.c\ - src/rtpmod.c\ - src/rtpparse.c\ - src/rtprecv.c\ - src/rtpsend.c\ - src/rtpsession.c\ - src/rtpsignaltable.c\ - src/rtptimer.c\ - src/scheduler.c\ - src/sessionset.c\ - src/str_utils.c\ - src/telephonyevents.c\ - src/test_tevrecv.c\ - src/test_tevsend.c\ - src/test_timer.c\ - src/tevmrtprecv.c\ - src/tevrtprecv.c\ - src/tevrtpsend.c - -module.pixmap.name=. -module.pixmap.type= -module.pixmap.files=\ - docs/html/home.png\ - docs/html/left.png\ - docs/html/right.png\ - docs/html/up.png - -module.data.name=. -module.data.type= -module.data.files= - -module.help.name=. -module.help.type= -module.help.files= - -module.doc.name=. -module.doc.type= -module.doc.files=\ - build/win32/oRTP/README\ - AUTHORS\ - COPYING\ - ChangeLog\ - INSTALL\ - NEWS\ - README\ - TODO\ - docs/tmpl/multiplexing.sgml\ - docs/tmpl/ortp-unused.sgml\ - docs/tmpl/payloads.sgml\ - docs/tmpl/rtpsessionapi.sgml\ - docs/tmpl/stackinit.sgml\ - docs/tmpl/stackmanagement.sgml\ - docs/tmpl/telephoneevents.sgml\ - docs/sgml/payloads.sgml\ - docs/sgml/tree_index.sgml\ - docs/sgml/object_index.sgml\ - docs/sgml/rtpsessionapi.sgml\ - docs/sgml/stackmanagement.sgml\ - docs/sgml/multiplexing.sgml\ - docs/sgml/telephoneevents.sgml\ - docs/ortp-docs.sgml\ - docs/html/book1.html\ - docs/html/ortpapi.html\ - docs/html/ortp-stack-management-functions.html\ - docs/html/ortp-rtpsession-api.html\ - docs/html/ortp-rtp-payloads-and-profiles.html\ - docs/html/ortp-multiplexing-sessions-(in-a-one-thread-design).html\ - docs/html/ortp-telephone-events-(rfc2833)-.html\ - docs/html/index.sgml\ - docs/html/ortp-library-management-functions.html - -module.po.files= - -compiler.options.supports= -compiler.options.include.paths=\ - .\ - .. -compiler.options.library.paths= -compiler.options.libraries= -compiler.options.libraries.selected= -compiler.options.defines=\ - HAVE_CONFIG_H -compiler.options.defines.selected= -compiler.options.warning.buttons=0 0 1 1 0 1 0 0 0 0 0 0 0 1 0 0 -compiler.options.optimize.buttons=0 0 1 0 -compiler.options.other.buttons=1 0 -compiler.options.other.c.flags= -compiler.options.other.l.flags= -compiler.options.other.l.libs= - -project.src.paths= diff --git a/linphone/oRTP/oRTP.pws b/linphone/oRTP/oRTP.pws deleted file mode 100644 index 342999ad9..000000000 --- a/linphone/oRTP/oRTP.pws +++ /dev/null @@ -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 diff --git a/linphone/oRTP/ortp.doxygen.in b/linphone/oRTP/ortp.doxygen.in deleted file mode 100644 index 69ba62da2..000000000 --- a/linphone/oRTP/ortp.doxygen.in +++ /dev/null @@ -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 diff --git a/linphone/oRTP/ortp.pc.in b/linphone/oRTP/ortp.pc.in deleted file mode 100644 index 8084faecd..000000000 --- a/linphone/oRTP/ortp.pc.in +++ /dev/null @@ -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@ diff --git a/linphone/oRTP/ortp.spec.in b/linphone/oRTP/ortp.spec.in deleted file mode 100644 index f73cdfcdf..000000000 --- a/linphone/oRTP/ortp.spec.in +++ /dev/null @@ -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 -- Add to oRTP distribution with "make rpm" target diff --git a/linphone/oRTP/pkg.list b/linphone/oRTP/pkg.list deleted file mode 100644 index e02f91683..000000000 --- a/linphone/oRTP/pkg.list +++ /dev/null @@ -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 - diff --git a/linphone/oRTP/src/.gitignore b/linphone/oRTP/src/.gitignore deleted file mode 100644 index fec93a5ec..000000000 --- a/linphone/oRTP/src/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -*.lo -.deps -.libs -Makefile -Makefile.in -libortp.la -mrtprecv -mrtpsend -rtpmemtest -rtprecv -rtpsend -test_timer -tevmrtprecv -tevrtprecv -tevrtpsend diff --git a/linphone/oRTP/src/Makefile.am b/linphone/oRTP/src/Makefile.am deleted file mode 100644 index 251c6dff7..000000000 --- a/linphone/oRTP/src/Makefile.am +++ /dev/null @@ -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 diff --git a/linphone/oRTP/src/avprofile.c b/linphone/oRTP/src/avprofile.c deleted file mode 100644 index a16a4c345..000000000 --- a/linphone/oRTP/src/avprofile.c +++ /dev/null @@ -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 - -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 -}; - diff --git a/linphone/oRTP/src/b64.c b/linphone/oRTP/src/b64.c deleted file mode 100644 index 08b0ed3e6..000000000 --- a/linphone/oRTP/src/b64.c +++ /dev/null @@ -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 -#include -#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); -} - -/* ////////////////////////////////////////////////////////////////////////// */ diff --git a/linphone/oRTP/src/dll_entry.c b/linphone/oRTP/src/dll_entry.c deleted file mode 100644 index 37ac6cf12..000000000 --- a/linphone/oRTP/src/dll_entry.c +++ /dev/null @@ -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. -} diff --git a/linphone/oRTP/src/event.c b/linphone/oRTP/src/event.c deleted file mode 100644 index 00718e2e7..000000000 --- a/linphone/oRTP/src/event.c +++ /dev/null @@ -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)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); -} - diff --git a/linphone/oRTP/src/jitterctl.c b/linphone/oRTP/src/jitterctl.c deleted file mode 100644 index 0ee9dd4ca..000000000 --- a/linphone/oRTP/src/jitterctl.c +++ /dev/null @@ -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 - -#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; -} - diff --git a/linphone/oRTP/src/jitterctl.h b/linphone/oRTP/src/jitterctl.h deleted file mode 100644 index 713756118..000000000 --- a/linphone/oRTP/src/jitterctl.h +++ /dev/null @@ -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 diff --git a/linphone/oRTP/src/master b/linphone/oRTP/src/master deleted file mode 100644 index ded8bca41..000000000 --- a/linphone/oRTP/src/master +++ /dev/null @@ -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 -$$$ diff --git a/linphone/oRTP/src/ortp-config-win32.h b/linphone/oRTP/src/ortp-config-win32.h deleted file mode 100644 index d98265ee7..000000000 --- a/linphone/oRTP/src/ortp-config-win32.h +++ /dev/null @@ -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 diff --git a/linphone/oRTP/src/ortp.c b/linphone/oRTP/src/ortp.c deleted file mode 100644 index 4edd91a4d..000000000 --- a/linphone/oRTP/src/ortp.c +++ /dev/null @@ -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); -} diff --git a/linphone/oRTP/src/payloadtype.c b/linphone/oRTP/src/payloadtype.c deleted file mode 100644 index bae1b0776..000000000 --- a/linphone/oRTP/src/payloadtype.c +++ /dev/null @@ -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;imime_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;imime_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;ipayload[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;iname); - for (i=0;iname) { - ortp_free(prof->name); - prof->name = NULL; - } - for (i=0;iflags & PAYLOAD_TYPE_ALLOCATED)) - payload_type_destroy(payload); - } - ortp_free(prof); -} diff --git a/linphone/oRTP/src/port.c b/linphone/oRTP/src/port.c deleted file mode 100644 index 15a324091..000000000 --- a/linphone/oRTP/src/port.c +++ /dev/null @@ -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 -#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 - -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 -#include -#include -#include - -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 diff --git a/linphone/oRTP/src/posixtimer.c b/linphone/oRTP/src/posixtimer.c deleted file mode 100644 index 6330da00b..000000000 --- a/linphone/oRTP/src/posixtimer.c +++ /dev/null @@ -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 -#endif - -#include -#include -#include - - -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 -#include - - -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 diff --git a/linphone/oRTP/src/rtcp.c b/linphone/oRTP/src/rtcp.c deleted file mode 100644 index 2d14813d5..000000000 --- a/linphone/oRTP/src/rtcp.c +++ /dev/null @@ -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 (sizech,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 (sizech,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 (sizech,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_countrtp.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; -} - diff --git a/linphone/oRTP/src/rtcpparse.c b/linphone/oRTP/src/rtcpparse.c deleted file mode 100644 index 64df2c776..000000000 --- a/linphone/oRTP/src/rtcpparse.c +++ /dev/null @@ -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+nextlenb_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 (sizeb_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)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 (idxch)){ - 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)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 (idxch)){ - 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)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(rptrb_rptr; - int rc=rtcp_common_header_get_rc(&bye->ch); - int len=rtcp_common_header_get_length(&bye->ch); - if (idxssrc[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 (rptrb_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; ich.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; ich.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; -} diff --git a/linphone/oRTP/src/rtpparse.c b/linphone/oRTP/src/rtpparse.c deleted file mode 100644 index 9a15ab9db..000000000 --- a/linphone/oRTP/src/rtpparse.c +++ /dev/null @@ -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 -#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 (msgsizestats.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;icc;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; -} - diff --git a/linphone/oRTP/src/rtpsession.c b/linphone/oRTP/src/rtpsession.c deleted file mode 100644 index 795a35983..000000000 --- a/linphone/oRTP/src/rtpsession.c +++ /dev/null @@ -1,1608 +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 "ortp/telephonyevents.h" -#include "ortp/rtcp.h" -#include "jitterctl.h" -#include "scheduler.h" -#include "utils.h" -#include "rtpsession_priv.h" - -extern mblk_t *rtcp_create_simple_bye_packet(uint32_t ssrc, const char *reason); -extern int rtcp_sr_init(RtpSession *session, char *buf, int size); -extern int rtcp_rr_init(RtpSession *session, char *buf, int size); - - - -/* this function initialize all session parameter's that depend on the payload type */ -static void payload_type_changed(RtpSession *session, PayloadType *pt){ - jitter_control_set_payload(&session->rtp.jittctl,pt); - session->rtp.rtcp_report_snt_interval=RTCP_DEFAULT_REPORT_INTERVAL*pt->clock_rate; - rtp_session_set_time_jump_limit(session,session->rtp.time_jump); - if (pt->type==PAYLOAD_VIDEO){ - session->permissive=TRUE; - ortp_message("Using permissive algorithm"); - } - else session->permissive=FALSE; -} - -void wait_point_init(WaitPoint *wp){ - ortp_mutex_init(&wp->lock,NULL); - ortp_cond_init(&wp->cond,NULL); - wp->time=0; - wp->wakeup=FALSE; -} -void wait_point_uninit(WaitPoint *wp){ - ortp_cond_destroy(&wp->cond); - ortp_mutex_destroy(&wp->lock); -} - -#define wait_point_lock(wp) ortp_mutex_lock(&(wp)->lock) -#define wait_point_unlock(wp) ortp_mutex_unlock(&(wp)->lock) - -void wait_point_wakeup_at(WaitPoint *wp, uint32_t t, bool_t dosleep){ - wp->time=t; - wp->wakeup=TRUE; - if (dosleep) ortp_cond_wait(&wp->cond,&wp->lock); -} - - -bool_t wait_point_check(WaitPoint *wp, uint32_t t){ - bool_t ok=FALSE; - - if (wp->wakeup){ - if (TIME_IS_NEWER_THAN(t,wp->time)){ - wp->wakeup=FALSE; - ok=TRUE; - - } - } - return ok; -} -#define wait_point_wakeup(wp) ortp_cond_signal(&(wp)->cond); - -extern void rtp_parse(RtpSession *session, mblk_t *mp, uint32_t local_str_ts, - struct sockaddr *addr, socklen_t addrlen); - - -static uint32_t uint32_t_random(){ - return random(); -} - - -#define RTP_SEQ_IS_GREATER(seq1,seq2)\ - ((uint16_t)((uint16_t)(seq1) - (uint16_t)(seq2))< (uint16_t)(1<<15)) - -/* put an rtp packet in queue. It is called by rtp_parse()*/ -void rtp_putq(queue_t *q, mblk_t *mp) -{ - mblk_t *tmp; - rtp_header_t *rtp=(rtp_header_t*)mp->b_rptr,*tmprtp; - /* insert message block by increasing time stamp order : the last (at the bottom) - message of the queue is the newest*/ - ortp_debug("rtp_putq(): Enqueuing packet with ts=%i and seq=%i",rtp->timestamp,rtp->seq_number); - - if (qempty(q)) { - putq(q,mp); - return; - } - tmp=qlast(q); - /* we look at the queue from bottom to top, because enqueued packets have a better chance - to be enqueued at the bottom, since there are surely newer */ - while (!qend(q,tmp)) - { - tmprtp=(rtp_header_t*)tmp->b_rptr; - ortp_debug("rtp_putq(): Seeing packet with seq=%i",tmprtp->seq_number); - - if (rtp->seq_number == tmprtp->seq_number) - { - /* this is a duplicated packet. Don't queue it */ - ortp_debug("rtp_putq: duplicated message."); - freemsg(mp); - return; - }else if (RTP_SEQ_IS_GREATER(rtp->seq_number,tmprtp->seq_number)){ - - insq(q,tmp->b_next,mp); - return; - } - tmp=tmp->b_prev; - } - /* this packet is the oldest, it has to be - placed on top of the queue */ - insq(q,qfirst(q),mp); - -} - - - -mblk_t *rtp_getq(queue_t *q,uint32_t timestamp, int *rejected) -{ - mblk_t *tmp,*ret=NULL,*old=NULL; - rtp_header_t *tmprtp; - uint32_t ts_found=0; - - *rejected=0; - ortp_debug("rtp_getq(): Timestamp %i wanted.",timestamp); - - if (qempty(q)) - { - /*ortp_debug("rtp_getq: q is empty.");*/ - return NULL; - } - /* return the packet with ts just equal or older than the asked timestamp */ - /* packets with older timestamps are discarded */ - while ((tmp=qfirst(q))!=NULL) - { - tmprtp=(rtp_header_t*)tmp->b_rptr; - ortp_debug("rtp_getq: Seeing packet with ts=%i",tmprtp->timestamp); - if ( RTP_TIMESTAMP_IS_NEWER_THAN(timestamp,tmprtp->timestamp) ) - { - if (ret!=NULL && tmprtp->timestamp==ts_found) { - /* we've found two packets with same timestamp. return the first one */ - break; - } - if (old!=NULL) { - ortp_debug("rtp_getq: discarding too old packet with ts=%i",ts_found); - (*rejected)++; - freemsg(old); - } - ret=getq(q); /* dequeue the packet, since it has an interesting timestamp*/ - ts_found=tmprtp->timestamp; - ortp_debug("rtp_getq: Found packet with ts=%i",tmprtp->timestamp); - old=ret; - } - else - { - break; - } - } - return ret; -} - -mblk_t *rtp_getq_permissive(queue_t *q,uint32_t timestamp, int *rejected) -{ - mblk_t *tmp,*ret=NULL; - rtp_header_t *tmprtp; - - *rejected=0; - ortp_debug("rtp_getq_permissive(): Timestamp %i wanted.",timestamp); - - if (qempty(q)) - { - /*ortp_debug("rtp_getq: q is empty.");*/ - return NULL; - } - /* return the packet with the older timestamp (provided that it is older than - the asked timestamp) */ - tmp=qfirst(q); - tmprtp=(rtp_header_t*)tmp->b_rptr; - ortp_debug("rtp_getq_permissive: Seeing packet with ts=%i",tmprtp->timestamp); - if ( RTP_TIMESTAMP_IS_NEWER_THAN(timestamp,tmprtp->timestamp) ) - { - ret=getq(q); /* dequeue the packet, since it has an interesting timestamp*/ - ortp_debug("rtp_getq_permissive: Found packet with ts=%i",tmprtp->timestamp); - } - return ret; -} - - -void -rtp_session_init (RtpSession * session, int mode) -{ - JBParameters jbp; - if (session == NULL) - { - ortp_debug("rtp_session_init: Invalid paramter (session=NULL)"); - return; - } - memset (session, 0, sizeof (RtpSession)); - session->mode = (RtpSessionMode) mode; - if ((mode == RTP_SESSION_RECVONLY) || (mode == RTP_SESSION_SENDRECV)) - { - rtp_session_set_flag (session, RTP_SESSION_RECV_SYNC); - rtp_session_set_flag (session, RTP_SESSION_RECV_NOT_STARTED); - - } - if ((mode == RTP_SESSION_SENDONLY) || (mode == RTP_SESSION_SENDRECV)) - { - rtp_session_set_flag (session, RTP_SESSION_SEND_NOT_STARTED); - session->snd.ssrc=uint32_t_random(); - /* set default source description */ - rtp_session_set_source_description(session,"unknown@unknown",NULL,NULL, - NULL,NULL,"oRTP-" ORTP_VERSION,"This is free sofware (LGPL) !"); - } - session->snd.telephone_events_pt=-1; /* not defined a priori */ - session->rcv.telephone_events_pt=-1; /* not defined a priori */ - rtp_session_set_profile (session, &av_profile); /*the default profile to work with */ - session->rtp.socket=-1; - session->rtcp.socket=-1; -#ifndef WIN32 - session->rtp.snd_socket_size=0; /*use OS default value unless on windows where they are definitely too short*/ - session->rtp.rcv_socket_size=0; -#else - session->rtp.snd_socket_size=session->rtp.rcv_socket_size=65536; -#endif - session->dscp=RTP_DEFAULT_DSCP; - session->multicast_ttl=RTP_DEFAULT_MULTICAST_TTL; - session->multicast_loopback=RTP_DEFAULT_MULTICAST_LOOPBACK; - qinit(&session->rtp.rq); - qinit(&session->rtp.tev_rq); - qinit(&session->contributing_sources); - session->eventqs=NULL; - /* init signal tables */ - rtp_signal_table_init (&session->on_ssrc_changed, session,"ssrc_changed"); - rtp_signal_table_init (&session->on_payload_type_changed, session,"payload_type_changed"); - rtp_signal_table_init (&session->on_telephone_event, session,"telephone-event"); - rtp_signal_table_init (&session->on_telephone_event_packet, session,"telephone-event_packet"); - rtp_signal_table_init (&session->on_timestamp_jump,session,"timestamp_jump"); - rtp_signal_table_init (&session->on_network_error,session,"network_error"); - rtp_signal_table_init (&session->on_rtcp_bye,session,"rtcp_bye"); - wait_point_init(&session->snd.wp); - wait_point_init(&session->rcv.wp); - /*defaults send payload type to 0 (pcmu)*/ - rtp_session_set_send_payload_type(session,0); - /*sets supposed recv payload type to undefined */ - rtp_session_set_recv_payload_type(session,-1); - /* configure jitter buffer with working default parameters */ - jbp.min_size=RTP_DEFAULT_JITTER_TIME; - jbp.nom_size=RTP_DEFAULT_JITTER_TIME; - jbp.max_size=-1; - jbp.max_packets= 100;/* maximum number of packet allowed to be queued */ - jbp.adaptive=TRUE; - rtp_session_enable_jitter_buffer(session,TRUE); - rtp_session_set_jitter_buffer_params(session,&jbp); - rtp_session_set_time_jump_limit(session,5000); - rtp_session_enable_rtcp(session,TRUE); - session->recv_buf_size = UDP_MAX_SIZE; - session->symmetric_rtp = FALSE; - session->permissive=FALSE; - msgb_allocator_init(&session->allocator); -} - - -/** - * Creates a new rtp session. - * If the session is able to send data (RTP_SESSION_SENDONLY or - * RTP_SESSION_SENDRECV), then a random SSRC number is choosed for - * the outgoing stream. - * @param mode One of the RtpSessionMode flags. - * - * @return the newly created rtp session. -**/ -RtpSession * -rtp_session_new (int mode) -{ - RtpSession *session; - session = (RtpSession *) ortp_malloc (sizeof (RtpSession)); - if (session == NULL) - { - ortp_error("rtp_session_new: Memory allocation failed"); - return NULL; - } - rtp_session_init (session, mode); - return session; -} - -/** - * Sets the scheduling mode of the rtp session. If @yesno is TRUE, the rtp session is in - * the scheduled mode, that means that you can use session_set_select() to block until it's time - * to receive or send on this session according to the timestamp passed to the respective functions. - * You can also use blocking mode (see rtp_session_set_blocking_mode() ), to simply block within - * the receive and send functions. - * If @yesno is FALSE, the ortp scheduler will not manage those sessions, meaning that blocking mode - * and the use of session_set_select() for this session are disabled. - *@param session a rtp session. - *@param yesno a boolean to indicate the scheduling mode. - * - * -**/ -void -rtp_session_set_scheduling_mode (RtpSession * session, int yesno) -{ - if (yesno) - { - RtpScheduler *sched; - sched = ortp_get_scheduler (); - if (sched != NULL) - { - rtp_session_set_flag (session, RTP_SESSION_SCHEDULED); - session->sched = sched; - rtp_scheduler_add_session (sched, session); - } - else - ortp_warning - ("rtp_session_set_scheduling_mode: Cannot use scheduled mode because the " - "scheduler is not started. Use ortp_scheduler_init() before."); - } - else - rtp_session_unset_flag (session, RTP_SESSION_SCHEDULED); -} - - -/** - * This function implicitely enables the scheduling mode if yesno is TRUE. - * rtp_session_set_blocking_mode() defines the behaviour of the rtp_session_recv_with_ts() and - * rtp_session_send_with_ts() functions. If @yesno is TRUE, rtp_session_recv_with_ts() - * will block until it is time for the packet to be received, according to the timestamp - * passed to the function. After this time, the function returns. - * For rtp_session_send_with_ts(), it will block until it is time for the packet to be sent. - * If @yesno is FALSE, then the two functions will return immediately. - * - * @param session a rtp session - * @param yesno a boolean -**/ -void -rtp_session_set_blocking_mode (RtpSession * session, int yesno) -{ - if (yesno){ - rtp_session_set_scheduling_mode(session,TRUE); - rtp_session_set_flag (session, RTP_SESSION_BLOCKING_MODE); - }else - rtp_session_unset_flag (session, RTP_SESSION_BLOCKING_MODE); -} - -/** - * Set the RTP profile to be used for the session. By default, all session are created by - * rtp_session_new() are initialized with the AV profile, as defined in RFC 3551. The application - * can set any other profile instead using that function. - * - * @param session a rtp session - * @param profile a rtp profile -**/ - -void -rtp_session_set_profile (RtpSession * session, RtpProfile * profile) -{ - session->snd.profile = profile; - session->rcv.profile = profile; - rtp_session_telephone_events_supported(session); -} - -/** - * By default oRTP automatically sends RTCP SR or RR packets. If - * yesno is set to FALSE, the RTCP sending of packet is disabled. - * This functionnality might be needed for some equipments that do not - * support RTCP, leading to a traffic of ICMP errors on the network. - * It can also be used to save bandwidth despite the RTCP bandwidth is - * actually and usually very very low. -**/ -void rtp_session_enable_rtcp(RtpSession *session, bool_t yesno){ - session->rtcp.enabled=yesno; -} - -/** - * Set the RTP profile to be used for the sending by this session. By default, all session are created by - * rtp_session_new() are initialized with the AV profile, as defined in RFC 3551. The application - * can set any other profile instead using that function. - * @param session a rtp session - * @param profile a rtp profile - * -**/ - -void -rtp_session_set_send_profile (RtpSession * session, RtpProfile * profile) -{ - session->snd.profile = profile; - rtp_session_send_telephone_events_supported(session); -} - - - -/** - * Set the RTP profile to be used for the receiveing by this session. By default, all session are created by - * rtp_session_new() are initialized with the AV profile, as defined in RFC 3551. The application - * can set any other profile instead using that function. - * - * @param session a rtp session - * @param profile a rtp profile -**/ - -void -rtp_session_set_recv_profile (RtpSession * session, RtpProfile * profile) -{ - session->rcv.profile = profile; - rtp_session_recv_telephone_events_supported(session); -} - -/** - *@param session a rtp session - * - * DEPRECATED! Returns current send profile. - * Use rtp_session_get_send_profile() or rtp_session_get_recv_profile() - * -**/ -RtpProfile *rtp_session_get_profile(RtpSession *session){ - return session->snd.profile; -} - - -/** - *@param session a rtp session - * - * Returns current send profile. - * -**/ -RtpProfile *rtp_session_get_send_profile(RtpSession *session){ - return session->snd.profile; -} - -/** - *@param session a rtp session - * - * Returns current receive profile. - * -**/ -RtpProfile *rtp_session_get_recv_profile(RtpSession *session){ - return session->rcv.profile; -} - -/** - * The default value is UDP_MAX_SIZE bytes, a value which is working for mostly everyone. - * However if your application can make assumption on the sizes of received packet, - * it can be interesting to set it to a lower value in order to save memory. - * - * @param session a rtp session - * @param bufsize max size in bytes for receiving packets -**/ -void rtp_session_set_recv_buf_size(RtpSession *session, int bufsize){ - session->recv_buf_size=bufsize; -} - -/** - * Set kernel send maximum buffer size for the rtp socket. - * A value of zero defaults to the operating system default. -**/ -void rtp_session_set_rtp_socket_send_buffer_size(RtpSession * session, unsigned int size){ - session->rtp.snd_socket_size=size; -} - -/** - * Set kernel recv maximum buffer size for the rtp socket. - * A value of zero defaults to the operating system default. -**/ -void rtp_session_set_rtp_socket_recv_buffer_size(RtpSession * session, unsigned int size){ - session->rtp.rcv_socket_size=size; -} - -/** - * This function provides the way for an application to be informed of various events that - * may occur during a rtp session. @signal is a string identifying the event, and @cb is - * a user supplied function in charge of processing it. The application can register - * several callbacks for the same signal, in the limit of #RTP_CALLBACK_TABLE_MAX_ENTRIES. - * Here are name and meaning of supported signals types: - * - * "ssrc_changed" : the SSRC of the incoming stream has changed. - * - * "payload_type_changed" : the payload type of the incoming stream has changed. - * - * "telephone-event_packet" : a telephone-event rtp packet (RFC2833) is received. - * - * "telephone-event" : a telephone event has occured. This is a high-level shortcut for "telephone-event_packet". - * - * "network_error" : a network error happened on a socket. Arguments of the callback functions are - * a const char * explaining the error, an int errno error code and the user_data as usual. - * - * "timestamp_jump" : we have received a packet with timestamp in far future compared to last timestamp received. - * The farness of far future is set by rtp_sesssion_set_time_jump_limit() - * "rtcp_bye": we have received a RTCP bye packet. Arguments of the callback - * functions are a const char * containing the leaving reason and - * the user_data. - * - * Returns: 0 on success, -EOPNOTSUPP if the signal does not exists, -1 if no more callbacks - * can be assigned to the signal type. - * - * @param session a rtp session - * @param signal_name the name of a signal - * @param cb a RtpCallback - * @param user_data a pointer to any data to be passed when invoking the callback. - * -**/ -int -rtp_session_signal_connect (RtpSession * session, const char *signal_name, - RtpCallback cb, unsigned long user_data) -{ - OList *elem; - for (elem=session->signal_tables;elem!=NULL;elem=o_list_next(elem)){ - RtpSignalTable *s=(RtpSignalTable*) elem->data; - if (strcmp(signal_name,s->signal_name)==0){ - return rtp_signal_table_add(s,cb,user_data); - } - } - ortp_warning ("rtp_session_signal_connect: inexistant signal %s",signal_name); - return -1; -} - - -/** - * Removes callback function @cb to the list of callbacks for signal @signal. - * - * @param session a rtp session - * @param signal_name a signal name - * @param cb a callback function. - * @return: 0 on success, a negative value if the callback was not found. -**/ -int -rtp_session_signal_disconnect_by_callback (RtpSession * session, const char *signal_name, - RtpCallback cb) -{ - OList *elem; - for (elem=session->signal_tables;elem!=NULL;elem=o_list_next(elem)){ - RtpSignalTable *s=(RtpSignalTable*) elem->data; - if (strcmp(signal_name,s->signal_name)==0){ - return rtp_signal_table_remove_by_callback(s,cb); - } - } - ortp_warning ("rtp_session_signal_connect: inexistant signal %s",signal_name); - return -1; -} - - -/** - * sets the initial sequence number of a sending session. - * @param session a rtp session freshly created. - * @param addr a 16 bit unsigned number. - * -**/ -void rtp_session_set_seq_number(RtpSession *session, uint16_t seq){ - session->rtp.snd_seq=seq; -} - - -uint16_t rtp_session_get_seq_number(RtpSession *session){ - return session->rtp.snd_seq; -} - - -/** - * Sets the SSRC for the outgoing stream. - * If not done, a random ssrc is used. - * - * @param session a rtp session. - * @param ssrc an unsigned 32bit integer representing the synchronisation source identifier (SSRC). -**/ -void -rtp_session_set_ssrc (RtpSession * session, uint32_t ssrc) -{ - session->snd.ssrc = ssrc; -} - - -void rtp_session_update_payload_type(RtpSession *session, int paytype){ - /* check if we support this payload type */ - PayloadType *pt=rtp_profile_get_payload(session->rcv.profile,paytype); - if (pt!=0){ - session->hw_recv_pt=paytype; - ortp_message ("payload type changed to %i(%s) !", - paytype,pt->mime_type); - payload_type_changed(session,pt); - }else{ - ortp_warning("Receiving packet with unknown payload type %i.",paytype); - } -} -/** - * Sets the payload type of the rtp session. It decides of the payload types written in the - * of the rtp header for the outgoing stream, if the session is SENDRECV or SENDONLY. - * For payload type in incoming packets, the application can be informed by registering - * for the "payload_type_changed" signal, so that it can make the necessary changes - * on the downstream decoder that deals with the payload of the packets. - * - * @param session a rtp session - * @param paytype the payload type number - * @return 0 on success, -1 if the payload is not defined. -**/ - -int -rtp_session_set_send_payload_type (RtpSession * session, int paytype) -{ - session->snd.pt=paytype; - return 0; -} - -/** - *@param session a rtp session - * - *@return the payload type currently used in outgoing rtp packets -**/ -int rtp_session_get_send_payload_type(const RtpSession *session){ - return session->snd.pt; -} - -/** - * - * Sets the expected payload type for incoming packets. - * If the actual payload type in incoming packets is different that this expected payload type, thus - * the "payload_type_changed" signal is emitted. - * - *@param session a rtp session - *@param paytype the payload type number - *@return 0 on success, -1 if the payload is not defined. -**/ - -int -rtp_session_set_recv_payload_type (RtpSession * session, int paytype) -{ - PayloadType *pt; - session->rcv.pt=paytype; - session->hw_recv_pt=paytype; - pt=rtp_profile_get_payload(session->rcv.profile,paytype); - if (pt!=NULL){ - payload_type_changed(session,pt); - } - return 0; -} - -/** - *@param session a rtp session - * - * @return the payload type currently used in incoming rtp packets -**/ -int rtp_session_get_recv_payload_type(const RtpSession *session){ - return session->rcv.pt; -} - -/** - * Sets the expected payload type for incoming packets and payload type to be used for outgoing packets. - * If the actual payload type in incoming packets is different that this expected payload type, thus - * the "payload_type_changed" signal is emitted. - * - * @param session a rtp session - * @param paytype the payload type number - * @return 0 on success, -1 if the payload is not defined. -**/ -int rtp_session_set_payload_type(RtpSession *session, int pt){ - if (rtp_session_set_send_payload_type(session,pt)<0) return -1; - if (rtp_session_set_recv_payload_type(session,pt)<0) return -1; - return 0; -} - - -static void rtp_header_init_from_session(rtp_header_t *rtp, RtpSession *session){ - rtp->version = 2; - rtp->padbit = 0; - rtp->extbit = 0; - rtp->markbit= 0; - rtp->cc = 0; - rtp->paytype = session->snd.pt; - rtp->ssrc = session->snd.ssrc; - rtp->timestamp = 0; /* set later, when packet is sended */ - /* set a seq number */ - rtp->seq_number=session->rtp.snd_seq; -} - -/** - * Allocates a new rtp packet. In the header, ssrc and payload_type according to the session's - * context. Timestamp is not set, it will be set when the packet is going to be - * sent with rtp_session_sendm_with_ts(). Sequence number is initalized to previous sequence number sent + 1 - * If payload_size is zero, thus an empty packet (just a RTP header) is returned. - * - *@param session a rtp session. - *@param header_size the rtp header size. For standart size (without extensions), it is RTP_FIXED_HEADER_SIZE - *@param payload data to be copied into the rtp packet. - *@param payload_size size of data carried by the rtp packet. - *@return a rtp packet in a mblk_t (message block) structure. -**/ -mblk_t * rtp_session_create_packet(RtpSession *session,int header_size, const uint8_t *payload, int payload_size) -{ - mblk_t *mp; - int msglen=header_size+payload_size; - rtp_header_t *rtp; - - mp=allocb(msglen,BPRI_MED); - rtp=(rtp_header_t*)mp->b_rptr; - rtp_header_init_from_session(rtp,session); - /*copy the payload, if any */ - mp->b_wptr+=header_size; - if (payload_size){ - memcpy(mp->b_wptr,payload,payload_size); - mp->b_wptr+=payload_size; - } - return mp; -} - -/** - * Creates a new rtp packet using the given payload buffer (no copy). The header will be allocated separetely. - * In the header, ssrc and payload_type according to the session's - * context. Timestamp and seq number are not set, there will be set when the packet is going to be - * sent with rtp_session_sendm_with_ts(). - * oRTP will send this packet using libc's sendmsg() (if this function is availlable!) so that there will be no - * packet concatenation involving copies to be done in user-space. - * @freefn can be NULL, in that case payload will be kept untouched. - * - * @param session a rtp session. - * @param payload the data to be sent with this packet - * @param payload_size size of data - * @param freefn a function that will be called when the payload buffer is no more needed. - * @return: a rtp packet in a mblk_t (message block) structure. -**/ - -mblk_t * rtp_session_create_packet_with_data(RtpSession *session, uint8_t *payload, int payload_size, void (*freefn)(void*)) -{ - mblk_t *mp,*mpayload; - int header_size=RTP_FIXED_HEADER_SIZE; /* revisit when support for csrc is done */ - rtp_header_t *rtp; - - mp=allocb(header_size,BPRI_MED); - rtp=(rtp_header_t*)mp->b_rptr; - rtp_header_init_from_session(rtp,session); - mp->b_wptr+=header_size; - /* create a mblk_t around the user supplied payload buffer */ - mpayload=esballoc(payload,payload_size,BPRI_MED,freefn); - mpayload->b_wptr+=payload_size; - /* link it with the header */ - mp->b_cont=mpayload; - return mp; -} - - -/** - * Creates a new rtp packet using the buffer given in arguments (no copy). - * In the header, ssrc and payload_type according to the session's - *context. Timestamp and seq number are not set, there will be set when the packet is going to be - * sent with rtp_session_sendm_with_ts(). - * @freefn can be NULL, in that case payload will be kept untouched. - * - * @param session a rtp session. - * @param buffer a buffer that contains first just enough place to write a RTP header, then the data to send. - * @param size the size of the buffer - * @param freefn a function that will be called once the buffer is no more needed (the data has been sent). - * @return a rtp packet in a mblk_t (message block) structure. -**/ -mblk_t * rtp_session_create_packet_in_place(RtpSession *session,uint8_t *buffer, int size, void (*freefn)(void*) ) -{ - mblk_t *mp; - rtp_header_t *rtp; - - mp=esballoc(buffer,size,BPRI_MED,freefn); - - rtp=(rtp_header_t*)mp->b_rptr; - rtp_header_init_from_session(rtp,session); - return mp; -} - - -int -__rtp_session_sendm_with_ts (RtpSession * session, mblk_t *mp, uint32_t packet_ts, uint32_t send_ts) -{ - rtp_header_t *rtp; - uint32_t packet_time; - int error = 0; - int packsize; - RtpScheduler *sched=session->sched; - RtpStream *stream=&session->rtp; - - if (session->flags & RTP_SESSION_SEND_NOT_STARTED) - { - session->rtp.snd_ts_offset = send_ts; - /* Set initial last_rcv_time to first send time. */ - if ((session->flags & RTP_SESSION_RECV_NOT_STARTED) - || session->mode == RTP_SESSION_SENDONLY) - { - gettimeofday(&session->last_recv_time, NULL); - } - if (session->flags & RTP_SESSION_SCHEDULED) - { - session->rtp.snd_time_offset = sched->time_; - } - rtp_session_unset_flag (session,RTP_SESSION_SEND_NOT_STARTED); - } - /* if we are in blocking mode, then suspend the process until the scheduler it's time to send the - * next packet */ - /* if the timestamp of the packet queued is older than current time, then you we must - * not block */ - if (session->flags & RTP_SESSION_SCHEDULED) - { - wait_point_lock(&session->snd.wp); - packet_time = - rtp_session_ts_to_time (session, - send_ts - - session->rtp.snd_ts_offset) + - session->rtp.snd_time_offset; - /*ortp_message("rtp_session_send_with_ts: packet_time=%i time=%i",packet_time,sched->time_);*/ - if (TIME_IS_STRICTLY_NEWER_THAN (packet_time, sched->time_)) - { - wait_point_wakeup_at(&session->snd.wp,packet_time,(session->flags & RTP_SESSION_BLOCKING_MODE)!=0); - session_set_clr(&sched->w_sessions,session); /* the session has written */ - } - else session_set_set(&sched->w_sessions,session); /*to indicate select to return immediately */ - wait_point_unlock(&session->snd.wp); - } - - if(mp==NULL) {/*for people who just want to be blocked but - do not want to send anything.*/ - session->rtp.snd_last_ts = packet_ts; - return 0; - } - - rtp=(rtp_header_t*)mp->b_rptr; - - packsize = msgdsize(mp) ; - - rtp->timestamp=packet_ts; - if (session->snd.telephone_events_pt==rtp->paytype) - { - rtp->seq_number = session->rtp.snd_seq; - session->rtp.snd_seq++; - } - else - session->rtp.snd_seq=rtp->seq_number+1; - session->rtp.snd_last_ts = packet_ts; - - - ortp_global_stats.sent += packsize; - stream->sent_payload_bytes+=packsize-RTP_FIXED_HEADER_SIZE; - stream->stats.sent += packsize; - ortp_global_stats.packet_sent++; - stream->stats.packet_sent++; - - error = rtp_session_rtp_send (session, mp); - /*send RTCP packet if needed */ - rtp_session_rtcp_process_send(session); - /* receives rtcp packet if session is send-only*/ - /*otherwise it is done in rtp_session_recvm_with_ts */ - if (session->mode==RTP_SESSION_SENDONLY) rtp_session_rtcp_recv(session); - return error; -} - -/** - * Send the rtp datagram @mp to the destination set by rtp_session_set_remote_addr() - * with timestamp @timestamp. For audio data, the timestamp is the number - * of the first sample resulting of the data transmitted. See rfc1889 for details. - * The packet (@mp) is freed once it is sended. - * - *@param session a rtp session. - *@param mp a rtp packet presented as a mblk_t. - *@param timestamp the timestamp of the data to be sent. - * @return the number of bytes sent over the network. -**/ - -int rtp_session_sendm_with_ts(RtpSession *session, mblk_t *packet, uint32_t timestamp){ - return __rtp_session_sendm_with_ts(session,packet,timestamp,timestamp); -} - - - - -/** - * Send a rtp datagram to the destination set by rtp_session_set_remote_addr() containing - * the data from @buffer with timestamp @userts. This is a high level function that uses - * rtp_session_create_packet() and rtp_session_sendm_with_ts() to send the data. - * - *@param session a rtp session. - *@param buffer a buffer containing the data to be sent in a rtp packet. - *@param len the length of the data buffer, in bytes. - *@param userts the timestamp of the data to be sent. Refer to the rfc to know what it is. - * - *@param return the number of bytes sent over the network. -**/ -int -rtp_session_send_with_ts (RtpSession * session, const uint8_t * buffer, int len, - uint32_t userts) -{ - mblk_t *m; - int err; -#ifdef USE_SENDMSG - m=rtp_session_create_packet_with_data(session,(uint8_t*)buffer,len,NULL); -#else - m = rtp_session_create_packet(session,RTP_FIXED_HEADER_SIZE,(uint8_t*)buffer,len); -#endif - err=rtp_session_sendm_with_ts(session,m,userts); - return err; -} - - - -extern void rtcp_parse(RtpSession *session, mblk_t *mp); - - - -static void payload_type_changed_notify(RtpSession *session, int paytype){ - PayloadType *pt = rtp_profile_get_payload(session->rcv.profile,paytype); - if (pt) { - session->rcv.pt = paytype; - rtp_signal_table_emit (&session->on_payload_type_changed); - } -} - - -/** - * Try to get a rtp packet presented as a mblk_t structure from the rtp session. - * The @user_ts parameter is relative to the first timestamp of the incoming stream. In other - * words, the application does not have to know the first timestamp of the stream, it can - * simply call for the first time this function with @user_ts=0, and then incrementing it - * as it want. The RtpSession takes care of synchronisation between the stream timestamp - * and the user timestamp given here. - * - * This function returns the entire packet (with header). - * - * The behaviour of this function has changed since version 0.15.0. Previously the payload data could be - * accessed using mblk_t::b_cont::b_rptr field of the returned mblk_t. - * This is no more the case. - * The convenient way of accessing the payload data is to use rtp_get_payload() : - * @code - * unsigned char *payload; - * int payload_size; - * payload_size=rtp_get_payload(mp,&payload); - * @endcode - * OR simply skip the header this way, the data is then comprised between mp->b_rptr and mp->b_wptr: - * @code - * rtp_get_payload(mp,&mp->b_rptr); - * @endcode - * - * - * @param session a rtp session. - * @param user_ts a timestamp. - * - * @return a rtp packet presented as a mblk_t. -**/ - -mblk_t * -rtp_session_recvm_with_ts (RtpSession * session, uint32_t user_ts) -{ - mblk_t *mp = NULL; - rtp_header_t *rtp; - uint32_t ts; - uint32_t packet_time; - RtpScheduler *sched=session->sched; - RtpStream *stream=&session->rtp; - int rejected=0; - bool_t read_socket=TRUE; - - /* if we are scheduled, remember the scheduler time at which the application has - * asked for its first timestamp */ - - if (session->flags & RTP_SESSION_RECV_NOT_STARTED) - { - session->rtp.rcv_query_ts_offset = user_ts; - /* Set initial last_rcv_time to first recv time. */ - if ((session->flags & RTP_SESSION_SEND_NOT_STARTED) - || session->mode == RTP_SESSION_RECVONLY){ - gettimeofday(&session->last_recv_time, NULL); - } - if (session->flags & RTP_SESSION_SCHEDULED) - { - session->rtp.rcv_time_offset = sched->time_; - //ortp_message("setting snd_time_offset=%i",session->rtp.snd_time_offset); - } - rtp_session_unset_flag (session,RTP_SESSION_RECV_NOT_STARTED); - }else{ - /*prevent reading from the sockets when two - consecutives calls for a same timestamp*/ - if (user_ts==session->rtp.rcv_last_app_ts) - read_socket=FALSE; - } - session->rtp.rcv_last_app_ts = user_ts; - if (read_socket){ - rtp_session_rtp_recv (session, user_ts); - rtp_session_rtcp_recv(session); - } - /* check for telephone event first */ - mp=getq(&session->rtp.tev_rq); - if (mp!=NULL){ - int msgsize=msgdsize(mp); - ortp_global_stats.recv += msgsize; - stream->stats.recv += msgsize; - rtp_signal_table_emit2(&session->on_telephone_event_packet,(long)mp); - rtp_session_check_telephone_events(session,mp); - freemsg(mp); - mp=NULL; - } - - /* then now try to return a media packet, if possible */ - /* first condition: if the session is starting, don't return anything - * until the queue size reaches jitt_comp */ - - if (session->flags & RTP_SESSION_RECV_SYNC) - { - queue_t *q = &session->rtp.rq; - if (qempty(q)) - { - ortp_debug ("Queue is empty."); - goto end; - } - rtp = (rtp_header_t *) qfirst(q)->b_rptr; - session->rtp.rcv_ts_offset = rtp->timestamp; - session->rtp.rcv_last_ret_ts = user_ts; /* just to have an init value */ - session->rcv.ssrc = rtp->ssrc; - /* delete the recv synchronisation flag */ - rtp_session_unset_flag (session, RTP_SESSION_RECV_SYNC); - } - - /*calculate the stream timestamp from the user timestamp */ - ts = jitter_control_get_compensated_timestamp(&session->rtp.jittctl,user_ts); - if (session->rtp.jittctl.enabled==TRUE){ - if (session->permissive) - mp = rtp_getq_permissive(&session->rtp.rq, ts,&rejected); - else{ - mp = rtp_getq(&session->rtp.rq, ts,&rejected); - } - }else mp=getq(&session->rtp.rq);/*no jitter buffer at all*/ - - stream->stats.outoftime+=rejected; - ortp_global_stats.outoftime+=rejected; - - goto end; - - end: - if (mp != NULL) - { - int msgsize = msgdsize (mp); /* evaluate how much bytes (including header) is received by app */ - uint32_t packet_ts; - ortp_global_stats.recv += msgsize; - stream->stats.recv += msgsize; - rtp = (rtp_header_t *) mp->b_rptr; - packet_ts=rtp->timestamp; - ortp_debug("Returning mp with ts=%i", packet_ts); - /* check for payload type changes */ - if (session->rcv.pt != rtp->paytype) - { - payload_type_changed_notify(session, rtp->paytype); - } - /* update the packet's timestamp so that it corrected by the - adaptive jitter buffer mechanism */ - if (session->rtp.jittctl.adaptive){ - uint32_t changed_ts; - /* only update correction offset between packets of different - timestamps*/ - if (packet_ts!=session->rtp.rcv_last_ts) - jitter_control_update_corrective_slide(&session->rtp.jittctl); - changed_ts=packet_ts+session->rtp.jittctl.corrective_slide; - rtp->timestamp=changed_ts; - /*ortp_debug("Returned packet has timestamp %u, with clock slide compensated it is %u",packet_ts,rtp->timestamp);*/ - } - session->rtp.rcv_last_ts = packet_ts; - if (!(session->flags & RTP_SESSION_FIRST_PACKET_DELIVERED)){ - rtp_session_set_flag(session,RTP_SESSION_FIRST_PACKET_DELIVERED); - } - } - else - { - ortp_debug ("No mp for timestamp queried"); - stream->stats.unavaillable++; - ortp_global_stats.unavaillable++; - } - rtp_session_rtcp_process_recv(session); - - if (session->flags & RTP_SESSION_SCHEDULED) - { - /* if we are in blocking mode, then suspend the calling process until timestamp - * wanted expires */ - /* but we must not block the process if the timestamp wanted by the application is older - * than current time */ - wait_point_lock(&session->rcv.wp); - packet_time = - rtp_session_ts_to_time (session, - user_ts - - session->rtp.rcv_query_ts_offset) + - session->rtp.rcv_time_offset; - ortp_debug ("rtp_session_recvm_with_ts: packet_time=%i, time=%i",packet_time, sched->time_); - - if (TIME_IS_STRICTLY_NEWER_THAN (packet_time, sched->time_)) - { - wait_point_wakeup_at(&session->rcv.wp,packet_time, (session->flags & RTP_SESSION_BLOCKING_MODE)!=0); - session_set_clr(&sched->r_sessions,session); - } - else session_set_set(&sched->r_sessions,session); /*to unblock _select() immediately */ - wait_point_unlock(&session->rcv.wp); - } - return mp; -} - - -/** - * NOTE: use of this function is discouraged when sending payloads other than - * pcm/pcmu/pcma/adpcm types. - * rtp_session_recvm_with_ts() does better job. - * - * Tries to read the bytes of the incoming rtp stream related to timestamp ts. In case - * where the user supplied buffer @buffer is not large enough to get all the data - * related to timestamp ts, then *( have_more) is set to 1 to indicate that the application - * should recall the function with the same timestamp to get more data. - * - * When the rtp session is scheduled (see rtp_session_set_scheduling_mode() ), and the - * blocking mode is on (see rtp_session_set_blocking_mode() ), then the calling thread - * is suspended until the timestamp given as argument expires, whatever a received packet - * fits the query or not. - * - * Important note: it is clear that the application cannot know the timestamp of the first - * packet of the incoming stream, because it can be random. The @ts timestamp given to the - * function is used relatively to first timestamp of the stream. In simple words, 0 is a good - * value to start calling this function. - * - * This function internally calls rtp_session_recvm_with_ts() to get a rtp packet. The content - * of this packet is then copied into the user supplied buffer in an intelligent manner: - * the function takes care of the size of the supplied buffer and the timestamp given in - * argument. Using this function it is possible to read continous audio data (e.g. pcma,pcmu...) - * with for example a standart buffer of size of 160 with timestamp incrementing by 160 while the incoming - * stream has a different packet size. - * - *Returns: if a packet was availlable with the corresponding timestamp supplied in argument - * then the number of bytes written in the user supplied buffer is returned. If no packets - * are availlable, either because the sender has not started to send the stream, or either - * because silence packet are not transmitted, or either because the packet was lost during - * network transport, then the function returns zero. - *@param session a rtp session. - *@param buffer a user supplied buffer to write the data. - *@param len the length in bytes of the user supplied buffer. - *@param ts the timestamp wanted. - *@param have_more the address of an integer to indicate if more data is availlable for the given timestamp. - * -**/ -int rtp_session_recv_with_ts (RtpSession * session, uint8_t * buffer, - int len, uint32_t ts, int * have_more){ - mblk_t *mp=NULL; - int plen,blen=0; - *have_more=0; - while(1){ - if (session->pending){ - mp=session->pending; - session->pending=NULL; - }else { - mp=rtp_session_recvm_with_ts(session,ts); - if (mp!=NULL) rtp_get_payload(mp,&mp->b_rptr); - } - if (mp){ - plen=mp->b_wptr-mp->b_rptr; - if (plen<=len){ - memcpy(buffer,mp->b_rptr,plen); - buffer+=plen; - blen+=plen; - len-=plen; - freemsg(mp); - mp=NULL; - }else{ - memcpy(buffer,mp->b_rptr,len); - mp->b_rptr+=len; - buffer+=len; - blen+=len; - len=0; - session->pending=mp; - *have_more=1; - break; - } - }else break; - } - return blen; -} -/** - * When the rtp session is scheduled and has started to send packets, this function - * computes the timestamp that matches to the present time. Using this function can be - * usefull when sending discontinuous streams. Some time can be elapsed between the end - * of a stream burst and the begin of a new stream burst, and the application may be not - * not aware of this elapsed time. In order to get a valid (current) timestamp to pass to - * #rtp_session_send_with_ts() or #rtp_session_sendm_with_ts(), the application may - * use rtp_session_get_current_send_ts(). - * - * @param session a rtp session. - * @return the current send timestamp for the rtp session. -**/ -uint32_t rtp_session_get_current_send_ts(RtpSession *session) -{ - uint32_t userts; - uint32_t session_time; - RtpScheduler *sched=session->sched; - PayloadType *payload; - payload=rtp_profile_get_payload(session->snd.profile,session->snd.pt); - return_val_if_fail(payload!=NULL, 0); - if ( (session->flags & RTP_SESSION_SCHEDULED)==0 ){ - ortp_warning("can't guess current timestamp because session is not scheduled."); - return 0; - } - session_time=sched->time_-session->rtp.snd_time_offset; - userts= (uint32_t)( ( (double)(session_time) * (double) payload->clock_rate )/ 1000.0) - + session->rtp.snd_ts_offset; - return userts; -} - -/** - * Same thing as rtp_session_get_current_send_ts() except that it's for an incoming stream. - * Works only on scheduled mode. - * - * @param session a rtp session. - * @return the theoritical that would have to be receive now. - * -**/ -uint32_t rtp_session_get_current_recv_ts(RtpSession *session){ - uint32_t userts; - uint32_t session_time; - RtpScheduler *sched=ortp_get_scheduler(); - PayloadType *payload; - payload=rtp_profile_get_payload(session->rcv.profile,session->rcv.pt); - return_val_if_fail(payload!=NULL, 0); - if ( (session->flags & RTP_SESSION_SCHEDULED)==0 ){ - ortp_warning("can't guess current timestamp because session is not scheduled."); - return 0; - } - session_time=sched->time_-session->rtp.rcv_time_offset; - userts= (uint32_t)( ( (double)(session_time) * (double) payload->clock_rate )/ 1000.0) - + session->rtp.rcv_ts_offset; - return userts; -} - -/** - * oRTP has the possibility to inform the application through a callback registered - * with rtp_session_signal_connect about crazy incoming RTP stream that jumps from - * a timestamp N to N+some_crazy_value. This lets the opportunity for the application - * to reset the session in order to resynchronize, or any other action like stopping the call - * and reporting an error. - * @param session the rtp session - * @param ts_step a time interval in miliseconds - * -**/ -void rtp_session_set_time_jump_limit(RtpSession *session, int milisecs){ - uint32_t ts; - session->rtp.time_jump=milisecs; - ts=rtp_session_time_to_ts(session,milisecs); - if (ts==0) session->rtp.ts_jump=1<<31; /* do not detect ts jump */ - else session->rtp.ts_jump=ts; -} - -/** - * Closes the rtp and rtcp sockets. -**/ -void rtp_session_release_sockets(RtpSession *session){ - if (session->rtp.socket>=0) close_socket (session->rtp.socket); - if (session->rtcp.socket>=0) close_socket (session->rtcp.socket); - session->rtp.socket=-1; - session->rtcp.socket=-1; - - session->rtp.tr = 0; - session->rtcp.tr = 0; - - /* don't discard remote addresses, then can be preserved for next use. - session->rtp.rem_addrlen=0; - session->rtcp.rem_addrlen=0; - */ -} - -ortp_socket_t rtp_session_get_rtp_socket(const RtpSession *session){ - return rtp_session_using_transport(session, rtp) ? (session->rtp.tr->t_getsocket)(session->rtp.tr) : session->rtp.socket; -} - -ortp_socket_t rtp_session_get_rtcp_socket(const RtpSession *session){ - return rtp_session_using_transport(session, rtcp) ? (session->rtcp.tr->t_getsocket)(session->rtcp.tr) : session->rtcp.socket; -} - -/** - * Register an event queue. - * An application can use an event queue to get informed about various RTP events. -**/ -void rtp_session_register_event_queue(RtpSession *session, OrtpEvQueue *q){ - session->eventqs=o_list_append(session->eventqs,q); -} - -void rtp_session_unregister_event_queue(RtpSession *session, OrtpEvQueue *q){ - session->eventqs=o_list_remove(session->eventqs,q); -} - -void rtp_session_dispatch_event(RtpSession *session, OrtpEvent *ev){ - OList *it; - int i; - for(i=0,it=session->eventqs;it!=NULL;it=it->next,++i){ - ortp_ev_queue_put((OrtpEvQueue*)it->data,ortp_event_dup(ev)); - } - ortp_event_destroy(ev); -} - - -void rtp_session_uninit (RtpSession * session) -{ - /* first of all remove the session from the scheduler */ - if (session->flags & RTP_SESSION_SCHEDULED) - { - rtp_scheduler_remove_session (session->sched,session); - } - /*flush all queues */ - flushq(&session->rtp.rq, FLUSHALL); - flushq(&session->rtp.tev_rq, FLUSHALL); - - if (session->eventqs!=NULL) o_list_free(session->eventqs); - /* close sockets */ - rtp_session_release_sockets(session); - - wait_point_uninit(&session->snd.wp); - wait_point_uninit(&session->rcv.wp); - if (session->current_tev!=NULL) freemsg(session->current_tev); - if (session->rtp.cached_mp!=NULL) freemsg(session->rtp.cached_mp); - if (session->rtcp.cached_mp!=NULL) freemsg(session->rtcp.cached_mp); - if (session->sd!=NULL) freemsg(session->sd); - - session->signal_tables = o_list_free(session->signal_tables); - msgb_allocator_uninit(&session->allocator); -} - -/** - * Resynchronize to the incoming RTP streams. - * This can be useful to handle discoutinuous timestamps. - * For example, call this function from the timestamp_jump signal handler. - * @param session the rtp session -**/ -void rtp_session_resync(RtpSession *session){ - flushq (&session->rtp.rq, FLUSHALL); - rtp_session_set_flag(session, RTP_SESSION_RECV_SYNC); - rtp_session_unset_flag(session,RTP_SESSION_FIRST_PACKET_DELIVERED); - jitter_control_init(&session->rtp.jittctl,-1,NULL); -} - -/** - * Reset the session: local and remote addresses are kept. It resets timestamp, sequence - * number, and calls rtp_session_resync(). - * - * @param session a rtp session. -**/ -void rtp_session_reset (RtpSession * session) -{ - rtp_session_set_flag (session, RTP_SESSION_RECV_NOT_STARTED); - rtp_session_set_flag (session, RTP_SESSION_SEND_NOT_STARTED); - //session->ssrc=0; - session->rtp.snd_time_offset = 0; - session->rtp.snd_ts_offset = 0; - session->rtp.snd_rand_offset = 0; - session->rtp.snd_last_ts = 0; - session->rtp.rcv_time_offset = 0; - session->rtp.rcv_ts_offset = 0; - session->rtp.rcv_query_ts_offset = 0; - session->rtp.rcv_last_ts = 0; - session->rtp.rcv_last_app_ts = 0; - session->rtp.hwrcv_extseq = 0; - session->rtp.hwrcv_since_last_SR=0; - session->rtp.snd_seq = 0; - session->rtp.sent_payload_bytes=0; - rtp_session_clear_send_error_code(session); - rtp_session_clear_recv_error_code(session); - rtp_stats_reset(&session->rtp.stats); - rtp_session_resync(session); - session->ssrc_set=FALSE; -} - -/** - * Retrieve the session's statistics. -**/ -const rtp_stats_t * rtp_session_get_stats(const RtpSession *session){ - return &session->rtp.stats; -} - -void rtp_session_reset_stats(RtpSession *session){ - memset(&session->rtp.stats,0,sizeof(rtp_stats_t)); -} - -/** - * Stores some application specific data into the session, so that it is easy to retrieve it from the signal callbacks using rtp_session_get_data(). - * @param session a rtp session - * @param data an opaque pointer to be stored in the session -**/ - -void rtp_session_set_data(RtpSession *session, void *data){ - session->user_data=data; -} - -/** - * @param session a rtp session - * @return the void pointer previously set using rtp_session_set_data() -**/ -void *rtp_session_get_data(const RtpSession *session){ - return session->user_data; -} - -/** - * Enable or disable the "rtp symmetric" hack which consists of the following: - * after the first packet is received, the source address of the packet - * is set to be the destination address for all next packets. - * This is useful to pass-through firewalls. - * @param session a rtp session - * @param yesno a boolean to enable or disable the feature - * -**/ -void -rtp_session_set_symmetric_rtp (RtpSession * session, bool_t yesno) -{ - session->symmetric_rtp =yesno; -} - -/** - * If yesno is TRUE, thus a connect() syscall is done on the socket to - * the destination address set by rtp_session_set_remote_addr(), or - * if the session does symmetric rtp (see rtp_session_set_symmetric_rtp()) - * a the connect() is done to the source address of the first packet received. - * Connecting a socket has effect of rejecting all incoming packets that - * don't come from the address specified in connect(). - * It also makes ICMP errors (such as connection refused) available to the - * application. - * @param session a rtp session - * @param yesno a boolean to enable or disable the feature - * -**/ -void rtp_session_set_connected_mode(RtpSession *session, bool_t yesno){ - session->use_connect=yesno; -} - -static float compute_bw(struct timeval *orig, unsigned int bytes){ - struct timeval current; - float bw; - float time; - if (bytes==0) return 0; - gettimeofday(¤t,NULL); - time=(float)(current.tv_sec - orig->tv_sec) + - ((float)(current.tv_usec - orig->tv_usec)*1e-6); - bw=((float)bytes)*8/(time+0.001); - /*+0.0001 avoids a division by zero without changing the results significatively*/ - return bw; -} - -float rtp_session_compute_recv_bandwidth(RtpSession *session){ - float bw; - bw=compute_bw(&session->rtp.recv_bw_start,session->rtp.recv_bytes); - session->rtp.recv_bytes=0; - return bw; -} - -float rtp_session_compute_send_bandwidth(RtpSession *session){ - float bw; - bw=compute_bw(&session->rtp.send_bw_start,session->rtp.sent_bytes); - session->rtp.sent_bytes=0; - return bw; -} - -int rtp_session_get_last_send_error_code(RtpSession *session){ - return session->rtp.send_errno; -} - -void rtp_session_clear_send_error_code(RtpSession *session){ - session->rtp.send_errno=0; -} - -int rtp_session_get_last_recv_error_code(RtpSession *session){ - return session->rtp.recv_errno; -} - -void rtp_session_clear_recv_error_code(RtpSession *session){ - session->rtp.send_errno=0; -} - -/** - * Destroys a rtp session. - * All memory allocated for the RtpSession is freed. - * - * @param session a rtp session. -**/ -void rtp_session_destroy (RtpSession * session) -{ - rtp_session_uninit (session); - ortp_free (session); -} - -void rtp_session_make_time_distorsion(RtpSession *session, int milisec) -{ - session->rtp.snd_time_offset+=milisec; -} - - -/* packet api */ - -void rtp_add_csrc(mblk_t *mp, uint32_t csrc) -{ - rtp_header_t *hdr=(rtp_header_t*)mp->b_rptr; - hdr->csrc[hdr->cc]=csrc; - hdr->cc++; -} - -/** - * Get a pointer to the beginning of the payload data of the RTP packet. - * @param packet a RTP packet represented as a mblk_t - * @param start a pointer to the beginning of the payload data, pointing inside the packet. - * @return the length of the payload data. -**/ -int rtp_get_payload(mblk_t *packet, unsigned char **start){ - unsigned char *tmp; - int header_len=RTP_FIXED_HEADER_SIZE+(rtp_get_cc(packet)*4); - tmp=packet->b_rptr+header_len; - if (tmp>packet->b_wptr){ - if (packet->b_cont!=NULL){ - tmp=packet->b_cont->b_rptr+(header_len- (packet->b_wptr-packet->b_rptr)); - if (tmp<=packet->b_cont->b_wptr){ - *start=tmp; - return packet->b_cont->b_wptr-tmp; - } - } - ortp_warning("Invalid RTP packet"); - return -1; - } - *start=tmp; - return packet->b_wptr-tmp; -} - - -/** - * Gets last time a valid RTP or RTCP packet was received. - * @param session RtpSession to get last receive time from. - * @param tv Pointer to struct timeval to fill. - * -**/ -void -rtp_session_get_last_recv_time(RtpSession *session, struct timeval *tv) -{ -#ifdef PERF - ortp_error("rtp_session_get_last_recv_time() feature disabled."); -#else - *tv = session->last_recv_time; -#endif -} - - - -uint32_t rtp_session_time_to_ts(RtpSession *session, int millisecs){ - PayloadType *payload; - payload = - rtp_profile_get_payload (session->snd.profile, - session->snd.pt); - if (payload == NULL) - { - ortp_warning - ("rtp_session_ts_to_t: use of unsupported payload type %d.", session->snd.pt); - return 0; - } - /* the return value is in milisecond */ - return (uint32_t) (payload->clock_rate*(double) (millisecs/1000.0f)); -} - -/* function used by the scheduler only:*/ -uint32_t rtp_session_ts_to_time (RtpSession * session, uint32_t timestamp) -{ - PayloadType *payload; - payload = - rtp_profile_get_payload (session->snd.profile, - session->snd.pt); - if (payload == NULL) - { - ortp_warning - ("rtp_session_ts_to_t: use of unsupported payload type %d.", session->snd.pt); - return 0; - } - /* the return value is in milisecond */ - return (uint32_t) (1000.0 * - ((double) timestamp / - (double) payload->clock_rate)); -} - - -/* time is the number of miliseconds elapsed since the start of the scheduler */ -void rtp_session_process (RtpSession * session, uint32_t time, RtpScheduler *sched) -{ - wait_point_lock(&session->snd.wp); - if (wait_point_check(&session->snd.wp,time)){ - session_set_set(&sched->w_sessions,session); - wait_point_wakeup(&session->snd.wp); - } - wait_point_unlock(&session->snd.wp); - - wait_point_lock(&session->rcv.wp); - if (wait_point_check(&session->rcv.wp,time)){ - session_set_set(&sched->r_sessions,session); - wait_point_wakeup(&session->rcv.wp); - } - wait_point_unlock(&session->rcv.wp); -} - diff --git a/linphone/oRTP/src/rtpsession_inet.c b/linphone/oRTP/src/rtpsession_inet.c deleted file mode 100644 index 0ec5a7526..000000000 --- a/linphone/oRTP/src/rtpsession_inet.c +++ /dev/null @@ -1,1034 +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" -#include "ortp/rtpsession.h" -#include "rtpsession_priv.h" - - -#if defined(WIN32) || defined(_WIN32_WCE) -#include "ortp-config-win32.h" -#else -#include "ortp-config.h" /*needed for HAVE_SYS_UIO_H */ -#endif - -#ifdef HAVE_SYS_UIO_H -#include -#define USE_SENDMSG 1 -#endif - -#define can_connect(s) ( (s)->use_connect && !(s)->symmetric_rtp) - -static bool_t try_connect(int fd, const struct sockaddr *dest, socklen_t addrlen){ - if (connect(fd,dest,addrlen)<0){ - ortp_warning("Could not connect() socket: %s",getSocketError()); - return FALSE; - } - return TRUE; -} - -static ortp_socket_t create_and_bind(const char *addr, int port, int *sock_family, bool_t reuse_addr){ - int err; - int optval = 1; - ortp_socket_t sock=-1; - -#ifdef ORTP_INET6 - char num[8]; - struct addrinfo hints, *res0, *res; -#else - struct sockaddr_in saddr; -#endif - -#ifdef ORTP_INET6 - - memset(&hints, 0, sizeof(hints)); - hints.ai_family = PF_UNSPEC; - hints.ai_socktype = SOCK_DGRAM; - snprintf(num, sizeof(num), "%d",port); - err = getaddrinfo(addr,num, &hints, &res0); - if (err!=0) { - ortp_warning ("Error in getaddrinfo on (addr=%s port=%i): %s", addr, port, gai_strerror(err)); - return -1; - } - - for (res = res0; res; res = res->ai_next) { - sock = socket(res->ai_family, res->ai_socktype, 0); - if (sock==-1) - continue; - - if (reuse_addr){ - err = setsockopt (sock, SOL_SOCKET, SO_REUSEADDR, - (SOCKET_OPTION_VALUE)&optval, sizeof (optval)); - if (err < 0) - { - ortp_warning ("Fail to set rtp address reusable: %s.", getSocketError()); - } - } - - *sock_family=res->ai_family; - err = bind (sock, res->ai_addr, res->ai_addrlen); - if (err != 0){ - ortp_warning ("Fail to bind rtp socket to (addr=%s port=%i) : %s.", addr,port, getSocketError()); - close_socket (sock); - sock=-1; - continue; - } -#ifndef __hpux - switch (res->ai_family) - { - case AF_INET: - if (IN_MULTICAST(ntohl(((struct sockaddr_in *) res->ai_addr)->sin_addr.s_addr))) - { - struct ip_mreq mreq; - mreq.imr_multiaddr.s_addr = ((struct sockaddr_in *) res->ai_addr)->sin_addr.s_addr; - mreq.imr_interface.s_addr = INADDR_ANY; - err = setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, (SOCKET_OPTION_VALUE) &mreq, sizeof(mreq)); - if (err < 0){ - ortp_warning ("Fail to join address group: %s.", getSocketError()); - close_socket (sock); - sock=-1; - continue; - } - } - break; - case AF_INET6: - if (IN6_IS_ADDR_MULTICAST(&(((struct sockaddr_in6 *) res->ai_addr)->sin6_addr))) - { - struct ipv6_mreq mreq; - mreq.ipv6mr_multiaddr = ((struct sockaddr_in6 *) res->ai_addr)->sin6_addr; - mreq.ipv6mr_interface = 0; - err = setsockopt(sock, IPPROTO_IPV6, IPV6_JOIN_GROUP, (SOCKET_OPTION_VALUE)&mreq, sizeof(mreq)); - if (err < 0) - { - ortp_warning ("Fail to join address group: %s.", getSocketError()); - close_socket (sock); - sock=-1; - continue; - } - } - break; - } -#endif /*hpux*/ - break; - } - freeaddrinfo(res0); -#else - saddr.sin_family = AF_INET; - *sock_family=AF_INET; - err = inet_aton (addr, &saddr.sin_addr); - if (err < 0) - { - ortp_warning ("Error in socket address:%s.", getSocketError()); - return -1; - } - saddr.sin_port = htons (port); - - sock = socket (PF_INET, SOCK_DGRAM, 0); - if (sock==-1) return -1; - - if (reuse_addr){ - err = setsockopt (sock, SOL_SOCKET, SO_REUSEADDR, - (SOCKET_OPTION_VALUE)&optval, sizeof (optval)); - if (err < 0) - { - ortp_warning ("Fail to set rtp address reusable: %s.",getSocketError()); - } - } - - err = bind (sock, - (struct sockaddr *) &saddr, - sizeof (saddr)); - - if (err != 0) - { - ortp_warning ("Fail to bind rtp socket to port %i: %s.", port, getSocketError()); - close_socket (sock); - return -1; - } -#endif - if (sock!=-1){ - set_non_blocking_socket (sock); - } - return sock; -} - -static void set_socket_sizes(int sock, unsigned int sndbufsz, unsigned int rcvbufsz){ - int err; - bool_t done=FALSE; - if (sndbufsz>0){ -#ifdef SO_SNDBUFFORCE - err = setsockopt(sock, SOL_SOCKET, SO_SNDBUFFORCE, (void *)&sndbufsz, sizeof(sndbufsz)); - if (err == -1) { - ortp_error("Fail to increase socket's send buffer size with SO_SNDBUFFORCE: %s.", getSocketError()); - }else done=TRUE; -#endif - if (!done){ - err = setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (void *)&sndbufsz, sizeof(sndbufsz)); - if (err == -1) { - ortp_error("Fail to increase socket's send buffer size with SO_SNDBUF: %s.", getSocketError()); - } - } - } - done=FALSE; - if (rcvbufsz>0){ -#ifdef SO_RCVBUFFORCE - err = setsockopt(sock, SOL_SOCKET, SO_RCVBUFFORCE, (void *)&rcvbufsz, sizeof(rcvbufsz)); - if (err == -1) { - ortp_error("Fail to increase socket's recv buffer size with SO_RCVBUFFORCE: %s.", getSocketError()); - } -#endif - if (!done){ - err = setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (void *)&rcvbufsz, sizeof(rcvbufsz)); - if (err == -1) { - ortp_error("Fail to increase socket's recv buffer size with SO_RCVBUF: %s.", getSocketError()); - } - } - - } -} - -static ortp_socket_t create_and_bind_random(const char *localip, int *sock_family, int *port){ - int retry; - ortp_socket_t sock = -1; - for (retry=0;retry<100;retry++) - { - int localport; - do - { - localport = (rand () + 5000) & 0xfffe; - } - while ((localport < 5000) || (localport > 0xffff)); - /*do not set REUSEADDR in case of random allocation */ - sock = create_and_bind(localip, localport, sock_family,FALSE); - if (sock!=-1) { - *port=localport; - return sock; - } - } - ortp_warning("create_and_bind_random: Could not find a random port for %s !",localip); - return -1; -} - -/** - *rtp_session_set_local_addr: - *@session: a rtp session freshly created. - *@addr: a local IP address in the xxx.xxx.xxx.xxx form. - *@port: a local port or -1 to let oRTP choose the port randomly - * - * Specify the local addr to be use to listen for rtp packets or to send rtp packet from. - * In case where the rtp session is send-only, then it is not required to call this function: - * when calling rtp_session_set_remote_addr(), if no local address has been set, then the - * default INADRR_ANY (0.0.0.0) IP address with a random port will be used. Calling - * rtp_sesession_set_local_addr() is mandatory when the session is recv-only or duplex. - * - * Returns: 0 on success. -**/ - -int -rtp_session_set_local_addr (RtpSession * session, const char * addr, int port) -{ - ortp_socket_t sock; - int sockfamily; - bool_t reuse_addr; - if (session->rtp.socket>=0){ - /* don't rebind, but close before*/ - rtp_session_release_sockets(session); - } -#ifdef SO_REUSE_ADDR - reuse_addr=TRUE; -#else - reuse_addr=FALSE; -#endif - /* try to bind the rtp port */ - if (port>0) - sock=create_and_bind(addr,port,&sockfamily,reuse_addr); - else - sock=create_and_bind_random(addr,&sockfamily,&port); - if (sock!=-1){ - set_socket_sizes(sock,session->rtp.snd_socket_size,session->rtp.rcv_socket_size); - session->rtp.sockfamily=sockfamily; - session->rtp.socket=sock; - session->rtp.loc_port=port; - /*try to bind rtcp port */ - sock=create_and_bind(addr,port+1,&sockfamily,reuse_addr); - if (sock!=-1){ - session->rtcp.sockfamily=sockfamily; - session->rtcp.socket=sock; - }else{ - ortp_warning("Could not create and bind rtcp socket."); - } - - /* set socket options (but don't change chosen states) */ - rtp_session_set_dscp( session, -1 ); - rtp_session_set_multicast_ttl( session, -1 ); - rtp_session_set_multicast_loopback( session, -1 ); - - return 0; - } - return -1; -} - - -/** - *rtp_session_set_multicast_ttl: - *@session: a rtp session - *@ttl: desired Multicast Time-To-Live - * - * Sets the TTL (Time-To-Live) for outgoing multicast packets. - * - * Returns: 0 on success. - * -**/ -int rtp_session_set_multicast_ttl(RtpSession *session, int ttl) -{ - int retval; - - // Store new TTL if one is specified - if (ttl>0) session->multicast_ttl = ttl; - - // Don't do anything if socket hasn't been created yet - if (session->rtp.socket < 0) return 0; - - switch (session->rtp.sockfamily) { - case AF_INET: { - - retval= setsockopt(session->rtp.socket, IPPROTO_IP, IP_MULTICAST_TTL, - (SOCKET_OPTION_VALUE) &session->multicast_ttl, sizeof(session->multicast_ttl)); - - if (retval<0) break; - - retval= setsockopt(session->rtcp.socket, IPPROTO_IP, IP_MULTICAST_TTL, - (SOCKET_OPTION_VALUE) &session->multicast_ttl, sizeof(session->multicast_ttl)); - - } break; -#ifdef ORTP_INET6 - case AF_INET6: { - - retval= setsockopt(session->rtp.socket, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, - (SOCKET_OPTION_VALUE)&session->multicast_ttl, sizeof(session->multicast_ttl)); - - if (retval<0) break; - - retval= setsockopt(session->rtcp.socket, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, - (SOCKET_OPTION_VALUE) &session->multicast_ttl, sizeof(session->multicast_ttl)); - - } break; -#endif - default: - retval=-1; - } - - if (retval<0) - ortp_warning("Failed to set multicast TTL on socket."); - - - return retval; -} - - -/** - *rtp_session_get_multicast_ttl: - *@session: a rtp session - * - * Returns the TTL (Time-To-Live) for outgoing multicast packets. - * -**/ -int rtp_session_get_multicast_ttl(RtpSession *session) -{ - return session->multicast_ttl; -} - - -/** - *rtp_session_set_multicast_loopback: - *@session: a rtp session - *@ttl: desired Multicast Time-To-Live - * - * Sets the TTL (Time-To-Live) for outgoing multicast packets. - * - * Returns: 0 on success. - * -**/ -int rtp_session_set_multicast_loopback(RtpSession *session, int yesno) -{ - int retval; - - // Store new loopback state if one is specified - if (yesno==0) { - // Don't loop back - session->multicast_loopback = 0; - } else if (yesno>0) { - // Do loop back - session->multicast_loopback = 1; - } - - // Don't do anything if socket hasn't been created yet - if (session->rtp.socket < 0) return 0; - - switch (session->rtp.sockfamily) { - case AF_INET: { - - retval= setsockopt(session->rtp.socket, IPPROTO_IP, IP_MULTICAST_LOOP, - (SOCKET_OPTION_VALUE) &session->multicast_loopback, sizeof(session->multicast_loopback)); - - if (retval<0) break; - - retval= setsockopt(session->rtcp.socket, IPPROTO_IP, IP_MULTICAST_LOOP, - (SOCKET_OPTION_VALUE) &session->multicast_loopback, sizeof(session->multicast_loopback)); - - } break; -#ifdef ORTP_INET6 - case AF_INET6: { - - retval= setsockopt(session->rtp.socket, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, - (SOCKET_OPTION_VALUE) &session->multicast_loopback, sizeof(session->multicast_loopback)); - - if (retval<0) break; - - retval= setsockopt(session->rtcp.socket, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, - (SOCKET_OPTION_VALUE) &session->multicast_loopback, sizeof(session->multicast_loopback)); - - } break; -#endif - default: - retval=-1; - } - - if (retval<0) - ortp_warning("Failed to set multicast loopback on socket."); - - - return retval; -} - - -/** - *rtp_session_get_multicast_loopback: - *@session: a rtp session - * - * Returns the multicast loopback state of rtp session (true or false). - * -**/ -int rtp_session_get_multicast_loopback(RtpSession *session) -{ - return session->multicast_loopback; -} - -/** - *rtp_session_set_dscp: - *@session: a rtp session - *@dscp: desired DSCP PHB value - * - * Sets the DSCP (Differentiated Services Code Point) for outgoing RTP packets. - * - * Returns: 0 on success. - * -**/ -int rtp_session_set_dscp(RtpSession *session, int dscp){ - int retval=0; - int tos; - - // Store new DSCP value if one is specified - if (dscp>=0) session->dscp = dscp; - - // Don't do anything if socket hasn't been created yet - if (session->rtp.socket < 0) return 0; - - // DSCP value is in the upper six bits of the TOS field - tos = (session->dscp << 2) & 0xFC; - switch (session->rtp.sockfamily) { - case AF_INET: - retval = setsockopt(session->rtp.socket, IPPROTO_IP, IP_TOS, (SOCKET_OPTION_VALUE)&tos, sizeof(tos)); - break; -#ifdef ORTP_INET6 - case AF_INET6: -# ifdef IPV6_TCLASS /*seems not defined by my libc*/ - retval = setsockopt(session->rtp.socket, IPPROTO_IPV6, IPV6_TCLASS, - (SOCKET_OPTION_VALUE)&tos, sizeof(tos)); -# else - /*in case that works:*/ - retval = setsockopt(session->rtp.socket, IPPROTO_IPV6, IP_TOS, - (SOCKET_OPTION_VALUE)&tos, sizeof(tos)); -#endif - break; -#endif - default: - retval=-1; - } - if (retval<0) - ortp_warning("Failed to set DSCP value on socket."); - - return retval; -} - - -/** - *rtp_session_get_dscp: - *@session: a rtp session - * - * Returns the DSCP (Differentiated Services Code Point) for outgoing RTP packets. - * -**/ -int rtp_session_get_dscp(const RtpSession *session) -{ - return session->dscp; -} - - -/** - *rtp_session_get_local_port: - *@session: a rtp session for which rtp_session_set_local_addr() or rtp_session_set_remote_addr() has been called - * - * This function can be useful to retrieve the local port that was randomly choosen by - * rtp_session_set_remote_addr() when rtp_session_set_local_addr() was not called. - * - * Returns: the local port used to listen for rtp packets, -1 if not set. -**/ - -int rtp_session_get_local_port(const RtpSession *session){ - return (session->rtp.loc_port>0) ? session->rtp.loc_port : -1; -} - - -static char * ortp_inet_ntoa(struct sockaddr *addr, int addrlen, char *dest, int destlen){ -#ifdef ORTP_INET6 - int err; - dest[0]=0; - err=getnameinfo(addr,addrlen,dest,destlen,NULL,0,NI_NUMERICHOST); - if (err!=0){ - ortp_warning("getnameinfo error: %s",gai_strerror(err)); - } -#else - char *tmp=inet_ntoa(((struct sockaddr_in*)addr)->sin_addr); - strncpy(dest,tmp,destlen); - dest[destlen-1]='\0'; -#endif - return dest; -} - -/** - *rtp_session_set_remote_addr: - *@session: a rtp session freshly created. - *@addr: a local IP address in the xxx.xxx.xxx.xxx form. - *@port: a local port. - * - * Sets the remote address of the rtp session, ie the destination address where rtp packet - * are sent. If the session is recv-only or duplex, it also sets the origin of incoming RTP - * packets. Rtp packets that don't come from addr:port are discarded. - * - * Returns: 0 on success. -**/ -int -rtp_session_set_remote_addr (RtpSession * session, const char * addr, int port){ - return rtp_session_set_remote_addr_full (session, addr, port, port+1); -} - -/** - *rtp_session_set_remote_addr_full: - *@session: a rtp session freshly created. - *@addr: a local IP address in the xxx.xxx.xxx.xxx form. - *@rtp_port: a local rtp port. - *@rtcp_port: a local rtcp port. - * - * Sets the remote address of the rtp session, ie the destination address where rtp packet - * are sent. If the session is recv-only or duplex, it also sets the origin of incoming RTP - * packets. Rtp packets that don't come from addr:port are discarded. - * - * Returns: 0 on success. -**/ - -int -rtp_session_set_remote_addr_full (RtpSession * session, const char * addr, int rtp_port, int rtcp_port) -{ - int err; -#ifdef ORTP_INET6 - struct addrinfo hints, *res0, *res; - char num[8]; - memset(&hints, 0, sizeof(hints)); - hints.ai_family = PF_UNSPEC; - hints.ai_socktype = SOCK_DGRAM; - snprintf(num, sizeof(num), "%d", rtp_port); - err = getaddrinfo(addr, num, &hints, &res0); - if (err) { - ortp_warning ("Error in socket address: %s", gai_strerror(err)); - return -1; - } -#endif - if (session->rtp.socket == -1){ - /* the session has not its socket bound, do it */ - ortp_message ("Setting random local addresses."); -#ifdef ORTP_INET6 - /* bind to an address type that matches the destination address */ - if (res0->ai_addr->sa_family==AF_INET6) - err = rtp_session_set_local_addr (session, "::", -1); - else err=rtp_session_set_local_addr (session, "0.0.0.0", -1); -#else - err = rtp_session_set_local_addr (session, "0.0.0.0", -1); -#endif - if (err<0) return -1; - } - -#ifdef ORTP_INET6 - err=1; - for (res = res0; res; res = res->ai_next) { - /* set a destination address that has the same type as the local address */ - if (res->ai_family==session->rtp.sockfamily ) { - memcpy( &session->rtp.rem_addr, res->ai_addr, res->ai_addrlen); - session->rtp.rem_addrlen=res->ai_addrlen; - err=0; - break; - } - } - freeaddrinfo(res0); - if (err) { - ortp_warning("Could not set destination for RTP socket to %s:%i.",addr,rtp_port); - return -1; - } - - memset(&hints, 0, sizeof(hints)); - hints.ai_family = PF_UNSPEC; - hints.ai_socktype = SOCK_DGRAM; - snprintf(num, sizeof(num), "%d", rtcp_port); - err = getaddrinfo(addr, num, &hints, &res0); - if (err) { - ortp_warning ("Error: %s", gai_strerror(err)); - return err; - } - err=1; - for (res = res0; res; res = res->ai_next) { - /* set a destination address that has the same type as the local address */ - if (res->ai_family==session->rtp.sockfamily ) { - err=0; - memcpy( &session->rtcp.rem_addr, res->ai_addr, res->ai_addrlen); - session->rtcp.rem_addrlen=res->ai_addrlen; - break; - } - } - freeaddrinfo(res0); - if (err) { - ortp_warning("Could not set destination for RCTP socket to %s:%i.",addr,rtcp_port); - return -1; - } -#else - session->rtp.rem_addrlen=sizeof(session->rtp.rem_addr); - session->rtp.rem_addr.sin_family = AF_INET; - - err = inet_aton (addr, &session->rtp.rem_addr.sin_addr); - if (err < 0) - { - ortp_warning ("Error in socket address:%s.", getSocketError()); - return err; - } - session->rtp.rem_addr.sin_port = htons (rtp_port); - - memcpy (&session->rtcp.rem_addr, &session->rtp.rem_addr, - sizeof (struct sockaddr_in)); - session->rtcp.rem_addr.sin_port = htons (rtcp_port); - session->rtcp.rem_addrlen=sizeof(session->rtcp.rem_addr); -#endif - if (can_connect(session)){ - if (try_connect(session->rtp.socket,(struct sockaddr*)&session->rtp.rem_addr,session->rtp.rem_addrlen)) - session->flags|=RTP_SOCKET_CONNECTED; - if (session->rtcp.socket>=0){ - if (try_connect(session->rtcp.socket,(struct sockaddr*)&session->rtcp.rem_addr,session->rtcp.rem_addrlen)) - session->flags|=RTCP_SOCKET_CONNECTED; - } - }else if (session->flags & RTP_SOCKET_CONNECTED){ - /*must dissolve association done by connect(). - See connect(2) manpage*/ - struct sockaddr sa; - sa.sa_family=AF_UNSPEC; - if (connect(session->rtp.socket,&sa,sizeof(sa))<0){ - ortp_error("Cannot dissolve connect() association for rtp socket: %s", getSocketError()); - } - if (connect(session->rtcp.socket,&sa,sizeof(sa))<0){ - ortp_error("Cannot dissolve connect() association for rtcp socket: %s", getSocketError()); - } - session->flags&=~RTP_SOCKET_CONNECTED; - session->flags&=~RTCP_SOCKET_CONNECTED; - } - return 0; -} - -int -rtp_session_set_remote_addr_and_port(RtpSession * session, const char * addr, int rtp_port, int rtcp_port){ - return rtp_session_set_remote_addr_full(session,addr,rtp_port,rtcp_port); -} - -void rtp_session_set_sockets(RtpSession *session, int rtpfd, int rtcpfd) -{ - if (rtpfd>=0) set_non_blocking_socket(rtpfd); - if (rtcpfd>=0) set_non_blocking_socket(rtcpfd); - session->rtp.socket=rtpfd; - session->rtcp.socket=rtcpfd; - if (rtpfd>=0 || rtcpfd>=0 ) - session->flags|=(RTP_SESSION_USING_EXT_SOCKETS|RTP_SOCKET_CONNECTED|RTCP_SOCKET_CONNECTED); - else session->flags&=~(RTP_SESSION_USING_EXT_SOCKETS|RTP_SOCKET_CONNECTED|RTCP_SOCKET_CONNECTED); -} - -void rtp_session_set_transports(RtpSession *session, struct _RtpTransport *rtptr, struct _RtpTransport *rtcptr) -{ - session->rtp.tr = rtptr; - session->rtcp.tr = rtcptr; - if (rtptr) - rtptr->session=session; - if (rtcptr) - rtcptr->session=session; - - if (rtptr || rtcptr ) - session->flags|=(RTP_SESSION_USING_TRANSPORT); - else session->flags&=~(RTP_SESSION_USING_TRANSPORT); -} - - - -/** - *rtp_session_flush_sockets: - *@session: a rtp session - * - * Flushes the sockets for all pending incoming packets. - * This can be usefull if you did not listen to the stream for a while - * and wishes to start to receive again. During the time no receive is made - * packets get bufferised into the internal kernel socket structure. - * -**/ -void rtp_session_flush_sockets(RtpSession *session){ - unsigned char trash[4096]; -#ifdef ORTP_INET6 - struct sockaddr_storage from; -#else - struct sockaddr from; -#endif - socklen_t fromlen=sizeof(from); - if (rtp_session_using_transport(session, rtp)) - { - mblk_t *trashmp=esballoc(trash,sizeof(trash),0,NULL); - - while (session->rtp.tr->t_recvfrom(session->rtp.tr,trashmp,0,(struct sockaddr *)&from,&fromlen)>0){}; - - if (session->rtcp.tr) - while (session->rtcp.tr->t_recvfrom(session->rtcp.tr,trashmp,0,(struct sockaddr *)&from,&fromlen)>0){}; - freemsg(trashmp); - return; - } - - if (session->rtp.socket>=0){ - while (recvfrom(session->rtp.socket,(char*)trash,sizeof(trash),0,(struct sockaddr *)&from,&fromlen)>0){}; - } - if (session->rtcp.socket>=0){ - while (recvfrom(session->rtcp.socket,(char*)trash,sizeof(trash),0,(struct sockaddr*)&from,&fromlen)>0){}; - } -} - - -#ifdef USE_SENDMSG -#define MAX_IOV 30 -static int rtp_sendmsg(int sock,mblk_t *m, struct sockaddr *rem_addr, int addr_len){ - int error; - struct msghdr msg; - struct iovec iov[MAX_IOV]; - int iovlen; - for(iovlen=0; iovlenb_cont,iovlen++){ - iov[iovlen].iov_base=m->b_rptr; - iov[iovlen].iov_len=m->b_wptr-m->b_rptr; - } - if (iovlen==MAX_IOV){ - ortp_error("Too long msgb, didn't fit into iov, end discarded."); - } - msg.msg_name=(void*)rem_addr; - msg.msg_namelen=addr_len; - msg.msg_iov=&iov[0]; - msg.msg_iovlen=iovlen; - msg.msg_control=NULL; - msg.msg_controllen=0; - msg.msg_flags=0; - error=sendmsg(sock,&msg,0); - return error; -} -#endif - -#define IP_UDP_OVERHEAD (20+8) - -static void update_sent_bytes(RtpSession*s, int nbytes){ - if (s->rtp.sent_bytes==0){ - gettimeofday(&s->rtp.send_bw_start,NULL); - } - s->rtp.sent_bytes+=nbytes+IP_UDP_OVERHEAD; -} - -static void update_recv_bytes(RtpSession*s, int nbytes){ - if (s->rtp.recv_bytes==0){ - gettimeofday(&s->rtp.recv_bw_start,NULL); - } - s->rtp.recv_bytes+=nbytes+IP_UDP_OVERHEAD; -} - -int -rtp_session_rtp_send (RtpSession * session, mblk_t * m) -{ - int error; - int i; - rtp_header_t *hdr; - struct sockaddr *destaddr=(struct sockaddr*)&session->rtp.rem_addr; - socklen_t destlen=session->rtp.rem_addrlen; - ortp_socket_t sockfd=session->rtp.socket; - - hdr = (rtp_header_t *) m->b_rptr; - /* perform host to network conversions */ - hdr->ssrc = htonl (hdr->ssrc); - hdr->timestamp = htonl (hdr->timestamp); - hdr->seq_number = htons (hdr->seq_number); - for (i = 0; i < hdr->cc; i++) - hdr->csrc[i] = htonl (hdr->csrc[i]); - - if (session->flags & RTP_SOCKET_CONNECTED) { - destaddr=NULL; - destlen=0; - } - - if (rtp_session_using_transport(session, rtp)){ - error = (session->rtp.tr->t_sendto) (session->rtp.tr,m,0,destaddr,destlen); - }else{ -#ifdef USE_SENDMSG - error=rtp_sendmsg(sockfd,m,destaddr,destlen); -#else - if (m->b_cont!=NULL) - msgpullup(m,-1); - error = sendto (sockfd, (char*)m->b_rptr, (int) (m->b_wptr - m->b_rptr), - 0,destaddr,destlen); -#endif - } - if (error < 0){ - if (session->on_network_error.count>0){ - rtp_signal_table_emit3(&session->on_network_error,(long)"Error sending RTP packet",INT_TO_POINTER(getSocketErrorCode())); - }else ortp_warning ("Error sending rtp packet: %s ; socket=%i", getSocketError(), sockfd); - session->rtp.send_errno=getSocketErrorCode(); - }else{ - update_sent_bytes(session,error); - } - freemsg (m); - return error; -} - -int -rtp_session_rtcp_send (RtpSession * session, mblk_t * m) -{ - int error=0; - ortp_socket_t sockfd=session->rtcp.socket; - struct sockaddr *destaddr=(struct sockaddr*)&session->rtcp.rem_addr; - socklen_t destlen=session->rtcp.rem_addrlen; - bool_t using_connected_socket=(session->flags & RTCP_SOCKET_CONNECTED)!=0; - - if (using_connected_socket) { - destaddr=NULL; - destlen=0; - } - - if (session->rtcp.enabled && - ( (sockfd>=0 && (session->rtcp.rem_addrlen>0 ||using_connected_socket)) - || rtp_session_using_transport(session, rtcp) ) ){ - if (rtp_session_using_transport(session, rtcp)){ - error = (session->rtcp.tr->t_sendto) (session->rtcp.tr, m, 0, - destaddr, destlen); - } - else{ -#ifdef USE_SENDMSG - error=rtp_sendmsg(sockfd,m,destaddr, destlen); -#else - if (m->b_cont!=NULL){ - msgpullup(m,-1); - } - error = sendto (sockfd, (char*)m->b_rptr, - (int) (m->b_wptr - m->b_rptr), 0, - destaddr, destlen); -#endif - } - if (error < 0){ - char host[65]; - if (session->on_network_error.count>0){ - rtp_signal_table_emit3(&session->on_network_error,(long)"Error sending RTCP packet",INT_TO_POINTER(getSocketErrorCode())); - }else ortp_warning ("Error sending rtcp packet: %s ; socket=%i; addr=%s", getSocketError(), session->rtcp.socket, ortp_inet_ntoa((struct sockaddr*)&session->rtcp.rem_addr,session->rtcp.rem_addrlen,host,sizeof(host)) ); - } - }else ortp_message("Not sending rtcp report: sockfd=%i, rem_addrlen=%i, connected=%i",sockfd,session->rtcp.rem_addrlen,using_connected_socket); - freemsg (m); - return error; -} - -int -rtp_session_rtp_recv (RtpSession * session, uint32_t user_ts) -{ - int error; - ortp_socket_t sockfd=session->rtp.socket; -#ifdef ORTP_INET6 - struct sockaddr_storage remaddr; -#else - struct sockaddr remaddr; -#endif - socklen_t addrlen = sizeof (remaddr); - mblk_t *mp; - - if ((sockfd<0) && !rtp_session_using_transport(session, rtp)) return -1; /*session has no sockets for the moment*/ - - while (1) - { - int bufsz; - bool_t sock_connected=!!(session->flags & RTP_SOCKET_CONNECTED); - - if (session->rtp.cached_mp==NULL) - session->rtp.cached_mp = msgb_allocator_alloc(&session->allocator,session->recv_buf_size); - mp=session->rtp.cached_mp; - bufsz=(int) (mp->b_datap->db_lim - mp->b_datap->db_base); - if (sock_connected){ - error=recv(sockfd,(char*)mp->b_wptr,bufsz,0); - }else if (rtp_session_using_transport(session, rtp)) - error = (session->rtp.tr->t_recvfrom)(session->rtp.tr, mp, 0, - (struct sockaddr *) &remaddr, - &addrlen); - else error = recvfrom(sockfd, (char*)mp->b_wptr, - bufsz, 0, - (struct sockaddr *) &remaddr, - &addrlen); - if (error > 0){ - if (session->symmetric_rtp && !sock_connected){ - if (session->use_connect){ - /* store the sender rtp address to do symmetric RTP */ - memcpy(&session->rtp.rem_addr,&remaddr,addrlen); - session->rtp.rem_addrlen=addrlen; - if (try_connect(sockfd,(struct sockaddr*)&remaddr,addrlen)) - session->flags|=RTP_SOCKET_CONNECTED; - } - } - /* then parse the message and put on queue */ - mp->b_wptr+=error; - rtp_session_rtp_parse (session, mp, user_ts, (struct sockaddr*)&remaddr,addrlen); - session->rtp.cached_mp=NULL; - /*for bandwidth measurements:*/ - update_recv_bytes(session,error); - } - else - { - int errnum=getSocketErrorCode(); - if (error == 0){ - /*0 can be returned by RtpTransport functions in case of EWOULDBLOCK*/ - /*we ignore it*/ - /*ortp_warning - ("rtp_recv: strange... recv() returned zero.");*/ - } - else if (!is_would_block_error(errnum)) - { - if (session->on_network_error.count>0){ - rtp_signal_table_emit3(&session->on_network_error,(long)"Error receiving RTP packet",INT_TO_POINTER(getSocketErrorCode())); - }else ortp_warning("Error receiving RTP packet: %s.",getSocketError()); - } - /* don't free the cached_mp, it will be reused next time */ - return -1; /* avoids an infinite loop ! */ - } - } - return error; -} - -void rtp_session_notify_inc_rtcp(RtpSession *session, mblk_t *m){ - if (session->eventqs!=NULL){ - OrtpEvent *ev=ortp_event_new(ORTP_EVENT_RTCP_PACKET_RECEIVED); - OrtpEventData *d=ortp_event_get_data(ev); - d->packet=m; - rtp_session_dispatch_event(session,ev); - } - else freemsg(m); /* avoid memory leak */ -} - -int -rtp_session_rtcp_recv (RtpSession * session) -{ - int error; -#ifdef ORTP_INET6 - struct sockaddr_storage remaddr; -#else - struct sockaddr remaddr; -#endif - socklen_t addrlen=0; - mblk_t *mp; - - if (session->rtcp.socket<0 && !rtp_session_using_transport(session, rtcp)) return -1; /*session has no rtcp sockets for the moment*/ - - - while (1) - { - bool_t sock_connected=!!(session->flags & RTCP_SOCKET_CONNECTED); - if (session->rtcp.cached_mp==NULL) - session->rtcp.cached_mp = allocb (RTCP_MAX_RECV_BUFSIZE, 0); - - mp=session->rtcp.cached_mp; - if (sock_connected){ - error=recv(session->rtcp.socket,(char*)mp->b_wptr,RTCP_MAX_RECV_BUFSIZE,0); - }else { - addrlen=sizeof (remaddr); - - if (rtp_session_using_transport(session, rtcp)) - error=(session->rtcp.tr->t_recvfrom)(session->rtcp.tr, mp, 0, - (struct sockaddr *) &remaddr, - &addrlen); - else - error=recvfrom (session->rtcp.socket,(char*) mp->b_wptr, - RTCP_MAX_RECV_BUFSIZE, 0, - (struct sockaddr *) &remaddr, - &addrlen); - } - if (error > 0) - { - mp->b_wptr += error; - /* post an event to notify the application*/ - { - rtp_session_notify_inc_rtcp(session,mp); - } - session->rtcp.cached_mp=NULL; - if (session->symmetric_rtp && !sock_connected){ - /* store the sender rtp address to do symmetric RTP */ - memcpy(&session->rtcp.rem_addr,&remaddr,addrlen); - session->rtcp.rem_addrlen=addrlen; - if (session->use_connect){ - if (try_connect(session->rtcp.socket,(struct sockaddr*)&remaddr,addrlen)) - session->flags|=RTCP_SOCKET_CONNECTED; - } - } - } - else - { - int errnum=getSocketErrorCode(); - - if (error == 0) - { - ortp_warning - ("rtcp_recv: strange... recv() returned zero."); - } - else if (!is_would_block_error(errnum)) - { - if (session->on_network_error.count>0){ - rtp_signal_table_emit3(&session->on_network_error,(long)"Error receiving RTCP packet",INT_TO_POINTER(errnum)); - }else ortp_warning("Error receiving RTCP packet: %s.",getSocketError()); - session->rtp.recv_errno=errnum; - } - /* don't free the cached_mp, it will be reused next time */ - return -1; /* avoids an infinite loop ! */ - } - } - return error; -} - diff --git a/linphone/oRTP/src/rtpsession_priv.h b/linphone/oRTP/src/rtpsession_priv.h deleted file mode 100644 index 24e955669..000000000 --- a/linphone/oRTP/src/rtpsession_priv.h +++ /dev/null @@ -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 diff --git a/linphone/oRTP/src/rtpsignaltable.c b/linphone/oRTP/src/rtpsignaltable.c deleted file mode 100644 index 14d8587b9..000000000 --- a/linphone/oRTP/src/rtpsignaltable.c +++ /dev/null @@ -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 -#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;icallback[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;ccount;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;ccount;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;ccount;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;icallback[i]==cb){ - table->callback[i]=NULL; - table->user_data[i]=0; - table->count--; - return 0; - } - } - return -1; -} diff --git a/linphone/oRTP/src/rtptimer.c b/linphone/oRTP/src/rtptimer.c deleted file mode 100644 index 261be48ff..000000000 --- a/linphone/oRTP/src/rtptimer.c +++ /dev/null @@ -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; -} - - diff --git a/linphone/oRTP/src/rtptimer.h b/linphone/oRTP/src/rtptimer.h deleted file mode 100644 index c4a01a456..000000000 --- a/linphone/oRTP/src/rtptimer.h +++ /dev/null @@ -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 -#else -#include -#include "winsock2.h" -#endif - -#include - - -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 diff --git a/linphone/oRTP/src/scheduler.c b/linphone/oRTP/src/scheduler.c deleted file mode 100644 index 0e53c7bfb..000000000 --- a/linphone/oRTP/src/scheduler.c +++ /dev/null @@ -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 -#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;imax_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); -} diff --git a/linphone/oRTP/src/scheduler.h b/linphone/oRTP/src/scheduler.h deleted file mode 100644 index 5e15751a2..000000000 --- a/linphone/oRTP/src/scheduler.h +++ /dev/null @@ -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 diff --git a/linphone/oRTP/src/sessionset.c b/linphone/oRTP/src/sessionset.c deleted file mode 100644 index 49bee0e8d..000000000 --- a/linphone/oRTP/src/sessionset.c +++ /dev/null @@ -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 -#include -#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>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; -} diff --git a/linphone/oRTP/src/srtp.c b/linphone/oRTP/src/srtp.c deleted file mode 100644 index 444831d60..000000000 --- a/linphone/oRTP/src/srtp.c +++ /dev/null @@ -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 - diff --git a/linphone/oRTP/src/str_utils.c b/linphone/oRTP/src/str_utils.c deleted file mode 100644 index a38620b30..000000000 --- a/linphone/oRTP/src/str_utils.c +++ /dev/null @@ -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(wlenb_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;ib_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); -} diff --git a/linphone/oRTP/src/stun.c b/linphone/oRTP/src/stun.c deleted file mode 100644 index a5d2eb787..000000000 --- a/linphone/oRTP/src/stun.c +++ /dev/null @@ -1,2884 +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 - * . - * - */ - -#ifdef HAVE_CONFIG_H -#include "ortp-config.h" -#endif - -#ifndef _WIN32_WCE -#include -#endif - -#include - -#if defined(WIN32) || defined(_WIN32_WCE) -#include -#include -/* #include */ -#include -#include /*for isdigit() */ -#else - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif - - -#if !defined(HAVE_OPENSSL_HMAC_H) || !defined(HAVE_OPENSSL_MD5_H) -#define NOSSL 1 -#endif - -#include "ortp/stun_udp.h" -#include "ortp/stun.h" -#include "ortp/ortp.h" - -static char *ipaddr(const StunAddress4 *addr) -{ - static char tmp[512]; - struct in_addr inaddr; - char *atmp; - inaddr.s_addr = htonl(addr->addr); - atmp = (char *)inet_ntoa(inaddr); - - snprintf(tmp, 512, "%s:%i", atmp, addr->port); - return tmp; -} - -static bool_t -stunParseAtrAddress( char* body, unsigned int hdrLen, StunAtrAddress4 *result ) -{ - if ( hdrLen != 8 ) - { - ortp_error("stun: hdrLen wrong for Address\n"); - return FALSE; - } - result->pad = *body++; - result->family = *body++; - if (result->family == IPv4Family) - { - uint16_t nport; - uint32_t naddr; - memcpy(&nport, body, 2); body+=2; - result->ipv4.port = ntohs(nport); - - memcpy(&naddr, body, 4); body+=4; - result->ipv4.addr = ntohl(naddr); - return TRUE; - } - else if (result->family == IPv6Family) - { - ortp_error("stun: ipv6 not supported\n"); - } - else - { - ortp_error("stun: bad address family: %i\n", result->family); - } - - return FALSE; -} - -static bool_t -stunParseAtrChangeRequest( char* body, unsigned int hdrLen, StunAtrChangeRequest *result ) -{ - if ( hdrLen != 4 ) - { - /* ortp_error("stun: hdr length = %i expecting %i\n",hdrLen, sizeof(result)); */ - - ortp_error("stun: Incorrect size for SA_CHANGEREQUEST"); - return FALSE; - } - else - { - memcpy(&result->value, body, 4); - result->value = ntohl(result->value); - return TRUE; - } -} - -static bool_t -stunParseAtrError( char* body, unsigned int hdrLen, StunAtrError *result ) -{ - if ( hdrLen < 4 || hdrLen >= 128+4) - { - ortp_error("stun: Incorrect size for SA_ERRORCODE"); - return FALSE; - } - else - { - memcpy(&result->pad, body, 2); body+=2; - result->pad = ntohs(result->pad); - result->errorClass = *body++; - result->number = *body++; - - result->sizeReason = hdrLen - 4; - memcpy(&result->reason, body, result->sizeReason); - result->reason[result->sizeReason] = 0; - return TRUE; - } -} - -static bool_t -stunParseAtrUnknown( char* body, unsigned int hdrLen, StunAtrUnknown *result ) -{ - if ( hdrLen >= sizeof(result) ) - { - ortp_error("stun: Incorrect size for SA_UNKNOWNATTRIBUTE"); - return FALSE; - } - else - { - int i; - if (hdrLen % 4 != 0) return FALSE; - result->numAttributes = hdrLen / 4; - for (i=0; inumAttributes; i++) - { - memcpy(&result->attrType[i], body, 2); body+=2; - result->attrType[i] = ntohs(result->attrType[i]); - } - return TRUE; - } -} - -static bool_t -stunParseAtrString( char* body, unsigned int hdrLen, StunAtrString *result ) -{ - if ( hdrLen >= STUN_MAX_STRING ) - { - ortp_error("stun: String is too large"); - return FALSE; - } - else - { - result->sizeValue = hdrLen; - memcpy(&result->value, body, hdrLen); - result->value[hdrLen] = 0; - return TRUE; - } -} - - -static bool_t -stunParseAtrIntegrity( char* body, unsigned int hdrLen, StunAtrIntegrity *result ) -{ - if ( hdrLen != 20) - { - ortp_error("stun: SA_MESSAGEINTEGRITY must be 20 bytes"); - return FALSE; - } - else - { - memcpy(&result->hash, body, hdrLen); - return TRUE; - } -} - -static bool_t -turnParseAtrChannelNumber( char* body, unsigned int hdrLen, TurnAtrChannelNumber *result ) -{ - if ( hdrLen >= sizeof(result) ) - { - ortp_error("stun: Incorrect size for TA_CHANNELNUMBER"); - return FALSE; - } - else - { - if (hdrLen % 4 != 0) return FALSE; - memcpy(&result->channelNumber, body, 2); - body+=2; - result->channelNumber = ntohs(result->channelNumber); - memcpy(&result->rffu, body, 2); - body+=2; - result->rffu = ntohs(result->rffu); - return TRUE; - } -} - -static bool_t -turnParseAtrLifetime( char* body, unsigned int hdrLen, TurnAtrLifetime *result ) -{ - if ( hdrLen != sizeof(result) ) - { - ortp_error("stun: Incorrect size for TA_LIFETIME"); - return FALSE; - } - else - { - memcpy(&result->lifetime, body, 4); - result->lifetime = ntohl(result->lifetime); - return TRUE; - } -} - -static bool_t -turnParseAtrData( char* body, unsigned int hdrLen, TurnAtrData *result ) -{ - if ( hdrLen >= 1500 ) - { - ortp_error("stun: Incorrect size for TA_DATA"); - return FALSE; - } - else - { - result->sizeValue = hdrLen; - memcpy(&result->value, body, hdrLen); - result->value[hdrLen] = 0; - return TRUE; - } -} - -static bool_t -turnParseAtrRequestedTransport( char* body, unsigned int hdrLen, TurnAtrRequestedTransport *result ) -{ - if ( hdrLen != 4 ) - { - ortp_error("stun: Incorrect size for TA_REQUESTEDTRANSPORT"); - return FALSE; - } - result->proto = *body++; - result->pad1 = *body++; - result->pad2 = *body++; - result->pad3 = *body++; - return TRUE; -} - -#if defined(htonq) -#elif defined(ORTP_BIGENDIAN) -#define htonq(n) n -#define ntohq(n) n -#else /* little endian */ -static inline uint64_t -htonq (uint64_t v) -{ - return htonl ((uint32_t) (v >> 32)) - | (uint64_t) htonl ((uint32_t) v) << 32; -} -static inline uint64_t -ntohq (uint64_t v) -{ - return ntohl ((uint32_t) (v >> 32)) - | (uint64_t) ntohl ((uint32_t) v) << 32; -} -#endif /* little endian */ - -static bool_t -turnParseAtrReservationToken( char* body, unsigned int hdrLen, TurnAtrReservationToken *result ) -{ - if ( hdrLen != 8 ) - { - ortp_error("stun: Incorrect size for TA_RESERVATIONTOKEN"); - return FALSE; - } - memcpy(&result->value, body, 8); - result->value = ntohq(result->value); - return TRUE; -} - -static bool_t -stunParseAtrFingerprint( char* body, unsigned int hdrLen, StunAtrFingerprint *result ) -{ - if ( hdrLen != 4 ) - { - ortp_error("stun: Incorrect size for SA_FINGERPRINT"); - return FALSE; - } - - memcpy(&result->fingerprint, body, 4); - result->fingerprint = ntohl(result->fingerprint); - return TRUE; -} - -static bool_t -iceParseAtrPriority( char* body, unsigned int hdrLen, IceAtrPriority *result ) -{ - if ( hdrLen != 4 ) - { - ortp_error("stun: Incorrect size for ICEA_PRIORITY"); - return FALSE; - } - - memcpy(&result->priority, body, 4); - result->priority = ntohl(result->priority); - return TRUE; -} - -static bool_t -iceParseAtrIceControll( char* body, unsigned int hdrLen, IceAtrIceControll *result ) -{ - if ( hdrLen != 8 ) - { - ortp_error("stun: Incorrect size for ICEA_ICECONTROLLED/ICEA_ICECONTROLLING"); - return FALSE; - } - memcpy(&result->value, body, 8); - result->value = ntohq(result->value); - return TRUE; -} - -bool_t -stunParseMessage( char* buf, unsigned int bufLen, StunMessage *msg) -{ - char* body; - unsigned int size; - ortp_debug("stun: Received stun message: %i bytes\n", bufLen); - memset(msg, 0, sizeof(msg)); - - if (sizeof(StunMsgHdr) > bufLen) - { - ortp_warning("stun: message too short\n"); - return FALSE; - } - - memcpy(&msg->msgHdr, buf, sizeof(StunMsgHdr)); - msg->msgHdr.msgType = ntohs(msg->msgHdr.msgType); - msg->msgHdr.msgLength = ntohs(msg->msgHdr.msgLength); - - if (msg->msgHdr.msgLength + sizeof(StunMsgHdr) != bufLen) - { - ortp_warning("stun: Message header length doesn't match message size: %i - %i\n", msg->msgHdr.msgLength, bufLen); - return FALSE; - } - - body = buf + sizeof(StunMsgHdr); - size = msg->msgHdr.msgLength; - - /*ortp_message("stun: bytes after header = %i\n", size); */ - - while ( size > 0 ) - { - /* !jf! should check that there are enough bytes left in the buffer */ - - StunAtrHdr* attr = (StunAtrHdr*)body; /*reinterpret_cast(body);*/ - - unsigned int attrLen = ntohs(attr->length); - int atrType = ntohs(attr->type); - - if ( attrLen+4 > size ) - { - ortp_error("stun: claims attribute is larger than size of message (attribute type=%i)\n", atrType); - return FALSE; - } - - body += 4; /* skip the length and type in attribute header */ - size -= 4; - - if (atrType == SA_MAPPEDADDRESS) - { - msg->hasMappedAddress = TRUE; - if ( stunParseAtrAddress( body, attrLen, &msg->mappedAddress )== FALSE ) - { - ortp_error("stun: problem parsing SA_MAPPEDADDRESS\n"); - return FALSE; - } - else - { - ortp_debug("stun: SA_MAPPEDADDRESS = %s\n", ipaddr(&msg->mappedAddress.ipv4)); - } - - } - else if (atrType == SA_RESPONSEADDRESS) - { - msg->hasResponseAddress = TRUE; - if ( stunParseAtrAddress( body, attrLen, &msg->responseAddress )== FALSE ) - { - ortp_error("stun: problem parsing SA_RESPONSEADDRESS"); - return FALSE; - } - else - { - ortp_debug("stun: SA_RESPONSEADDRESS = %s\n", ipaddr(&msg->responseAddress.ipv4)); - } - } - else if (atrType == SA_CHANGEREQUEST) - { - msg->hasChangeRequest = TRUE; - if (stunParseAtrChangeRequest( body, attrLen, &msg->changeRequest) == FALSE) - { - ortp_error("stun: problem parsing SA_CHANGEREQUEST\n"); - return FALSE; - } - else - { - ortp_debug("stun: SA_CHANGEREQUEST = %i\n", msg->changeRequest.value); - } - } - else if (atrType == SA_SOURCEADDRESS) - { - msg->hasSourceAddress = TRUE; - if ( stunParseAtrAddress( body, attrLen, &msg->sourceAddress )== FALSE ) - { - ortp_error("stun: problem parsing SA_SOURCEADDRESS\n"); - return FALSE; - } - else - { - ortp_debug("stun: SA_SOURCEADDRESS = %s\n", ipaddr(&msg->sourceAddress.ipv4) ); - } - } - else if (atrType == SA_CHANGEDADDRESS) - { - msg->hasChangedAddress = TRUE; - if ( stunParseAtrAddress( body, attrLen, &msg->changedAddress )== FALSE ) - { - ortp_error("stun: problem parsing SA_CHANGEDADDRESS\n"); - return FALSE; - } - else - { - ortp_debug("stun: SA_CHANGEDADDRESS = %s\n", ipaddr(&msg->changedAddress.ipv4)); - } - } - else if (atrType == SA_USERNAME) - { - msg->hasUsername = TRUE; - if (stunParseAtrString( body, attrLen, &msg->username) == FALSE) - { - ortp_error("stun: problem parsing SA_USERNAME"); - return FALSE; - } - else - { - ortp_debug("stun: SA_USERNAME = %s\n", msg->username.value ); - } - } - else if (atrType == SA_PASSWORD) - { - msg->hasPassword = TRUE; - if (stunParseAtrString( body, attrLen, &msg->password) == FALSE) - { - ortp_error("stun: problem parsing SA_PASSWORD"); - return FALSE; - } - else - { - ortp_debug("stun: SA_PASSWORD = %s\n", msg->password.value ); - } - } - else if (atrType == SA_MESSAGEINTEGRITY) - { - msg->hasMessageIntegrity = TRUE; - if (stunParseAtrIntegrity( body, attrLen, &msg->messageIntegrity) == FALSE) - { - ortp_error("stun: problem parsing SA_MESSAGEINTEGRITY"); - return FALSE; - } - } - else if (atrType == SA_ERRORCODE) - { - msg->hasErrorCode = TRUE; - if (stunParseAtrError(body, attrLen, &msg->errorCode) == FALSE) - { - ortp_error("stun: problem parsing SA_ERRORCODE"); - return FALSE; - } - else - { - ortp_debug("stun: SA_ERRORCODE = %i %i %s\n", - msg->errorCode.errorClass , - msg->errorCode.number , - msg->errorCode.reason ); - } - - } - else if (atrType == SA_UNKNOWNATTRIBUTE) - { - msg->hasUnknownAttributes = TRUE; - if (stunParseAtrUnknown(body, attrLen, &msg->unknownAttributes) == FALSE) - { - ortp_error("stun: problem parsing SA_UNKNOWNATTRIBUTE"); - return FALSE; - } - } - else if (atrType == SA_REFLECTEDFROM) - { - msg->hasReflectedFrom = TRUE; - if ( stunParseAtrAddress( body, attrLen, &msg->reflectedFrom ) == FALSE ) - { - ortp_error("stun: problem parsing SA_REFLECTEDFROM"); - return FALSE; - } - } - else if (atrType == SA_REALM) - { - msg->hasRealm = TRUE; - if (stunParseAtrString( body, attrLen, &msg->realmName) == FALSE) - { - ortp_error("stun: problem parsing SA_REALM"); - return FALSE; - } - else - { - ortp_debug("stun: SA_REALM = %s\n", msg->realmName.value ); - } - } - else if (atrType == SA_NONCE) - { - msg->hasNonce = TRUE; - if (stunParseAtrString( body, attrLen, &msg->nonceName) == FALSE) - { - ortp_error("stun: problem parsing SA_NONCE"); - return FALSE; - } - else - { - ortp_debug("stun: SA_NONCE = %s\n", msg->nonceName.value ); - } - } - else if (atrType == SA_XORMAPPEDADDRESS || atrType == SA_XORMAPPEDADDRESS2) - { - msg->hasXorMappedAddress = TRUE; - if ( stunParseAtrAddress( body, attrLen, &msg->xorMappedAddress ) == FALSE ) - { - ortp_error("stun: problem parsing SA_XORMAPPEDADDRESS"); - return FALSE; - } - else - { - ortp_debug("stun: SA_XORMAPPEDADDRESS = %s\n", ipaddr(&msg->xorMappedAddress.ipv4) ); - } - } - else if (atrType == SA_XORONLY) - { - ortp_warning("stun: SA_XORONLY - non standard extension ignored\n" ); - } - else if (atrType == SA_SECONDARYADDRESS) - { - ortp_debug("stun: SA_SECONDARYADDRESS - non standard extension ignored\n" ); - } - else if (atrType == SA_SOFTWARE) - { - msg->hasSoftware = TRUE; - if (stunParseAtrString( body, attrLen, &msg->softwareName) == FALSE) - { - ortp_error("stun: problem parsing SA_SOFTWARE"); - return FALSE; - } - else - { - ortp_debug("stun: SA_SOFTWARE = %s\n", msg->softwareName.value ); - } - } - else if (atrType == TA_CHANNELNUMBER) - { - msg->hasChannelNumberAttributes = TRUE; - if (turnParseAtrChannelNumber(body, attrLen, &msg->channelNumberAttributes) == FALSE) - { - ortp_error("stun: problem parsing TA_CHANNELNUMBER"); - return FALSE; - } - } - else if (atrType == TA_LIFETIME) - { - msg->hasLifetimeAttributes = TRUE; - if (turnParseAtrLifetime(body, attrLen, &msg->lifetimeAttributes) == FALSE) - { - ortp_error("stun: problem parsing TA_LIFETIME"); - return FALSE; - } - } - else if (atrType == TA_DEPRECATEDBANDWIDTH) - { - ortp_warning("stun: deprecated attribute TA_DEPRECATEDBANDWIDTH"); - } - else if (atrType == TA_XORPEERADDRESS) - { - msg->hasXorPeerAddress = TRUE; - if ( stunParseAtrAddress( body, attrLen, &msg->xorPeerAddress )== FALSE ) - { - ortp_error("stun: problem parsing SA_XORPEERADDRESS\n"); - return FALSE; - } - else - { - ortp_debug("stun: SA_XORPEERADDRESS = %s\n", ipaddr(&msg->xorPeerAddress.ipv4)); - } - } - else if (atrType == TA_DATA) - { - msg->hasData = TRUE; - if (turnParseAtrData( body, attrLen, &msg->data) == FALSE) - { - ortp_error("stun: problem parsing TA_DATA"); - return FALSE; - } - else - { - } - } - else if (atrType == TA_XORRELAYEDADDRESS) - { - msg->hasXorRelayedAddress = TRUE; - if ( stunParseAtrAddress( body, attrLen, &msg->xorRelayedAddress )== FALSE ) - { - ortp_error("stun: problem parsing TA_XORRELAYEDADDRESS\n"); - return FALSE; - } - else - { - ortp_debug("stun: TA_XORRELAYEDADDRESS = %s\n", ipaddr(&msg->xorRelayedAddress.ipv4)); - } - } - else if (atrType == TA_EVENPORT) - { - ortp_warning("stun: do we need this... TA_EVENPORT"); - } - else if (atrType == TA_REQUESTEDTRANSPORT) - { - msg->hasRequestedTransport = TRUE; - if ( turnParseAtrRequestedTransport( body, attrLen, &msg->requestedTransport )== FALSE ) - { - ortp_error("stun: problem parsing TA_REQUESTEDTRANSPORT\n"); - return FALSE; - } - } - else if (atrType == TA_DONTFRAGMENT) - { - msg->hasDontFragment = TRUE; - } - else if (atrType == TA_DEPRECATEDTIMERVAL) - { - ortp_warning("stun: deprecated attribute TA_DEPRECATEDTIMERVAL"); - } - else if (atrType == TA_RESERVATIONTOKEN) - { - msg->hasReservationToken = TRUE; - if ( turnParseAtrReservationToken( body, attrLen, &msg->reservationToken)== FALSE ) - { - ortp_error("stun: problem parsing TA_RESERVATIONTOKEN\n"); - return FALSE; - } - } - else if (atrType == SA_FINGERPRINT) - { - msg->hasFingerprint = TRUE; - if ( stunParseAtrFingerprint( body, attrLen, &msg->fingerprint)== FALSE ) - { - ortp_error("stun: problem parsing SA_FINGERPRINT\n"); - return FALSE; - } - } - else if (atrType == ICEA_PRIORITY) - { - msg->hasPriority = TRUE; - if (iceParseAtrPriority(body, attrLen, &msg->priority) == FALSE) - { - ortp_error("stun: problem parsing ICEA_PRIORITY"); - return FALSE; - } - } - else if (atrType == ICEA_USECANDIDATE) - { - msg->hasUseCandidate = TRUE; - } - else if (atrType == ICEA_ICECONTROLLED) - { - msg->hasIceControlled = TRUE; - if (iceParseAtrIceControll(body, attrLen, &msg->iceControlled) == FALSE) - { - ortp_error("stun: problem parsing ICEA_ICECONTROLLED"); - return FALSE; - } - } - else if (atrType == ICEA_ICECONTROLLING) - { - msg->hasIceControlling = TRUE; - if (iceParseAtrIceControll(body, attrLen, &msg->iceControlling) == FALSE) - { - ortp_error("stun: problem parsing ICEA_ICECONTROLLING"); - return FALSE; - } - } - else - { - if ( atrType <= 0x7FFF ) - { - ortp_error("stun: Unknown Comprehension-Required attribute: %04x\n", atrType ); - return FALSE; - } - else - ortp_warning("stun: Unknown attribute: %04x\n", atrType ); - } - - if (attrLen%4>0) - attrLen += (4-(attrLen%4)); - - body += attrLen; - size -= attrLen; - } - - return TRUE; -} - - -static char* -encode16(char* buf, uint16_t data) -{ - uint16_t ndata = htons(data); - memcpy(buf, &ndata, sizeof(uint16_t)); - return buf + sizeof(uint16_t); -} - -static char* -encode32(char* buf, uint32_t data) -{ - uint32_t ndata = htonl(data); - memcpy(buf, &ndata, sizeof(uint32_t)); - return buf + sizeof(uint32_t); -} - -static char* -encode64(char* buf, uint64_t data) -{ - uint64_t ndata = htonq(data); - memcpy(buf, &ndata, sizeof(uint64_t)); - return buf + sizeof(uint64_t); -} - -static char* -encode(char* buf, const char* data, unsigned int length) -{ - memcpy(buf, data, length); - return buf + length; -} - - -static char* -encodeAtrAddress4(char* ptr, uint16_t type, const StunAtrAddress4 *atr) -{ - ptr = encode16(ptr, type); - ptr = encode16(ptr, 8); - *ptr++ = atr->pad; - *ptr++ = IPv4Family; - ptr = encode16(ptr, atr->ipv4.port); - ptr = encode32(ptr, atr->ipv4.addr); - - return ptr; -} - -static char* -encodeAtrChangeRequest(char* ptr, const StunAtrChangeRequest *atr) -{ - ptr = encode16(ptr, SA_CHANGEREQUEST); - ptr = encode16(ptr, 4); - ptr = encode32(ptr, atr->value); - return ptr; -} - -static char* -encodeAtrError(char* ptr, const StunAtrError *atr) -{ - int padding; - int i; - - ptr = encode16(ptr, SA_ERRORCODE); - ptr = encode16(ptr, 4 + atr->sizeReason); - ptr = encode16(ptr, atr->pad); - *ptr++ = atr->errorClass; - *ptr++ = atr->number; - ptr = encode(ptr, atr->reason, atr->sizeReason); - - padding = (atr->sizeReason+4) % 4; - if (padding>0) - { - for (i=0;i<4-padding;i++) - { - *ptr++ = 0; - } - } - return ptr; -} - - -static char* -encodeAtrUnknown(char* ptr, const StunAtrUnknown *atr) -{ - int i; - ptr = encode16(ptr, SA_UNKNOWNATTRIBUTE); - ptr = encode16(ptr, 2+2*atr->numAttributes); - for (i=0; inumAttributes; i++) - { - ptr = encode16(ptr, atr->attrType[i]); - } - return ptr; -} - -static char* -encodeAtrString(char* ptr, uint16_t type, const StunAtrString *atr) -{ - int padding; - int i; - - ptr = encode16(ptr, type); - ptr = encode16(ptr, atr->sizeValue); - ptr = encode(ptr, atr->value, atr->sizeValue); - - padding = atr->sizeValue % 4; - if (padding>0) - { - for (i=0;i<4-padding;i++) - { - *ptr++ = 0; - } - } - return ptr; -} - - -static char* -encodeAtrIntegrity(char* ptr, const StunAtrIntegrity *atr) -{ - ptr = encode16(ptr, SA_MESSAGEINTEGRITY); - ptr = encode16(ptr, 20); - ptr = encode(ptr, atr->hash, sizeof(atr->hash)); - return ptr; -} - -static char* -encodeAtrFingerprint(char* ptr, const StunAtrFingerprint *atr) -{ - uint32_t val; - ptr = encode16(ptr, SA_FINGERPRINT); - ptr = encode16(ptr, 4); - - val = atr->fingerprint; - val ^= 0x5354554E; - ptr = encode32(ptr, val); - return ptr; -} - -static char* -encodeAtrRequestedTransport(char* ptr, const TurnAtrRequestedTransport *atr) -{ - ptr = encode16(ptr, TA_REQUESTEDTRANSPORT); - ptr = encode16(ptr, 4); - *ptr++ = atr->proto; - *ptr++ = atr->pad1; - *ptr++ = atr->pad2; - *ptr++ = atr->pad3; - return ptr; -} - -static char* -encodeAtrLifeTime(char* ptr, const TurnAtrLifetime *atr) -{ - ptr = encode16(ptr, TA_LIFETIME); - ptr = encode16(ptr, 4); - ptr = encode32(ptr, atr->lifetime); - return ptr; -} - -static char* -encodeAtrDontFragment(char* ptr) -{ - ptr = encode16(ptr, TA_DONTFRAGMENT); - ptr = encode16(ptr, 0); - return ptr; -} - -static char* -encodeAtrUseCandidate(char* ptr) -{ - ptr = encode16(ptr, ICEA_USECANDIDATE); - ptr = encode16(ptr, 0); - return ptr; -} - -static char* -encodeAtrPriority(char* ptr, const IceAtrPriority *atr) -{ - ptr = encode16(ptr, ICEA_PRIORITY); - ptr = encode16(ptr, 4); - ptr = encode32(ptr, atr->priority); - return ptr; -} - -static char* -encodeAtrIceControll(char* ptr, uint16_t type, const IceAtrIceControll *atr) -{ - ptr = encode16(ptr, type); - ptr = encode16(ptr, 8); - ptr = encode64(ptr, atr->value); - return ptr; -} - -unsigned int -stunEncodeMessage( const StunMessage *msg, - char* buf, - unsigned int bufLen, - const StunAtrString *password) -{ - char* ptr = buf; - char* lengthp; - ptr = encode16(ptr, msg->msgHdr.msgType); - lengthp = ptr; - ptr = encode16(ptr, 0); - ptr = encode32(ptr, msg->msgHdr.magic_cookie); - ptr = encode(ptr, (const char*)msg->msgHdr.tr_id.octet, sizeof(msg->msgHdr.tr_id)); - - ortp_debug("stun: Encoding stun message: "); - - if (msg->hasRequestedTransport) - { - ortp_debug("stun: Encoding TA_REQUESTEDTRANSPORT: %i\n", msg->requestedTransport.proto ); - ptr = encodeAtrRequestedTransport (ptr, &msg->requestedTransport); - } - if (msg->hasLifetimeAttributes) - { - ortp_debug("stun: Encoding TA_LIFETIME: %i\n", msg->lifetimeAttributes.lifetime ); - ptr = encodeAtrLifeTime (ptr, &msg->lifetimeAttributes); - } - if (msg->hasDontFragment) - { - ortp_debug("stun: Encoding TA_DONTFRAGMENT: DF\n"); - ptr = encodeAtrDontFragment (ptr); - } - if (msg->hasMappedAddress) - { - ortp_debug("stun: Encoding SA_MAPPEDADDRESS: %s\n", ipaddr(&msg->mappedAddress.ipv4) ); - ptr = encodeAtrAddress4 (ptr, SA_MAPPEDADDRESS, &msg->mappedAddress); - } - if (msg->hasResponseAddress) - { - ortp_debug("stun: Encoding SA_RESPONSEADDRESS: %s\n", ipaddr(&msg->responseAddress.ipv4) ); - ptr = encodeAtrAddress4(ptr, SA_RESPONSEADDRESS, &msg->responseAddress); - } - if (msg->hasChangeRequest) - { - ortp_debug("stun: Encoding SA_CHANGEREQUEST: %i\n", msg->changeRequest.value ); - ptr = encodeAtrChangeRequest(ptr, &msg->changeRequest); - } - if (msg->hasSourceAddress) - { - ortp_debug("stun: Encoding SA_SOURCEADDRESS: %s\n", ipaddr(&msg->sourceAddress.ipv4) ); - ptr = encodeAtrAddress4(ptr, SA_SOURCEADDRESS, &msg->sourceAddress); - } - if (msg->hasChangedAddress) - { - ortp_debug("stun: Encoding SA_CHANGEDADDRESS: %s\n", ipaddr(&msg->changedAddress.ipv4) ); - ptr = encodeAtrAddress4(ptr, SA_CHANGEDADDRESS, &msg->changedAddress); - } - if (msg->hasUsername) - { - ortp_debug("stun: Encoding SA_USERNAME: %s\n", msg->username.value ); - ptr = encodeAtrString(ptr, SA_USERNAME, &msg->username); - } - //if (msg->hasPassword) - //{ - // ortp_debug("stun: Encoding SA_PASSWORD: %s\n", msg->password.value ); - // ptr = encodeAtrString(ptr, SA_PASSWORD, &msg->password); - //} - if (msg->hasErrorCode) - { - ortp_debug("stun: Encoding SA_ERRORCODE: class=%i number=%i reason=%s\n" - , msg->errorCode.errorClass - , msg->errorCode.number - , msg->errorCode.reason ); - - ptr = encodeAtrError(ptr, &msg->errorCode); - } - if (msg->hasUnknownAttributes) - { - ortp_debug("stun: Encoding SA_UNKNOWNATTRIBUTE: ???"); - ptr = encodeAtrUnknown(ptr, &msg->unknownAttributes); - } - if (msg->hasReflectedFrom) - { - ortp_debug("stun: Encoding SA_REFLECTEDFROM: %s\n", ipaddr(&msg->reflectedFrom.ipv4) ); - ptr = encodeAtrAddress4(ptr, SA_REFLECTEDFROM, &msg->reflectedFrom); - } - if (msg->hasNonce) - { - ortp_debug("stun: Encoding SA_NONCE: %s\n", msg->nonceName.value ); - ptr = encodeAtrString(ptr, SA_NONCE, &msg->nonceName); - } - if (msg->hasRealm) - { - ortp_debug("stun: Encoding SA_REALM: %s\n", msg->realmName.value ); - ptr = encodeAtrString(ptr, SA_REALM, &msg->realmName); - } - - if (msg->hasXorMappedAddress) - { - ortp_debug("stun: Encoding SA_XORMAPPEDADDRESS: %s\n", ipaddr(&msg->xorMappedAddress.ipv4) ); - ptr = encodeAtrAddress4 (ptr, SA_XORMAPPEDADDRESS, &msg->xorMappedAddress); - } - - if (msg->hasPriority) - { - ortp_debug("stun: Encoding ICEA_PRIORITY\n"); - ptr = encodeAtrPriority (ptr, &msg->priority); - } - if (msg->hasUseCandidate) - { - ortp_debug("stun: Encoding ICEA_USECANDIDATE\n"); - ptr = encodeAtrUseCandidate (ptr); - } - if (msg->hasIceControlled) - { - ortp_debug("stun: Encoding ICEA_ICECONTROLLED\n"); - ptr = encodeAtrIceControll (ptr, ICEA_ICECONTROLLED, &msg->iceControlled); - } - if (msg->hasIceControlling) - { - ortp_debug("stun: Encoding ICEA_ICECONTROLLING\n"); - ptr = encodeAtrIceControll (ptr, ICEA_ICECONTROLLING, &msg->iceControlling); - } - - if (msg->hasSoftware) - { - ortp_debug("stun: Encoding SA_SOFTWARE: %s\n", msg->softwareName.value ); - ptr = encodeAtrString(ptr, SA_SOFTWARE, &msg->softwareName); - } - - if (msg->hasMessageIntegrity - &&password!=NULL && password->sizeValue > 0 - &&msg->username.sizeValue>0 - &&msg->realmName.sizeValue>0) - { - StunAtrIntegrity integrity; - //ortp_debug("stun: HMAC with password: %s\n", password->value ); - - encode16(lengthp, (uint16_t)(ptr - buf - sizeof(StunMsgHdr)+24)); - stunCalculateIntegrity_longterm(integrity.hash, buf, (int)(ptr-buf) , - msg->username.value, msg->realmName.value, password->value); - ptr = encodeAtrIntegrity(ptr, &integrity); - } - else if (msg->hasMessageIntegrity - &&password!=NULL && password->sizeValue > 0 - &&msg->username.sizeValue>0) - { - StunAtrIntegrity integrity; - //ortp_debug("stun: HMAC with password: %s\n", password->value ); - - encode16(lengthp, (uint16_t)(ptr - buf - sizeof(StunMsgHdr)+24)); - stunCalculateIntegrity_shortterm(integrity.hash, buf, (int)(ptr-buf) , - password->value); - ptr = encodeAtrIntegrity(ptr, &integrity); - } - - if (msg->hasFingerprint) - { - StunAtrFingerprint fingerprint; - //ortp_debug("stun: HMAC with password: %s\n", password->value ); - - encode16(lengthp, (uint16_t)(ptr - buf - sizeof(StunMsgHdr)+8)); - fingerprint.fingerprint = stunCalculateFingerprint(buf, (int)(ptr-buf)); - ptr = encodeAtrFingerprint(ptr, &fingerprint); - } - encode16(lengthp, (uint16_t)(ptr - buf - sizeof(StunMsgHdr))); - return (int)(ptr - buf); -} - -int -stunRand(void) -{ - /* return 32 bits of random stuff */ - /* assert( sizeof(int) == 4 ); */ - static bool_t init=FALSE; - if ( !init ) - { - uint64_t tick; - int seed; - init = TRUE; - -#if defined(_WIN32_WCE) - tick = GetTickCount (); -#elif defined(_MSC_VER) - { - volatile unsigned int lowtick=0,hightick=0; - __asm - { - rdtsc - mov lowtick, eax - mov hightick, edx - } - tick = hightick; - tick <<= 32; - tick |= lowtick; - } -#elif defined(__MACH__) - { - int fd=open("/dev/random",O_RDONLY); - read(fd,&tick,sizeof(tick)); - closesocket(fd); - } -#elif defined(__GNUC__) && ( defined(__i686__) || defined(__i386__) ) - asm("rdtsc" : "=A" (tick)); -#elif defined(__GNUC__) && defined(__amd64__) - asm("rdtsc" : "=A" (tick)); -#elif defined (__SUNPRO_CC) && defined( __sparc__ ) - tick = gethrtime(); -#elif defined(__linux) || defined(HAVE_DEV_RANDOM) - { - fd_set fdSet; - int maxFd=0; - struct timeval tv; - int e; - - int fd=open("/dev/random",O_RDONLY); - - if (fd<0) - { - ortp_message("stun: Failed to open random device\n"); - return random(); - } - FD_ZERO(&fdSet); - FD_SET(fd,&fdSet); - maxFd=fd+1; - - tv.tv_sec = 0; - tv.tv_usec = 500; - - e = select( maxFd, &fdSet, NULL,NULL, &tv ); - if (e <= 0) - { - ortp_error("stun: Failed to get data from random device\n"); - closesocket(fd); - return random(); - } - read(fd,&tick,sizeof(tick)); - closesocket(fd); - } -#else -# error Need some way to seed the random number generator -#endif - seed = (int)(tick); -#if defined(_WIN32) || defined(_WIN32_WCE) - srand(seed); -#else - srandom(seed); -#endif - } - -#if defined(_WIN32) || defined(_WIN32_WCE) - /* assert( RAND_MAX == 0x7fff ); */ - { - int r1 = rand(); - int r2 = rand(); - int ret = (r1<<16) + r2; - - return ret; - } -#else - return random(); -#endif -} - - -/* return a random number to use as a port */ -static int -randomPort() -{ - int min=0x4000; - int max=0x7FFF; - - int ret = stunRand(); - ret = ret|min; - ret = ret&max; - - return ret; -} - - -#ifdef NOSSL -void -stunCalculateIntegrity_longterm(char* hmac, const char* input, int length, - const char *username, const char *realm, const char *password) -{ - strncpy(hmac,"hmac-not-implemented",20); -} -void -stunCalculateIntegrity_shortterm(char* hmac, const char* input, int length, const char* key) -{ - strncpy(hmac,"hmac-not-implemented",20); -} - -#else -#include -#include - -void -stunCalculateIntegrity_longterm(char* hmac, const char* input, int length, - const char *username, const char *realm, const char *password) -{ - unsigned int resultSize=0; - unsigned char HA1[16]; - char HA1_text[1024]; - - snprintf(HA1_text, sizeof(HA1_text), "%s:%s:%s", username, realm, password); - MD5((unsigned char *)HA1_text, strlen(HA1_text), HA1); - - HMAC(EVP_sha1(), - HA1, 16, - (const unsigned char*) input, length, - (unsigned char*)hmac, &resultSize); -} - -void -stunCalculateIntegrity_shortterm(char* hmac, const char* input, int length, const char* key) -{ - unsigned int resultSize=0; - HMAC(EVP_sha1(), - key, strlen(key), - (const unsigned char*) input, length, - (unsigned char*)hmac, &resultSize); -} - -#endif - -uint32_t -stunCalculateFingerprint(const char* input, int length) -{ - /*- - 2 * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or - 3 * code or tables extracted from it, as desired without restriction. - 4 */ - static uint32_t crc32_tab[] = { - 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, - 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, - 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, - 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, - 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, - 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, - 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, - 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, - 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, - 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, - 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, - 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, - 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, - 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, - 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, - 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, - 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, - 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, - 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, - 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, - 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, - 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, - 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, - 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, - 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, - 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, - 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, - 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, - 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, - 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, - 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, - 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, - 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, - 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, - 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, - 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, - 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, - 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, - 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, - 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, - 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, - 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, - 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d - }; - const uint8_t *p = (uint8_t*)input; - uint32_t crc; - - crc = ~0U; - while (length--) - crc = crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8); - return crc ^ ~0U; -} - -uint64_t -stunGetSystemTimeSecs(void) -{ - uint64_t time=0; -#if defined(_WIN32) || defined(_WIN32_WCE) - SYSTEMTIME t; - /* CJ TODO - this probably has bug on wrap around every 24 hours */ - GetSystemTime( &t ); - time = (t.wHour*60+t.wMinute)*60+t.wSecond; -#else - struct timeval now; - gettimeofday( &now , NULL ); - /* assert( now ); */ - time = now.tv_sec; -#endif - return time; -} - - -/* returns TRUE if it scucceeded */ -bool_t -stunParseHostName( const char* peerName, - uint32_t* ip, - uint16_t* portVal, - uint16_t defaultPort ) -{ - struct in_addr sin_addr; - - char host[512]; - char* port = NULL; - int portNum = defaultPort; - char* sep; - struct hostent* h; - - strncpy(host,peerName,512); - host[512-1]='\0'; - - /* pull out the port part if present. */ - sep = strchr(host,':'); - - if ( sep == NULL ) - { - portNum = defaultPort; - } - else - { - char* endPtr=NULL; - *sep = '\0'; - port = sep + 1; - /* set port part */ - - - portNum = strtol(port,&endPtr,10); - - if ( endPtr != NULL ) - { - if ( *endPtr != '\0' ) - { - portNum = defaultPort; - } - } - } - - if ( portNum < 1024 ) return FALSE; - if ( portNum >= 0xFFFF ) return FALSE; - - /* figure out the host part */ - -#if defined(_WIN32) || defined(_WIN32_WCE) - /* assert( strlen(host) >= 1 ); */ - if ( isdigit( host[0] ) ) - { - /* assume it is a ip address */ - unsigned long a = inet_addr(host); - /* cerr << "a=0x" << hex << a << dec ); */ - - *ip = ntohl( a ); - } - else - { - /* assume it is a host name */ - h = gethostbyname( host ); - - if ( h == NULL ) - { - /*int err = getErrno();*/ - - /* ortp_message("stun: error was %i\n", err); */ - /* std::cerr << "error was " << err << std::endl; */ - /* assert( err != WSANOTINITIALISED ); */ - - *ip = ntohl( 0x7F000001L ); - - return FALSE; - } - else - { - sin_addr = *(struct in_addr*)h->h_addr; - *ip = ntohl( sin_addr.s_addr ); - } - } - -#else - h = gethostbyname( host ); - if ( h == NULL ) - { - /* - int err = getErrno(); - ortp_message("stun: error was %i\n", err); - */ - *ip = ntohl( 0x7F000001L ); - return FALSE; - } - else - { - sin_addr = *(struct in_addr*)h->h_addr; - *ip = ntohl( sin_addr.s_addr ); - } -#endif - - *portVal = portNum; - - return TRUE; -} - - -bool_t -stunParseServerName( const char* name, StunAddress4 *addr) -{ - /* assert(name); */ - - /* TODO - put in DNS SRV stuff. */ - - bool_t ret = stunParseHostName( name, &addr->addr, &addr->port, 3478); - if ( ret != TRUE ) - { - addr->port=0xFFFF; - } - return ret; -} - - -static void -stunCreateErrorResponse(StunMessage *response, int cl, int number, const char* msg) -{ - response->msgHdr.msgType = (STUN_METHOD_BINDING | STUN_ERR_RESP); - response->hasErrorCode = TRUE; - response->errorCode.errorClass = cl; - response->errorCode.number = number; - strcpy(response->errorCode.reason, msg); -} - -#if 0 -static void -stunCreateSharedSecretErrorResponse(StunMessage& response, int cl, int number, const char* msg) -{ - response.msgHdr.msgType = SharedSecretErrorResponseMsg; - response.hasErrorCode = TRUE; - response.errorCode.errorClass = cl; - response.errorCode.number = number; - strcpy(response.errorCode.reason, msg); -} -#endif - -#if 0 -static void -stunCreateSharedSecretResponse(const StunMessage *request, const StunAddress4 *source, StunMessage *response) -{ - response->msgHdr.msgType = SharedSecretResponseMsg; - response->msgHdr.tr_id = request->msgHdr.tr_id; - - response->hasUsername = TRUE; - stunCreateUserName( source, &response->username); - - response->hasPassword = TRUE; - stunCreatePassword( &response->username, &response->password); -} -#endif - -/* This funtion takes a single message sent to a stun server, parses - and constructs an apropriate repsonse - returns TRUE if message is - valid */ -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 i; - StunMessage req; - StunAddress4 mapped; - StunAddress4 respondTo; - uint32_t flags; - bool_t ok; - /* set up information for default response */ - - memset( &req, 0 , sizeof(req) ); - memset( resp, 0 , sizeof(*resp) ); - - *changeIp = FALSE; - *changePort = FALSE; - - ok = stunParseMessage( buf,bufLen, &req); - - if (!ok) /* Complete garbage, drop it on the floor */ - { - ortp_error("stun: Request did not parse"); - return FALSE; - } - //ortp_debug("stun: Request parsed ok"); - - mapped = req.mappedAddress.ipv4; - respondTo = req.responseAddress.ipv4; - flags = req.changeRequest.value; - - if (req.msgHdr.msgType==(STUN_METHOD_BINDING|STUN_REQUEST)) - { - if (!req.hasMessageIntegrity) - { - //ortp_debug("stun: BindRequest does not contain SA_MESSAGEINTEGRITY"); - - if (0) /* !jf! mustAuthenticate */ - { - ortp_error("stun: Received BindRequest with no SA_MESSAGEINTEGRITY. Sending 401."); - stunCreateErrorResponse(resp, 4, 1, "Missing SA_MESSAGEINTEGRITY"); - return TRUE; - } - } - else - { - if (!req.hasUsername) - { - ortp_error("stun: No UserName. Send 432."); - stunCreateErrorResponse(resp, 4, 32, "No UserName and contains SA_MESSAGEINTEGRITY"); - return TRUE; - } - else - { - //ortp_debug("stun: Validating username: %s", req.username.value ); - /* !jf! could retrieve associated password from provisioning here */ - if (strcmp(req.username.value, "test") == 0) - { - if (0) - { - /* !jf! if the credentials are stale */ - stunCreateErrorResponse(resp, 4, 30, "Stale credentials on BindRequest"); - return TRUE; - } - else - { - unsigned char hmac[20]; - //ortp_debug("stun: Validating SA_MESSAGEINTEGRITY"); - /* need access to shared secret */ - -#ifndef NOSSL - { - unsigned int hmacSize=20; - - HMAC(EVP_sha1(), - "1234", 4, - (const unsigned char*) buf, bufLen-20-4, - hmac, &hmacSize); - } -#endif - - if (memcmp(buf, hmac, 20) != 0) - { - ortp_error("stun: SA_MESSAGEINTEGRITY is bad. Sending "); - stunCreateErrorResponse(resp, 4, 3, "Unknown username. Try test with password 1234"); - return TRUE; - } - - /* need to compute this later after message is filled in */ - resp->hasMessageIntegrity = TRUE; - /* assert(req.hasUsername); */ - resp->hasUsername = TRUE; - resp->username = req.username; /* copy username in */ - } - } - else - { - ortp_error("stun: Invalid username: %s Send 430", req.username.value); - } - } - } - - /* TODO !jf! should check for unknown attributes here and send 420 listing the - unknown attributes. */ - - if ( respondTo.port == 0 ) - { - /* respondTo = from; */ - memcpy(&respondTo, from, sizeof(StunAddress4)); - } - if ( mapped.port == 0 ) - { - /* mapped = from; */ - memcpy(&mapped, from, sizeof(StunAddress4)); - } - - *changeIp = ( flags & ChangeIpFlag )?TRUE:FALSE; - *changePort = ( flags & ChangePortFlag )?TRUE:FALSE; - - //ortp_debug("stun: Request is valid:\n"); - //ortp_debug("stun: \t flags= %i\n", flags ); - //ortp_debug("stun: \t changeIp= %i\n", *changeIp ); - //ortp_debug("stun: \t changePort=%i\n", *changePort ); - //ortp_debug("stun: \t from= %i\n", from->addr ); - //ortp_debug("stun: \t respond to= %i\n", respondTo.addr ); - //ortp_debug("stun: \t mapped= %i\n", mapped.addr ); - - /* form the outgoing message */ - resp->msgHdr.msgType = (STUN_METHOD_BINDING | STUN_SUCCESS_RESP); - resp->msgHdr.magic_cookie = ntohl(req.msgHdr.magic_cookie); - for (i=0; i<12; i++ ) - { - resp->msgHdr.tr_id.octet[i] = req.msgHdr.tr_id.octet[i]; - } - - if (1) /* do xorMapped address or not */ - { - uint32_t cookie = 0x2112A442; - resp->hasXorMappedAddress = TRUE; - resp->xorMappedAddress.ipv4.port = mapped.port^(cookie>>16); - resp->xorMappedAddress.ipv4.addr = mapped.addr^cookie; - } - - resp->hasSourceAddress = TRUE; - resp->sourceAddress.ipv4.port = (*changePort) ? altAddr->port : myAddr->port; - resp->sourceAddress.ipv4.addr = (*changeIp) ? altAddr->addr : myAddr->addr; - - resp->hasChangedAddress = TRUE; - resp->changedAddress.ipv4.port = altAddr->port; - resp->changedAddress.ipv4.addr = altAddr->addr; - - if ( req.hasUsername && req.username.sizeValue > 0 ) - { - /* copy username in */ - resp->hasUsername = TRUE; - /* assert( req.username.sizeValue % 4 == 0 ); */ - /* assert( req.username.sizeValue < STUN_MAX_STRING ); */ - memcpy( resp->username.value, req.username.value, req.username.sizeValue ); - resp->username.sizeValue = req.username.sizeValue; - } - - if (1) /* add ServerName */ - { - const char serverName[] = "oRTP " STUN_VERSION; /* must pad to mult of 4 */ - resp->hasSoftware = TRUE; - - /* assert( sizeof(serverName) < STUN_MAX_STRING ); */ - /* cerr << "sizeof serverName is " << sizeof(serverName) ); */ - /* assert( sizeof(serverName)%4 == 0 ); */ - memcpy( resp->softwareName.value, serverName, sizeof(serverName)); - resp->softwareName.sizeValue = sizeof(serverName); - } - -#if 0 - if ( req.hasMessageIntegrity & req.hasUsername ) - { - /* this creates the password that will be used in the HMAC when then */ - /* messages is sent */ - stunCreatePassword( &req.username, hmacPassword ); - } -#endif - - if (req.hasUsername && (req.username.sizeValue > 64 ) ) - { - uint32_t source; - /* assert( sizeof(int) == sizeof(uint32_t) ); */ - - sscanf(req.username.value, "%x", &source); - resp->hasReflectedFrom = TRUE; - resp->reflectedFrom.ipv4.port = 0; - resp->reflectedFrom.ipv4.addr = source; - } - - destination->port = respondTo.port; - destination->addr = respondTo.addr; - - return TRUE; - } - else - { - ortp_error("stun: Unknown or unsupported request "); - return FALSE; - } - - /* assert(0); */ - return FALSE; -} - -bool_t -stunInitServer(StunServerInfo *info, const StunAddress4 *myAddr, const StunAddress4 *altAddr, int startMediaPort) -{ - /* assert( myAddr.port != 0 ); */ - /* assert( altAddr.port!= 0 ); */ - /* assert( myAddr.addr != 0 ); */ - /* assert( altAddr.addr != 0 ); */ - - /* info->myAddr = myAddr; */ - info->myAddr.port = myAddr->port; - info->myAddr.addr = myAddr->addr; - - /* info->altAddr = altAddr; */ - info->altAddr.port = altAddr->port; - info->altAddr.addr = altAddr->addr; - - info->myFd = INVALID_SOCKET; - info->altPortFd = INVALID_SOCKET; - info->altIpFd = INVALID_SOCKET; - info->altIpPortFd = INVALID_SOCKET; - - memset(info->relays, 0, sizeof(info->relays)); - if (startMediaPort > 0) - { - int i; - info->relay = TRUE; - - for (i=0; irelays[i]; - relay->relayPort = startMediaPort+i; - relay->fd = 0; - relay->expireTime = 0; - } - } - else - { - info->relay = FALSE; - } - - if ((info->myFd = openPort(myAddr->port, myAddr->addr)) == INVALID_SOCKET) - { - ortp_error("stun: Can't open %i\n", myAddr->addr ); - stunStopServer(info); - - return FALSE; - } - - if ((info->altPortFd = openPort(altAddr->port,myAddr->addr)) == INVALID_SOCKET) - { - ortp_error("stun: Can't open %i\n", myAddr->addr ); - stunStopServer(info); - return FALSE; - } - - - info->altIpFd = INVALID_SOCKET; - if ( altAddr->addr != 0 ) - { - if ((info->altIpFd = openPort( myAddr->port, altAddr->addr)) == INVALID_SOCKET) - { - ortp_error("stun: Can't open %i\n", altAddr->addr ); - stunStopServer(info); - return FALSE; - } - } - - info->altIpPortFd = INVALID_SOCKET; - if ( altAddr->addr != 0 ) - { if ((info->altIpPortFd = openPort(altAddr->port, altAddr->addr)) == INVALID_SOCKET) - { - ortp_error("stun: Can't open %i\n", altAddr->addr ); - stunStopServer(info); - return FALSE; - } - } - - return TRUE; -} - -void -stunStopServer(StunServerInfo *info) -{ - if (info->myFd > 0) closesocket(info->myFd); - if (info->altPortFd > 0) closesocket(info->altPortFd); - if (info->altIpFd > 0) closesocket(info->altIpFd); - if (info->altIpPortFd > 0) closesocket(info->altIpPortFd); - - if (info->relay) - { - int i; - for (i=0; irelays[i]; - if (relay->fd) - { - closesocket(relay->fd); - relay->fd = 0; - } - } - } -} - -int -stunFindLocalInterfaces(uint32_t* addresses,int maxRet) -{ -#if defined(WIN32) || defined(_WIN32_WCE) || defined(__sparc__) - return 0; -#else - struct ifconf ifc; - int e; - - int s = socket( AF_INET, SOCK_DGRAM, 0 ); - int len = 100 * sizeof(struct ifreq); - - char buf[ 100 * sizeof(struct ifreq) ]; - char *ptr; - int tl; - int count=0; - - ifc.ifc_len = len; - ifc.ifc_buf = buf; - - e = ioctl(s,SIOCGIFCONF,&ifc); - ptr = buf; - tl = ifc.ifc_len; - - while ( (tl > 0) && ( count < maxRet) ) - { - struct ifreq* ifr = (struct ifreq *)ptr; - struct ifreq ifr2; - struct sockaddr a; - struct sockaddr_in* addr; - - uint32_t ai; - int si = sizeof(ifr->ifr_name) + sizeof(struct sockaddr); - tl -= si; - ptr += si; - /* char* name = ifr->ifr_ifrn.ifrn_name; */ - /* cerr << "name = " << name ); */ - - ifr2 = *ifr; - - e = ioctl(s,SIOCGIFADDR,&ifr2); - if ( e == -1 ) - { - break; - } - - /* cerr << "ioctl addr e = " << e ; */ - - a = ifr2.ifr_addr; - addr = (struct sockaddr_in*) &a; - - ai = ntohl( addr->sin_addr.s_addr ); - if ((int)((ai>>24)&0xFF) != 127) - { - addresses[count++] = ai; - } - - } - - closesocket(s); - - return count; -#endif -} - - -void -stunBuildReqSimple( StunMessage* msg, - const StunAtrString *username, - bool_t changePort, bool_t changeIp, unsigned int id ) -{ - int i; - /* assert( msg ); */ - memset( msg , 0 , sizeof(*msg) ); - - msg->msgHdr.msgType = (STUN_METHOD_BINDING|STUN_REQUEST); - - msg->msgHdr.magic_cookie = 0x2112A442; - for ( i=0; i<12; i=i+4 ) - { - /* assert(i+3<16); */ - int r = stunRand(); - msg->msgHdr.tr_id.octet[i+0]= r>>0; - msg->msgHdr.tr_id.octet[i+1]= r>>8; - msg->msgHdr.tr_id.octet[i+2]= r>>16; - msg->msgHdr.tr_id.octet[i+3]= r>>24; - } - - if ( id != 0 ) - { - msg->msgHdr.tr_id.octet[0] = id; - } - - if (changePort==TRUE || changeIp==TRUE) - { - msg->hasChangeRequest = TRUE; - msg->changeRequest.value =(changeIp?ChangeIpFlag:0) | - (changePort?ChangePortFlag:0); - } - - if ( username!=NULL && username->sizeValue > 0 ) - { - msg->hasUsername = TRUE; - /* msg->username = username; */ - memcpy(&msg->username, username, sizeof(StunAtrString)); - } -} - - -static void -stunSendTest( Socket myFd, StunAddress4 *dest, - const StunAtrString *username, const StunAtrString *password, - int testNum ) -{ - /* assert( dest.addr != 0 ); */ - /* assert( dest.port != 0 ); */ - - bool_t changePort=FALSE; - bool_t changeIP=FALSE; - bool_t discard=FALSE; - - StunMessage req; - char buf[STUN_MAX_MESSAGE_SIZE]; - int len = STUN_MAX_MESSAGE_SIZE; - - switch (testNum) - { - case 1: - case 10: - case 11: - break; - case 2: - /* changePort=TRUE; */ - changeIP=TRUE; - break; - case 3: - changePort=TRUE; - break; - case 4: - changeIP=TRUE; - break; - case 5: - discard=TRUE; - break; - default: - ortp_error("stun: Test %i is unkown\n", testNum); - return ; /* error */ - } - - memset(&req, 0, sizeof(StunMessage)); - - stunBuildReqSimple( &req, username, - changePort , changeIP , - testNum ); - - len = stunEncodeMessage( &req, buf, len, password ); - - //ortp_debug("stun: About to send msg of len %i to %s\n", len, ipaddr(dest) ); - - sendMessage( myFd, buf, len, dest->addr, dest->port ); - - /* add some delay so the packets don't get sent too quickly */ -#if defined(_WIN32_WCE) - Sleep (10); -#elif defined(WIN32)/* !cj! TODO - should fix this up in windows */ - { - clock_t now = clock(); - /* assert( CLOCKS_PER_SEC == 1000 ); */ - while ( clock() <= now+10 ) { }; - } -#else - usleep(10*1000); -#endif - -} - - -#if 0 -void -stunGetUserNameAndPassword( const StunAddress4 *dest, - StunAtrString* username, - StunAtrString* password) -{ - /* !cj! This is totally bogus - need to make TLS connection to dest and get a */ - /* username and password to use */ - stunCreateUserName(dest, username); - stunCreatePassword(username, password); -} -#endif - -int -stunTest( StunAddress4 *dest, int testNum, StunAddress4* sAddr , StunAddress4 *sMappedAddr, StunAddress4* sChangedAddr) -{ - /* assert( dest.addr != 0 ); */ - /* assert( dest.port != 0 ); */ - - int port = randomPort(); - uint32_t interfaceIp=0; - Socket myFd; - StunAtrString username; - StunAtrString password; - char msg[STUN_MAX_MESSAGE_SIZE]; - int msgLen = STUN_MAX_MESSAGE_SIZE; - StunAddress4 from; - StunMessage resp; - bool_t ok; - - if (sAddr) - { - interfaceIp = sAddr->addr; - if ( sAddr->port != 0 ) - { - port = sAddr->port; - } - } - myFd = openPort(port,interfaceIp); - if ( myFd == INVALID_SOCKET) - return -1; - - username.sizeValue = 0; - password.sizeValue = 0; - -#if 0 - stunGetUserNameAndPassword( dest, &username, &password ); -#endif - - stunSendTest( myFd, dest, &username, &password, testNum ); - - ok = getMessage( myFd, - msg, - &msgLen, - &from.addr, - &from.port ); - closesocket(myFd); - if (!ok) - return -1; - - memset(&resp, 0, sizeof(StunMessage)); - - //ortp_debug("stun: Got a response"); - ok = stunParseMessage( msg,msgLen, &resp ); - - //ortp_debug("stun: \t ok=%i\n", ok ); - //ortp_debug("stun: \t SA_MAPPEDADDRESS=%i\n", resp.mappedAddress.ipv4.addr ); - //ortp_debug("stun: \t SA_CHANGEDADDRESS=%i\n", resp.changedAddress.ipv4.addr ); - - if (sAddr) - { - sAddr->port = port; - } - - if (sMappedAddr) - { - sMappedAddr->port = resp.mappedAddress.ipv4.port; - sMappedAddr->addr = resp.mappedAddress.ipv4.addr; - } - - if (sChangedAddr) - { - sChangedAddr->port = resp.changedAddress.ipv4.port; - sChangedAddr->addr = resp.changedAddress.ipv4.addr; - } - - if (ok) - return 0; - else - return -1; -} - - - - -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 */ - ) -{ - /* assert( dest.addr != 0 ); */ - /* assert( dest.port != 0 ); */ - uint32_t interfaceIp=0; - Socket myFd1; - Socket myFd2; - - bool_t respTestI=FALSE; - bool_t isNat=TRUE; - StunAddress4 testIchangedAddr; - StunAddress4 testImappedAddr; - bool_t respTestI2=FALSE; - bool_t mappedIpSame = TRUE; - StunAddress4 testI2mappedAddr; - /* StunAddress4 testI2dest=dest; */ - StunAddress4 testI2dest; - bool_t respTestII=FALSE; - bool_t respTestIII=FALSE; - bool_t respTestHairpin=FALSE; - StunAtrString username; - StunAtrString password; - int count=0; - uint64_t second_started; - uint64_t second_elapsed; - Socket s; - - if ( hairpin ) - { - *hairpin = FALSE; - } - - if ( port == 0 ) - { - port = randomPort(); - } - - if (sAddr) - { - interfaceIp = sAddr->addr; - } - myFd1 = openPort(port,interfaceIp); - myFd2 = openPort(port+1,interfaceIp); - - if ( ( myFd1 == INVALID_SOCKET) || ( myFd2 == INVALID_SOCKET) ) - { - ortp_error("stun: Some problem opening port/interface to send on\n"); - return StunTypeFailure; - } - - /* assert( myFd1 != INVALID_SOCKET ); */ - /* assert( myFd2 != INVALID_SOCKET ); */ - - memcpy(&testI2dest, dest, sizeof(StunAddress4)); - - memset(&testImappedAddr,0,sizeof(testImappedAddr)); - - username.sizeValue = 0; - password.sizeValue = 0; - -#if 0 - stunGetUserNameAndPassword( dest, username, password ); -#endif - - /* stunSendTest( myFd1, dest, username, password, 1 ); */ - - - second_started = stunGetSystemTimeSecs(); - second_elapsed = 1; - - while ( count < 3 && second_elapsed < 5) - { - struct timeval tv; - fd_set fdSet; - int err; - int e; - -#if defined(WIN32) || defined(_WIN32_WCE) - unsigned int fdSetSize; -#else - int fdSetSize; -#endif - - second_elapsed = stunGetSystemTimeSecs() - second_started ; - - FD_ZERO(&fdSet); fdSetSize=0; - FD_SET(myFd1,&fdSet); fdSetSize = (myFd1+1>fdSetSize) ? myFd1+1 : fdSetSize; - FD_SET(myFd2,&fdSet); fdSetSize = (myFd2+1>fdSetSize) ? myFd2+1 : fdSetSize; - tv.tv_sec=0; - tv.tv_usec=500*1000; /* 150 ms */ - if ( count == 0 ) tv.tv_usec=0; - - err = select(fdSetSize, &fdSet, NULL, NULL, &tv); - e = getErrno(); - if ( err == SOCKET_ERROR ) - { - /* error occured */ -#if !defined(_WIN32_WCE) - ortp_error("stun: Error %i %s in select\n", e, strerror(e)); -#else - ortp_error("stun: Error %i in select\n", e); -#endif - closesocket(myFd1); /* AMD */ - closesocket(myFd2); /* AMD */ - return StunTypeFailure; - } - else if ( err == 0 ) - { - /* timeout occured */ - count++; - if ( !respTestI ) - { - stunSendTest( myFd1, dest, &username, &password, 1 ); - } - - if ( (!respTestI2) && respTestI ) - { - /* check the address to send to if valid */ - if ( ( testI2dest.addr != 0 ) && - ( testI2dest.port != 0 ) ) - { - stunSendTest( myFd1, &testI2dest, &username, &password, 10 ); - } - } - - if ( !respTestII ) - { - stunSendTest( myFd2, dest, &username, &password, 2 ); - } - - if ( !respTestIII ) - { - stunSendTest( myFd2, dest, &username, &password, 3 ); - } - - if ( respTestI && (!respTestHairpin) ) - { - if ( ( testImappedAddr.addr != 0 ) && - ( testImappedAddr.port != 0 ) ) - { - stunSendTest( myFd1, &testImappedAddr, &username, &password, 11 ); - } - } - - } - else - { - int i; - /* data is avialbe on some fd */ - - for ( i=0; i<2; i++) - { - Socket myFd; - if ( i==0 ) - { - myFd=myFd1; - } - else - { - myFd=myFd2; - } - - if ( myFd!=INVALID_SOCKET ) - { - if ( FD_ISSET(myFd,&fdSet) ) - { - char msg[STUN_MAX_MESSAGE_SIZE]; - int msgLen = sizeof(msg); - - StunAddress4 from; - StunMessage resp; - - getMessage( myFd, - msg, - &msgLen, - &from.addr, - &from.port ); - - memset(&resp, 0, sizeof(StunMessage)); - - stunParseMessage( msg,msgLen, &resp ); - - //ortp_debug("stun: Received message of type %i id=%i\n", - //resp.msgHdr.msgType, - //(int)(resp.msgHdr.tr_id.octet[0]) ); - - switch( resp.msgHdr.tr_id.octet[0] ) - { - case 1: - { - if ( !respTestI ) - { - - testIchangedAddr.addr = resp.changedAddress.ipv4.addr; - testIchangedAddr.port = resp.changedAddress.ipv4.port; - testImappedAddr.addr = resp.mappedAddress.ipv4.addr; - testImappedAddr.port = resp.mappedAddress.ipv4.port; - - if ( preservePort ) - { - *preservePort = ( testImappedAddr.port == port ); - } - - testI2dest.addr = resp.changedAddress.ipv4.addr; - - if (sAddr) - { - sAddr->port = testImappedAddr.port; - sAddr->addr = testImappedAddr.addr; - } - - count = 0; - } - respTestI=TRUE; - } - break; - case 2: - { - respTestII=TRUE; - } - break; - case 3: - { - respTestIII=TRUE; - } - break; - case 10: - { - if ( !respTestI2 ) - { - testI2mappedAddr.addr = resp.mappedAddress.ipv4.addr; - testI2mappedAddr.port = resp.mappedAddress.ipv4.port; - - mappedIpSame = FALSE; - if ( (testI2mappedAddr.addr == testImappedAddr.addr ) && - (testI2mappedAddr.port == testImappedAddr.port )) - { - mappedIpSame = TRUE; - } - - - } - respTestI2=TRUE; - } - break; - case 11: - { - - if ( hairpin ) - { - *hairpin = TRUE; - } - respTestHairpin = TRUE; - } - break; - } - } - } - } - } - } - - closesocket(myFd1); /* AMD */ - closesocket(myFd2); /* AMD */ - - /* see if we can bind to this address */ - /* cerr << "try binding to " << testImappedAddr ); */ - s = openPort( 0/*use ephemeral*/, testImappedAddr.addr ); - if ( s != INVALID_SOCKET ) - { - isNat = FALSE; - /* cerr << "binding worked"); */ - } - else - { - isNat = TRUE; - /* cerr << "binding failed"); */ - } - - closesocket(s); /* AMD */ - - //ortp_debug("stun: test I = %i\n", respTestI ); - //ortp_debug("stun: test II = %i\n", respTestII ); - //ortp_debug("stun: test III = %i\n", respTestIII ); - //ortp_debug("stun: test I(2) = %i\n", respTestI2 ); - ortp_debug("stun: is nat = %i\n", isNat); - ortp_debug("stun: mapped IP same = %i\n", mappedIpSame ); - - /* implement logic flow chart from draft RFC */ - if ( respTestI ) - { - if ( isNat ) - { - if (respTestII) - { - return StunTypeConeNat; - } - else - { - if ( mappedIpSame ) - { - if ( respTestIII ) - { - return StunTypeRestrictedNat; - } - else - { - return StunTypePortRestrictedNat; - } - } - else - { - return StunTypeSymNat; - } - } - } - else - { - if (respTestII) - { - return StunTypeOpen; - } - else - { - return StunTypeSymFirewall; - } - } - } - else - { - return StunTypeBlocked; - } - - return StunTypeUnknown; -} - -int -stunOpenSocket( StunAddress4 *dest, StunAddress4* mapAddr, - int port, StunAddress4* srcAddr ) -{ - /* assert( dest.addr != 0 ); */ - /* assert( dest.port != 0 ); */ - /* assert( mapAddr );*/ - unsigned int interfaceIp = 0; - Socket myFd; - char msg[STUN_MAX_MESSAGE_SIZE]; - int msgLen = sizeof(msg); - - StunAtrString username; - StunAtrString password; - - StunAddress4 from; - StunMessage resp; - bool_t ok; - StunAddress4 mappedAddr; - - if ( port == 0 ) - { - port = randomPort(); - } - - if ( srcAddr ) - { - interfaceIp = srcAddr->addr; - } - - myFd = openPort(port,interfaceIp); - if (myFd == INVALID_SOCKET) - { - return myFd; - } - - username.sizeValue = 0; - password.sizeValue = 0; - -#if 0 - stunGetUserNameAndPassword( dest, username, password ); -#endif - - stunSendTest(myFd, dest, &username, &password, 1 ); - - getMessage( myFd, msg, &msgLen, &from.addr, &from.port ); - - memset(&resp, 0, sizeof(StunMessage)); - - ok = stunParseMessage( msg, msgLen, &resp ); - if (!ok) - { - closesocket(myFd); - return -1; - } - - if (resp.hasXorMappedAddress==TRUE) - { - uint32_t cookie = 0x2112A442; - uint16_t cookie16 = 0x2112A442 >> 16; - mappedAddr.port = resp.xorMappedAddress.ipv4.port^cookie16; - mappedAddr.addr = resp.xorMappedAddress.ipv4.addr^cookie; - } - else - mappedAddr = resp.mappedAddress.ipv4; - - /* - ortp_message("stun: --- stunOpenSocket --- "); - ortp_message("stun: \treq id=" << req.id ); - ortp_message("stun: \tresp id=" << id ); - ortp_message("stun: \tmappedAddr=" << mappedAddr ); - */ - - *mapAddr = mappedAddr; - - return myFd; -} - - -bool_t -stunOpenSocketPair(StunAddress4 *dest, - StunAddress4* mapAddr_rtp, - StunAddress4* mapAddr_rtcp, - int* fd1, int* fd2, - int port, StunAddress4* srcAddr ) -{ - /* assert( dest.addr!= 0 ); */ - /* assert( dest.port != 0 ); */ - /* assert( mapAddr ); */ - - const int NUM=2; - char msg[STUN_MAX_MESSAGE_SIZE]; - int msgLen =sizeof(msg); - - StunAddress4 from; - int fd[2/*NUM*/]; - int i; - - unsigned int interfaceIp = 0; - - StunAtrString username; - StunAtrString password; - - StunAddress4 mappedAddr[2/*NUM*/]; - - if ( port == 0 ) - { - port = randomPort(); - } - - *fd1=-1; - *fd2=-1; - - if ( srcAddr ) - { - interfaceIp = srcAddr->addr; - } - - for( i=0; i 0) - { - closesocket(fd[--i]); - } - return FALSE; - } - } - - username.sizeValue = 0; - password.sizeValue = 0; - -#if 0 - stunGetUserNameAndPassword( dest, username, password ); -#endif - - for( i=0; i> 16; - mappedAddr[i].port = resp.xorMappedAddress.ipv4.port^cookie16; - mappedAddr[i].addr = resp.xorMappedAddress.ipv4.addr^cookie; - } - else - mappedAddr[i] = resp.mappedAddress.ipv4; - } - - //ortp_debug("stun: --- stunOpenSocketPair --- \n"); - for( i=0; isizeValue>0 - && password!=NULL && password->sizeValue>0 - && resp->hasRealm==TRUE - && resp->hasNonce==TRUE) - { - req.hasUsername = TRUE; - memcpy( req.username.value, username->value, username->sizeValue ); - req.username.sizeValue = username->sizeValue; - - req.hasNonce = TRUE; - memcpy( &req.nonceName, &resp->nonceName, sizeof(resp->nonceName)); - - req.hasRealm = TRUE; - memcpy( &req.realmName, &resp->realmName, sizeof(resp->realmName)); - - req.hasMessageIntegrity = TRUE; - } - - len = stunEncodeMessage( &req, buf, len, password ); - - ortp_debug("stun: About to send msg of len %i to %s\n", len, ipaddr(dest) ); - - sendMessage( myFd, buf, len, dest->addr, dest->port); - - /* add some delay so the packets don't get sent too quickly */ -#if defined(_WIN32_WCE) - Sleep (10); -#elif defined(WIN32)/* !cj! TODO - should fix this up in windows */ - { - clock_t now = clock(); - /* assert( CLOCKS_PER_SEC == 1000 ); */ - while ( clock() <= now+10 ) { }; - } -#else - usleep(10*1000); -#endif -} - -bool_t -turnAllocateSocketPair(StunAddress4 *dest, - StunAddress4* mapAddr_rtp, - StunAddress4* mapAddr_rtcp, - int* fd1, int* fd2, - int port, StunAddress4* srcAddr) -{ - const int NUM=2; - char msg[STUN_MAX_MESSAGE_SIZE]; - int msgLen =sizeof(msg); - - StunAddress4 from; - int fd[2/*NUM*/]; - int i; - - unsigned int interfaceIp = 0; - - StunAtrString username; - StunAtrString password; - - StunAddress4 mappedAddr[2/*NUM*/]; - - if ( port == 0 ) - { - port = randomPort(); - } - - *fd1=-1; - *fd2=-1; - - if ( srcAddr ) - { - interfaceIp = srcAddr->addr; - } - - for( i=0; i 0) - { - closesocket(fd[--i]); - } - return FALSE; - } - } - - snprintf(username.value, sizeof(username.value), "antisip"); - username.sizeValue = strlen(username.value); - snprintf(password.value, sizeof(password.value), "exosip"); - password.sizeValue = strlen(password.value); - - for( i=0; i> 16; - mappedAddr[i].port = resp.xorRelayedAddress.ipv4.port^cookie16; - mappedAddr[i].addr = resp.xorRelayedAddress.ipv4.addr^cookie; - } - else - { - for( i=0; i. - * - */ - -#include -#include -#include -#if !defined(WIN32) && !defined(_WIN32_WCE) -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif -#include - -#include - -#if defined(WIN32) || defined(_WIN32_WCE) - -#include -#include -/* #include */ - -#else - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif - -#include - -#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 - * . - * - */ - -/* Local Variables: - mode:c - c-file-style:"ellemtel" - c-file-offsets:((case-label . +)) - indent-tabs-mode:nil - End: -*/ diff --git a/linphone/oRTP/src/system b/linphone/oRTP/src/system deleted file mode 100644 index 50dcc4375..000000000 --- a/linphone/oRTP/src/system +++ /dev/null @@ -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 -$$$ - diff --git a/linphone/oRTP/src/telephonyevents.c b/linphone/oRTP/src/telephonyevents.c deleted file mode 100644 index 538bdba4e..000000000 --- a/linphone/oRTP/src/telephonyevents.c +++ /dev/null @@ -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 -#include "utils.h" -#include "rtpsession_priv.h" -#include - -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;ion_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;ib_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;icurrent_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); - } -} diff --git a/linphone/oRTP/src/tests/.gitignore b/linphone/oRTP/src/tests/.gitignore deleted file mode 100644 index 4f1b0f522..000000000 --- a/linphone/oRTP/src/tests/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -Makefile -Makefile.in -.deps -.libs -*.lo -*.la -mrtprecv -mrtpsend -rtpmemtest -rtprecv -rtpsend -test_timer -tevmrtprecv -tevrtprecv -tevrtpsend -rtpsend_stupid diff --git a/linphone/oRTP/src/tests/Makefile.am b/linphone/oRTP/src/tests/Makefile.am deleted file mode 100644 index 793312b0d..000000000 --- a/linphone/oRTP/src/tests/Makefile.am +++ /dev/null @@ -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/ diff --git a/linphone/oRTP/src/tests/mrtprecv.c b/linphone/oRTP/src/tests/mrtprecv.c deleted file mode 100644 index 22f5fdff7..000000000 --- a/linphone/oRTP/src/tests/mrtprecv.c +++ /dev/null @@ -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 -#include -#include -#include -#include -#include - -#ifndef _WIN32 -#include - -#include -#include -#include -#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 -#include -#include -#include - -#ifndef _WIN32 -#include -#include -#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;i0) && (runcond) ) - { - int k; - //ortp_message("Sending packet."); - for (k=0;k -#include -#include -#include - -#ifndef _WIN32 -#include -#include -#include -#include -#include -#include -#else -//#include -#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;isetflags=%i\n",session[k]->setflags); - } - /* and then suspend the process by selecting() */ - session_set_select(set,NULL,NULL); - for (k=0;k -#include -#include -#ifndef _WIN32 -#include -#include -#include -#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 ]\n"; - -#define MULAW 0 -#define ALAW 1 - -#if defined(__hpux) && HAVE_SYS_AUDIO_H - -#include - -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;i0) 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; -} diff --git a/linphone/oRTP/src/tests/rtpsend.c b/linphone/oRTP/src/tests/rtpsend.c deleted file mode 100644 index d1fefe830..000000000 --- a/linphone/oRTP/src/tests/rtpsend.c +++ /dev/null @@ -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 -#include -#include - -#ifndef _WIN32 -#include -#include -#include -#endif - -int runcond=1; - -void stophandler(int signum) -{ - runcond=0; -} - -static const char *help="usage: rtpsend filename dest_ip4addr dest_port [ --with-clockslide ] [ --with-jitter ]\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) { - 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; -} diff --git a/linphone/oRTP/src/tests/rtpsend_stupid.c b/linphone/oRTP/src/tests/rtpsend_stupid.c deleted file mode 100644 index 80db79a28..000000000 --- a/linphone/oRTP/src/tests/rtpsend_stupid.c +++ /dev/null @@ -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 -#include -#include - -#ifndef _WIN32 -#include -#include -#include -#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 ] [ --with-ptime ]\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) { - 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; -} diff --git a/linphone/oRTP/src/tests/test_timer.c b/linphone/oRTP/src/tests/test_timer.c deleted file mode 100644 index 48f4d0da2..000000000 --- a/linphone/oRTP/src/tests/test_timer.c +++ /dev/null @@ -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 - -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; -} diff --git a/linphone/oRTP/src/tests/tevmrtprecv.c b/linphone/oRTP/src/tests/tevmrtprecv.c deleted file mode 100644 index 023bec798..000000000 --- a/linphone/oRTP/src/tests/tevmrtprecv.c +++ /dev/null @@ -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 -#include -#include -#include - -#ifndef _WIN32 -#include -#include -#include -#include -#include -#include - -#else -//#include -#endif - -#include - -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 -#include -#include -#include -#include -#include -#ifndef _WIN32 -#include -#else -#include -#endif -#include - -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; -} diff --git a/linphone/oRTP/src/tests/tevrtpsend.c b/linphone/oRTP/src/tests/tevrtpsend.c deleted file mode 100644 index 185db8ff0..000000000 --- a/linphone/oRTP/src/tests/tevrtpsend.c +++ /dev/null @@ -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 -#include -#include -#include -#include -#ifndef _WIN32 -#include -#else -#include -#endif -#include - -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; -} diff --git a/linphone/oRTP/src/tests/win_receiver/.gitignore b/linphone/oRTP/src/tests/win_receiver/.gitignore deleted file mode 100644 index 3dda72986..000000000 --- a/linphone/oRTP/src/tests/win_receiver/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile.in -Makefile diff --git a/linphone/oRTP/src/tests/win_receiver/Makefile.am b/linphone/oRTP/src/tests/win_receiver/Makefile.am deleted file mode 100644 index e7e00556f..000000000 --- a/linphone/oRTP/src/tests/win_receiver/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -EXTRA_DIST=RTPReceiver.cpp RTPReceiver.vcproj - diff --git a/linphone/oRTP/src/tests/win_receiver/RTPReceiver.cpp b/linphone/oRTP/src/tests/win_receiver/RTPReceiver.cpp deleted file mode 100644 index 8701508f8..000000000 --- a/linphone/oRTP/src/tests/win_receiver/RTPReceiver.cpp +++ /dev/null @@ -1,236 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#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 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 Warning: session_set_select() is returning 0...\n"); - } - - for (k=0;k 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 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/linphone/oRTP/src/tests/win_sender/.gitignore b/linphone/oRTP/src/tests/win_sender/.gitignore deleted file mode 100644 index 3dda72986..000000000 --- a/linphone/oRTP/src/tests/win_sender/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile.in -Makefile diff --git a/linphone/oRTP/src/tests/win_sender/Makefile.am b/linphone/oRTP/src/tests/win_sender/Makefile.am deleted file mode 100644 index 3af05d969..000000000 --- a/linphone/oRTP/src/tests/win_sender/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -EXTRA_DIST=RTPSender.cpp RTPSender.vcproj - diff --git a/linphone/oRTP/src/tests/win_sender/RTPSender.cpp b/linphone/oRTP/src/tests/win_sender/RTPSender.cpp deleted file mode 100644 index 95630b079..000000000 --- a/linphone/oRTP/src/tests/win_sender/RTPSender.cpp +++ /dev/null @@ -1,265 +0,0 @@ -#include -#include - -#define STREAMS_COUNT 1000 - -enum -{ - EVENT_STOP, - EVENT_RTP, - EVENT_COUNT // Always last -}; - - -RtpSession * m_Session[STREAMS_COUNT]; - -int m_nPacket_Size = 160; -int m_nTimestamp_Inc = 160; - -char * m_pBuffer = NULL; -char * m_SSRC = NULL; - -int m_nChannels = 0; -int m_nPort = 0; - -HANDLE m_hEvents[EVENT_COUNT]; - -BOOL m_bExit = FALSE; - -static char *help="usage: mrtpsend filename ip port nstreams [--packet-size size] [--ts-inc value]\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; - SetEvent(m_hEvents[EVENT_STOP]); - return TRUE; - - default: - return FALSE; - } -} - -int GetCommandArguments(int argc, char *argv[]) -{ - int nCounter; - - // Check the number of arguments - if (argc<5) - { - printf(help); - return -1; - } - - m_nChannels = atoi(argv[4]); - - // Get the number of channels - if (m_nChannels == 0) - { - printf(help); - return -1; - } - - /* look at command line options */ - for (nCounter=5; nCounter Sorry dude...\n"); - Sleep(1000); - return -1; - } - - printf("==> Starting the RTP Sender test\n"); - - - // =============== INSTALL THE CONTROL HANDLER =============== - if (SetConsoleCtrlHandler( (PHANDLER_ROUTINE) ctrlHandlerFunction, TRUE) == 0) - { - printf("==> Cannot handle the CTRL-C...\n"); - } - - - printf("==> Timestamp increment will be %i\n" , m_nTimestamp_Inc); - printf("==> Packet size will be %i\n" , m_nPacket_Size); - - m_pBuffer = (char *) ortp_malloc(m_nPacket_Size); - - ortp_init(); - ortp_scheduler_init(); - printf("==> Scheduler initialized\n"); - - m_SSRC = getenv("SSRC"); - m_nPort = atoi(argv[3]); - - for (nCounter=0; nCounter < m_nChannels; nCounter++) - { - //printf("==> Channel [#%d]\n", nCounter); - - m_Session[nCounter] = rtp_session_new(RTP_SESSION_SENDONLY); - - rtp_session_set_scheduling_mode(m_Session[nCounter],1); - rtp_session_set_blocking_mode(m_Session[nCounter],0); - rtp_session_set_remote_addr(m_Session[nCounter],argv[2], m_nPort); - rtp_session_set_send_payload_type(m_Session[nCounter],0); - - if (m_SSRC != NULL) - { - rtp_session_set_ssrc(m_Session[nCounter],atoi(m_SSRC)); - } - - m_nPort+=2; - } - - infile=fopen(argv[1],"rb"); - - if (infile==NULL) - { - printf("==> Cannot open file !!!!"); - Sleep(1000); - return -1; - } - -// printf("==> Open file\n"); - - /* Create a set */ - pSessionSet = session_set_new(); -// printf("==> Session set\n"); - - while( ((nCounter= (int) fread(m_pBuffer,1,m_nPacket_Size,infile))>0) && (m_bExit == FALSE) ) - { - int k; - //g_message("Sending packet."); - for (k=0;k Session set set %d\n", k); - } - /* and then suspend the process by selecting() */ - session_set_select(NULL,pSessionSet,NULL); - //printf("==> Session set select\n"); - - for (k=0;k Session set is set %d\n", k); - rtp_session_send_with_ts(m_Session[k],m_pBuffer,nCounter,m_nUser_Timestamp); - //g_message("packet sended !"); - } - } - m_nUser_Timestamp+=m_nTimestamp_Inc; - } - - fclose(infile); - printf("==> Close file\n"); - - - - for(nCounter=0;nCounter Remove the CTRL-C handler...\n"); - SetConsoleCtrlHandler( (PHANDLER_ROUTINE) ctrlHandlerFunction, FALSE); - - // Wait for an input key - printf("Waiting for exit : "); - - for (nCounter = 0; nCounter < 4*5; nCounter++) - { - printf("."); - Sleep(250); - } - - return 0; -} - diff --git a/linphone/oRTP/src/tests/win_sender/RTPSender.vcproj b/linphone/oRTP/src/tests/win_sender/RTPSender.vcproj deleted file mode 100644 index 32b054186..000000000 --- a/linphone/oRTP/src/tests/win_sender/RTPSender.vcproj +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/linphone/oRTP/src/utils.c b/linphone/oRTP/src/utils.c deleted file mode 100644 index 436e2a2c2..000000000 --- a/linphone/oRTP/src/utils.c +++ /dev/null @@ -1,86 +0,0 @@ -/*************************************************************************** - * utils.c - * - * Wed Feb 23 14:15:36 2005 - * Copyright 2005 Simon Morlat - * Email simon.morlat@linphone.org - ****************************************************************************/ -/* - 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/port.h" -#include "utils.h" - -OList *o_list_new(void *data){ - OList *new_elem=(OList*)ortp_new0(OList,1); - new_elem->data=data; - return new_elem; -} - -OList * o_list_append(OList *elem, void * data){ - OList *new_elem=o_list_new(data); - OList *it=elem; - if (elem==NULL) return new_elem; - while (it->next!=NULL) it=o_list_next(it); - it->next=new_elem; - new_elem->prev=it; - return elem; -} - -OList * o_list_free(OList *list){ - OList *elem = list; - OList *tmp; - return_val_if_fail(list, list); - while(elem->next!=NULL) { - tmp = elem; - elem = elem->next; - ortp_free(tmp); - } - ortp_free(elem); - return NULL; -} - -OList *o_list_remove_link(OList *list, OList *elem){ - OList *ret; - if (elem==list){ - ret=elem->next; - elem->prev=NULL; - elem->next=NULL; - if (ret!=NULL) ret->prev=NULL; - ortp_free(elem); - return ret; - } - elem->prev->next=elem->next; - if (elem->next!=NULL) elem->next->prev=elem->prev; - elem->next=NULL; - elem->prev=NULL; - ortp_free(elem); - return list; -} - -OList * o_list_remove(OList *list, void *data){ - OList *it; - for(it=list;it!=NULL;it=it->next){ - if (it->data==data){ - return o_list_remove_link(list,it); - } - } - return list; -} - diff --git a/linphone/oRTP/src/utils.h b/linphone/oRTP/src/utils.h deleted file mode 100644 index 0a50fcf0f..000000000 --- a/linphone/oRTP/src/utils.h +++ /dev/null @@ -1,91 +0,0 @@ -/*************************************************************************** - * utils.h - * - * Wed Feb 23 14:15:36 2005 - * Copyright 2005 Simon Morlat - * Email simon.morlat@linphone.org - ****************************************************************************/ -/* - 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 UTILS_H -#define UTILS_H - -#include "ortp/event.h" - -struct _OList { - struct _OList *next; - struct _OList *prev; - void *data; -}; - -typedef struct _OList OList; - - -#define o_list_next(elem) ((elem)->next) - -OList * o_list_append(OList *elem, void * data); -OList * o_list_remove(OList *list, void *data); -OList * o_list_free(OList *elem); - -#ifndef MIN -#define MIN(a,b) (((a)>(b)) ? (b) : (a)) -#endif -#ifndef MAX -#define MAX(a,b) (((a)>(b)) ? (a) : (b)) -#endif - -#define return_if_fail(expr) if (!(expr)) {printf("%s:%i- assertion"#expr "failed\n",__FILE__,__LINE__); return;} -#define return_val_if_fail(expr,ret) if (!(expr)) {printf("%s:%i- assertion" #expr "failed\n",__FILE__,__LINE__); return (ret);} - - -#define INT_TO_POINTER(truc) ((long)(long)(truc)) -#define POINTER_TO_INT(truc) ((int)(long)(truc)) - -typedef struct _dwsplit_t{ -#ifdef ORTP_BIGENDIAN - uint16_t hi; - uint16_t lo; -#else - uint16_t lo; - uint16_t hi; -#endif -} dwsplit_t; - -typedef union{ - dwsplit_t split; - uint32_t one; -} poly32_t; - -#ifdef ORTP_BIGENDIAN -#define hton24(x) (x) -#else -#define hton24(x) ((( (x) & 0x00ff0000) >>16) | (( (x) & 0x000000ff) <<16) | ( (x) & 0x0000ff00) ) -#endif -#define ntoh24(x) hton24(x) - -#if defined(WIN32) || defined(_WIN32_WCE) -#define is_would_block_error(errnum) (errnum==WSAEWOULDBLOCK) -#else -#define is_would_block_error(errnum) (errnum==EWOULDBLOCK || errnum==EAGAIN) -#endif - -void ortp_ev_queue_put(OrtpEvQueue *q, OrtpEvent *ev); - -#endif From 4cb987ed5fcc96384c2c606839f7a00dfae56579 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 20 Jan 2010 11:37:11 +0100 Subject: [PATCH 2/6] remove mediastreamer2 and add it as a submodule instead. --- .gitmodules | 3 + linphone/mediastreamer2 | 1 + linphone/mediastreamer2/.gitignore | 30 - linphone/mediastreamer2/.indent.pro | 4 - linphone/mediastreamer2/AUTHORS | 1 - linphone/mediastreamer2/COPYING | 340 --- linphone/mediastreamer2/ChangeLog | 0 linphone/mediastreamer2/Makefile.am | 54 - linphone/mediastreamer2/Makefile.macosx | 76 - linphone/mediastreamer2/NEWS | 56 - linphone/mediastreamer2/README | 99 - linphone/mediastreamer2/acinclude.m4 | 180 -- linphone/mediastreamer2/autogen.sh | 30 - linphone/mediastreamer2/build/.gitignore | 2 - linphone/mediastreamer2/build/Makefile.am | 1 - .../build/win32-novideo/.gitignore | 2 - .../build/win32-novideo/Makefile.am | 2 - .../build/win32-novideo/alldescs.h | 70 - .../build/win32-novideo/mediastream.vcproj | 143 -- .../build/win32-novideo/mediastreamer2.def | 82 - .../build/win32-novideo/mediastreamer2.vcproj | 416 ---- .../build/win32native/.gitignore | 2 - .../build/win32native/Makefile.am | 2 - .../build/win32native/alldescs.h | 90 - .../build/win32native/mediastream.vcproj | 211 -- .../build/win32native/mediastreamer2.def | 117 -- .../build/win32native/mediastreamer2.vcproj | 504 ----- .../build/win32native/videodisplay.vcproj | 203 -- .../mediastreamer2/build/wince/.gitignore | 2 - .../mediastreamer2/build/wince/Makefile.am | 2 - .../mediastreamer2/build/wince/alldescs.h | 68 - .../build/wince/mediastreamer2.def | 129 -- .../build/wince/mediastreamer2.vcproj | 1568 -------------- .../mediastreamer2/build/winmob/Makefile.am | 2 - .../mediastreamer2/build/winmob/alldescs.h | 68 - .../build/winmob/echo/echo.vcproj | 227 -- .../build/winmob/mediastreamer2.def | 129 -- .../build/winmob/mediastreamer2.sln | 60 - .../build/winmob/mediastreamer2.vcproj | 933 --------- linphone/mediastreamer2/configure.ac | 659 ------ linphone/mediastreamer2/help/.gitignore | 2 - linphone/mediastreamer2/help/Doxyfile.in | 234 --- linphone/mediastreamer2/help/Makefile.am | 32 - linphone/mediastreamer2/help/doxygen.dox.in | 187 -- .../mediastreamer2/help/ht0-buildagraph.dox | 153 -- linphone/mediastreamer2/include/.gitignore | 2 - linphone/mediastreamer2/include/Makefile.am | 1 - .../include/mediastreamer2/.gitignore | 2 - .../include/mediastreamer2/Makefile.am | 29 - .../include/mediastreamer2/allfilters.h | 95 - .../include/mediastreamer2/dsptools.h | 388 ---- .../include/mediastreamer2/dtmfgen.h | 29 - .../include/mediastreamer2/ice.h | 96 - .../include/mediastreamer2/mediastream.h | 212 -- .../include/mediastreamer2/mscommon.h | 204 -- .../include/mediastreamer2/msequalizer.h | 44 - .../include/mediastreamer2/msfileplayer.h | 43 - .../include/mediastreamer2/msfilerec.h | 33 - .../include/mediastreamer2/msfilter.h | 508 ----- .../include/mediastreamer2/msqueue.h | 117 -- .../include/mediastreamer2/msrtp.h | 45 - .../include/mediastreamer2/mssndcard.h | 436 ---- .../include/mediastreamer2/msspeexec.h | 38 - .../include/mediastreamer2/mstee.h | 30 - .../include/mediastreamer2/msticker.h | 153 -- .../include/mediastreamer2/msv4l.h | 30 - .../include/mediastreamer2/msvideo.h | 191 -- .../include/mediastreamer2/msvideoout.h | 104 - .../include/mediastreamer2/msvolume.h | 63 - .../include/mediastreamer2/mswebcam.h | 233 --- .../include/mediastreamer2/rfc3984.h | 60 - .../include/mediastreamer2/waveheader.h | 96 - linphone/mediastreamer2/mediastreamer.pc.in | 11 - .../mediastreamer2/mediastreamer2.spec.in | 81 - linphone/mediastreamer2/pkg.list | 43 - linphone/mediastreamer2/plugins/.gitignore | 3 - .../mediastreamer2/plugins/msilbc/AUTHORS | 0 .../mediastreamer2/plugins/msilbc/COPYING | 340 --- .../mediastreamer2/plugins/msilbc/ChangeLog | 0 .../mediastreamer2/plugins/msilbc/INSTALL | 236 --- .../mediastreamer2/plugins/msilbc/Makefile.am | 11 - linphone/mediastreamer2/plugins/msilbc/NEWS | 0 linphone/mediastreamer2/plugins/msilbc/README | 13 - .../plugins/msilbc/configure.ac | 152 -- .../plugins/msilbc/ilbc-rfc3951.tar.gz | Bin 330306 -> 0 bytes linphone/mediastreamer2/plugins/msilbc/ilbc.c | 283 --- .../mediastreamer2/plugins/msx264/AUTHORS | 1 - .../mediastreamer2/plugins/msx264/COPYING | 340 --- .../mediastreamer2/plugins/msx264/ChangeLog | 0 .../mediastreamer2/plugins/msx264/INSTALL | 302 --- .../mediastreamer2/plugins/msx264/Makefile.am | 48 - linphone/mediastreamer2/plugins/msx264/NEWS | 8 - linphone/mediastreamer2/plugins/msx264/README | 18 - .../mediastreamer2/plugins/msx264/autogen.sh | 19 - .../plugins/msx264/configure.ac | 159 -- .../plugins/msx264/msx264.iss.in | 34 - .../plugins/msx264/src/Makefile.am | 27 - .../plugins/msx264/src/msx264.c | 563 ----- linphone/mediastreamer2/src/.gitignore | 8 - linphone/mediastreamer2/src/Makefile.am | 188 -- linphone/mediastreamer2/src/_kiss_fft_guts.h | 205 -- linphone/mediastreamer2/src/alaw.c | 222 -- linphone/mediastreamer2/src/alsa.c | 1050 ---------- linphone/mediastreamer2/src/aqsnd.c | 955 --------- linphone/mediastreamer2/src/arts.c | 207 -- linphone/mediastreamer2/src/audiostream.c | 604 ------ linphone/mediastreamer2/src/dsptools.c | 386 ---- linphone/mediastreamer2/src/dtmfgen.c | 204 -- linphone/mediastreamer2/src/dxfilter.cpp | 884 -------- linphone/mediastreamer2/src/dxfilter.h | 231 -- linphone/mediastreamer2/src/equalizer.c | 368 ---- linphone/mediastreamer2/src/ffmpeg-priv.h | 66 - linphone/mediastreamer2/src/g711common.h | 171 -- linphone/mediastreamer2/src/gsm.c | 165 -- linphone/mediastreamer2/src/ice.c | 1381 ------------ linphone/mediastreamer2/src/kiss_fft.c | 519 ----- linphone/mediastreamer2/src/kiss_fft.h | 114 - linphone/mediastreamer2/src/kiss_fftr.c | 294 --- linphone/mediastreamer2/src/kiss_fftr.h | 57 - linphone/mediastreamer2/src/macsnd.c | 710 ------- linphone/mediastreamer2/src/mire.c | 164 -- linphone/mediastreamer2/src/mscommon.c | 589 ------ linphone/mediastreamer2/src/msconf.c | 820 -------- linphone/mediastreamer2/src/msdscap-mingw.cc | 1071 ---------- linphone/mediastreamer2/src/msfileplayer.c | 325 --- .../mediastreamer2/src/msfileplayer_win.c | 369 ---- linphone/mediastreamer2/src/msfilerec.c | 200 -- linphone/mediastreamer2/src/msfilerec_win.c | 246 --- linphone/mediastreamer2/src/msfilter.c | 309 --- linphone/mediastreamer2/src/msjoin.c | 72 - linphone/mediastreamer2/src/msqueue.c | 117 -- linphone/mediastreamer2/src/msresample.c | 252 --- linphone/mediastreamer2/src/msrtp.c | 525 ----- linphone/mediastreamer2/src/mssndcard.c | 231 -- linphone/mediastreamer2/src/msspeex.c | 538 ----- linphone/mediastreamer2/src/msticker.c | 468 ----- linphone/mediastreamer2/src/msv4l.c | 1072 ---------- linphone/mediastreamer2/src/msv4l2.c | 524 ----- linphone/mediastreamer2/src/msv4m.m | 706 ------- linphone/mediastreamer2/src/msvideo.c | 252 --- linphone/mediastreamer2/src/msvolume.c | 431 ---- linphone/mediastreamer2/src/mswebcam.c | 137 -- linphone/mediastreamer2/src/mtu.c | 249 --- linphone/mediastreamer2/src/nowebcam.c | 1827 ---------------- linphone/mediastreamer2/src/nowebcam.h | 28 - linphone/mediastreamer2/src/nowebcamCIF.jpg | Bin 14247 -> 0 bytes linphone/mediastreamer2/src/oss.c | 605 ------ linphone/mediastreamer2/src/pasnd.c | 597 ------ linphone/mediastreamer2/src/pixconv.c | 204 -- linphone/mediastreamer2/src/rfc2429.h | 50 - linphone/mediastreamer2/src/rfc3984.c | 321 --- linphone/mediastreamer2/src/sdlout.c | 375 ---- linphone/mediastreamer2/src/sizeconv.c | 235 --- linphone/mediastreamer2/src/speexec.c | 381 ---- linphone/mediastreamer2/src/swscale.h | 146 -- linphone/mediastreamer2/src/tee.c | 110 - linphone/mediastreamer2/src/theora.c | 590 ------ linphone/mediastreamer2/src/ulaw.c | 227 -- linphone/mediastreamer2/src/vfw-missing.h | 286 --- linphone/mediastreamer2/src/videodec.c | 858 -------- linphone/mediastreamer2/src/videoenc.c | 1041 --------- linphone/mediastreamer2/src/videoout.c | 1005 --------- linphone/mediastreamer2/src/videostream.c | 583 ------ linphone/mediastreamer2/src/void.c | 61 - linphone/mediastreamer2/src/wincevideods.c | 1003 --------- linphone/mediastreamer2/src/winsnd.c | 972 --------- linphone/mediastreamer2/src/winsnd2.c | 1593 -------------- linphone/mediastreamer2/src/winsnd3.c | 713 ------- linphone/mediastreamer2/src/winsndds.cpp | 1864 ----------------- linphone/mediastreamer2/src/winvideo.c | 682 ------ linphone/mediastreamer2/src/winvideo2.c | 505 ----- linphone/mediastreamer2/src/winvideods.c | 1493 ------------- linphone/mediastreamer2/tests/.gitignore | 11 - linphone/mediastreamer2/tests/Makefile.am | 37 - linphone/mediastreamer2/tests/bench.c | 365 ---- linphone/mediastreamer2/tests/echo.c | 99 - linphone/mediastreamer2/tests/mediastream.c | 381 ---- linphone/mediastreamer2/tests/mtudiscover.c | 33 - linphone/mediastreamer2/tests/ring.c | 52 - linphone/mediastreamer2/tests/videodisplay.c | 115 - 180 files changed, 4 insertions(+), 51250 deletions(-) create mode 160000 linphone/mediastreamer2 delete mode 100644 linphone/mediastreamer2/.gitignore delete mode 100644 linphone/mediastreamer2/.indent.pro delete mode 100644 linphone/mediastreamer2/AUTHORS delete mode 100644 linphone/mediastreamer2/COPYING delete mode 100644 linphone/mediastreamer2/ChangeLog delete mode 100644 linphone/mediastreamer2/Makefile.am delete mode 100644 linphone/mediastreamer2/Makefile.macosx delete mode 100644 linphone/mediastreamer2/NEWS delete mode 100644 linphone/mediastreamer2/README delete mode 100644 linphone/mediastreamer2/acinclude.m4 delete mode 100755 linphone/mediastreamer2/autogen.sh delete mode 100644 linphone/mediastreamer2/build/.gitignore delete mode 100755 linphone/mediastreamer2/build/Makefile.am delete mode 100644 linphone/mediastreamer2/build/win32-novideo/.gitignore delete mode 100755 linphone/mediastreamer2/build/win32-novideo/Makefile.am delete mode 100755 linphone/mediastreamer2/build/win32-novideo/alldescs.h delete mode 100755 linphone/mediastreamer2/build/win32-novideo/mediastream.vcproj delete mode 100755 linphone/mediastreamer2/build/win32-novideo/mediastreamer2.def delete mode 100755 linphone/mediastreamer2/build/win32-novideo/mediastreamer2.vcproj delete mode 100644 linphone/mediastreamer2/build/win32native/.gitignore delete mode 100755 linphone/mediastreamer2/build/win32native/Makefile.am delete mode 100755 linphone/mediastreamer2/build/win32native/alldescs.h delete mode 100755 linphone/mediastreamer2/build/win32native/mediastream.vcproj delete mode 100755 linphone/mediastreamer2/build/win32native/mediastreamer2.def delete mode 100755 linphone/mediastreamer2/build/win32native/mediastreamer2.vcproj delete mode 100755 linphone/mediastreamer2/build/win32native/videodisplay.vcproj delete mode 100644 linphone/mediastreamer2/build/wince/.gitignore delete mode 100755 linphone/mediastreamer2/build/wince/Makefile.am delete mode 100644 linphone/mediastreamer2/build/wince/alldescs.h delete mode 100644 linphone/mediastreamer2/build/wince/mediastreamer2.def delete mode 100644 linphone/mediastreamer2/build/wince/mediastreamer2.vcproj delete mode 100755 linphone/mediastreamer2/build/winmob/Makefile.am delete mode 100644 linphone/mediastreamer2/build/winmob/alldescs.h delete mode 100644 linphone/mediastreamer2/build/winmob/echo/echo.vcproj delete mode 100644 linphone/mediastreamer2/build/winmob/mediastreamer2.def delete mode 100644 linphone/mediastreamer2/build/winmob/mediastreamer2.sln delete mode 100644 linphone/mediastreamer2/build/winmob/mediastreamer2.vcproj delete mode 100644 linphone/mediastreamer2/configure.ac delete mode 100644 linphone/mediastreamer2/help/.gitignore delete mode 100644 linphone/mediastreamer2/help/Doxyfile.in delete mode 100644 linphone/mediastreamer2/help/Makefile.am delete mode 100644 linphone/mediastreamer2/help/doxygen.dox.in delete mode 100644 linphone/mediastreamer2/help/ht0-buildagraph.dox delete mode 100644 linphone/mediastreamer2/include/.gitignore delete mode 100644 linphone/mediastreamer2/include/Makefile.am delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/.gitignore delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/Makefile.am delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/allfilters.h delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/dsptools.h delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/dtmfgen.h delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/ice.h delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/mediastream.h delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/mscommon.h delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/msequalizer.h delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/msfileplayer.h delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/msfilerec.h delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/msfilter.h delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/msqueue.h delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/msrtp.h delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/mssndcard.h delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/msspeexec.h delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/mstee.h delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/msticker.h delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/msv4l.h delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/msvideo.h delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/msvideoout.h delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/msvolume.h delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/mswebcam.h delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/rfc3984.h delete mode 100644 linphone/mediastreamer2/include/mediastreamer2/waveheader.h delete mode 100644 linphone/mediastreamer2/mediastreamer.pc.in delete mode 100644 linphone/mediastreamer2/mediastreamer2.spec.in delete mode 100644 linphone/mediastreamer2/pkg.list delete mode 100644 linphone/mediastreamer2/plugins/.gitignore delete mode 100644 linphone/mediastreamer2/plugins/msilbc/AUTHORS delete mode 100644 linphone/mediastreamer2/plugins/msilbc/COPYING delete mode 100644 linphone/mediastreamer2/plugins/msilbc/ChangeLog delete mode 100644 linphone/mediastreamer2/plugins/msilbc/INSTALL delete mode 100644 linphone/mediastreamer2/plugins/msilbc/Makefile.am delete mode 100644 linphone/mediastreamer2/plugins/msilbc/NEWS delete mode 100644 linphone/mediastreamer2/plugins/msilbc/README delete mode 100644 linphone/mediastreamer2/plugins/msilbc/configure.ac delete mode 100644 linphone/mediastreamer2/plugins/msilbc/ilbc-rfc3951.tar.gz delete mode 100644 linphone/mediastreamer2/plugins/msilbc/ilbc.c delete mode 100644 linphone/mediastreamer2/plugins/msx264/AUTHORS delete mode 100644 linphone/mediastreamer2/plugins/msx264/COPYING delete mode 100644 linphone/mediastreamer2/plugins/msx264/ChangeLog delete mode 100644 linphone/mediastreamer2/plugins/msx264/INSTALL delete mode 100644 linphone/mediastreamer2/plugins/msx264/Makefile.am delete mode 100644 linphone/mediastreamer2/plugins/msx264/NEWS delete mode 100644 linphone/mediastreamer2/plugins/msx264/README delete mode 100755 linphone/mediastreamer2/plugins/msx264/autogen.sh delete mode 100644 linphone/mediastreamer2/plugins/msx264/configure.ac delete mode 100644 linphone/mediastreamer2/plugins/msx264/msx264.iss.in delete mode 100644 linphone/mediastreamer2/plugins/msx264/src/Makefile.am delete mode 100644 linphone/mediastreamer2/plugins/msx264/src/msx264.c delete mode 100644 linphone/mediastreamer2/src/.gitignore delete mode 100644 linphone/mediastreamer2/src/Makefile.am delete mode 100644 linphone/mediastreamer2/src/_kiss_fft_guts.h delete mode 100644 linphone/mediastreamer2/src/alaw.c delete mode 100644 linphone/mediastreamer2/src/alsa.c delete mode 100644 linphone/mediastreamer2/src/aqsnd.c delete mode 100644 linphone/mediastreamer2/src/arts.c delete mode 100644 linphone/mediastreamer2/src/audiostream.c delete mode 100644 linphone/mediastreamer2/src/dsptools.c delete mode 100644 linphone/mediastreamer2/src/dtmfgen.c delete mode 100644 linphone/mediastreamer2/src/dxfilter.cpp delete mode 100644 linphone/mediastreamer2/src/dxfilter.h delete mode 100644 linphone/mediastreamer2/src/equalizer.c delete mode 100644 linphone/mediastreamer2/src/ffmpeg-priv.h delete mode 100644 linphone/mediastreamer2/src/g711common.h delete mode 100644 linphone/mediastreamer2/src/gsm.c delete mode 100644 linphone/mediastreamer2/src/ice.c delete mode 100644 linphone/mediastreamer2/src/kiss_fft.c delete mode 100644 linphone/mediastreamer2/src/kiss_fft.h delete mode 100644 linphone/mediastreamer2/src/kiss_fftr.c delete mode 100644 linphone/mediastreamer2/src/kiss_fftr.h delete mode 100644 linphone/mediastreamer2/src/macsnd.c delete mode 100644 linphone/mediastreamer2/src/mire.c delete mode 100644 linphone/mediastreamer2/src/mscommon.c delete mode 100644 linphone/mediastreamer2/src/msconf.c delete mode 100755 linphone/mediastreamer2/src/msdscap-mingw.cc delete mode 100644 linphone/mediastreamer2/src/msfileplayer.c delete mode 100644 linphone/mediastreamer2/src/msfileplayer_win.c delete mode 100644 linphone/mediastreamer2/src/msfilerec.c delete mode 100644 linphone/mediastreamer2/src/msfilerec_win.c delete mode 100644 linphone/mediastreamer2/src/msfilter.c delete mode 100644 linphone/mediastreamer2/src/msjoin.c delete mode 100644 linphone/mediastreamer2/src/msqueue.c delete mode 100644 linphone/mediastreamer2/src/msresample.c delete mode 100644 linphone/mediastreamer2/src/msrtp.c delete mode 100644 linphone/mediastreamer2/src/mssndcard.c delete mode 100644 linphone/mediastreamer2/src/msspeex.c delete mode 100644 linphone/mediastreamer2/src/msticker.c delete mode 100644 linphone/mediastreamer2/src/msv4l.c delete mode 100644 linphone/mediastreamer2/src/msv4l2.c delete mode 100644 linphone/mediastreamer2/src/msv4m.m delete mode 100644 linphone/mediastreamer2/src/msvideo.c delete mode 100644 linphone/mediastreamer2/src/msvolume.c delete mode 100644 linphone/mediastreamer2/src/mswebcam.c delete mode 100644 linphone/mediastreamer2/src/mtu.c delete mode 100644 linphone/mediastreamer2/src/nowebcam.c delete mode 100644 linphone/mediastreamer2/src/nowebcam.h delete mode 100644 linphone/mediastreamer2/src/nowebcamCIF.jpg delete mode 100644 linphone/mediastreamer2/src/oss.c delete mode 100644 linphone/mediastreamer2/src/pasnd.c delete mode 100644 linphone/mediastreamer2/src/pixconv.c delete mode 100644 linphone/mediastreamer2/src/rfc2429.h delete mode 100644 linphone/mediastreamer2/src/rfc3984.c delete mode 100644 linphone/mediastreamer2/src/sdlout.c delete mode 100644 linphone/mediastreamer2/src/sizeconv.c delete mode 100644 linphone/mediastreamer2/src/speexec.c delete mode 100644 linphone/mediastreamer2/src/swscale.h delete mode 100644 linphone/mediastreamer2/src/tee.c delete mode 100644 linphone/mediastreamer2/src/theora.c delete mode 100644 linphone/mediastreamer2/src/ulaw.c delete mode 100755 linphone/mediastreamer2/src/vfw-missing.h delete mode 100644 linphone/mediastreamer2/src/videodec.c delete mode 100644 linphone/mediastreamer2/src/videoenc.c delete mode 100644 linphone/mediastreamer2/src/videoout.c delete mode 100644 linphone/mediastreamer2/src/videostream.c delete mode 100644 linphone/mediastreamer2/src/void.c delete mode 100644 linphone/mediastreamer2/src/wincevideods.c delete mode 100644 linphone/mediastreamer2/src/winsnd.c delete mode 100755 linphone/mediastreamer2/src/winsnd2.c delete mode 100755 linphone/mediastreamer2/src/winsnd3.c delete mode 100644 linphone/mediastreamer2/src/winsndds.cpp delete mode 100644 linphone/mediastreamer2/src/winvideo.c delete mode 100755 linphone/mediastreamer2/src/winvideo2.c delete mode 100644 linphone/mediastreamer2/src/winvideods.c delete mode 100644 linphone/mediastreamer2/tests/.gitignore delete mode 100644 linphone/mediastreamer2/tests/Makefile.am delete mode 100644 linphone/mediastreamer2/tests/bench.c delete mode 100644 linphone/mediastreamer2/tests/echo.c delete mode 100644 linphone/mediastreamer2/tests/mediastream.c delete mode 100644 linphone/mediastreamer2/tests/mtudiscover.c delete mode 100644 linphone/mediastreamer2/tests/ring.c delete mode 100644 linphone/mediastreamer2/tests/videodisplay.c diff --git a/.gitmodules b/.gitmodules index fb753dd0f..98a346518 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "linphone/oRTP"] path = linphone/oRTP url = git://git.linphone.org/ortp.git +[submodule "linphone/mediastreamer2"] + path = linphone/mediastreamer2 + url = git://git.linphone.org/mediastreamer2.git diff --git a/linphone/mediastreamer2 b/linphone/mediastreamer2 new file mode 160000 index 000000000..d32cda045 --- /dev/null +++ b/linphone/mediastreamer2 @@ -0,0 +1 @@ +Subproject commit d32cda04540a3a2b0604a3184a5fec8dbc6d7b18 diff --git a/linphone/mediastreamer2/.gitignore b/linphone/mediastreamer2/.gitignore deleted file mode 100644 index 6be2672d9..000000000 --- a/linphone/mediastreamer2/.gitignore +++ /dev/null @@ -1,30 +0,0 @@ -*.la -*.lo -.deps -.libs -Makefile -Makefile.in -aclocal.m4 -autom4te.cache -compile -config.guess -config.h -config.h.in -config.log -config.status -config.sub -configure -depcomp -install-sh -intltool-extract -intltool-merge -intltool-update -libtool -ltmain.sh -mediastreamer-config.h -mediastreamer-config.h.in -mediastreamer.pc -mediastreamer2.spec -missing -mkinstalldirs -stamp-h1 diff --git a/linphone/mediastreamer2/.indent.pro b/linphone/mediastreamer2/.indent.pro deleted file mode 100644 index 0f9555875..000000000 --- a/linphone/mediastreamer2/.indent.pro +++ /dev/null @@ -1,4 +0,0 @@ --kr ---use-tabs ---tab-size4 - diff --git a/linphone/mediastreamer2/AUTHORS b/linphone/mediastreamer2/AUTHORS deleted file mode 100644 index ff6dbf174..000000000 --- a/linphone/mediastreamer2/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -Simon MORLAT \ No newline at end of file diff --git a/linphone/mediastreamer2/COPYING b/linphone/mediastreamer2/COPYING deleted file mode 100644 index d60c31a97..000000000 --- a/linphone/mediastreamer2/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/linphone/mediastreamer2/ChangeLog b/linphone/mediastreamer2/ChangeLog deleted file mode 100644 index e69de29bb..000000000 diff --git a/linphone/mediastreamer2/Makefile.am b/linphone/mediastreamer2/Makefile.am deleted file mode 100644 index fb246149b..000000000 --- a/linphone/mediastreamer2/Makefile.am +++ /dev/null @@ -1,54 +0,0 @@ - -EXTRA_DIST=mediastreamer-config.h.in pkg.list autogen.sh mediastreamer.pc.in mediastreamer2.spec.in mediastreamer2.spec Makefile.macosx - -SUBDIRS=src build include tests help - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = mediastreamer.pc - -## oRTP packaging methods: - -# `make rpm' - -.phony: rpm - -rpm: - $(MAKE) dist -# - TAR_OPTIONS=--wildcards rpmbuild -ta --clean --rmsource --rmspec $(PACKAGE)-$(VERSION).tar.gz - -# `make package' - -if WITH_EPM - -.PHONY: package - -PKG_NAME = $(PACKAGE)-$(VERSION)-$(RELEASE) -BUILDROOT=`pwd`/epm-install - -package: $(srcdir)/pkg.list $(srcdir)/configure - [ -n "$(BUILDROOT)" ] && rm -rf $(BUILDROOT)/* - [ -n "$(PKG_NAME).*" ] && rm -f $(PKG_NAME).* - $(MAKE) install DESTDIR=$(BUILDROOT) - $(MKEPMLIST) -u $(SYS_USER) -g $(SYS_GROUP) --prefix $(prefix) \ - $(BUILDROOT)/$(prefix) > files.list - $(EPM) -v -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 - rm -rf $(BUILDROOT) - 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 - -endif WITH_EPM diff --git a/linphone/mediastreamer2/Makefile.macosx b/linphone/mediastreamer2/Makefile.macosx deleted file mode 100644 index bff389626..000000000 --- a/linphone/mediastreamer2/Makefile.macosx +++ /dev/null @@ -1,76 +0,0 @@ -# MacOS X Temporary make file -# H.M 2007.05.23 - -SPEEXDIR = ../../../speex-1.2beta1 -GSMDIR = ../../../gsm-1.0-pl12 -ORTPDIR = ../../oRTP - -INCPATH = -I../include -I$(ORTPDIR)/include -I$(SPEEXDIR)/include -I$(GSMDIR)/inc/ -LIBPATH = -L. -L../../../gsm-1.0-pl12/lib -FRAMEWORK = -framework CoreAudio -framework AudioToolbox -framework Carbon -framework AudioUnit -CFLUGS = -g $(INCPATH) -DWORDS_BIGENDIAN -DDEBUG -#CFLUGS = $(INCPATH) -DWORDS_BIGENDIAN - - -LIBOBJ = mscommon.o msqueue.o msfilerec.o msfilter.o msspeex.o mssndcard.o alaw.o ulaw.o msconf.o msjoin.o msrtp.o ice.o tee.o gsm.o speexec.o audiostream.o msticker.o macsnd.o msfileplayer.o -DYLIB = libms.dylib - -all: echo - -echo: ../tests/echo.c $(DYLIB) - cc -c $(CFLUGS) ../tests/echo.c - cc -o echo $(FRAMEWORK) $(LIBPATH) echo.o $(DYLIB) -lortp -lspeex -lgsm - -clean: - rm -rf *.o *.dylib - -$(DYLIB): $(LIBOBJ) libortp.dylib libspeex.dylib - cc -o $(DYLIB) $(FRAMEWORK) -dynamiclib -compatibility_version 1 -current_version 1 $(LIBOBJ) $(LIBPATH) -lortp -lspeex -lgsm - -libortp.dylib: - cp $(ORTPDIR)/src/.libs/libortp.dylib . - install_name_tool -id @executable_path/libortp.dylib libortp.dylib - -libspeex.dylib: - cp $(SPEEXDIR)/libspeex/.libs/libspeex.dylib . - install_name_tool -id @executable_path/libspeex.dylib libspeex.dylib - -msfileplayer.o: msfileplayer.c - gcc -c $(CFLUGS) msfileplayer.c -msticker.o: msticker.c - gcc -c $(CFLUGS) msticker.c -audiostream.o: audiostream.c - gcc -c $(CFLUGS) audiostream.c -speexec.o: speexec.c - gcc -c $(CFLUGS) speexec.c -gsm.o: gsm.c - gcc -c $(CFLUGS) gsm.c -tee.o: tee.c - gcc -c $(CFLUGS) tee.c -ice.o: ice.c - gcc -c $(CFLUGS) ice.c -msrtp.o: msrtp.c - gcc -c $(CFLUGS) msrtp.c -msjoin.o: msjoin.c - gcc -c $(CFLUGS) msjoin.c -msconf.o: msconf.c - gcc -c $(CFLUGS) msconf.c -msfilter.o: msfilter.c - gcc -c $(CFLUGS) msfilter.c -alaw.o: alaw.c - gcc -c $(CFLUGS) alaw.c -ulaw.o: ulaw.c - gcc -c $(CFLUGS) ulaw.c -msfilerec.o: msfilerec.c - gcc -c $(CFLUGS) msfilerec.c -msspeex.o: msspeex.c - gcc -c $(CFLUGS) msspeex.c -mssndcard.o: mssndcard.c - gcc -c $(CFLUGS) mssndcard.c -msqueue.o: msqueue.c - gcc -c $(CFLUGS) msqueue.c -macsnd.o: macsnd.c - gcc -c $(CFLUGS) macsnd.c - -mscommon.o: mscommon.c - gcc -c $(CFLUGS) -DPACKAGE_PLUGINS_DIR=\".\" mscommon.c diff --git a/linphone/mediastreamer2/NEWS b/linphone/mediastreamer2/NEWS deleted file mode 100644 index 0b4abfc4b..000000000 --- a/linphone/mediastreamer2/NEWS +++ /dev/null @@ -1,56 +0,0 @@ -mediastreamer-2.3.2: ???????? - * use libv4l2 when possible to benefit from hardware pixel conversion - * added jpeg over RTP support - -mediastreamer-2.3.1: October 5, 2009 - * preserve ratio in windows video display (not yet implemented for linux/SDL) - -mediastreamer-2.3.0: September 17, 2009 - * integrate directshow capture filter for mingw (was a plugin before) - * builds on windows with mingw/msys using ./configure && make (see linphone's README.mingw) - * new parametric equalizer filter (to modify gains per frequency bands), working with natural curves - * new noise-gate feature added to MSVolume - * list of soundcard dynamically updates on windows upon device plugs/unplugs - * MSVolume echo limiter feature improved - -mediastreamer-2.2.4: May 4, 2009 - * fix crash during video window resizing on windows - * improve documentation - * various little improvements - -mediastreamer-2.2.3: 21, January 2009 - * rfc3984 support improved - * webcam support on windows largely improved (vfw mode) - * support for configuring video size up to svga - * video output can automatically resize to the size of received video stream - * fix crash when resizing video window - * new MSWebcam object to provide Webcam management and MSFilter instantiation - * alsa bugfixes - -mediastreamer-2.2.2: 6, october 2008 - * new winsnd3.c file for support of soundcard under windows (seems to work a bit better) - * bugfixes - -mediastreamer-2.2.1: 25, january 2008 - * video output resizing - * 4CIF and VGA support - * bugfixes - * added snow codec (experimental) - * enable setting of max rtp payload size for all encoders - -mediastreamer-2.2.0: 19, November 2007 - * new "no webcam" screen - * bandwidth settings improvements - * new REQ_VFU command to request a video encoder to send an I-frame - (implemented for ffmpeg based encoders) - * contributed macosx sound support - * new MSVolume filter to make sound power measurements - * rate control of ffmpeg video codecs - -mediastreamer-2.1.0: 23, January 2007 - * add support for Video4Linux V2 cameras - * support for mpjeg cameras - * webcam support on windows operational - * video window display ok on windows - * fix bug with quickcam driver on linux - * bandwidth setting improvements. diff --git a/linphone/mediastreamer2/README b/linphone/mediastreamer2/README deleted file mode 100644 index bf67fab8a..000000000 --- a/linphone/mediastreamer2/README +++ /dev/null @@ -1,99 +0,0 @@ -Project : mediastreamer2 - a modular sound and video processing and streaming -Email : simon.morlat_at_linphone.org -License : GPL -Home Page : http://savannah.gnu.org/projects/linphone - -Mediastreamer2 is a GPL licensed library to make audio and -video real-time streaming and processing. Written in pure C, -it is based upon the ortp library. - -Design: ------- - -Using mediastreamer2 will allow you to chain filters in a graph. Each -filter will be responsible for doing some kind of processing and will -deliver data to the next filter. As an example, you could get some -data from network and unpack it in an RTP filter. This RTP filter will -deliver the data to a decoder (speex, G711...) which will deliver it -to a filter that is able to play the PCM data or record it into a .wav -file. - -There is a doxygen documentation for more information. - -Features: --------- - -mediastreamer2 already provides a large set of filters. -Here is a complete list of built-in filters. - - All supported platforms: - * RTP receiver - * RTP sender - * tee (duplicate data) - - Audio Filters: - * audio capture - * audio playback - * mme API (windows) - * alsa API (linux) - * oss API (linux) - * arts API (linux) - * portaudio API (macosx and other) - * macsnd API (native macosx API -please do more testing...-) - * aq (audio queue, macos API too) - * several audio encoder/decoder: PCMU, PCMA, speex, gsm - * wav file reader. - * wav file recorder. - * resampler. - * conference bridge. - * volume analyser, gain control, and automatic gain control. - * acoustic echo canceller. - * dtmf generation filter. - * parametric equalizer, can be used to compensate the spectral response of a bad quality speaker or microphone - - Video Filters: - * video capture - * v4w API (windows, deprecated) - * directshow API (windows) - * video4linux and video4linux2 APIs (linux) - * video display - * v4w API (windows) - * SDL API (linux, macosx...) - * several audio encoder/decoder: H263-1998, MP4V-ES, theora - * image resizer. - * format converter. (RBG24, I420...) - - Plugin Filters: - * iLBC decoder/encoder. - * H264 codec, based on x264 - - -Note that, you can build your own components/filters to do your -own processing or support other codecs. - -Installation procedure: ------------------------ - -The program is known to run on linux, but might work -on any unix and windows systems. - - $> ./configure - $> make - $> su -c 'make install' - -Contact information: --------------------- - -For more information on mediastreamer2, any contributions, or any remarks, -you can contact me at . - -Use the *linphone* mailing list for question about mediastreamer2. - . - -Subscribe by writing to: - with a subject set to "subscribe". - -Commercial support and licensing is provided by Belledonne Communications -http://www.belledonne-communications.com - - diff --git a/linphone/mediastreamer2/acinclude.m4 b/linphone/mediastreamer2/acinclude.m4 deleted file mode 100644 index 98f1b4687..000000000 --- a/linphone/mediastreamer2/acinclude.m4 +++ /dev/null @@ -1,180 +0,0 @@ -dnl -*- autoconf -*- -AC_DEFUN([MS_CHECK_DEP],[ - dnl $1=dependency description - dnl $2=dependency short name, will be suffixed with _CFLAGS and _LIBS - dnl $3=headers's place - dnl $4=lib's place - dnl $5=header to check - dnl $6=lib to check - dnl $7=function to check in library - - dep_name=$2 - dep_headersdir=$3 - dep_libsdir=$4 - dep_header=$5 - dep_lib=$6 - dep_funclib=$7 - other_libs=$8 - - CPPFLAGS_save=$CPPFLAGS - LDFLAGS_save=$LDFLAGS - LIBS_save=$LIBS - - case "$target_os" in - *mingw*) - ms_check_dep_mingw_found=yes - ;; - esac - if test "$ms_check_dep_mingw_found" != "yes" ; then - CPPFLAGS=`echo "-I$dep_headersdir"|sed -e "s:-I/usr/include[\ ]*$::"` - LDFLAGS=`echo "-L$dep_libsdir"|sed -e "s:-L/usr/lib\(64\)*[\ ]*::"` - else - CPPFLAGS="-I$dep_headersdir" - LDFLAGS="-L$dep_libsdir" - fi - - - LIBS="-l$dep_lib" - - - $2_CFLAGS="$CPPFLAGS" - $2_LIBS="$LDFLAGS $LIBS" - - AC_CHECK_HEADERS([$dep_header],[AC_CHECK_LIB([$dep_lib],[$dep_funclib],found=yes,found=no, [$other_libs]) - ],found=no) - - if test "$found" = "yes" ; then - eval $2_found=yes - else - eval $2_found=no - eval $2_CFLAGS= - eval $2_LIBS= - fi - AC_SUBST($2_CFLAGS) - AC_SUBST($2_LIBS) - CPPFLAGS=$CPPFLAGS_save - LDFLAGS=$LDFLAGS_save - LIBS=$LIBS_save -]) - - -AC_DEFUN([MS_CHECK_VIDEO],[ - - dnl conditionnal build of video support - AC_ARG_ENABLE(video, - [ --enable-video Turn on video support compiling], - [case "${enableval}" in - yes) video=true ;; - no) video=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-video) ;; - esac],[video=true]) - - AC_ARG_WITH( ffmpeg, - [ --with-ffmpeg Sets the installation prefix of ffmpeg, needed for video support. [default=/usr] ], - [ ffmpegdir=${withval}],[ ffmpegdir=/usr ]) - - if test "$video" = "true"; then - - dnl test for ffmpeg presence - PKG_CHECK_MODULES(FFMPEG, [libavcodec >= 51.0.0 ],ffmpeg_found=yes , ffmpeg_found=no) - if test x$ffmpeg_found = xno ; then - AC_MSG_ERROR([Could not find libavcodec (from ffmpeg) headers and library. This is mandatory for video support]) - fi - PKG_CHECK_MODULES(SWSCALE, [libswscale >= 0.7.0 ],swscale_found=yes , swscale_found=no) - if test x$swscale_found = xno ; then - AC_MSG_ERROR([Could not find libswscale (from ffmpeg) headers and library. This is mandatory for video support]) - fi - - dnl check for new/old ffmpeg header file layout - CPPFLAGS_save=$CPPFLAGS - CPPFLAGS="$FFMPEG_CFLAGS $CPPFLAGS" - AC_CHECK_HEADERS(libavcodec/avcodec.h) - CPPFLAGS=$CPPFLAGS_save - - dnl to workaround a bug on debian and ubuntu, check if libavcodec needs -lvorbisenc to compile - AC_CHECK_LIB(avcodec,avcodec_register_all, novorbis=yes , [ - LIBS="$LIBS -lvorbisenc" - ], $FFMPEG_LIBS ) - - dnl when swscale feature is not provided by - dnl libswscale, its features are swallowed by - dnl libavcodec, but without swscale.h and without any - dnl declaration into avcodec.h (this is to be - dnl considered as an ffmpeg bug). - dnl - dnl #if defined(HAVE_LIBAVCODEC_AVCODEC_H) && !defined(HAVE_LIBSWSCALE_SWSCALE_H) - dnl # include "swscale.h" // private linhone swscale.h - dnl #endif - CPPFLAGS_save=$CPPFLAGS - CPPFLAGS="$SWSCALE_CFLAGS $CPPFLAGS" - AC_CHECK_HEADERS(libswscale/swscale.h) - CPPFLAGS=$CPPFLAGS_save - - AC_ARG_ENABLE(sdl, - [ --disable-sdl Disable SDL support], - [case "${enableval}" in - yes) enable_sdl=true ;; - no) enable_sdl=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --disable-sdl) ;; - esac],[enable_sdl=true]) - - sdl_found=no - if test "$enable_sdl" = "true"; then - PKG_CHECK_MODULES(SDL, [sdl >= 1.2.0 ],sdl_found=yes,sdl_found=no) - - if test "$sdl_found" = "no" && test "$mingw_found" != "yes"; then - AC_MSG_ERROR([Could not find libsdl headers and library. This is mandatory for video support]) - fi - fi - - AC_ARG_ENABLE(theora, - [ --disable-theora Disable theora support], - [case "${enableval}" in - yes) theora=true ;; - no) theora=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --disable-theora) ;; - esac],[theora=true]) - - if test x$theora = xtrue; then - PKG_CHECK_MODULES(THEORA, [theora >= 1.0alpha7 ], [have_theora=yes], - [have_theora=no]) - fi - - AC_ARG_ENABLE(x11, - [ --disable-x11 Disable X11 support], - [case "${enableval}" in - yes) enable_x11=true ;; - no) enable_x11=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --disable-x11) ;; - esac],[enable_x11=true]) - - if test "$enable_x11" = "true"; then - AC_CHECK_HEADERS(X11/Xlib.h) - fi - - VIDEO_CFLAGS=" $FFMPEG_CFLAGS -DVIDEO_ENABLED" - VIDEO_LIBS=" $FFMPEG_LIBS $SWSCALE_LIBS" - - if test "$sdl_found" = "yes" ; then - VIDEO_CFLAGS="$VIDEO_CFLAGS $SDL_CFLAGS -DHAVE_SDL" - VIDEO_LIBS="$VIDEO_LIBS $SDL_LIBS" - fi - - if test "${ac_cv_header_X11_Xlib_h}" = "yes" ; then - VIDEO_LIBS="$VIDEO_LIBS -lX11" - fi - - if test "$mingw_found" = "yes" ; then - VIDEO_LIBS="$VIDEO_LIBS -lvfw32" - fi - - case $target_os in - *darwin*) - LIBS="$LIBS -framework QuickTime" - ;; - esac - fi - - AC_SUBST(VIDEO_CFLAGS) - AC_SUBST(VIDEO_LIBS) -]) diff --git a/linphone/mediastreamer2/autogen.sh b/linphone/mediastreamer2/autogen.sh deleted file mode 100755 index f88915e64..000000000 --- a/linphone/mediastreamer2/autogen.sh +++ /dev/null @@ -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 - -echo "Generating build scripts in mediastreamer..." -set -x -$LIBTOOLIZE --copy --force -$ACLOCAL $ACLOCAL_ARGS -autoheader -$AUTOMAKE --force-missing --add-missing --copy -autoconf - diff --git a/linphone/mediastreamer2/build/.gitignore b/linphone/mediastreamer2/build/.gitignore deleted file mode 100644 index 3dda72986..000000000 --- a/linphone/mediastreamer2/build/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile.in -Makefile diff --git a/linphone/mediastreamer2/build/Makefile.am b/linphone/mediastreamer2/build/Makefile.am deleted file mode 100755 index 7d64e0e78..000000000 --- a/linphone/mediastreamer2/build/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS= win32native win32-novideo wince winmob diff --git a/linphone/mediastreamer2/build/win32-novideo/.gitignore b/linphone/mediastreamer2/build/win32-novideo/.gitignore deleted file mode 100644 index 3dda72986..000000000 --- a/linphone/mediastreamer2/build/win32-novideo/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile.in -Makefile diff --git a/linphone/mediastreamer2/build/win32-novideo/Makefile.am b/linphone/mediastreamer2/build/win32-novideo/Makefile.am deleted file mode 100755 index b8a8dc25a..000000000 --- a/linphone/mediastreamer2/build/win32-novideo/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -EXTRA_DIST=alldescs.h mediastreamer2.vcproj mediastream.vcproj mediastreamer2.def - diff --git a/linphone/mediastreamer2/build/win32-novideo/alldescs.h b/linphone/mediastreamer2/build/win32-novideo/alldescs.h deleted file mode 100755 index 146f85da8..000000000 --- a/linphone/mediastreamer2/build/win32-novideo/alldescs.h +++ /dev/null @@ -1,70 +0,0 @@ -#include "mediastreamer2/msfilter.h" - -extern MSFilterDesc ms_alaw_dec_desc; -extern MSFilterDesc ms_alaw_enc_desc; -extern MSFilterDesc ms_ulaw_dec_desc; -extern MSFilterDesc ms_ulaw_enc_desc; -extern MSFilterDesc ms_file_player_desc; -extern MSFilterDesc ms_rtp_send_desc; -extern MSFilterDesc ms_rtp_recv_desc; -extern MSFilterDesc ms_dtmf_gen_desc; -extern MSFilterDesc ms_file_rec_desc; -extern MSFilterDesc ms_speex_dec_desc; -extern MSFilterDesc ms_speex_enc_desc; -extern MSFilterDesc ms_gsm_dec_desc; -extern MSFilterDesc ms_gsm_enc_desc; -extern MSFilterDesc ms_speex_ec_desc; -extern MSFilterDesc ms_tee_desc; -extern MSFilterDesc ms_conf_desc; -//extern MSFilterDesc alsa_write_desc; -//extern MSFilterDesc alsa_read_desc; -//extern MSFilterDesc oss_read_desc; -//extern MSFilterDesc oss_write_desc; -//extern MSFilterDesc ms_arts_read_desc; -//extern MSFilterDesc ms_arts_write_desc; -//extern MSFilterDesc ms_v4l_desc; -//extern MSFilterDesc ms_sdl_out_desc; -//extern MSFilterDesc ms_h263_enc_desc; -//extern MSFilterDesc ms_h263_dec_desc; -extern MSFilterDesc ms_join_desc; -extern MSFilterDesc ms_resample_desc; -extern MSFilterDesc ms_volume_desc; -extern MSFilterDesc ms_ice_desc; -extern MSFilterDesc ms_equalizer_desc; -MSFilterDesc * ms_filter_descs[]={ -&ms_alaw_dec_desc, -&ms_alaw_enc_desc, -&ms_ulaw_dec_desc, -&ms_ulaw_enc_desc, -&ms_file_player_desc, -&ms_rtp_send_desc, -&ms_rtp_recv_desc, -&ms_dtmf_gen_desc, -&ms_file_rec_desc, -&ms_speex_dec_desc, -&ms_speex_enc_desc, -&ms_gsm_dec_desc, -&ms_gsm_enc_desc, -&ms_speex_ec_desc, -&ms_tee_desc, -&ms_conf_desc, -//&alsa_write_desc, -//&alsa_read_desc, -//&oss_read_desc, -//&oss_write_desc, -//&ms_arts_read_desc, -//&ms_arts_write_desc, -//&ms_v4l_desc, -//&ms_sdl_out_desc, -//&ms_h263_enc_desc, -//&ms_h263_dec_desc, -&ms_join_desc, -#ifndef DISABLE_RESAMPLE -&ms_resample_desc, -#endif -&ms_volume_desc, -&ms_ice_desc, -&ms_equalizer_desc, -NULL -}; - diff --git a/linphone/mediastreamer2/build/win32-novideo/mediastream.vcproj b/linphone/mediastreamer2/build/win32-novideo/mediastream.vcproj deleted file mode 100755 index b44c28431..000000000 --- a/linphone/mediastreamer2/build/win32-novideo/mediastream.vcproj +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/linphone/mediastreamer2/build/win32-novideo/mediastreamer2.def b/linphone/mediastreamer2/build/win32-novideo/mediastreamer2.def deleted file mode 100755 index 8287deb3b..000000000 --- a/linphone/mediastreamer2/build/win32-novideo/mediastreamer2.def +++ /dev/null @@ -1,82 +0,0 @@ -LIBRARY mediastreamer2 - -EXPORTS - - ms_init - ms_exit - - ms_filter_new - ms_filter_new_from_desc - ms_filter_destroy - ms_filter_create_encoder - ms_filter_create_decoder - ms_filter_call_method - ms_filter_call_method_noarg - ms_filter_link - ms_filter_unlink - ms_filter_preprocess - ms_filter_postprocess - ms_filter_codec_supported - ms_filter_register - ms_filter_new_from_name - ms_filter_set_notify_callback - - ms_snd_card_new - ms_snd_card_manager_destroy - ms_snd_card_manager_reload - ms_snd_card_manager_add_card - ms_snd_card_manager_register_desc - ms_snd_card_create_reader - ms_snd_card_create_writer - ms_snd_card_get_name - ms_snd_card_get_string_id - ms_snd_card_manager_get - ms_snd_card_manager_get_default_card - ms_snd_card_manager_get_default_capture_card - ms_snd_card_manager_get_default_playback_card - ms_snd_card_manager_get_card - ms_snd_card_manager_get_list - ms_snd_card_dup - ms_snd_card_destroy - ms_snd_card_set_level - ms_snd_card_get_level - ms_snd_card_set_capture - ms_snd_card_set_control - ms_snd_card_get_control - - ms_ticker_new - ms_ticker_set_name - ms_ticker_destroy - ms_ticker_attach - ms_ticker_detach - ms_ticker_set_time_func - ms_ticker_print_graphs - - ms_bufferizer_init - ms_bufferizer_uninit - ms_bufferizer_read - ms_bufferizer_put - ms_bufferizer_put_from_queue - - audio_stream_start - audio_stream_stop - audio_stream_free - create_duplex_rtpsession - - ms_load_plugins - - ms_is_ipv6 - - ms_sleep - - ms_queue_init - ms_queue_flush - - ms_list_free - ms_list_for_each - ms_list_append - ms_list_remove - - ms_discover_mtu - ms_set_mtu - \ No newline at end of file diff --git a/linphone/mediastreamer2/build/win32-novideo/mediastreamer2.vcproj b/linphone/mediastreamer2/build/win32-novideo/mediastreamer2.vcproj deleted file mode 100755 index e57e5b06f..000000000 --- a/linphone/mediastreamer2/build/win32-novideo/mediastreamer2.vcproj +++ /dev/null @@ -1,416 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/linphone/mediastreamer2/build/win32native/.gitignore b/linphone/mediastreamer2/build/win32native/.gitignore deleted file mode 100644 index 3dda72986..000000000 --- a/linphone/mediastreamer2/build/win32native/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile.in -Makefile diff --git a/linphone/mediastreamer2/build/win32native/Makefile.am b/linphone/mediastreamer2/build/win32native/Makefile.am deleted file mode 100755 index 82fc5635a..000000000 --- a/linphone/mediastreamer2/build/win32native/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -EXTRA_DIST=alldescs.h mediastreamer2.vcproj mediastream.vcproj videodisplay.vcproj mediastreamer2.def - diff --git a/linphone/mediastreamer2/build/win32native/alldescs.h b/linphone/mediastreamer2/build/win32native/alldescs.h deleted file mode 100755 index a83db96ee..000000000 --- a/linphone/mediastreamer2/build/win32native/alldescs.h +++ /dev/null @@ -1,90 +0,0 @@ -#include "mediastreamer2/msfilter.h" - -extern MSFilterDesc ms_alaw_dec_desc; -extern MSFilterDesc ms_alaw_enc_desc; -extern MSFilterDesc ms_ulaw_dec_desc; -extern MSFilterDesc ms_ulaw_enc_desc; -extern MSFilterDesc ms_file_player_desc; -extern MSFilterDesc ms_rtp_send_desc; -extern MSFilterDesc ms_rtp_recv_desc; -extern MSFilterDesc ms_dtmf_gen_desc; -extern MSFilterDesc ms_file_rec_desc; -extern MSFilterDesc ms_speex_dec_desc; -extern MSFilterDesc ms_speex_enc_desc; -extern MSFilterDesc ms_gsm_dec_desc; -extern MSFilterDesc ms_gsm_enc_desc; -extern MSFilterDesc ms_speex_ec_desc; -extern MSFilterDesc ms_tee_desc; -extern MSFilterDesc ms_void_sink_desc; -extern MSFilterDesc ms_conf_desc; -extern MSFilterDesc ms_v4w_desc; -extern MSFilterDesc ms_video_out_desc; -extern MSFilterDesc ms_h263_enc_desc; -extern MSFilterDesc ms_h263_dec_desc; -extern MSFilterDesc ms_h263_old_enc_desc; -extern MSFilterDesc ms_h263_old_dec_desc; -extern MSFilterDesc ms_mpeg4_enc_desc; -extern MSFilterDesc ms_mpeg4_dec_desc; -extern MSFilterDesc ms_snow_enc_desc; -extern MSFilterDesc ms_snow_dec_desc; -extern MSFilterDesc ms_theora_enc_desc; -extern MSFilterDesc ms_theora_dec_desc; -extern MSFilterDesc ms_mjpeg_enc_desc; -extern MSFilterDesc ms_mjpeg_dec_desc; -extern MSFilterDesc ms_size_conv_desc; -extern MSFilterDesc ms_pix_conv_desc; -extern MSFilterDesc ms_join_desc; -extern MSFilterDesc ms_resample_desc; -extern MSFilterDesc ms_volume_desc; -extern MSFilterDesc ms_static_image_desc; -extern MSFilterDesc ms_mire_desc; -extern MSFilterDesc ms_vfw_desc; -extern MSFilterDesc ms_ice_desc; -extern MSFilterDesc ms_equalizer_desc; -MSFilterDesc * ms_filter_descs[]={ -&ms_alaw_dec_desc, -&ms_alaw_enc_desc, -&ms_ulaw_dec_desc, -&ms_ulaw_enc_desc, -&ms_file_player_desc, -&ms_rtp_send_desc, -&ms_rtp_recv_desc, -&ms_dtmf_gen_desc, -&ms_file_rec_desc, -&ms_speex_dec_desc, -&ms_speex_enc_desc, -&ms_gsm_dec_desc, -&ms_gsm_enc_desc, -&ms_speex_ec_desc, -&ms_tee_desc, -&ms_void_sink_desc, -&ms_conf_desc, -&ms_v4w_desc, -&ms_video_out_desc, -&ms_h263_old_enc_desc, -&ms_h263_old_dec_desc, -&ms_h263_enc_desc, -&ms_h263_dec_desc, -&ms_mpeg4_enc_desc, -&ms_mpeg4_dec_desc, -&ms_snow_enc_desc, -&ms_snow_dec_desc, -&ms_theora_enc_desc, -&ms_theora_dec_desc, -&ms_mjpeg_enc_desc, -&ms_mjpeg_dec_desc, -&ms_size_conv_desc, -&ms_pix_conv_desc, -&ms_join_desc, -#ifndef NORESAMPLE -&ms_resample_desc, -#endif -&ms_volume_desc, -&ms_static_image_desc, -&ms_mire_desc, -&ms_vfw_desc, -&ms_ice_desc, -&ms_equalizer_desc, -NULL -}; - diff --git a/linphone/mediastreamer2/build/win32native/mediastream.vcproj b/linphone/mediastreamer2/build/win32native/mediastream.vcproj deleted file mode 100755 index 1dd3ec7b0..000000000 --- a/linphone/mediastreamer2/build/win32native/mediastream.vcproj +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/linphone/mediastreamer2/build/win32native/mediastreamer2.def b/linphone/mediastreamer2/build/win32native/mediastreamer2.def deleted file mode 100755 index e13dd8674..000000000 --- a/linphone/mediastreamer2/build/win32native/mediastreamer2.def +++ /dev/null @@ -1,117 +0,0 @@ -LIBRARY mediastreamer2 - -EXPORTS - - ms_init - ms_exit - - ms_filter_new - ms_filter_new_from_desc - ms_filter_destroy - ms_filter_create_encoder - ms_filter_create_decoder - ms_filter_call_method - ms_filter_call_method_noarg - ms_filter_link - ms_filter_unlink - ms_filter_preprocess - ms_filter_postprocess - ms_filter_codec_supported - ms_filter_register - ms_filter_new_from_name - ms_filter_set_notify_callback - - ms_snd_card_new - ms_snd_card_manager_destroy - ms_snd_card_manager_reload - ms_snd_card_manager_add_card - ms_snd_card_manager_register_desc - ms_snd_card_create_reader - ms_snd_card_create_writer - ms_snd_card_get_name - ms_snd_card_get_string_id - ms_snd_card_manager_get - ms_snd_card_manager_get_default_card - ms_snd_card_manager_get_default_capture_card - ms_snd_card_manager_get_default_playback_card - ms_snd_card_manager_get_card - ms_snd_card_manager_get_list - ms_snd_card_dup - ms_snd_card_destroy - ms_snd_card_set_level - ms_snd_card_get_level - ms_snd_card_set_capture - ms_snd_card_set_control - ms_snd_card_get_control - - ms_ticker_new - ms_ticker_set_name - ms_ticker_destroy - ms_ticker_attach - ms_ticker_detach - ms_ticker_set_time_func - ms_ticker_print_graphs - - ms_bufferizer_init - ms_bufferizer_uninit - ms_bufferizer_read - ms_bufferizer_put - ms_bufferizer_put_from_queue - - audio_stream_start - audio_stream_stop - audio_stream_free - create_duplex_rtpsession - - ms_load_plugins - - ms_display_new - ms_display_set_window_id - ms_display_desc_set_default - ms_display_destroy - - video_preview_stop - video_preview_start - video_stream_new - video_stream_start - video_stream_stop - video_stream_iterate - video_stream_set_sent_video_size - - ms_is_ipv6 - - yuv_buf_alloc - yuv_buf_init_from_mblk - yuv_buf_init_from_mblk_with_size - - ms_sleep - - ms_queue_init - ms_queue_flush - - rfc3984_init - rfc3984_uninit - rfc3984_pack - rfc3984_unpack - rfc3984_set_mode - - ms_list_free - ms_list_for_each - ms_list_append - ms_list_remove - - ms_discover_mtu - ms_set_mtu - - ms_web_cam_new - ms_web_cam_manager_reload - ms_web_cam_manager_get_default_cam - ms_web_cam_manager_get - ms_web_cam_manager_get_list - ms_web_cam_manager_get_cam - ms_web_cam_manager_add_cam - ms_web_cam_manager_register_desc - ms_web_cam_create_reader - ms_web_cam_get_driver_type - ms_web_cam_get_name - ms_web_cam_get_string_id diff --git a/linphone/mediastreamer2/build/win32native/mediastreamer2.vcproj b/linphone/mediastreamer2/build/win32native/mediastreamer2.vcproj deleted file mode 100755 index 93dd6356a..000000000 --- a/linphone/mediastreamer2/build/win32native/mediastreamer2.vcproj +++ /dev/null @@ -1,504 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/linphone/mediastreamer2/build/win32native/videodisplay.vcproj b/linphone/mediastreamer2/build/win32native/videodisplay.vcproj deleted file mode 100755 index 5784ff317..000000000 --- a/linphone/mediastreamer2/build/win32native/videodisplay.vcproj +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/linphone/mediastreamer2/build/wince/.gitignore b/linphone/mediastreamer2/build/wince/.gitignore deleted file mode 100644 index 282522db0..000000000 --- a/linphone/mediastreamer2/build/wince/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/linphone/mediastreamer2/build/wince/Makefile.am b/linphone/mediastreamer2/build/wince/Makefile.am deleted file mode 100755 index 07d97c86e..000000000 --- a/linphone/mediastreamer2/build/wince/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -EXTRA_DIST=alldescs.h mediastreamer2.vcproj mediastreamer2.def - diff --git a/linphone/mediastreamer2/build/wince/alldescs.h b/linphone/mediastreamer2/build/wince/alldescs.h deleted file mode 100644 index e5e179401..000000000 --- a/linphone/mediastreamer2/build/wince/alldescs.h +++ /dev/null @@ -1,68 +0,0 @@ -#include "mediastreamer2/msfilter.h" - -extern MSFilterDesc ms_alaw_dec_desc; -extern MSFilterDesc ms_alaw_enc_desc; -extern MSFilterDesc ms_ulaw_dec_desc; -extern MSFilterDesc ms_ulaw_enc_desc; -extern MSFilterDesc ms_file_player_desc; -extern MSFilterDesc ms_rtp_send_desc; -extern MSFilterDesc ms_rtp_recv_desc; -extern MSFilterDesc ms_dtmf_gen_desc; -extern MSFilterDesc ms_file_rec_desc; -extern MSFilterDesc ms_speex_dec_desc; -extern MSFilterDesc ms_speex_enc_desc; -//extern MSFilterDesc ms_gsm_dec_desc; -//extern MSFilterDesc ms_gsm_enc_desc; -extern MSFilterDesc ms_speex_ec_desc; -extern MSFilterDesc ms_tee_desc; -extern MSFilterDesc ms_conf_desc; -//extern MSFilterDesc alsa_write_desc; -//extern MSFilterDesc alsa_read_desc; -//extern MSFilterDesc oss_read_desc; -//extern MSFilterDesc oss_write_desc; -//extern MSFilterDesc ms_arts_read_desc; -//extern MSFilterDesc ms_arts_write_desc; -//extern MSFilterDesc ms_v4l_desc; -//extern MSFilterDesc ms_sdl_out_desc; -//extern MSFilterDesc ms_h263_enc_desc; -//extern MSFilterDesc ms_h263_dec_desc; -extern MSFilterDesc ms_join_desc; -extern MSFilterDesc ms_resample_desc; -extern MSFilterDesc ms_volume_desc; -extern MSFilterDesc ms_ice_desc; -extern MSFilterDesc ms_void_sink_desc; -MSFilterDesc * ms_filter_descs[]={ -&ms_alaw_dec_desc, -&ms_alaw_enc_desc, -&ms_ulaw_dec_desc, -&ms_ulaw_enc_desc, -&ms_file_player_desc, -&ms_rtp_send_desc, -&ms_rtp_recv_desc, -&ms_dtmf_gen_desc, -&ms_file_rec_desc, -&ms_speex_dec_desc, -&ms_speex_enc_desc, -//&ms_gsm_dec_desc, -//&ms_gsm_enc_desc, -&ms_speex_ec_desc, -&ms_tee_desc, -&ms_conf_desc, -//&alsa_write_desc, -//&alsa_read_desc, -//&oss_read_desc, -//&oss_write_desc, -//&ms_arts_read_desc, -//&ms_arts_write_desc, -//&ms_v4l_desc, -//&ms_sdl_out_desc, -//&ms_h263_enc_desc, -//&ms_h263_dec_desc, -&ms_join_desc, -&ms_resample_desc, -&ms_volume_desc, -&ms_ice_desc, -&ms_void_sink_desc, -NULL -}; - diff --git a/linphone/mediastreamer2/build/wince/mediastreamer2.def b/linphone/mediastreamer2/build/wince/mediastreamer2.def deleted file mode 100644 index 80dad5f0b..000000000 --- a/linphone/mediastreamer2/build/wince/mediastreamer2.def +++ /dev/null @@ -1,129 +0,0 @@ -LIBRARY mediastreamer2 - -EXPORTS - - ms_init - ms_exit - - ms_filter_new - ms_filter_new_from_desc - ms_filter_destroy - ms_filter_create_encoder - ms_filter_create_decoder - ms_filter_call_method - ms_filter_call_method_noarg - ms_filter_link - ms_filter_unlink - ms_filter_preprocess - ms_filter_postprocess - ms_filter_codec_supported - ms_filter_register - ms_filter_new_from_name - ms_filter_set_notify_callback - ms_filter_get_encoder - - ms_snd_card_new - ms_snd_card_manager_destroy - ms_snd_card_manager_reload - ms_snd_card_manager_add_card - ms_snd_card_manager_register_desc - ms_snd_card_create_reader - ms_snd_card_create_writer - ms_snd_card_get_name - ms_snd_card_get_string_id - ms_snd_card_manager_get - ms_snd_card_manager_get_default_card - ms_snd_card_manager_get_default_capture_card - ms_snd_card_manager_get_default_playback_card - ms_snd_card_manager_get_card - ms_snd_card_manager_get_list - ms_snd_card_dup - ms_snd_card_destroy - ms_snd_card_set_level - ms_snd_card_get_level - ms_snd_card_set_capture - ms_snd_card_set_control - ms_snd_card_get_control - - ms_web_cam_new - ms_web_cam_manager_reload - ms_web_cam_manager_get_default_cam - ms_web_cam_manager_get - ms_web_cam_manager_get_list - ms_web_cam_manager_get_cam - ms_web_cam_manager_add_cam - ms_web_cam_manager_register_desc - ms_web_cam_create_reader - ms_web_cam_get_driver_type - ms_web_cam_get_name - ms_web_cam_get_string_id - - ms_ticker_new - ms_ticker_set_name - ms_ticker_destroy - ms_ticker_attach - ms_ticker_detach - ms_ticker_set_time_func - ms_ticker_print_graphs - - - ms_bufferizer_init - ms_bufferizer_uninit - ms_bufferizer_read - ms_bufferizer_put - ms_bufferizer_put_from_queue - - ms_queue_init - ms_queue_flush - - rfc3984_init - rfc3984_uninit - rfc3984_pack - rfc3984_unpack - rfc3984_set_mode - - ms_load_plugins - - audio_stream_start - audio_stream_alive - audio_stream_enable_automatic_gain_control - audio_stream_set_echo_canceler_params - audio_stream_enable_gain_control - audio_stream_enable_echo_limiter - audio_stream_new - audio_stream_set_rtcp_information - audio_stream_start_with_files - audio_stream_start_now - audio_stream_set_relay_session_id - audio_stream_play_received_dtmfs - audio_stream_set_mic_gain - audio_stream_stop - audio_stream_play - audio_stream_record - ms_snd_card_get_capabilities - ring_start_with_cb - ring_start - ring_stop - audio_stream_send_dtmf - ms_discover_mtu - ms_set_mtu - - ms_list_append - ms_list_remove - ms_list_free - ms_list_for_each - ms_list_find - ms_list_for_each2 - ms_list_find_custom - ms_list_size - ms_list_nth_data - ms_list_remove_link - ms_list_index - ms_list_prepend - ms_list_position - - ms_time - ms_get_payload_max_size - ms_sleep - - \ No newline at end of file diff --git a/linphone/mediastreamer2/build/wince/mediastreamer2.vcproj b/linphone/mediastreamer2/build/wince/mediastreamer2.vcproj deleted file mode 100644 index ac78735cf..000000000 --- a/linphone/mediastreamer2/build/wince/mediastreamer2.vcproj +++ /dev/null @@ -1,1568 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/linphone/mediastreamer2/build/winmob/Makefile.am b/linphone/mediastreamer2/build/winmob/Makefile.am deleted file mode 100755 index 29f98410c..000000000 --- a/linphone/mediastreamer2/build/winmob/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -EXTRA_DIST=alldescs.h mediastreamer2.vcproj mediastreamer2.sln mediastreamer2.def - diff --git a/linphone/mediastreamer2/build/winmob/alldescs.h b/linphone/mediastreamer2/build/winmob/alldescs.h deleted file mode 100644 index e5e179401..000000000 --- a/linphone/mediastreamer2/build/winmob/alldescs.h +++ /dev/null @@ -1,68 +0,0 @@ -#include "mediastreamer2/msfilter.h" - -extern MSFilterDesc ms_alaw_dec_desc; -extern MSFilterDesc ms_alaw_enc_desc; -extern MSFilterDesc ms_ulaw_dec_desc; -extern MSFilterDesc ms_ulaw_enc_desc; -extern MSFilterDesc ms_file_player_desc; -extern MSFilterDesc ms_rtp_send_desc; -extern MSFilterDesc ms_rtp_recv_desc; -extern MSFilterDesc ms_dtmf_gen_desc; -extern MSFilterDesc ms_file_rec_desc; -extern MSFilterDesc ms_speex_dec_desc; -extern MSFilterDesc ms_speex_enc_desc; -//extern MSFilterDesc ms_gsm_dec_desc; -//extern MSFilterDesc ms_gsm_enc_desc; -extern MSFilterDesc ms_speex_ec_desc; -extern MSFilterDesc ms_tee_desc; -extern MSFilterDesc ms_conf_desc; -//extern MSFilterDesc alsa_write_desc; -//extern MSFilterDesc alsa_read_desc; -//extern MSFilterDesc oss_read_desc; -//extern MSFilterDesc oss_write_desc; -//extern MSFilterDesc ms_arts_read_desc; -//extern MSFilterDesc ms_arts_write_desc; -//extern MSFilterDesc ms_v4l_desc; -//extern MSFilterDesc ms_sdl_out_desc; -//extern MSFilterDesc ms_h263_enc_desc; -//extern MSFilterDesc ms_h263_dec_desc; -extern MSFilterDesc ms_join_desc; -extern MSFilterDesc ms_resample_desc; -extern MSFilterDesc ms_volume_desc; -extern MSFilterDesc ms_ice_desc; -extern MSFilterDesc ms_void_sink_desc; -MSFilterDesc * ms_filter_descs[]={ -&ms_alaw_dec_desc, -&ms_alaw_enc_desc, -&ms_ulaw_dec_desc, -&ms_ulaw_enc_desc, -&ms_file_player_desc, -&ms_rtp_send_desc, -&ms_rtp_recv_desc, -&ms_dtmf_gen_desc, -&ms_file_rec_desc, -&ms_speex_dec_desc, -&ms_speex_enc_desc, -//&ms_gsm_dec_desc, -//&ms_gsm_enc_desc, -&ms_speex_ec_desc, -&ms_tee_desc, -&ms_conf_desc, -//&alsa_write_desc, -//&alsa_read_desc, -//&oss_read_desc, -//&oss_write_desc, -//&ms_arts_read_desc, -//&ms_arts_write_desc, -//&ms_v4l_desc, -//&ms_sdl_out_desc, -//&ms_h263_enc_desc, -//&ms_h263_dec_desc, -&ms_join_desc, -&ms_resample_desc, -&ms_volume_desc, -&ms_ice_desc, -&ms_void_sink_desc, -NULL -}; - diff --git a/linphone/mediastreamer2/build/winmob/echo/echo.vcproj b/linphone/mediastreamer2/build/winmob/echo/echo.vcproj deleted file mode 100644 index 5a8b40e64..000000000 --- a/linphone/mediastreamer2/build/winmob/echo/echo.vcproj +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/linphone/mediastreamer2/build/winmob/mediastreamer2.def b/linphone/mediastreamer2/build/winmob/mediastreamer2.def deleted file mode 100644 index 80dad5f0b..000000000 --- a/linphone/mediastreamer2/build/winmob/mediastreamer2.def +++ /dev/null @@ -1,129 +0,0 @@ -LIBRARY mediastreamer2 - -EXPORTS - - ms_init - ms_exit - - ms_filter_new - ms_filter_new_from_desc - ms_filter_destroy - ms_filter_create_encoder - ms_filter_create_decoder - ms_filter_call_method - ms_filter_call_method_noarg - ms_filter_link - ms_filter_unlink - ms_filter_preprocess - ms_filter_postprocess - ms_filter_codec_supported - ms_filter_register - ms_filter_new_from_name - ms_filter_set_notify_callback - ms_filter_get_encoder - - ms_snd_card_new - ms_snd_card_manager_destroy - ms_snd_card_manager_reload - ms_snd_card_manager_add_card - ms_snd_card_manager_register_desc - ms_snd_card_create_reader - ms_snd_card_create_writer - ms_snd_card_get_name - ms_snd_card_get_string_id - ms_snd_card_manager_get - ms_snd_card_manager_get_default_card - ms_snd_card_manager_get_default_capture_card - ms_snd_card_manager_get_default_playback_card - ms_snd_card_manager_get_card - ms_snd_card_manager_get_list - ms_snd_card_dup - ms_snd_card_destroy - ms_snd_card_set_level - ms_snd_card_get_level - ms_snd_card_set_capture - ms_snd_card_set_control - ms_snd_card_get_control - - ms_web_cam_new - ms_web_cam_manager_reload - ms_web_cam_manager_get_default_cam - ms_web_cam_manager_get - ms_web_cam_manager_get_list - ms_web_cam_manager_get_cam - ms_web_cam_manager_add_cam - ms_web_cam_manager_register_desc - ms_web_cam_create_reader - ms_web_cam_get_driver_type - ms_web_cam_get_name - ms_web_cam_get_string_id - - ms_ticker_new - ms_ticker_set_name - ms_ticker_destroy - ms_ticker_attach - ms_ticker_detach - ms_ticker_set_time_func - ms_ticker_print_graphs - - - ms_bufferizer_init - ms_bufferizer_uninit - ms_bufferizer_read - ms_bufferizer_put - ms_bufferizer_put_from_queue - - ms_queue_init - ms_queue_flush - - rfc3984_init - rfc3984_uninit - rfc3984_pack - rfc3984_unpack - rfc3984_set_mode - - ms_load_plugins - - audio_stream_start - audio_stream_alive - audio_stream_enable_automatic_gain_control - audio_stream_set_echo_canceler_params - audio_stream_enable_gain_control - audio_stream_enable_echo_limiter - audio_stream_new - audio_stream_set_rtcp_information - audio_stream_start_with_files - audio_stream_start_now - audio_stream_set_relay_session_id - audio_stream_play_received_dtmfs - audio_stream_set_mic_gain - audio_stream_stop - audio_stream_play - audio_stream_record - ms_snd_card_get_capabilities - ring_start_with_cb - ring_start - ring_stop - audio_stream_send_dtmf - ms_discover_mtu - ms_set_mtu - - ms_list_append - ms_list_remove - ms_list_free - ms_list_for_each - ms_list_find - ms_list_for_each2 - ms_list_find_custom - ms_list_size - ms_list_nth_data - ms_list_remove_link - ms_list_index - ms_list_prepend - ms_list_position - - ms_time - ms_get_payload_max_size - ms_sleep - - \ No newline at end of file diff --git a/linphone/mediastreamer2/build/winmob/mediastreamer2.sln b/linphone/mediastreamer2/build/winmob/mediastreamer2.sln deleted file mode 100644 index 8a3de9d24..000000000 --- a/linphone/mediastreamer2/build/winmob/mediastreamer2.sln +++ /dev/null @@ -1,60 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mediastreamer2", "mediastreamer2.vcproj", "{177F5AE2-A40C-4412-8F26-7F85FA32464E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "echo", "echo\echo.vcproj", "{B616AC95-748E-4CD5-89AC-772DC3C069D9}" -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 - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Standard SDK (ARMV4I) - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Standard SDK (ARMV4I) - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Standard SDK (ARMV4I) - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Standard SDK (ARMV4I) - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I) - {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I) - {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) - {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) - {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) - {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) - {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) - {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) - {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) - {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) - {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) - {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) - {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) - {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Release|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/linphone/mediastreamer2/build/winmob/mediastreamer2.vcproj b/linphone/mediastreamer2/build/winmob/mediastreamer2.vcproj deleted file mode 100644 index 8758723c2..000000000 --- a/linphone/mediastreamer2/build/winmob/mediastreamer2.vcproj +++ /dev/null @@ -1,933 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/linphone/mediastreamer2/configure.ac b/linphone/mediastreamer2/configure.ac deleted file mode 100644 index a3affd4a5..000000000 --- a/linphone/mediastreamer2/configure.ac +++ /dev/null @@ -1,659 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -AC_INIT([mediastreamer],[2.3.1]) - -AC_MSG_NOTICE([$PACKAGE_NAME-$PACKAGE_VERSION A mediastreaming library for telephony application.]) -AC_MSG_NOTICE([licensed under the terms of the General Public License (GPL)]) - -AC_CANONICAL_SYSTEM - -dnl Source packaging numbers -MEDIASTREAMER_MAJOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f1) -MEDIASTREAMER_MINOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f2) -MEDIASTREAMER_MICRO_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f3) -MEDIASTREAMER_EXTRA_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f4) - -LIBMEDIASTREAMER_SO_CURRENT=0 dnl increment this number when you add/change/remove an interface -LIBMEDIASTREAMER_SO_REVISION=1 dnl increment this number when you change source code, without changing interfaces; set to 0 when incrementing CURRENT -LIBMEDIASTREAMER_SO_AGE=0 dnl increment this number when you add an interface, set to 0 if you remove an interface - -LIBMEDIASTREAMER_SO_VERSION=$LIBMEDIASTREAMER_SO_CURRENT:$LIBMEDIASTREAMER_SO_REVISION:$LIBMEDIASTREAMER_SO_AGE -MEDIASTREAMER_VERSION=${MEDIASTREAMER_MAJOR_VERSION}.${MEDIASTREAMER_MINOR_VERSION}.${MEDIASTREAMER_MICRO_VERSION} - -if test -n "$MEDIASTREAMER_EXTRA_VERSION" ; then - MEDIASTREAMER_VERSION="${MEDIASTREAMER_VERSION}.${MEDIASTREAMER_EXTRA_VERSION}" -fi - -AC_SUBST(LIBMEDIASTREAMER_SO_VERSION) -AC_SUBST(MEDIASTREAMER_VERSION) - -PACKAGE=mediastreamer - -OS=`uname|sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` -AC_MSG_RESULT([Building Package on ${OS}]) - -AM_INIT_AUTOMAKE([tar-ustar]) -m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],) -AC_CONFIG_HEADERS(mediastreamer-config.h) -AC_DEFINE_UNQUOTED(MEDIASTREAMER_MAJOR_VERSION,$MEDIASTREAMER_MAJOR_VERSION, [major version]) -AC_DEFINE_UNQUOTED(MEDIASTREAMER_MINOR_VERSION,$MEDIASTREAMER_MINOR_VERSION, [minor version]) -AC_DEFINE_UNQUOTED(MEDIASTREAMER_MICRO_VERSION,$MEDIASTREAMER_MICRO_VERSION, [micro version]) -AC_DEFINE_UNQUOTED(MEDIASTREAMER_VERSION,"$MEDIASTREAMER_VERSION",[MEDIASTREAMER version number]) - -MS_PUBLIC_CFLAGS= - -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=no]], -[wall_werror=$enableval], -[ - if test "$USER" = "smorlat" ; then - wall_werror=yes - else - wall_werror=no - fi -] -) - -CFLAGS="-DORTP_INET6 $CFLAGS " - -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 - CFLAGS="$CFLAGS -DINET6" -fi - - -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] ) - - -dnl Checks for programs. -AC_PROG_CC -AC_PROG_CXX -AC_PROG_OBJC -AC_LIBTOOL_WIN32_DLL -AC_PROG_LIBTOOL -AC_ENABLE_SHARED(yes) -AC_ENABLE_STATIC(no) - -if test "$GCC" != "yes" ; then - case $target_os in - *hpux*) - dnl we are probably using HPUX cc compiler, so add a +O2 to CFLAGS - CFLAGS="$CFLAGS +O2 -g " - ;; - esac -else - CFLAGS="$CFLAGS -Wall" -fi - - - -if test $debug_enabled = "yes"; then - CFLAGS="$CFLAGS -g -DDEBUG" -else - CFLAGS="$CFLAGS -O2 -g " -fi - -dnl Checks for header files. -AC_HEADER_STDC - -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 - CFLAGS="$CFLAGS -D_BIGENDIAN " -fi - -if test $GCC = yes && test $wall_werror = yes; then - CFLAGS="$CFLAGS -Werror " -fi - -macosx_found=no -mingw32ce_found=no - -dnl add thread flags -case $target_os in - *darwin*) - MSPLUGINS_CFLAGS="" - MSPLUGINS_LIBS="-dynamiclib" - macosx_found=yes - LIBS="$LIBS -framework CoreFoundation -framework AudioToolbox -framework CoreAudio" - ;; - *mingw32ce) - CFLAGS="$CFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -D_WIN32_WCE -DORTP_STATIC" - CXXFLAGS="$CXXFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -DORTP_STATIC -D_WIN32_WCE" -dnl ORTP_STATIC to tell ortp not to export its variable with dllexport, as if we were building statically, or dynamically on linux - LIBS="$LIBS -lws2" - mingw_found=yes - mingw32ce_found=yes - build_tests=no - ;; - *mingw*) - CFLAGS="$CFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -DORTP_STATIC" - CXXFLAGS="$CXXFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -DORTP_STATIC" -dnl ORTP_STATIC to tell ortp not to export its variable with dllexport, as if we were building statically, or dynamically on linux - LIBS="$LIBS -lws2_32 -lwinmm " - mingw_found=yes - ;; - *) - MSPLUGINS_CFLAGS="-pthread" - MSPLUGINS_LIBS="-shared -pthread" - CFLAGS="$CFLAGS -pthread -D_REENTRANT" - LIBS="$LIBS -pthread -lpthread" - ;; -esac - -AM_CONDITIONAL(BUILD_MACOSX, test x$macosx_found = xyes) - -AM_CONDITIONAL(BUILD_TESTS,test x$build_tests != xno) - -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 -else - echo "No need to hack libtool." -fi -], [mingw_found=$mingw_found]) - - -dnl prefer fixed point computations -AC_ARG_ENABLE(fixed_point, - [ --enable-fixed-point Turn on fixed point computations (default: guess)], - [case "${enableval}" in - yes) fixed_point=true;; - no) fixed_point=false;; - guess) fixed_point=guess;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-fixed-point) ;; - esac],[fixed_point=guess]) - -if test "$fixed_point" = "guess" ; then - AC_MSG_CHECKING([whether fixed point arithmetic is preferred]) - case ${target_cpu}${host_cpu} in - *bfin*) - fixed_point=true - ;; - *arm*) - fixed_point=true - ;; - *) - fixed_point=false - ;; - esac - AC_MSG_RESULT([$fixed_point]) -fi - - -if test x$fixed_point = xtrue ; then - MS_PUBLIC_CFLAGS="$MS_PUBLIC_CFLAGS -DMS_FIXED_POINT" -fi - - -dnl initialize pkg-config so that we can use it within if else fi statements. -PKG_PROG_PKG_CONFIG() - -AC_SUBST(MSPLUGINS_CFLAGS) -AC_SUBST(MSPLUGINS_LIBS) - -AC_CHECK_LIB(rt,clock_gettime,[LIBS="$LIBS -lrt"]) - -dnl ********************************* -dnl various checks for soundcard apis -dnl ********************************* - -found_sound=no - -if test x$mingw_found = xyes ; then - found_sound=yes -fi - -AC_ARG_ENABLE(oss, - [ --enable-oss Disable oss support], - [case "${enableval}" in - yes) oss=true ;; - no) oss=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --disable-oss) ;; - esac],[oss=true]) - -if "$oss" = "true"; then -AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h sys/audio.h) -if test "${ac_cv_header_sys_soundcard_h}" = "yes" || \ - test "${ac_cv_header_soundcard_h}" = "yes" || \ - test "${ac_cv_header_sys_audio_h}" = "yes" || \ - test "${ac_cv_header_machine_soundcard_h}" = "yes"; then - found_sound=yes -else - oss=false -fi -fi - -AM_CONDITIONAL(BUILD_OSS, test x$oss = xtrue) - -dnl conditionnal build of ALSA support -AC_ARG_ENABLE(alsa, - [ --enable-alsa Turn on alsa native support compiling], - [case "${enableval}" in - yes) alsa=true ;; - no) alsa=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-alsa) ;; - esac],[alsa=true]) - -if test "$alsa" = "true"; then - AC_CHECK_HEADERS(alsa/asoundlib.h, - [ AC_CHECK_LIB(asound,snd_pcm_open, - [ ALSA_LIBS="-lasound" - found_sound=yes - AC_DEFINE(__ALSA_ENABLED__,1,[defined if alsa support is available]) - alsa_enabled=true - ]) - ] - ) -fi -AC_SUBST(ALSA_LIBS) - -AM_CONDITIONAL(BUILD_ALSA, test x$alsa_enabled = xtrue) - - -AC_ARG_ENABLE(artsc, - [ --enable-artsc Turn on artsc (kde<4) sound input/output (no) ], - [case "${enableval}" in - yes) artsc=true ;; - no) artsc=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-artsc) ;; - esac],[artsc=no]) - -arts_enabled=false - -if test "$artsc" = "true" ; then - - dnl check for arts (kde sound daemon) support - PKG_CHECK_MODULES(ARTS, [artsc],[ - dnl New detection - arts_enabled=true - ],[ - dnl Old detection - if test x$artsc = xtrue ; then - AC_CHECK_HEADERS(kde/artsc/artsc.h, - [ AC_CHECK_LIB(artsc,arts_init, - [ ARTS_LIBS="-lartsc" - arts_enabled=true - ]) - ] - ) - fi - AC_SUBST(ARTS_LIBS) - ]) -fi - -if test x$arts_enabled = xtrue; then - found_sound=yes - AC_DEFINE(__ARTS_ENABLED__,1,[defined if arts support is available]) -fi - -AM_CONDITIONAL(BUILD_ARTS, test x$arts_enabled = xtrue) - -AC_ARG_ENABLE(portaudio, - [ --enable-portaudio Turn on portaudio native support compiling], - [case "${enableval}" in - yes) portaudio=true ;; - no) portaudio=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-portaudio) ;; - esac],[portaudio=false]) - -if test "$portaudio" = "true"; then - AC_CHECK_HEADERS(portaudio.h, - [ AC_CHECK_LIB(portaudio,Pa_Initialize, - [ PORTAUDIO_LIBS="-lportaudio" - found_sound=yes - AC_DEFINE(__PORTAUDIO_ENABLED__,1,[defined if portaudio support is available]) - portaudio_enabled=true - ]) - ] - ) -fi - -AC_SUBST(PORTAUDIO_LIBS) -AM_CONDITIONAL(BUILD_PORTAUDIO, test x$portaudio_enabled = xtrue) - -AC_ARG_ENABLE(macsnd, - [ --enable-macsnd Turn on native macosx sound support (default=no)], - [case "${enableval}" in - yes) macsnd=true ;; - no) macsnd=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-macsnd) ;; - esac],[macsnd=false]) - -if test "$macsnd" = "true"; then - AC_DEFINE(__MACSND_ENABLED__,1,[defined if native macosx sound support is available]) - macsnd_enabled=true - found_sound=yes -fi - -AM_CONDITIONAL(BUILD_MACSND, test x$macsnd_enabled = xtrue) - -AC_ARG_ENABLE(macaqsnd, - [ --enable-macaqsnd Turn on native macosx Audio Queue sound support (default=yes)], - [case "${enableval}" in - yes) macaqsnd=true ;; - no) macaqsnd=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-macaqsnd) ;; - esac],[macaqsnd=true]) - -if test "$macosx_found" != "yes" ; then - macaqsnd=false -fi - -if test "$macaqsnd" = "true"; then - AC_DEFINE(__MAC_AQ_ENABLED__,1,[defined if native macosx AQ sound support is available]) - found_sound=yes -fi - -AM_CONDITIONAL(BUILD_MACAQSND, test x$macaqsnd = xtrue) - -AC_ARG_ENABLE(jack, - [ --disable-jack Disable jack support], - [case "${enableval}" in - yes) jack=true ;; - no) jack=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --disable-jack) ;; - esac],[jack=true]) - -if test x$jack = xtrue; then - -dnl Check for samplerate libraries -dnl Check for jack libraries (sound output plugin) -PKG_CHECK_MODULES(JACK,jack >= 0.15.0, -[ - dnl we' found jack devel files - PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.0.13, - [AC_DEFINE(__JACK_ENABLED__,1,[Jack support]) - found_sound=yes - jack_found=yes] , - [echo "libsamplerate not found, jack support disabled."]) - AC_SUBST(SAMPLERATE_CFLAGS) - AC_SUBST(SAMPLERATE_LIBS) -], -[echo "No jack support."] ) - -if test x$jack_found = xno ; then - dnl reset flags - JACK_CFLAGS= - JACK_LIBS= - SAMPLERATE_CFLAGS= - SAMPLERATE_LIBS= -fi - -AC_SUBST(JACK_CFLAGS) -AC_SUBST(JACK_LIBS) - -fi - -if test "$found_sound" = "no"; then - AC_MSG_WARN([Could not find a support sound driver API]) -fi - - -dnl ************************************* -dnl check for various codecs libraries -dnl ************************************* - -AC_ARG_ENABLE(speex, - [ --disable-speex Disable speex support], - [case "${enableval}" in - yes) speex=true ;; - no) speex=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --disable-speex) ;; - esac],[speex=true]) - -if test x$speex = xtrue; then - -dnl check for installed version of speex -PKG_CHECK_MODULES(SPEEX, speex >= 1.2beta3, - [ AC_DEFINE(HAVE_SPEEX_NOISE,1,[tells whether the noise arg of speex_echo_cancel can be used]) ], - [try_other_speex=yes] -) -PKG_CHECK_MODULES(SPEEX, speex >= 1.2beta3, build_speex=yes) -build_resample=false -PKG_CHECK_MODULES(SPEEXDSP, speexdsp >= 1.2beta3, - [SPEEX_LIBS="$SPEEX_LIBS $SPEEXDSP_LIBS" - AC_DEFINE(HAVE_SPEEXDSP,1,[have speexdsp library]) - build_resample=yes] , - [AC_MSG_NOTICE([No speexdsp library found.]) -] -) -AC_SUBST(SPEEX_CFLAGS) -AC_SUBST(SPEEX_LIBS) - -fi - -AM_CONDITIONAL(BUILD_SPEEX, test x$build_speex = xyes ) -AM_CONDITIONAL(BUILD_RESAMPLE, test x$build_resample = xyes ) - -AC_ARG_ENABLE(gsm, - [ --disable-gsm Disable gsm support], - [case "${enableval}" in - yes) gsm=true ;; - no) gsm=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --disable-gsm) ;; - esac],[gsm=true]) - -if test x$gsm = xtrue; then - -dnl check for gsm -build_gsm=no -AC_ARG_WITH( gsm, - [ --with-gsm Sets the installation prefix of gsm codec library [default=/usr] ], - [ gsmdir=${withval}],[ gsmdir=/usr ]) - -if test x"$gsmdir" != xno ; then - test x"$gmsdir" = xyes && gsmdir=/usr - MS_CHECK_DEP([gsm codec],[GSM],[${gsmdir}/include], - [${gsmdir}/lib],[gsm/gsm.h],[gsm],[gsm_create]) - if test "$GSM_found" = "yes" ; then - build_gsm=yes - fi -else - build_gsm=no -fi - -fi - -AM_CONDITIONAL(BUILD_GSM, test x$build_gsm = xyes ) - -MS_CHECK_VIDEO -AM_CONDITIONAL(BUILD_VIDEO, test "$video" = "true") -AM_CONDITIONAL(BUILD_THEORA, test "$have_theora" = "yes") -AM_CONDITIONAL(BUILD_WIN32, test "$mingw_found" = "yes") -AM_CONDITIONAL(BUILD_WIN32_WCE, test "$mingw32ce_found" = "yes") - -dnl ********************************************* -dnl setup oRTP dependency -dnl ********************************************* -AC_ARG_ENABLE(external-ortp, - [ --enable-external-ortp Use external oRTP library], - [case "${enableval}" in - yes) external_ortp=true ;; - no) external_ortp=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-external-ortp) ;; - esac],[external_ortp=false]) - -if test "$external_ortp" = 'false'; then - if test -e $srcdir/../oRTP/include/ortp/ortp.h ; then - echo "building from linphone source tree, using ../oRTP/include/ortp/ortp.h" - ORTP_CFLAGS="-I\$(top_srcdir)/../oRTP/include" - ORTP_LIBS="\$(top_builddir)/../oRTP/src/libortp.la" - if test x$ac_cv_c_bigendian = xyes ; then - ORTP_CFLAGS="$ORTP_CFLAGS -DORTP_BIGENDIAN" - fi - else - external_ortp=true - fi -fi -if test "$external_ortp" = 'true'; then - PKG_CHECK_MODULES(ORTP, ortp >= 0.9.0, , - [ AC_MSG_ERROR([Couldn't find ortp library]) ] ) -fi -AC_SUBST(ORTP_CFLAGS) -AC_SUBST(ORTP_LIBS) - - -dnl check dlopen support in headers and libraries, so that we can use mediastreamer plugins -AC_CHECK_HEADERS(dlfcn.h) -have_dlopen=false -AC_CHECK_LIB(dl,dlopen,[LIBS="$LIBS -ldl"; have_dlopen=true]) -AC_CHECK_FUNC(dlopen,[have_dlopen=true]) -if test "$have_dlopen" = "true" ; then - AC_DEFINE(HAVE_DLOPEN,1,[Defined if dlopen() is availlable]) -fi - -dnl check various things -AC_FUNC_ALLOCA - -if test "x${prefix}" = "xNONE"; then - package_prefix=${ac_default_prefix} -else - package_prefix=${prefix} -fi - -if test x$mingw_found = xyes ; then - package_prefix="." -fi - -dnl define path of plugins: -AC_DEFINE_UNQUOTED(PACKAGE_PLUGINS_DIR, "${package_prefix}/lib/mediastreamer/plugins" ,[path of plugins]) -PACKAGE_PLUGINS_DIR="${package_prefix}/lib/mediastreamer/plugins" -AC_SUBST(PACKAGE_PLUGINS_DIR) - -PACKAGE_DATA_DIR="$prefix/share" -AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${package_prefix}/share" ,[path of data]) -AC_SUBST(PACKAGE_DATA_DIR) - -dnl check for video4linux headers -AC_CHECK_HEADERS(linux/videodev.h linux/videodev2.h) -if test "${ac_cv_header_linux_videodev_h}" = "yes" || \ - test "${ac_cv_header_linux_videodev2_h}" = "yes" ; then - found_v4l=yes -else - found_v4l=no -fi - -AM_CONDITIONAL(BUILD_V4L, test x$found_v4l = xyes ) - -PKG_CHECK_MODULES(LIBV4L2, libv4l2, - [AC_DEFINE(HAVE_LIBV4L2,1,[Defined if we have libv4l2])] - ,[echo "No libv4l2 found."] -) -PKG_CHECK_MODULES(LIBV4L1, libv4l1, - [AC_DEFINE(HAVE_LIBV4L1,1,[Defined if we have libv4l1])] - ,[echo "No libv4l1 found."] -) - -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) - - -# 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="A mediastreaming library." -AC_SUBST(SUMMARY) -PACKAGER=anonymous -AC_SUBST(PACKAGER) -LICENSE=GPL -AC_SUBST(LICENSE) -VENDOR=Linphone -AC_SUBST(VENDOR) -RELEASE=1 -AC_SUBST(RELEASE) - -CFLAGS="$CFLAGS $MS_PUBLIC_CFLAGS" -CXXFLAGS="$CXXFLAGS $MS_PUBLIC_CFLAGS" -dnl: these ones gets exported in pkgconfig file. -AC_SUBST(MS_PUBLIC_CFLAGS) - -AC_OUTPUT( -Makefile -include/Makefile -include/mediastreamer2/Makefile -src/Makefile -tests/Makefile -build/Makefile -build/win32native/Makefile -build/win32-novideo/Makefile -build/wince/Makefile -build/winmob/Makefile -mediastreamer.pc -mediastreamer2.spec -help/Makefile -help/Doxyfile -help/doxygen.dox -) diff --git a/linphone/mediastreamer2/help/.gitignore b/linphone/mediastreamer2/help/.gitignore deleted file mode 100644 index 8d4b209b9..000000000 --- a/linphone/mediastreamer2/help/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Doxyfile -doxygen.dox diff --git a/linphone/mediastreamer2/help/Doxyfile.in b/linphone/mediastreamer2/help/Doxyfile.in deleted file mode 100644 index 1c7f5b41c..000000000 --- a/linphone/mediastreamer2/help/Doxyfile.in +++ /dev/null @@ -1,234 +0,0 @@ -# Doxyfile 1.4.1 - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = mediastreamer2 -PROJECT_NUMBER = @MEDIASTREAMER_VERSION@ -OUTPUT_DIRECTORY = doc -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = NO -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 -DISTRIBUTE_GROUP_DOC = NO -TAB_SIZE = 8 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = YES -OPTIMIZE_OUTPUT_JAVA = 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 = YES -HIDE_UNDOC_CLASSES = YES -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 = NO -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 = YES -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 = . \ - ../include/ \ - ../src -FILE_PATTERNS = *.h \ - *.c \ - *.dox -RECURSIVE = YES -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = ../ -EXAMPLE_PATTERNS = -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 = NO -REFERENCES_RELATION = NO -VERBATIM_HEADERS = NO -#--------------------------------------------------------------------------- -# 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 = 1 -GENERATE_TREEVIEW = NO -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = YES -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 = YES -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 = YES -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = ../include/mediastreamer2 -INCLUDE_FILE_PATTERNS = *.h -PREDEFINED = DOXYGEN -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 = YES -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_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 = 1000 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO diff --git a/linphone/mediastreamer2/help/Makefile.am b/linphone/mediastreamer2/help/Makefile.am deleted file mode 100644 index fdc5bb258..000000000 --- a/linphone/mediastreamer2/help/Makefile.am +++ /dev/null @@ -1,32 +0,0 @@ - -EXTRA_DIST = Doxyfile.in doxygen.dox.in - -#html doc -if HAVE_DOXYGEN - -SOURCES=$(top_srcdir)/include/mediastreamer2/*.h $(top_srcdir)/src/*.c $(top_srcdir)/src/*.h - -# doxdir & pkgdocdir are not always defined by automake -docdir=$(datadir)/doc -pkgdocdir=$(docdir)/$(PACKAGE)-$(VERSION) -doc_htmldir=$(pkgdocdir)/html - -doc_html_DATA = $(top_builddir)/help/doc/html/html.tar - -$(doc_html_DATA): $(top_builddir)/help/doc/html/index.html - cd $(. - * - * @section definitions Some definitions. - * - * Filter: - * A filter is a mediastreamer2 component that process data. A filter - * have 0 or several INPUT pins and 0 or several OUTPUT pins. - * Here is a list of possible use of filters: - *
- *   capture audio or video data.
- *   play audio or display video data.
- *   send or receive RTP data.
- *   encode or decode audio or video data.
- *   transform (resize video, resample audio...) data.
- *   duplicate any kind of data.
- *   mix audio/video data.
- * 
- * Graph: - * A graph is a manager of filters connected together. It will transfer - * data from OUTPUT pins to INPUT pins and will be responsible for - * running filters. - * - * @section when_do_i_use_mediastreamer2 How do I use mediastremer2? - * - * Mediastreamer2 can be used for a lot of different purpose. The primary - * use is to manage RTP audio and video session. You will need to use - * the API to build filters, link them together in a graph. Then the - * ticker API will help you to start and stop the graph. - * - * Basic graph sample: - * - *
- *  AUDIO CAPTURE   -->   ENCODE  -->     RTP
- *      FILTER      -->   FILTER  -->    FILTER
- * 
- * - * - * The above graph is composed of three filters. The first one has no input: - * tt captures audio data directly from the drivers and provide it to the - * OUTPUT pin. This data is sent to the INPUT pin of the encoder which of - * course encode the data and send it to its OUTPUT pin. This pin is connected - * to the INPUT pin of a filter capable to build and send RTP packets. - * - * The modular design helps you to encode in many different format just by - * replacing the "ENCODE FILTER" with another one. mediastreamer2 contains - * internal support for g711u, g711a, speex and gsm. You can add new encoding - * format by implementing new filters which can then be dynamically loaded. - * - * @section list_of_filters List of existing filters. - * - * mediastreamer2 already provides a large set of filters. Here is a complete - * list of built-in filters. - * - *
- * All supported platforms:
- *   RTP receiver
- *   RTP sender
- *   tee (duplicate data)
- *
- * Audio Filters:
- *   audio capture
- *   audio playback
- *     mme API (windows)
- *     alsa API (linux)
- *     oss API (linux)
- *     arts API (linux)
- *     portaudio API (macosx and other)
- *   macsnd API (native macosx API -please do more testing...-)
- *   several audio encoder/decoder: PCMU, PCMA, speex, gsm
- *   wav file reader.
- *   wav file recorder.
- *   resampler.
- *   conference bridge.
- *   volume analyser.
- *   acoustic echo canceller.
- *   dtmf generation filter.
- *
- * Video Filters:
- *   video capture
- *     v4w API (windows)
- *     directshow API (windows)
- *     video4linux API (linux)
- *   video display
- *     v4w API (windows)
- *     SDL API (linux, macosx...)
- *   several audio encoder/decoder: H263-1998, MP4V-ES, theora
- *   image resizer.
- *   format converter. (RBG24, I420...)
- *
- * Plugin Filters:
- *  iLBC decoder/encoder.
- * 
- * - * @section what_thanks Thanks - * - * Thanks to all the contributors and to all bug reporters. - * Enjoy mediastreamer2! - * - */ - -/** - * @defgroup mediastreamer2_api Mediastreamer2 API - * @brief All API to manage mediastreamer2 library. - * - */ - -/** - * @defgroup mediastreamer2_init Init API - manage mediastreamer2 library. - * @ingroup mediastreamer2_api - * @brief Init API to manage mediastreamer2 library. - * - * This file provide the API needed to initialize - * and reset the mediastreamer2 library. - */ - -/** - * @defgroup mediastreamer2_soundcard Sound Card API - manage audio capture/play filters. - * @ingroup mediastreamer2_api - * @brief Sound Card API to manage audio capture/play filters. - * - * This file provide the API needed to manage - * soundcard filters. - */ - -/** - * @defgroup mediastreamer2_filter Filter API - manage mediastreamer2 filters. - * @ingroup mediastreamer2_api - * @brief Filter API to manage mediastreamer2 filters. - * - * This file provide the API needed to create, link, - * unlink, find and destroy filter. - * - * It also provides definitions if you wish to implement - * your own filters. - */ - -/** - * @defgroup mediastreamer2_ticker Ticker API - manage mediastreamer2 graphs. - * @ingroup mediastreamer2_api - * @brief Ticker API to manage mediastreamer2 graphs. - * - * This file provide the API needed to create, start - * and stop a graph. - */ - - -/** - * @page mediastreamer2_readme README - * @verbinclude README - */ - -/** - * @page mediastreamer2_install INSTALL - * @verbinclude INSTALL - */ - -/** - * @page mediastreamer2_license COPYING - * @verbinclude COPYING - */ - -/** - * @page mediastreamer2_changelog ChangeLog - * @verbinclude ChangeLog - */ - diff --git a/linphone/mediastreamer2/help/ht0-buildagraph.dox b/linphone/mediastreamer2/help/ht0-buildagraph.dox deleted file mode 100644 index 9acc3b0e5..000000000 --- a/linphone/mediastreamer2/help/ht0-buildagraph.dox +++ /dev/null @@ -1,153 +0,0 @@ -/** - * @defgroup howto0_samplegraph Howto 1: build a sample audio graph. - * @ingroup mediastreamer2 - -

Initialize mediastreamer2

- -When using mediastreamer2, your first task is to initialize the -library: - -
-	##include 
-
-	int i;
-
-	i=ms_init();
-	if (i!=0)
-	  return -1;
-
-
- -Mediastreamer2 provides internal components which are called filters. Those -filters must be linked together so that OUTPUT from one filter is sent to -INPUT of the other filters. - -Usually, filters are used for processing audio or video data. They could -capture data, play/draw data, encode/decode data, mix data (conference), -transform data (echo canceller). One of the most important filter is the -RTP filters that are able to send and receive RTP data. - -

Graph sample

- -If you are using mediastreamer2, you probably want to do Voice Over IP -and get a graph providing a 2 way communication. This 2 graphs are very -simple: - -This first graph shows the filters needed to capture data from a sound -card, encode them and send it through an RTP session. - -
-             AUDIO    ->    ENCODER   ->   RTP
-            CAPTURE   ->              ->  SENDER
-
- - This second graph shows the filters needed to receive data from an RTP -session decode it and send it to the playback device. - -
-        RTP      ->    DECODER   ->   DTMF       ->   AUDIO
-       RECEIVER  ->              ->  GENERATION  ->  PLAYBACK
-
- -

Code to initiate the filters of the Graph sample

- -Note that the NULL/error checks are not done for better reading. -To build the graph, you'll need some information: you need to -select the sound card and of course have an RTP session created -with oRTP. - -
-	MSSndCard *sndcard;
-	sndcard=ms_snd_card_manager_get_default_card(ms_snd_card_manager_get());
-
-        /* audio capture filter */
-	MSFilter *soundread=ms_snd_card_create_reader(captcard);
-	MSFilter *soundwrite=ms_snd_card_create_writer(playcard);
-
-	MSFilter *encoder=ms_filter_create_encoder("PCMU");
-	MSFilter *decoder=ms_filter_create_decoder("PCMU");
-
-	MSFilter *rtpsend=ms_filter_new(MS_RTP_SEND_ID);
-	MSFilter *rtprecv=ms_filter_new(MS_RTP_RECV_ID);
-
-	RtpSession *rtp_session = *** your_ortp_session *** ;
-
-	ms_filter_call_method(rtpsend,MS_RTP_SEND_SET_SESSION,rtp_session);
-	ms_filter_call_method(rtprecv,MS_RTP_RECV_SET_SESSION,rtp_session);
-
-	MSFilter *dtmfgen=ms_filter_new(MS_DTMF_GEN_ID);
-
- -In most cases, the above graph is not enough: you'll need to configure -filter's options. As an example, you need to set sampling rate of sound -cards' filters: - -
-        int sr = 8000;
-	int chan=1;
-	ms_filter_call_method(soundread,MS_FILTER_SET_SAMPLE_RATE,&sr);
-	ms_filter_call_method(soundwrite,MS_FILTER_SET_SAMPLE_RATE,&sr);
-	ms_filter_call_method(stream->encoder,MS_FILTER_SET_SAMPLE_RATE,&sr);
-	ms_filter_call_method(stream->decoder,MS_FILTER_SET_SAMPLE_RATE,&sr);
-
-	ms_filter_call_method(soundwrite,MS_FILTER_SET_NCHANNELS, &chan);
-
-        /* if you have some fmtp parameters (from SDP for example!)
-        char *fmtp1 = ** get your fmtp line **;
-        char *fmtp2 = ** get your fmtp line **;
-	ms_filter_call_method(stream->encoder,MS_FILTER_ADD_FMTP, (void*)fmtp1);
-	ms_filter_call_method(stream->decoder,MS_FILTER_ADD_FMTP,(void*)fmtp2);
-
- - -

Code to link the filters and run the graph sample

- -
-	ms_filter_link(stream->soundread,0,stream->encoder,0);
-	ms_filter_link(stream->encoder,0,stream->rtpsend,0);
-
-	ms_filter_link(stream->rtprecv,0,stream->decoder,0);
-	ms_filter_link(stream->decoder,0,stream->dtmfgen,0);
-	ms_filter_link(stream->dtmfgen,0,stream->soundwrite,0);	
-
- -Then you need to 'attach' the filters to a ticker. A ticker is a graph -manager responsible for running filters. - -In the above case, there is 2 independant graph within the ticker: you -need to attach the first element of each graph (the one that does not -contains any INPUT pins) - -
-	/* create ticker */
-	MSTicker *ticker=ms_ticker_new();
-
-	ms_ticker_attach(ticker,soundread);
-	ms_ticker_attach(ticker,rtprecv);
-
- -

Code to unlink the filters and stop the graph sample

- -
-	ms_ticker_detach(ticker,soundread);
-	ms_ticker_detach(ticker,rtprecv);
-
-	ms_filter_unlink(stream->soundread,0,stream->encoder,0);
-	ms_filter_unlink(stream->encoder,0,stream->rtpsend,0);
-
-	ms_filter_unlink(stream->rtprecv,0,stream->decoder,0);
-	ms_filter_unlink(stream->decoder,0,stream->dtmfgen,0);
-	ms_filter_unlink(stream->dtmfgen,0,stream->soundwrite,0);
-
-	if (rtp_session!=NULL) rtp_session_destroy(rtp_session);
-	if (rtpsend!=NULL) ms_filter_destroy(rtpsend);
-	if (rtprecv!=NULL) ms_filter_destroy(rtprecv);
-	if (soundread!=NULL) ms_filter_destroy(soundread);
-	if (soundwrite!=NULL) ms_filter_destroy(soundwrite);
-	if (encoder!=NULL) ms_filter_destroy(encoder);
-	if (decoder!=NULL) ms_filter_destroy(decoder);
-	if (dtmfgen!=NULL) ms_filter_destroy(dtmfgen);
-	if (ticker!=NULL) ms_ticker_destroy(ticker);
-
- -*/ \ No newline at end of file diff --git a/linphone/mediastreamer2/include/.gitignore b/linphone/mediastreamer2/include/.gitignore deleted file mode 100644 index 3dda72986..000000000 --- a/linphone/mediastreamer2/include/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile.in -Makefile diff --git a/linphone/mediastreamer2/include/Makefile.am b/linphone/mediastreamer2/include/Makefile.am deleted file mode 100644 index c7b5d9316..000000000 --- a/linphone/mediastreamer2/include/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS=mediastreamer2 diff --git a/linphone/mediastreamer2/include/mediastreamer2/.gitignore b/linphone/mediastreamer2/include/mediastreamer2/.gitignore deleted file mode 100644 index 3dda72986..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile.in -Makefile diff --git a/linphone/mediastreamer2/include/mediastreamer2/Makefile.am b/linphone/mediastreamer2/include/mediastreamer2/Makefile.am deleted file mode 100644 index 74673ce14..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/Makefile.am +++ /dev/null @@ -1,29 +0,0 @@ - -mediastreamer2_includedir=$(includedir)/mediastreamer2 - -mediastreamer2_include_HEADERS= ice.h \ - msfilter.h \ - msqueue.h \ - mscommon.h \ - allfilters.h \ - msticker.h \ - msrtp.h \ - dtmfgen.h \ - msfilerec.h \ - msfileplayer.h \ - mssndcard.h \ - mediastream.h \ - msv4l.h \ - msvideo.h \ - waveheader.h \ - msvideoout.h \ - msvolume.h \ - mstee.h \ - rfc3984.h \ - mswebcam.h \ - dsptools.h \ - msequalizer.h \ - msspeexec.h - -EXTRA_DIST=$(mediastreamer2_include_HEADERS) - diff --git a/linphone/mediastreamer2/include/mediastreamer2/allfilters.h b/linphone/mediastreamer2/include/mediastreamer2/allfilters.h deleted file mode 100644 index eb6440506..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/allfilters.h +++ /dev/null @@ -1,95 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef allfilters_h -#define allfilters_h - -/* this is the enum where to add your own filter id. -Please take care of always add new IDs at the end in order to preserve the binary interface*/ -/*this id is used for type checking of methods, events with filters */ -/*it must be used also to create filters */ -typedef enum MSFilterId{ - MS_FILTER_NOT_SET_ID, - MS_FILTER_PLUGIN_ID, /* no type checking will be performed on plugins */ - MS_FILTER_BASE_ID, - MS_ALSA_READ_ID, - MS_ALSA_WRITE_ID, - MS_OSS_READ_ID, - MS_OSS_WRITE_ID, - MS_ULAW_ENC_ID, - MS_ULAW_DEC_ID, - MS_ALAW_ENC_ID, - MS_ALAW_DEC_ID, - MS_RTP_SEND_ID, - MS_RTP_RECV_ID, - MS_FILE_PLAYER_ID, - MS_FILE_REC_ID, - MS_DTMF_GEN_ID, - MS_SPEEX_ENC_ID, - MS_SPEEX_DEC_ID, - MS_GSM_ENC_ID, - MS_GSM_DEC_ID, - MS_V4L_ID, - MS_SDL_OUT_ID, - MS_H263_ENC_ID, - MS_H263_DEC_ID, - MS_ARTS_READ_ID, - MS_ARTS_WRITE_ID, - MS_WINSND_READ_ID, - MS_WINSND_WRITE_ID, - MS_SPEEX_EC_ID, - MS_PIX_CONV_ID, - MS_TEE_ID, - MS_SIZE_CONV_ID, - MS_CONF_ID, - MS_THEORA_ENC_ID, - MS_THEORA_DEC_ID, - MS_PASND_READ_ID, - MS_PASND_WRITE_ID, - MS_MPEG4_ENC_ID, - MS_MPEG4_DEC_ID, - MS_MJPEG_DEC_ID, - MS_JOIN_ID, - MS_RESAMPLE_ID, - MS_VIDEO_OUT_ID, - MS_VOLUME_ID, - MS_SNOW_DEC_ID, - MS_SNOW_ENC_ID, - MS_CA_READ_ID, - MS_CA_WRITE_ID, - MS_WINSNDDS_READ_ID, - MS_WINSNDDS_WRITE_ID, - MS_STATIC_IMAGE_ID, - MS_V4L2_CAPTURE_ID, - MS_H263_OLD_DEC_ID, - MS_H263_OLD_ENC_ID, - MS_MIRE_ID, - MS_VFW_ID, - MS_ICE_ID, - MS_VOID_SINK_ID, - MS_DSCAP_ID, - MS_AQ_READ_ID, - MS_AQ_WRITE_ID, - MS_EQUALIZER_ID, - MS_JPEG_DEC_ID, - MS_JPEG_ENC_ID, -} MSFilterId; - - -#endif diff --git a/linphone/mediastreamer2/include/mediastreamer2/dsptools.h b/linphone/mediastreamer2/include/mediastreamer2/dsptools.h deleted file mode 100644 index 711e075b7..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/dsptools.h +++ /dev/null @@ -1,388 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2009 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -/* This file contains useful DSP routines from the speex project. -*/ - -/* Copyright (C) 2002-2006 Jean-Marc Valin - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef ms_dsptools_h -#define ms_dsptools_h - -#include - -typedef int32_t ms_int32_t; - -#ifdef MS_FIXED_POINT - -typedef short ms_word16_t; -typedef int ms_word32_t; -typedef int ms_mem_t; -typedef short ms_coef_t; - -#define QCONST16(x,bits) ((ms_word16_t)(.5+(x)*(((ms_word32_t)1)<<(bits)))) -#define QCONST32(x,bits) ((ms_word32_t)(.5+(x)*(((ms_word32_t)1)<<(bits)))) - -#define NEG16(x) (-(x)) -#define NEG32(x) (-(x)) -#define EXTRACT16(x) ((ms_word16_t)(x)) -#define EXTEND32(x) ((ms_word32_t)(x)) -#define SHR16(a,shift) ((a) >> (shift)) -#define SHL16(a,shift) ((a) << (shift)) -#define SHR32(a,shift) ((a) >> (shift)) -#define SHL32(a,shift) ((a) << (shift)) -#define PSHR16(a,shift) (SHR16((a)+((1<<((shift))>>1)),shift)) -#define PSHR32(a,shift) (SHR32((a)+((EXTEND32(1)<<((shift))>>1)),shift)) -#define VSHR32(a, shift) (((shift)>0) ? SHR32(a, shift) : SHL32(a, -(shift))) -#define SATURATE16(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x))) -#define SATURATE32(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x))) - -#define SHR(a,shift) ((a) >> (shift)) -#define SHL(a,shift) ((ms_word32_t)(a) << (shift)) -#define PSHR(a,shift) (SHR((a)+((EXTEND32(1)<<((shift))>>1)),shift)) -#define SATURATE(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x))) - - -#define ADD16(a,b) ((ms_word16_t)((ms_word16_t)(a)+(ms_word16_t)(b))) -#define SUB16(a,b) ((ms_word16_t)(a)-(ms_word16_t)(b)) -#define ADD32(a,b) ((ms_word32_t)(a)+(ms_word32_t)(b)) -#define SUB32(a,b) ((ms_word32_t)(a)-(ms_word32_t)(b)) - - -/* result fits in 16 bits */ -#define MULT16_16_16(a,b) ((((ms_word16_t)(a))*((ms_word16_t)(b)))) - -/* (ms_word32_t)(ms_word16_t) gives TI compiler a hint that it's 16x16->32 multiply */ -#define MULT16_16(a,b) (((ms_word32_t)(ms_word16_t)(a))*((ms_word32_t)(ms_word16_t)(b))) - -#define MAC16_16(c,a,b) (ADD32((c),MULT16_16((a),(b)))) -#define MULT16_32_Q12(a,b) ADD32(MULT16_16((a),SHR((b),12)), SHR(MULT16_16((a),((b)&0x00000fff)),12)) -#define MULT16_32_Q13(a,b) ADD32(MULT16_16((a),SHR((b),13)), SHR(MULT16_16((a),((b)&0x00001fff)),13)) -#define MULT16_32_Q14(a,b) ADD32(MULT16_16((a),SHR((b),14)), SHR(MULT16_16((a),((b)&0x00003fff)),14)) - -#define MULT16_32_Q11(a,b) ADD32(MULT16_16((a),SHR((b),11)), SHR(MULT16_16((a),((b)&0x000007ff)),11)) -#define MAC16_32_Q11(c,a,b) ADD32(c,ADD32(MULT16_16((a),SHR((b),11)), SHR(MULT16_16((a),((b)&0x000007ff)),11))) - -#define MULT16_32_P15(a,b) ADD32(MULT16_16((a),SHR((b),15)), PSHR(MULT16_16((a),((b)&0x00007fff)),15)) -#define MULT16_32_Q15(a,b) ADD32(MULT16_16((a),SHR((b),15)), SHR(MULT16_16((a),((b)&0x00007fff)),15)) -#define MAC16_32_Q15(c,a,b) ADD32(c,ADD32(MULT16_16((a),SHR((b),15)), SHR(MULT16_16((a),((b)&0x00007fff)),15))) - - -#define MAC16_16_Q11(c,a,b) (ADD32((c),SHR(MULT16_16((a),(b)),11))) -#define MAC16_16_Q13(c,a,b) (ADD32((c),SHR(MULT16_16((a),(b)),13))) -#define MAC16_16_P13(c,a,b) (ADD32((c),SHR(ADD32(4096,MULT16_16((a),(b))),13))) - -#define MULT16_16_Q11_32(a,b) (SHR(MULT16_16((a),(b)),11)) -#define MULT16_16_Q13(a,b) (SHR(MULT16_16((a),(b)),13)) -#define MULT16_16_Q14(a,b) (SHR(MULT16_16((a),(b)),14)) -#define MULT16_16_Q15(a,b) (SHR(MULT16_16((a),(b)),15)) - -#define MULT16_16_P13(a,b) (SHR(ADD32(4096,MULT16_16((a),(b))),13)) -#define MULT16_16_P14(a,b) (SHR(ADD32(8192,MULT16_16((a),(b))),14)) -#define MULT16_16_P15(a,b) (SHR(ADD32(16384,MULT16_16((a),(b))),15)) - -#define MUL_16_32_R15(a,bh,bl) ADD32(MULT16_16((a),(bh)), SHR(MULT16_16((a),(bl)),15)) - -#define DIV32_16(a,b) ((ms_word16_t)(((ms_word32_t)(a))/((ms_word16_t)(b)))) -#define PDIV32_16(a,b) ((ms_word16_t)(((ms_word32_t)(a)+((ms_word16_t)(b)>>1))/((ms_word16_t)(b)))) -#define DIV32(a,b) (((ms_word32_t)(a))/((ms_word32_t)(b))) -#define PDIV32(a,b) (((ms_word32_t)(a)+((ms_word16_t)(b)>>1))/((ms_word32_t)(b))) - -#ifdef ARM5E_ASM -#error "Fix me" -#elif defined (ARM4_ASM) -#error "Fix me" -#elif defined (BFIN_ASM) - -#undef PDIV32_16 -static inline ms_word16_t PDIV32_16(ms_word32_t a, ms_word16_t b) -{ - ms_word32_t res, bb; - bb = b; - a += b>>1; - __asm__ ( - "P0 = 15;\n\t" - "R0 = %1;\n\t" - "R1 = %2;\n\t" - //"R0 = R0 + R1;\n\t" - "R0 <<= 1;\n\t" - "DIVS (R0, R1);\n\t" - "LOOP divide%= LC0 = P0;\n\t" - "LOOP_BEGIN divide%=;\n\t" - "DIVQ (R0, R1);\n\t" - "LOOP_END divide%=;\n\t" - "R0 = R0.L;\n\t" - "%0 = R0;\n\t" - : "=m" (res) - : "m" (a), "m" (bb) - : "P0", "R0", "R1", "cc"); - return res; -} - -#undef DIV32_16 -static inline ms_word16_t DIV32_16(ms_word32_t a, ms_word16_t b) -{ - ms_word32_t res, bb; - bb = b; - /* Make the roundinf consistent with the C version - (do we need to do that?)*/ - if (a<0) - a += (b-1); - __asm__ ( - "P0 = 15;\n\t" - "R0 = %1;\n\t" - "R1 = %2;\n\t" - "R0 <<= 1;\n\t" - "DIVS (R0, R1);\n\t" - "LOOP divide%= LC0 = P0;\n\t" - "LOOP_BEGIN divide%=;\n\t" - "DIVQ (R0, R1);\n\t" - "LOOP_END divide%=;\n\t" - "R0 = R0.L;\n\t" - "%0 = R0;\n\t" - : "=m" (res) - : "m" (a), "m" (bb) - : "P0", "R0", "R1", "cc"); - return res; -} - -#undef MAX16 -static inline ms_word16_t MAX16(ms_word16_t a, ms_word16_t b) -{ - ms_word32_t res; - __asm__ ( - "%1 = %1.L (X);\n\t" - "%2 = %2.L (X);\n\t" - "%0 = MAX(%1,%2);" - : "=d" (res) - : "%d" (a), "d" (b) - ); - return res; -} - -#undef MULT16_32_Q15 -static inline ms_word32_t MULT16_32_Q15(ms_word16_t a, ms_word32_t b) -{ - ms_word32_t res; - __asm__ - ( - "A1 = %2.L*%1.L (M);\n\t" - "A1 = A1 >>> 15;\n\t" - "%0 = (A1 += %2.L*%1.H) ;\n\t" - : "=&W" (res), "=&d" (b) - : "d" (a), "1" (b) - : "A1" - ); - return res; -} - -#undef MAC16_32_Q15 -static inline ms_word32_t MAC16_32_Q15(ms_word32_t c, ms_word16_t a, ms_word32_t b) -{ - ms_word32_t res; - __asm__ - ( - "A1 = %2.L*%1.L (M);\n\t" - "A1 = A1 >>> 15;\n\t" - "%0 = (A1 += %2.L*%1.H);\n\t" - "%0 = %0 + %4;\n\t" - : "=&W" (res), "=&d" (b) - : "d" (a), "1" (b), "d" (c) - : "A1" - ); - return res; -} - -#undef MULT16_32_Q14 -static inline ms_word32_t MULT16_32_Q14(ms_word16_t a, ms_word32_t b) -{ - ms_word32_t res; - __asm__ - ( - "%2 <<= 1;\n\t" - "A1 = %1.L*%2.L (M);\n\t" - "A1 = A1 >>> 15;\n\t" - "%0 = (A1 += %1.L*%2.H);\n\t" - : "=W" (res), "=d" (a), "=d" (b) - : "1" (a), "2" (b) - : "A1" - ); - return res; -} - -#undef MAC16_32_Q14 -static inline ms_word32_t MAC16_32_Q14(ms_word32_t c, ms_word16_t a, ms_word32_t b) -{ - ms_word32_t res; - __asm__ - ( - "%1 <<= 1;\n\t" - "A1 = %2.L*%1.L (M);\n\t" - "A1 = A1 >>> 15;\n\t" - "%0 = (A1 += %2.L*%1.H);\n\t" - "%0 = %0 + %4;\n\t" - : "=&W" (res), "=&d" (b) - : "d" (a), "1" (b), "d" (c) - : "A1" - ); - return res; -} - - - -#endif - - - -#else - -typedef float ms_mem_t; -typedef float ms_coef_t; -typedef float ms_lsp_t; -typedef float ms_sig_t; -typedef float ms_word16_t; -typedef float ms_word32_t; - -#define Q15ONE 1.0f -#define LPC_SCALING 1.f -#define SIG_SCALING 1.f -#define LSP_SCALING 1.f -#define GAMMA_SCALING 1.f -#define GAIN_SCALING 1.f -#define GAIN_SCALING_1 1.f - - -#define VERY_SMALL 1e-15f -#define VERY_LARGE32 1e15f -#define VERY_LARGE16 1e15f -#define Q15_ONE ((ms_word16_t)1.f) - -#define QCONST16(x,bits) (x) -#define QCONST32(x,bits) (x) - -#define NEG16(x) (-(x)) -#define NEG32(x) (-(x)) -#define EXTRACT16(x) (x) -#define EXTEND32(x) (x) -#define SHR16(a,shift) (a) -#define SHL16(a,shift) (a) -#define SHR32(a,shift) (a) -#define SHL32(a,shift) (a) -#define PSHR16(a,shift) (a) -#define PSHR32(a,shift) (a) -#define VSHR32(a,shift) (a) -#define SATURATE16(x,a) (x) -#define SATURATE32(x,a) (x) - -#define PSHR(a,shift) (a) -#define SHR(a,shift) (a) -#define SHL(a,shift) (a) -#define SATURATE(x,a) (x) - -#define ADD16(a,b) ((a)+(b)) -#define SUB16(a,b) ((a)-(b)) -#define ADD32(a,b) ((a)+(b)) -#define SUB32(a,b) ((a)-(b)) -#define MULT16_16_16(a,b) ((a)*(b)) -#define MULT16_16(a,b) ((ms_word32_t)(a)*(ms_word32_t)(b)) -#define MAC16_16(c,a,b) ((c)+(ms_word32_t)(a)*(ms_word32_t)(b)) - -#define MULT16_32_Q11(a,b) ((a)*(b)) -#define MULT16_32_Q13(a,b) ((a)*(b)) -#define MULT16_32_Q14(a,b) ((a)*(b)) -#define MULT16_32_Q15(a,b) ((a)*(b)) -#define MULT16_32_P15(a,b) ((a)*(b)) - -#define MAC16_32_Q11(c,a,b) ((c)+(a)*(b)) -#define MAC16_32_Q15(c,a,b) ((c)+(a)*(b)) - -#define MAC16_16_Q11(c,a,b) ((c)+(a)*(b)) -#define MAC16_16_Q13(c,a,b) ((c)+(a)*(b)) -#define MAC16_16_P13(c,a,b) ((c)+(a)*(b)) -#define MULT16_16_Q11_32(a,b) ((a)*(b)) -#define MULT16_16_Q13(a,b) ((a)*(b)) -#define MULT16_16_Q14(a,b) ((a)*(b)) -#define MULT16_16_Q15(a,b) ((a)*(b)) -#define MULT16_16_P15(a,b) ((a)*(b)) -#define MULT16_16_P13(a,b) ((a)*(b)) -#define MULT16_16_P14(a,b) ((a)*(b)) - -#define DIV32_16(a,b) (((ms_word32_t)(a))/(ms_word16_t)(b)) -#define PDIV32_16(a,b) (((ms_word32_t)(a))/(ms_word16_t)(b)) -#define DIV32(a,b) (((ms_word32_t)(a))/(ms_word32_t)(b)) -#define PDIV32(a,b) (((ms_word32_t)(a))/(ms_word32_t)(b)) - - -#endif - -#define MIN16(a,b) ((a) < (b) ? (a) : (b)) /**< Maximum 16-bit value. */ - -#ifdef __cplusplus -extern "C"{ -#endif - -/*abstraction layer over kiss fft, taken from speex as well*/ - -/** Compute tables for an FFT */ -void *ms_fft_init(int size); - -/** Destroy tables for an FFT */ -void ms_fft_destroy(void *table); - -/** Forward (real to half-complex) transform */ -void ms_fft(void *table, ms_word16_t *in, ms_word16_t *out); - -/** Backward (half-complex to real) transform */ -void ms_ifft(void *table, ms_word16_t *in, ms_word16_t *out); - -/** digital filtering api*/ -void ms_fir_mem16(const ms_word16_t *x, const ms_coef_t *num, ms_word16_t *y, int N, int ord, ms_mem_t *mem); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/linphone/mediastreamer2/include/mediastreamer2/dtmfgen.h b/linphone/mediastreamer2/include/mediastreamer2/dtmfgen.h deleted file mode 100644 index 0ea4b930d..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/dtmfgen.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef dtmfgen_h -#define dtmfgen_h - -#include "msfilter.h" - -#define MS_DTMF_GEN_PUT MS_FILTER_METHOD(MS_DTMF_GEN_ID,0,const char) - -extern MSFilterDesc ms_dtmf_gen_desc; - -#endif diff --git a/linphone/mediastreamer2/include/mediastreamer2/ice.h b/linphone/mediastreamer2/include/mediastreamer2/ice.h deleted file mode 100644 index df986c8c8..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/ice.h +++ /dev/null @@ -1,96 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef ice_hh -#define ice_hh - -#include "msfilter.h" -#include "ortp/stun_udp.h" -#include "ortp/stun.h" -#include "ortp/ortp.h" - -/* list of state for STUN connectivity check */ -#define ICE_PRUNED -1 -#define ICE_FROZEN 0 -#define ICE_WAITING 1 -#define ICE_IN_PROGRESS 2 /* STUN request was sent */ -#define ICE_SUCCEEDED 3 -#define ICE_FAILED 4 /* no answer or unrecoverable failure */ - - -struct SdpCandidate { - /* mandatory attributes: draft 19 */ - int foundation; - int component_id; - char transport[20]; - int priority; - char conn_addr[64]; - int conn_port; - char cand_type[20]; - char rel_addr[64]; - int rel_port; - - /* optionnal attributes: draft 19 */ - char extension_attr[512]; /* *(SP extension-att-name SP extension-att-value) */ -}; - -struct CandidatePair { - - struct SdpCandidate local_candidate; - struct SdpCandidate remote_candidate; - long long pair_priority; - /* additionnal information */ - int rem_controlling; - UInt96 tid; - int connectivity_check; - int retransmission_number; - uint64_t retransmission_time; - int nominated_pair; -}; - -#define MAX_ICE_CANDIDATES 10 - -struct IceCheckList { - struct CandidatePair cand_pairs[MAX_ICE_CANDIDATES]; - int nominated_pair_index; - - char loc_ice_ufrag[256]; - char loc_ice_pwd[256]; - char rem_ice_ufrag[256]; - char rem_ice_pwd[256]; - - int rem_controlling; - uint64_t tiebreak_value; - -#define ICE_CL_RUNNING 0 -#define ICE_CL_COMPLETED 1 -#define ICE_CL_FAILED 2 - int state; - - int RTO; - int Ta; - uint64_t keepalive_time; -}; - -#define MS_ICE_SET_SESSION MS_FILTER_METHOD(MS_ICE_ID,0,RtpSession*) -#define MS_ICE_SET_CANDIDATEPAIRS MS_FILTER_METHOD(MS_ICE_ID,1,struct CandidatePair*) - -extern MSFilterDesc ms_ice_desc; - -#endif diff --git a/linphone/mediastreamer2/include/mediastreamer2/mediastream.h b/linphone/mediastreamer2/include/mediastreamer2/mediastream.h deleted file mode 100644 index e0b971fce..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/mediastream.h +++ /dev/null @@ -1,212 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -#ifndef MEDIASTREAM_H -#define MEDIASTREAM_H - -#include "mediastreamer2/msfilter.h" -#include "mediastreamer2/msticker.h" -#include "mediastreamer2/mssndcard.h" -#include "mediastreamer2/mswebcam.h" -#include "mediastreamer2/msvideo.h" -#include "ortp/ortp.h" -#include "ortp/event.h" -#include - -#if defined(_WIN32_WCE) -time_t ms_time (time_t *t); -#else -#define ms_time time -#endif - -typedef enum EchoLimiterType{ - ELInactive, - ELControlMic, - ELControlSpeaker -} EchoLimiterType; - -struct _AudioStream -{ - MSTicker *ticker; - RtpSession *session; - MSFilter *soundread; - MSFilter *soundwrite; - MSFilter *encoder; - MSFilter *decoder; - MSFilter *rtprecv; - MSFilter *rtpsend; - MSFilter *dtmfgen; - MSFilter *ec;/*echo canceler*/ - MSFilter *volsend,*volrecv; /*MSVolumes*/ - MSFilter *read_resampler; - MSFilter *write_resampler; - MSFilter *equalizer; - uint64_t last_packet_count; - time_t last_packet_time; - EchoLimiterType el_type; /*use echo limiter: two MSVolume, measured input level controlling local output level*/ - int ec_tail_len; /*milliseconds*/ - int ec_delay; /*milliseconds*/ - int ec_framesize; /* number of fft points */ - bool_t play_dtmfs; - bool_t use_gc; - bool_t use_agc; - bool_t eq_active; - bool_t use_ng;/*noise gate*/ -}; - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct _AudioStream AudioStream; - -struct _RingStream -{ - MSTicker *ticker; - MSFilter *source; - MSFilter *sndwrite; -}; - -typedef struct _RingStream RingStream; - - - -/* start a thread that does sampling->encoding->rtp_sending|rtp_receiving->decoding->playing */ -AudioStream *audio_stream_start (RtpProfile * prof, int locport, const char *remip, - int remport, int payload_type, int jitt_comp, bool_t echo_cancel); - -AudioStream *audio_stream_start_with_sndcards(RtpProfile * prof, int locport, const char *remip4, int remport, int payload_type, int jitt_comp, MSSndCard *playcard, MSSndCard *captcard, bool_t echocancel); - -int audio_stream_start_with_files (AudioStream * stream, RtpProfile * prof, - const char *remip, int remport, int rem_rtcp_port, - int pt, int jitt_comp, - const char * infile, const char * outfile); - -void audio_stream_play(AudioStream *st, const char *name); -void audio_stream_record(AudioStream *st, const char *name); - -void audio_stream_set_rtcp_information(AudioStream *st, const char *cname, const char *tool); - -void audio_stream_play_received_dtmfs(AudioStream *st, bool_t yesno); - -/* those two function do the same as audio_stream_start() but in two steps -this is useful to make sure that sockets are open before sending an invite; -or to start to stream only after receiving an ack.*/ -AudioStream *audio_stream_new(int locport, bool_t ipv6); -int audio_stream_start_now(AudioStream * stream, RtpProfile * prof, const char *remip, int remport, int rem_rtcp_port, int payload_type, int jitt_comp,MSSndCard *playcard, MSSndCard *captcard, bool_t echo_cancel); -void audio_stream_set_relay_session_id(AudioStream *stream, const char *relay_session_id); -/*returns true if we are still receiving some data from remote end in the last timeout seconds*/ -bool_t audio_stream_alive(AudioStream * stream, int timeout); - -/*enable echo-limiter dispositve: one MSVolume in input branch controls a MSVolume in the output branch*/ -void audio_stream_enable_echo_limiter(AudioStream *stream, EchoLimiterType type); - -/*enable gain control, to be done before start() */ -void audio_stream_enable_gain_control(AudioStream *stream, bool_t val); - -/*enable automatic gain control, to be done before start() */ -void audio_stream_enable_automatic_gain_control(AudioStream *stream, bool_t val); - -/*to be done before start */ -void audio_stream_set_echo_canceller_params(AudioStream *st, int tail_len_ms, int delay_ms, int framesize); - -void audio_stream_set_mic_gain(AudioStream *stream, float gain); - -/*enable noise gate, must be done before start()*/ -void audio_stream_enable_noise_gate(AudioStream *stream, bool_t val); - -/*enable parametric equalizer in the stream that goes to the speaker*/ -void audio_stream_enable_equalizer(AudioStream *stream, bool_t enabled); - -void audio_stream_equalizer_set_gain(AudioStream *stream, int frequency, float gain, int freq_width); - -/* stop the audio streaming thread and free everything*/ -void audio_stream_stop (AudioStream * stream); - -RingStream *ring_start (const char * file, int interval, MSSndCard *sndcard); -RingStream *ring_start_with_cb(const char * file, int interval, MSSndCard *sndcard, MSFilterNotifyFunc func, void * user_data); -void ring_stop (RingStream * stream); - - -/* send a dtmf */ -int audio_stream_send_dtmf (AudioStream * stream, char dtmf); - -void audio_stream_set_default_card(int cardindex); - - -/***************** - Video Support - *****************/ - - -struct _VideoStream -{ - MSTicker *ticker; - RtpSession *session; - MSFilter *source; - MSFilter *pixconv; - MSFilter *sizeconv; - MSFilter *tee; - MSFilter *output; - MSFilter *encoder; - MSFilter *decoder; - MSFilter *rtprecv; - MSFilter *rtpsend; - OrtpEvQueue *evq; - MSVideoSize sent_vsize; - int corner; /*for selfview*/ - bool_t adapt_bitrate; -}; - -typedef struct _VideoStream VideoStream; - -VideoStream *video_stream_new(int locport, bool_t use_ipv6); -void video_stream_enable_adaptive_bitrate_control(VideoStream *s, bool_t yesno); -int video_stream_start(VideoStream * stream, RtpProfile *profile, const char *remip, int remport, int rem_rtcp_port, - int payload, int jitt_comp, MSWebCam *device); -void video_stream_set_relay_session_id(VideoStream *stream, const char *relay_session_id); -void video_stream_set_rtcp_information(VideoStream *st, const char *cname, const char *tool); -/*function to call periodically to handle various events */ -void video_stream_iterate(VideoStream *stream); -void video_stream_send_vfu(VideoStream *stream); -void video_stream_stop(VideoStream * stream); -void video_stream_set_sent_video_size(VideoStream *stream, MSVideoSize vsize); -void video_stream_enable_self_view(VideoStream *stream, bool_t val); -unsigned long video_stream_get_native_window_id(VideoStream *stream); - - -VideoStream * video_preview_start(MSWebCam *device, MSVideoSize vsize); -void video_preview_stop(VideoStream *stream); - -int video_stream_recv_only_start(VideoStream * stream, RtpProfile *profile, const char *remip, int remport, int payload, int jitt_comp); -int video_stream_send_only_start(VideoStream * stream, RtpProfile *profile, const char *remip, int remport, - int rem_rtcp_port, int payload, int jitt_comp, MSWebCam *device); -void video_stream_recv_only_stop(VideoStream *stream); -void video_stream_send_only_stop(VideoStream *stream); - - -bool_t ms_is_ipv6(const char *address); - -#ifdef __cplusplus -} -#endif - - -#endif diff --git a/linphone/mediastreamer2/include/mediastreamer2/mscommon.h b/linphone/mediastreamer2/include/mediastreamer2/mscommon.h deleted file mode 100644 index 869feeff3..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/mscommon.h +++ /dev/null @@ -1,204 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef mscommon_h -#define mscommon_h - -#include - -#define ms_malloc ortp_malloc -#define ms_malloc0 ortp_malloc0 -#define ms_realloc ortp_realloc -#define ms_new ortp_new -#define ms_new0 ortp_new0 -#define ms_free ortp_free -#define ms_strdup ortp_strdup -#define ms_strdup_printf ortp_strdup_printf - -#define ms_mutex_t ortp_mutex_t -#define ms_mutex_init ortp_mutex_init -#define ms_mutex_destroy ortp_mutex_destroy -#define ms_mutex_lock ortp_mutex_lock -#define ms_mutex_unlock ortp_mutex_unlock - -#define ms_cond_t ortp_cond_t -#define ms_cond_init ortp_cond_init -#define ms_cond_wait ortp_cond_wait -#define ms_cond_signal ortp_cond_signal -#define ms_cond_broadcast ortp_cond_broadcast -#define ms_cond_destroy ortp_cond_destroy - -#ifdef WIN32 -static inline void ms_debug(const char *fmt,...) -{ - va_list args; - va_start (args, fmt); - ortp_logv(ORTP_DEBUG, fmt, args); - va_end (args); -} -#else -#ifdef DEBUG -static inline void ms_debug(const char *fmt,...) -{ - va_list args; - va_start (args, fmt); - ortp_logv(ORTP_DEBUG, fmt, args); - va_end (args); -} -#else -#define ms_debug(...) -#endif -#endif - - - -#define ms_message ortp_message -#define ms_warning ortp_warning -#define ms_error ortp_error -#define ms_fatal ortp_fatal - -#define ms_return_val_if_fail(_expr_,_ret_)\ - if (!(_expr_)) { ms_error("assert "#_expr_ "failed"); return (_ret_);} - -#define ms_return_if_fail(_expr_) \ - if (!(_expr_)){ ms_error("assert "#_expr_ "failed"); return ;} - -#define ms_thread_t ortp_thread_t -#define ms_thread_create ortp_thread_create -#define ms_thread_join ortp_thread_join -#define ms_thread_exit ortp_thread_exit - -struct _MSList { - struct _MSList *next; - struct _MSList *prev; - void *data; -}; - -typedef struct _MSList MSList; - - -#define ms_list_next(elem) ((elem)->next) - - -#ifdef __cplusplus -extern "C"{ -#endif - -MSList * ms_list_append(MSList *elem, void * data); -MSList * ms_list_prepend(MSList *elem, void * data); -MSList * ms_list_free(MSList *elem); -MSList * ms_list_concat(MSList *first, MSList *second); -MSList * ms_list_remove(MSList *first, void *data); -int ms_list_size(const MSList *first); -void ms_list_for_each(const MSList *list, void (*func)(void *)); -void ms_list_for_each2(const MSList *list, void (*func)(void *, void *), void *user_data); -MSList *ms_list_remove_link(MSList *list, MSList *elem); -MSList *ms_list_find(MSList *list, void *data); -MSList *ms_list_find_custom(MSList *list, int (*compare_func)(const void *, const void*), void *user_data); -void * ms_list_nth_data(const MSList *list, int index); -int ms_list_position(const MSList *list, MSList *elem); -int ms_list_index(const MSList *list, void *data); -MSList *ms_list_insert_sorted(MSList *list, void *data, int (*compare_func)(const void *, const void*)); -MSList *ms_list_insert(MSList *list, MSList *before, void *data); -MSList *ms_list_copy(const MSList *list); - -#undef MIN -#define MIN(a,b) ((a)>(b) ? (b) : (a)) -#undef MAX -#define MAX(a,b) ((a)>(b) ? (a) : (b)) - -/** - * @file mscommon.h - * @brief mediastreamer2 mscommon.h include file - * - * This file provide the API needed to initialize - * and reset the mediastreamer2 library. - * - */ - -/** - * @defgroup mediastreamer2_init Init API - manage mediastreamer2 library. - * @ingroup mediastreamer2_api - * @{ - */ - - -/** - * Initialize the mediastreamer2 library. - * - * This must be called once before calling any other API. - */ -void ms_init(void); - -/** - * Load plugins from a specific directory. - * This method basically loads all libraries in the specified directory and attempts to call a C function called - * \_init. For example if a library 'libdummy.so' or 'libdummy.dll' is found, then the loader tries to locate - * a C function called 'libdummy_init()' and calls it if it exists. - * ms_load_plugins() can be used to load non-mediastreamer2 plugins as it does not expect mediastreamer2 specific entry points. - * - * @param directory A directory where plugins library are available. - * - * Returns: >0 if successfull, 0 if not plugins loaded, -1 otherwise. - */ -int ms_load_plugins(const char *directory); - -/** - * Release resource allocated in the mediastreamer2 library. - * - * This must be called once before closing program. - */ -void ms_exit(void); - -struct _MSSndCardDesc; - -void ms_sleep(int seconds); - -/** - * The max payload size allowed. - * Filters that generate data that can be sent through RTP should make packets - * whose size is below ms_get_payload_max_size(). - * The default value is 1440 computed as the standart internet MTU minus IPv6 header, - * UDP header and RTP header. As IPV4 header is smaller than IPv6 header, this - * value works for both. - * -**/ -int ms_get_payload_max_size(); - -void ms_set_payload_max_size(int size); - -/** - * Returns the network Max Transmission Unit to reach destination_host. - * This will attempt to send one or more big packets to destination_host, to a random port. - * Those packets are filled with zeroes. -**/ -int ms_discover_mtu(const char *destination_host); - -/** - * Set mediastreamer default mtu, used to compute the default RTP max payload size. - * This function will call ms_set_payload_max_size(mtu-[ipv6 header size]). -**/ -void ms_set_mtu(int mtu); - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/linphone/mediastreamer2/include/mediastreamer2/msequalizer.h b/linphone/mediastreamer2/include/mediastreamer2/msequalizer.h deleted file mode 100644 index cebecaaf3..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/msequalizer.h +++ /dev/null @@ -1,44 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2009 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef msequalizer_h -#define msequalizer_h - -#include - -typedef struct _MSEqualizerGain{ - float frequency; ///< In hz - float gain; ///< between 0-1.2 - float width; ///< frequency band width around mid frequency for which the gain is applied, in Hz. Use 0 for the lowest frequency resolution. -}MSEqualizerGain; - -#define MS_EQUALIZER_SET_GAIN MS_FILTER_METHOD(MS_EQUALIZER_ID,0,MSEqualizerGain) -#define MS_EQUALIZER_GET_GAIN MS_FILTER_METHOD(MS_EQUALIZER_ID,1,MSEqualizerGain) -#define MS_EQUALIZER_SET_ACTIVE MS_FILTER_METHOD(MS_EQUALIZER_ID,2,int) -/**dump the spectral response into a table of float. The table must be sized according to the value returned by - * MS_EQUALIZER_GET_NUM_FREQUENCIES -**/ -#define MS_EQUALIZER_DUMP_STATE MS_FILTER_METHOD(MS_EQUALIZER_ID,3,float) - -/**returns the number of frequencies*/ -#define MS_EQUALIZER_GET_NUM_FREQUENCIES MS_FILTER_METHOD(MS_EQUALIZER_ID,4,int) - - -#endif - diff --git a/linphone/mediastreamer2/include/mediastreamer2/msfileplayer.h b/linphone/mediastreamer2/include/mediastreamer2/msfileplayer.h deleted file mode 100644 index 8e1931448..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/msfileplayer.h +++ /dev/null @@ -1,43 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef msfileplayer_h -#define msfileplayer_h - -#include "msfilter.h" - - -/*methods*/ -#define MS_FILE_PLAYER_OPEN MS_FILTER_METHOD(MS_FILE_PLAYER_ID,0,const char*) -#define MS_FILE_PLAYER_START MS_FILTER_METHOD_NO_ARG(MS_FILE_PLAYER_ID,1) -#define MS_FILE_PLAYER_STOP MS_FILTER_METHOD_NO_ARG(MS_FILE_PLAYER_ID,2) -#define MS_FILE_PLAYER_CLOSE MS_FILTER_METHOD_NO_ARG(MS_FILE_PLAYER_ID,3) -/* set loop mode: - -1: no looping, - 0: loop at end of file, - x>0, loop after x miliseconds after eof -*/ -#define MS_FILE_PLAYER_LOOP MS_FILTER_METHOD(MS_FILE_PLAYER_ID,4,int) -#define MS_FILE_PLAYER_DONE MS_FILTER_METHOD(MS_FILE_PLAYER_ID,5,int) -#define MS_FILE_PLAYER_BIG_BUFFER MS_FILTER_METHOD(MS_FILE_PLAYER_ID,6,int) - -/*events*/ -#define MS_FILE_PLAYER_EOF MS_FILTER_EVENT_NO_ARG(MS_FILE_PLAYER_ID,0) - -#endif - diff --git a/linphone/mediastreamer2/include/mediastreamer2/msfilerec.h b/linphone/mediastreamer2/include/mediastreamer2/msfilerec.h deleted file mode 100644 index b46cb38ac..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/msfilerec.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef msfilerec_h -#define msfilerec_h - -#include "msfilter.h" - -extern MSFilterDesc ms_file_rec_desc; - -#define MS_FILE_REC_OPEN MS_FILTER_METHOD(MS_FILE_REC_ID,0,const char) -#define MS_FILE_REC_START MS_FILTER_METHOD_NO_ARG(MS_FILE_REC_ID,1) -#define MS_FILE_REC_STOP MS_FILTER_METHOD_NO_ARG(MS_FILE_REC_ID,2) -#define MS_FILE_REC_CLOSE MS_FILTER_METHOD_NO_ARG(MS_FILE_REC_ID,3) - - - -#endif diff --git a/linphone/mediastreamer2/include/mediastreamer2/msfilter.h b/linphone/mediastreamer2/include/mediastreamer2/msfilter.h deleted file mode 100644 index 3828144bf..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/msfilter.h +++ /dev/null @@ -1,508 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef msfilter_h -#define msfilter_h - -#include "mscommon.h" -#include "msqueue.h" -#include "allfilters.h" - -/** - * @file msfilter.h - * @brief mediastreamer2 msfilter.h include file - * - * This file provide the API needed to create, link, - * unlink, find and destroy filter. - * - * It also provides definitions if you wish to implement - * your own filters. - * - */ - -/** - * @defgroup mediastreamer2_filter Filter API - manage mediastreamer2 filters. - * @ingroup mediastreamer2_api - * @{ - */ - -/** - * Structure for filter's methods (init, preprocess, process, postprocess, uninit). - * @var MSFilterFunc - */ -typedef void (*MSFilterFunc)(struct _MSFilter *f); - -/** - * Structure for filter's methods used to set filter's options. - * @var MSFilterMethodFunc - */ -typedef int (*MSFilterMethodFunc)(struct _MSFilter *f, void *arg); - -/** - * Structure for filter's methods used as a callback to notify events. - * @var MSFilterNotifyFunc - */ -typedef void (*MSFilterNotifyFunc)(void *userdata , unsigned int id, void *arg); - -struct _MSFilterMethod{ - int id; - MSFilterMethodFunc method; -}; - - -/** - * Structure for holding filter's methods to set filter's options. - * @var MSFilterMethod - */ -typedef struct _MSFilterMethod MSFilterMethod; - -enum _MSFilterCategory{ - MS_FILTER_OTHER, - MS_FILTER_ENCODER, - MS_FILTER_DECODER -}; - -/** - * Structure to describe filter's category. - *
- *     MS_FILTER_OTHER
- *     MS_FILTER_ENCODER
- *     MS_FILTER_DECODER
- * 
- * @var MSFilterCategory - */ -typedef enum _MSFilterCategory MSFilterCategory; - -enum _MSFilterFlags{ - MS_FILTER_IS_PUMP = 1 -}; - -typedef enum _MSFilterFlags MSFilterFlags; - -struct _MSFilterDesc{ - MSFilterId id; /* the id declared in allfilters.h */ - const char *name; /* filter name */ - const char *text; /*some descriptive text*/ - MSFilterCategory category; - const char *enc_fmt; /* must be set if MS_FILTER_ENCODER/MS_FILTER_DECODER */ - int ninputs; /*number of inputs */ - int noutputs; /*number of outputs */ - MSFilterFunc init; - MSFilterFunc preprocess; /* called once before processing */ - MSFilterFunc process; /* called every tick to do the filter's job*/ - MSFilterFunc postprocess; /*called once after processing */ - MSFilterFunc uninit; - MSFilterMethod *methods; - unsigned int flags; -}; - -/** - * Structure for filter's description. - * @var MSFilterDesc - */ -typedef struct _MSFilterDesc MSFilterDesc; - -struct _MSFilter{ - MSFilterDesc *desc; - /*protected attributes */ - ms_mutex_t lock; - MSQueue **inputs; - MSQueue **outputs; - MSFilterNotifyFunc notify; - void *notify_ud; - void *data; - struct _MSTicker *ticker; - /*private attributes */ - uint32_t last_tick; - bool_t seen; -}; - - -/** - * Structure to create/link/unlink/destroy filter's object. - * @var MSFilter - */ -typedef struct _MSFilter MSFilter; - -struct _MSConnectionPoint{ - MSFilter *filter; - int pin; -}; - -/** - * Structure that represents a connection point of a MSFilter - * @var MSConnectionPoint - */ -typedef struct _MSConnectionPoint MSConnectionPoint; - -struct _MSConnectionHelper{ - MSConnectionPoint last; -}; - -/** - * Structure that holds data when using the ms_connection_helper_* functions. - * @var MSConnectionHelper -**/ -typedef struct _MSConnectionHelper MSConnectionHelper; - - -#ifdef __cplusplus -extern "C"{ -#endif - -/** - * Register a filter description. (plugins use only!) - * - * When you build your own plugin, this method will - * add the encoder or decoder to the internal list - * of supported codec. Then, this plugin can be used - * transparently from the application. - * - * ms_filter_get_encoder, ms_filter_get_decoder, - * ms_filter_create_encoder, ms_filter_create_decoder - * and ms_filter_codec_supported - * can then be used as if the codec was internally. - * supported. - * - * @param desc a filter description. - */ -void ms_filter_register(MSFilterDesc *desc); - -/** - * Retrieve encoders according to codec name. - * - * Internal supported codecs: - * PCMU, PCMA, speex, gsm - * Existing Public plugins: - * iLBC - * - * @param mime A string indicating the codec. - * - * Returns: a MSFilterDesc if successfull, NULL otherwise. - */ -MSFilterDesc * ms_filter_get_encoder(const char *mime); - -/** - * Retrieve decoders according to codec name. - * - * Internal supported codecs: - * PCMU, PCMA, speex, gsm - * Existing Public plugins: - * iLBC - * - * @param mime A string indicating the codec. - * - * Returns: a MSFilterDesc if successfull, NULL otherwise. - */ -MSFilterDesc * ms_filter_get_decoder(const char *mime); - -/** - * Create encoder filter according to codec name. - * - * Internal supported codecs: - * PCMU, PCMA, speex, gsm - * Existing Public plugins: - * iLBC - * - * @param mime A string indicating the codec. - * - * Returns: a MSFilter if successfull, NULL otherwise. - */ -MSFilter * ms_filter_create_encoder(const char *mime); - -/** - * Create decoder filter according to codec name. - * - * Internal supported codecs: - * PCMU, PCMA, speex, gsm - * Existing Public plugins: - * iLBC - * - * @param mime A string indicating the codec. - * - * Returns: a MSFilter if successfull, NULL otherwise. - */ -MSFilter * ms_filter_create_decoder(const char *mime); - -/** - * Check if a encode or decode filter exists for a codec name. - * - * Internal supported codecs: - * PCMU, PCMA, speex, gsm - * Existing Public plugins: - * iLBC - * - * @param mime A string indicating the codec. - * - * Returns: TRUE if successfull, FALSE otherwise. - */ -bool_t ms_filter_codec_supported(const char *mime); - -/** - * Create decoder filter according to a filter's MSFilterId. - * - * @param id A MSFilterId identifier for the filter. - * - * Returns: a MSFilter if successfull, NULL otherwise. - */ -MSFilter *ms_filter_new(MSFilterId id); - -/** - * Create decoder filter according to a filter's name. - * - * @param name A name for the filter. - * - * Returns: a MSFilter if successfull, NULL otherwise. - */ -MSFilter *ms_filter_new_from_name(const char *name); - -/** - * Create decoder filter according to a filter's description. - * - * The primary use is to create your own filter's in your - * application and avoid registration inside mediastreamer2. - * - * @param desc A MSFilterDesc for the filter. - * - * Returns: a MSFilter if successfull, NULL otherwise. - */ -MSFilter *ms_filter_new_from_desc(MSFilterDesc *desc); - -/** - * Link one OUTPUT pin from a filter to an INPUT pin of another filter. - * - * All data coming from the OUTPUT pin of one filter will be distributed - * to the INPUT pin of the second filter. - * - * @param f1 A MSFilter object containing the OUTPUT pin - * @param pin1 An index of an OUTPUT pin. - * @param f2 A MSFilter object containing the INPUT pin - * @param pin2 An index of an INPUT pin. - * - * Returns: 0 if sucessful, -1 otherwise. - */ -int ms_filter_link(MSFilter *f1, int pin1, MSFilter *f2, int pin2); - -/** - * Unlink one OUTPUT pin from a filter to an INPUT pin of another filter. - * - * @param f1 A MSFilter object containing the OUTPUT pin - * @param pin1 An index of an OUTPUT pin. - * @param f2 A MSFilter object containing the INPUT pin - * @param pin2 An index of an INPUT pin. - * - * Returns: 0 if sucessful, -1 otherwise. - */ -int ms_filter_unlink(MSFilter *f1, int pin1, MSFilter *f2, int pin2); - -/** - * Call a filter's method to set or get options. - * - * @param f A MSFilter object. - * @param id A private filter ID for the option. - * @param arg A private user data for the filter. - * - * Returns: 0 if successfull, -1 otherwise. - */ -int ms_filter_call_method(MSFilter *f, unsigned int id, void *arg); - -/** - * Call a filter's method to set options. - * - * @param f A MSFilter object. - * @param id A private filter ID for the option. - * - * Returns: 0 if successfull, -1 otherwise. - */ -int ms_filter_call_method_noarg(MSFilter *f, unsigned int id); - -/** - * Set a callback on filter's to be informed of private filter's event. - * - * @param f A MSFilter object. - * @param fn A MSFilterNotifyFunc that will be called. - * @param userdata A pointer to private data. - * - * Returns: 0 if successfull, -1 otherwise. - */ -void ms_filter_set_notify_callback(MSFilter *f, MSFilterNotifyFunc fn, void *userdata); - -/** - * Get MSFilterId's filter. - * - * @param f A MSFilter object. - * - * Returns: MSFilterId if successfull, -1 otherwise. - */ -MSFilterId ms_filter_get_id(MSFilter *f); - - -/** - * Obtain the list of current filter's neighbours, ie filters that are part of same graph. - * - * Returns: a MSList of MSFilter, that needs to be freed by the caller when no more needed. -**/ -MSList * ms_filter_find_neighbours(MSFilter *me); - -/** - * Destroy a filter object. - * - * @param f A MSFilter object. - * - */ -void ms_filter_destroy(MSFilter *f); - -/** - * Initialize a MSConnectionHelper. - * - * @param h A MSConnectionHelper, usually (but not necessarily) on stack - * -**/ -void ms_connection_helper_start(MSConnectionHelper *h); - -/** - * \brief Enter a MSFilter to be connected into the MSConnectionHelper object. - * - * This functions enters a MSFilter to be connected into the MSConnectionHelper - * object and connects it to the last entered if not the first one. - * The MSConnectionHelper is useful to reduce the amount of code necessary to create graphs in case - * the connections are made in an ordered manner and some filters are present conditionally in graphs. - * For example, instead of writing - * \code - * ms_filter_link(f1,0,f2,1); - * ms_filter_link(f2,0,f3,0); - * ms_filter_link(f3,1,f4,0); - * \endcode - * You can write: - * \code - * MSConnectionHelper h; - * ms_connection_helper_start(&h); - * ms_connection_helper_link(&h,f1,-1,0); - * ms_connection_helper_link(&h,f2,1,0); - * ms_connection_helper_link(&h,f3,0,1); - * ms_connection_helper_link(&h,f4,0,-1); - * \endcode - * Which is a bit longer to write here, but now imagine f2 needs to be present in the graph only - * in certain conditions: in the first case you have rewrite the two first lines, in the second case - * you just need to replace the fourth line by: - * \code - * if (my_condition) ms_connection_helper_link(&h,f2,1,0); - * \endcode - * - * @param h a connection helper - * @param f a MSFilter - * @param inpin an input pin number with which the MSFilter needs to connect to previously entered MSFilter - * @param outpin an output pin number with which the MSFilter needs to be connected to the next entered MSFilter - * - * Returns: the return value of ms_filter_link() that is called internally to this function. -**/ -int ms_connection_helper_link(MSConnectionHelper *h, MSFilter *f, int inpin, int outpin); - - -/** - * \brief Enter a MSFilter to be disconnected into the MSConnectionHelper object. - * Process exactly the same way as ms_connection_helper_link() but calls ms_filter_unlink() on the - * entered filters. -**/ -int ms_connection_helper_unlink(MSConnectionHelper *h, MSFilter *f, int inpin, int outpin); - -/* I define the id taking the lower bits of the address of the MSFilterDesc object, -the method index (_cnt_) and the argument size */ -/* I hope using this to avoid type mismatch (calling a method on the wrong filter)*/ -#define MS_FILTER_METHOD_ID(_id_,_cnt_,_argsize_) \ - ( (((unsigned long)(_id_)) & 0xFFFF)<<16 | (_cnt_<<8) | (_argsize_ & 0xFF )) - -#define MS_FILTER_METHOD(_id_,_count_,_argtype_) \ - MS_FILTER_METHOD_ID(_id_,_count_,sizeof(_argtype_)) - -#define MS_FILTER_METHOD_NO_ARG(_id_,_count_) \ - MS_FILTER_METHOD_ID(_id_,_count_,0) - - -#define MS_FILTER_BASE_METHOD(_count_,_argtype_) \ - MS_FILTER_METHOD_ID(MS_FILTER_BASE_ID,_count_,sizeof(_argtype_)) - -#define MS_FILTER_BASE_METHOD_NO_ARG(_count_) \ - MS_FILTER_METHOD_ID(MS_FILTER_BASE_ID,_count_,0) - -#define MS_FILTER_EVENT(_id_,_count_,_argtype_) \ - MS_FILTER_METHOD_ID(_id_,_count_,sizeof(_argtype_)) - -#define MS_FILTER_EVENT_NO_ARG(_id_,_count_)\ - MS_FILTER_METHOD_ID(_id_,_count_,0) - -/* some MSFilter base generic methods:*/ -#define MS_FILTER_SET_SAMPLE_RATE MS_FILTER_BASE_METHOD(0,int) -#define MS_FILTER_GET_SAMPLE_RATE MS_FILTER_BASE_METHOD(1,int) -#define MS_FILTER_SET_BITRATE MS_FILTER_BASE_METHOD(2,int) -#define MS_FILTER_GET_BITRATE MS_FILTER_BASE_METHOD(3,int) -#define MS_FILTER_GET_NCHANNELS MS_FILTER_BASE_METHOD(5,int) -#define MS_FILTER_SET_NCHANNELS MS_FILTER_BASE_METHOD(6,int) -#define MS_FILTER_ADD_FMTP MS_FILTER_BASE_METHOD(7,const char) -#define MS_FILTER_ADD_ATTR MS_FILTER_BASE_METHOD(8,const char) -#define MS_FILTER_SET_MTU MS_FILTER_BASE_METHOD(9,int) -#define MS_FILTER_GET_MTU MS_FILTER_BASE_METHOD(10,int) - - -/* more specific methods: to be moved into implementation specific header files*/ -#define MS_FILTER_SET_FRAMESIZE MS_FILTER_BASE_METHOD(11,int) -#define MS_FILTER_SET_FILTERLENGTH MS_FILTER_BASE_METHOD(12,int) -#define MS_FILTER_SET_OUTPUT_SAMPLE_RATE MS_FILTER_BASE_METHOD(13,int) -#define MS_FILTER_ENABLE_DIRECTMODE MS_FILTER_BASE_METHOD(14,int) -#define MS_FILTER_ENABLE_VAD MS_FILTER_BASE_METHOD(15,int) -#define MS_FILTER_GET_STAT_DISCARDED MS_FILTER_BASE_METHOD(16,int) -#define MS_FILTER_GET_STAT_MISSED MS_FILTER_BASE_METHOD(17,int) -#define MS_FILTER_GET_STAT_INPUT MS_FILTER_BASE_METHOD(18,int) -#define MS_FILTER_GET_STAT_OUTPUT MS_FILTER_BASE_METHOD(19,int) -#define MS_FILTER_ENABLE_AGC MS_FILTER_BASE_METHOD(20,int) -#define MS_FILTER_SET_PLAYBACKDELAY MS_FILTER_BASE_METHOD(21,int) -#define MS_FILTER_ENABLE_HALFDUPLEX MS_FILTER_BASE_METHOD(22,int) -#define MS_FILTER_SET_VAD_PROB_START MS_FILTER_BASE_METHOD(23,int) -#define MS_FILTER_SET_VAD_PROB_CONTINUE MS_FILTER_BASE_METHOD(24,int) -#define MS_FILTER_SET_MAX_GAIN MS_FILTER_BASE_METHOD(25,int) - -#define MS_CONF_SPEEX_PREPROCESS_MIC MS_FILTER_EVENT(MS_CONF_ID, 1, void*) -#define MS_CONF_CHANNEL_VOLUME MS_FILTER_EVENT(MS_CONF_ID, 3, void*) - -#define MS_SPEEX_EC_PREPROCESS_MIC MS_FILTER_EVENT(MS_SPEEX_EC_ID, 1, void*) -#define MS_SPEEX_EC_ECHO_STATE MS_FILTER_EVENT(MS_SPEEX_EC_ID, 2, void*) -/** @} */ - -/*private methods*/ -void ms_filter_process(MSFilter *f); -void ms_filter_preprocess(MSFilter *f, struct _MSTicker *t); -void ms_filter_postprocess(MSFilter *f); -bool_t ms_filter_inputs_have_data(MSFilter *f); -void ms_filter_notify(MSFilter *f, unsigned int id, void *arg); -void ms_filter_notify_no_arg(MSFilter *f, unsigned int id); -#define ms_filter_lock(f) ms_mutex_lock(&(f)->lock) -#define ms_filter_unlock(f) ms_mutex_unlock(&(f)->lock) -void ms_filter_unregister_all(void); - -#ifdef __cplusplus -} -#endif - -/* used by awk script in Makefile.am to generate alldescs.c */ -#define MS_FILTER_DESC_EXPORT(desc) - -/* xgettext markup */ -#define N_(String) String - -#endif diff --git a/linphone/mediastreamer2/include/mediastreamer2/msqueue.h b/linphone/mediastreamer2/include/mediastreamer2/msqueue.h deleted file mode 100644 index 98e776d2b..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/msqueue.h +++ /dev/null @@ -1,117 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef MSQUEUE_H -#define MSQUEUE_H - -#include "ortp/str_utils.h" - -/* for the moment these are stupid queues limited to one element*/ - -typedef struct _MSCPoint{ - struct _MSFilter *filter; - int pin; -} MSCPoint; - -typedef struct _MSQueue -{ - queue_t q; - MSCPoint prev; - MSCPoint next; -}MSQueue; - - -MSQueue * ms_queue_new(struct _MSFilter *f1, int pin1, struct _MSFilter *f2, int pin2 ); - -static inline mblk_t *ms_queue_get(MSQueue *q){ - return getq(&q->q); -} - -static inline void ms_queue_put(MSQueue *q, mblk_t *m){ - putq(&q->q,m); - return; -} - -static inline mblk_t * ms_queue_peek_last(MSQueue *q){ - return qlast(&q->q); -} - -static inline bool_t ms_queue_empty(MSQueue *q){ - return qempty(&q->q); -} - -#ifdef __cplusplus -extern "C" -{ -#endif - -/*init a queue on stack*/ -void ms_queue_init(MSQueue *q); - -void ms_queue_flush(MSQueue *q); - -void ms_queue_destroy(MSQueue *q); - -#define mblk_set_timestamp_info(m,ts) (m)->reserved1=(ts); -#define mblk_get_timestamp_info(m) ((m)->reserved1) -#define mblk_set_marker_info(m,bit) (m)->reserved2=((m)->reserved2|bit) -#define mblk_get_marker_info(m) ((m)->reserved2&0x1) -#define mblk_set_rate(m,bits) (m)->reserved2=((m)->reserved2|(bits)<<1) -#define mblk_get_rate(m) (((m)->reserved2>>1)&0x3) -#define mblk_set_payload_type(m,bits) (m)->reserved2=((m)->reserved2|(bits<<3)) -#define mblk_get_payload_type(m) (((m)->reserved2>>3)&0x7F) -#define mblk_set_precious_flag(m,bit) (m)->reserved2=(m)->reserved2|((bit & 0x1)<<10) /*use to prevent mirroring*/ -#define mblk_get_precious_flag(m) (((m)->reserved2)>>10 & 0x1) - -struct _MSBufferizer{ - queue_t q; - int size; -}; - -typedef struct _MSBufferizer MSBufferizer; - -/*allocates and initialize */ -MSBufferizer * ms_bufferizer_new(void); - -/*initialize in memory */ -void ms_bufferizer_init(MSBufferizer *obj); - -void ms_bufferizer_put(MSBufferizer *obj, mblk_t *m); - -/* put every mblk_t from q, into the bufferizer */ -void ms_bufferizer_put_from_queue(MSBufferizer *obj, MSQueue *q); - -int ms_bufferizer_read(MSBufferizer *obj, uint8_t *data, int datalen); - -/* returns the number of bytes available in the bufferizer*/ -static inline int ms_bufferizer_get_avail(MSBufferizer *obj){ - return obj->size; -} - -/* purge all data pending in the bufferizer */ -void ms_bufferizer_flush(MSBufferizer *obj); - -void ms_bufferizer_uninit(MSBufferizer *obj); - -void ms_bufferizer_destroy(MSBufferizer *obj); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/linphone/mediastreamer2/include/mediastreamer2/msrtp.h b/linphone/mediastreamer2/include/mediastreamer2/msrtp.h deleted file mode 100644 index 13ac30a65..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/msrtp.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -#ifndef msrtp_hh -#define msrtp_hh - -#include "msfilter.h" -#include "ice.h" -#include "ortp/ortp.h" - -#define MS_RTP_RECV_SET_SESSION MS_FILTER_METHOD(MS_RTP_RECV_ID,0,RtpSession*) - -#define MS_RTP_SEND_SET_SESSION MS_FILTER_METHOD(MS_RTP_SEND_ID,0,RtpSession*) - -#define MS_RTP_SEND_SEND_DTMF MS_FILTER_METHOD(MS_RTP_SEND_ID,1,const char) - -#define MS_RTP_SEND_MUTE_MIC MS_FILTER_METHOD_NO_ARG(MS_RTP_SEND_ID,3) - -#define MS_RTP_SEND_UNMUTE_MIC MS_FILTER_METHOD_NO_ARG(MS_RTP_SEND_ID,4) - -#define MS_RTP_SEND_SET_RELAY_SESSION_ID MS_FILTER_METHOD(MS_RTP_SEND_ID,5,const char *) - -#define MS_RTP_SEND_SET_DTMF_DURATION MS_FILTER_METHOD(MS_RTP_SEND_ID,1,int) - -extern MSFilterDesc ms_rtp_send_desc; -extern MSFilterDesc ms_rtp_recv_desc; - -#endif diff --git a/linphone/mediastreamer2/include/mediastreamer2/mssndcard.h b/linphone/mediastreamer2/include/mediastreamer2/mssndcard.h deleted file mode 100644 index ea197482f..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/mssndcard.h +++ /dev/null @@ -1,436 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef sndcard_h -#define sndcard_h - -#include "mscommon.h" - -/** - * @file mssndcard.h - * @brief mediastreamer2 mssndcard.h include file - * - * This file provide the API needed to manage - * soundcard filters. - * - */ - -/** - * @defgroup mediastreamer2_soundcard Sound Card API - manage audio capture/play filters. - * @ingroup mediastreamer2_api - * @{ - */ - -struct _MSSndCardManager{ - MSList *cards; - MSList *descs; -}; - -/** - * Structure for sound card manager object. - * @var MSSndCardManager - */ -typedef struct _MSSndCardManager MSSndCardManager; - -enum _MSSndCardMixerElem{ - MS_SND_CARD_MASTER, - MS_SND_CARD_PLAYBACK, - MS_SND_CARD_CAPTURE -}; - -/** - * Structure for sound card mixer values. - * @var MSSndCardMixerElem - */ -typedef enum _MSSndCardMixerElem MSSndCardMixerElem; - -enum _MSSndCardCapture { - MS_SND_CARD_MIC, - MS_SND_CARD_LINE -}; - -/** - * Structure for sound card capture source values. - * @var MSSndCardCapture - */ -typedef enum _MSSndCardCapture MSSndCardCapture; - -enum _MSSndCardControlElem { - MS_SND_CARD_MASTER_MUTE, - MS_SND_CARD_PLAYBACK_MUTE, - MS_SND_CARD_CAPTURE_MUTE -}; - -/** - * Structure for sound card mixer values. - * @var MSSndCardControlElem - */ -typedef enum _MSSndCardControlElem MSSndCardControlElem; - -struct _MSSndCard; - -typedef void (*MSSndCardDetectFunc)(MSSndCardManager *obj); -typedef void (*MSSndCardInitFunc)(struct _MSSndCard *obj); -typedef void (*MSSndCardUninitFunc)(struct _MSSndCard *obj); -typedef void (*MSSndCardSetLevelFunc)(struct _MSSndCard *obj, MSSndCardMixerElem e, int percent); -typedef void (*MSSndCardSetCaptureFunc)(struct _MSSndCard *obj, MSSndCardCapture e); -typedef int (*MSSndCardGetLevelFunc)(struct _MSSndCard *obj, MSSndCardMixerElem e); -typedef int (*MSSndCardSetControlFunc)(struct _MSSndCard *obj, MSSndCardControlElem e, int val); -typedef int (*MSSndCardGetControlFunc)(struct _MSSndCard *obj, MSSndCardControlElem e); -typedef struct _MSFilter * (*MSSndCardCreateReaderFunc)(struct _MSSndCard *obj); -typedef struct _MSFilter * (*MSSndCardCreateWriterFunc)(struct _MSSndCard *obj); -typedef struct _MSSndCard * (*MSSndCardDuplicateFunc)(struct _MSSndCard *obj); -typedef void (*MSSndCardUnloadFunc)(MSSndCardManager *obj); - -struct _MSSndCardDesc{ - const char *driver_type; - MSSndCardDetectFunc detect; - MSSndCardInitFunc init; - MSSndCardSetLevelFunc set_level; - MSSndCardGetLevelFunc get_level; - MSSndCardSetCaptureFunc set_capture; - MSSndCardSetControlFunc set_control; - MSSndCardGetControlFunc get_control; - MSSndCardCreateReaderFunc create_reader; - MSSndCardCreateWriterFunc create_writer; - MSSndCardUninitFunc uninit; - MSSndCardDuplicateFunc duplicate; - MSSndCardUnloadFunc unload; - -}; - -/** - * Structure for sound card description object. - * @var MSSndCardDesc - */ -typedef struct _MSSndCardDesc MSSndCardDesc; - -#define MS_SND_CARD_CAP_DISABLED (0) -#define MS_SND_CARD_CAP_CAPTURE (1) -#define MS_SND_CARD_CAP_PLAYBACK (1<<1) - -struct _MSSndCard{ - MSSndCardDesc *desc; - char *name; - char *id; - unsigned int capabilities; - void *data; -}; - -/** - * Structure for sound card object. - * @var MSSndCard - */ -typedef struct _MSSndCard MSSndCard; - -#ifdef __cplusplus -extern "C"{ -#endif - -/** - * @defgroup mediastreamer2_soundcardmanager Sound Card Manager API - * @ingroup mediastreamer2_soundcard - * @{ - */ - -/** - * Retreive a sound card manager object. - * - * Returns: MSSndCardManager if successfull, NULL otherwise. - */ -MSSndCardManager * ms_snd_card_manager_get(void); - -/** - * Destroy a sound card manager object. - * - */ -void ms_snd_card_manager_destroy(void); - -/** - * Retreive a sound card object based on its name. - * - * @param m A sound card manager containing sound cards. - * @param id A name for card to search. - * - * Returns: MSSndCard if successfull, NULL otherwise. - */ -MSSndCard * ms_snd_card_manager_get_card(MSSndCardManager *m, const char *id); - -/** - * Retreive the default sound card object. - * - * @param m A sound card manager containing sound cards. - * - * Returns: MSSndCard if successfull, NULL otherwise. - */ -MSSndCard * ms_snd_card_manager_get_default_card(MSSndCardManager *m); - -/** - * Retreive the default capture sound card object. - * - * @param m A sound card manager containing sound cards. - * - * Returns: MSSndCard if successfull, NULL otherwise. - */ -MSSndCard * ms_snd_card_manager_get_default_capture_card(MSSndCardManager *m); - -/** - * Retreive the default playback sound card object. - * - * @param m A sound card manager containing sound cards. - * - * Returns: MSSndCard if successfull, NULL otherwise. - */ -MSSndCard * ms_snd_card_manager_get_default_playback_card(MSSndCardManager *m); - -/** - * Retreive the list of sound card objects. - * - * @param m A sound card manager containing sound cards. - * - * Returns: MSList of cards if successfull, NULL otherwise. - */ -const MSList * ms_snd_card_manager_get_list(MSSndCardManager *m); - -/** - * Add a sound card object in a sound card manager's list. - * - * @param m A sound card manager containing sound cards. - * @param c A sound card object. - * - */ -void ms_snd_card_manager_add_card(MSSndCardManager *m, MSSndCard *c); - -/** - * Register a sound card description in a sound card manager. - * - * @param m A sound card manager containing sound cards. - * @param desc A sound card description object. - * - */ -void ms_snd_card_manager_register_desc(MSSndCardManager *m, MSSndCardDesc *desc); - -/** - * Ask all registered MSSndCardDesc to re-detect their soundcards. - * @param m The sound card manager. -**/ -void ms_snd_card_manager_reload(MSSndCardManager *m); - -/** @} */ - -/** - * @defgroup mediastreamer2_soundcardfilter Sound Card Filter API - * @ingroup mediastreamer2_soundcard - * @{ - */ - -/** - * Create an INPUT filter based on the selected sound card. - * - * @param obj A sound card object. - * - * Returns: A MSFilter if successfull, NULL otherwise. - */ -struct _MSFilter * ms_snd_card_create_reader(MSSndCard *obj); - -/** - * Create an OUPUT filter based on the selected sound card. - * - * @param obj A sound card object. - * - * Returns: A MSFilter if successfull, NULL otherwise. - */ -struct _MSFilter * ms_snd_card_create_writer(MSSndCard *obj); - -/** - * Create a new sound card object. - * - * @param desc A sound card description object. - * - * Returns: MSSndCard if successfull, NULL otherwise. - */ -MSSndCard * ms_snd_card_new(MSSndCardDesc *desc); - -/** - * Destroy sound card object. - * - * @param obj A MSSndCard object. - */ -void ms_snd_card_destroy(MSSndCard *obj); - -/** - * Duplicate a sound card object. - * - * This helps to open several time a sound card. - * - * @param card A sound card object. - * - * Returns: MSSndCard if successfull, NULL otherwise. - */ -MSSndCard * ms_snd_card_dup(MSSndCard *card); - -/** - * Retreive a sound card's driver type string. - * - * Internal driver types are either: "OSS, ALSA, WINSND, PASND, CA" - * - * @param obj A sound card object. - * - * Returns: a string if successfull, NULL otherwise. - */ -const char *ms_snd_card_get_driver_type(const MSSndCard *obj); - -/** - * Retreive a sound card's name. - * - * @param obj A sound card object. - * - * Returns: a string if successfull, NULL otherwise. - */ -const char *ms_snd_card_get_name(const MSSndCard *obj); - -/** - * Retreive sound card's name ($driver_type: $name). - * - * @param obj A sound card object. - * - * Returns: A string if successfull, NULL otherwise. - */ -const char *ms_snd_card_get_string_id(MSSndCard *obj); - - -/** - * Retreive sound card's capabilities. - * - *
- *   MS_SND_CARD_CAP_CAPTURE
- *   MS_SND_CARD_CAP_PLAYBACK
- *   MS_SND_CARD_CAP_CAPTURE|MS_SND_CARD_CAP_PLAYBACK
- * 
- * - * @param obj A sound card object. - * - * Returns: A unsigned int if successfull, 0 otherwise. - */ -unsigned int ms_snd_card_get_capabilities(const MSSndCard *obj); - -/** - * Set some mixer level value. - * - *
- *   MS_SND_CARD_MASTER,
- *   MS_SND_CARD_PLAYBACK,
- *   MS_SND_CARD_CAPTURE
- * 
- * Note: not implemented on all sound card filters. - * - * @param obj A sound card object. - * @param e A sound card mixer object. - * @param percent A volume level. - * - */ -void ms_snd_card_set_level(MSSndCard *obj, MSSndCardMixerElem e, int percent); - -/** - * Get some mixer level value. - * - *
- *   MS_SND_CARD_MASTER,
- *   MS_SND_CARD_PLAYBACK,
- *   MS_SND_CARD_CAPTURE
- * 
- * Note: not implemented on all sound card filters. - * - * @param obj A sound card object. - * @param e A sound card mixer object. - * - * Returns: A int if successfull, <0 otherwise. - */ -int ms_snd_card_get_level(MSSndCard *obj, MSSndCardMixerElem e); - -/** - * Set some source for capture. - * - *
- *   MS_SND_CARD_MIC,
- *   MS_SND_CARD_LINE
- * 
- * Note: not implemented on all sound card filters. - * - * @param obj A sound card object. - * @param c A sound card capture value. - * - * Returns: A int if successfull, 0 otherwise. - */ -void ms_snd_card_set_capture(MSSndCard *obj, MSSndCardCapture c); - -/** - * Set some mixer control. - * - *
- *   MS_SND_CARD_MASTER_MUTE, -> 0: unmute, 1: mute
- *   MS_SND_CARD_PLAYBACK_MUTE, -> 0: unmute, 1: mute
- *   MS_SND_CARD_CAPTURE_MUTE -> 0: unmute, 1: mute
- * 
- * Note: not implemented on all sound card filters. - * - * @param obj A sound card object. - * @param e A sound card control object. - * @param percent A value for control. - * - * Returns: 0 if successfull, <0 otherwise. - */ -int ms_snd_card_set_control(MSSndCard *obj, MSSndCardControlElem e, int val); - -/** - * Get some mixer control. - * - *
- *   MS_SND_CARD_MASTER_MUTE, -> return 0: unmute, 1: mute
- *   MS_SND_CARD_PLAYBACK_MUTE, -> return 0: unmute, 1: mute
- *   MS_SND_CARD_CAPTURE_MUTE -> return 0: unmute, 1: mute
- * 
- * Note: not implemented on all sound card filters. - * - * @param obj A sound card object. - * @param e A sound card mixer object. - * - * Returns: A int if successfull, <0 otherwise. - */ -int ms_snd_card_get_control(MSSndCard *obj, MSSndCardControlElem e); - -/** - * Create a alsa card with user supplied pcm name and mixer name. - * @param pcmdev The pcm device name following alsa conventions (ex: plughw:0) - * @param mixdev The mixer device name following alsa conventions. - * - * Returns: a MSSndCard object, NULL if alsa support is not available. - */ -MSSndCard * ms_alsa_card_new_custom(const char *pcmdev, const char *mixdev); - - -/** @} */ - -#ifdef __cplusplus -} -#endif - -/** @} */ - -#endif diff --git a/linphone/mediastreamer2/include/mediastreamer2/msspeexec.h b/linphone/mediastreamer2/include/mediastreamer2/msspeexec.h deleted file mode 100644 index e9bc24d26..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/msspeexec.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006-2009 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -msspeexec.h : interface of the speex echo canceler integration in mediastreamer2 - -*/ - -#ifndef msspeexec_h -#define msspeexec_h - -#include - -/** sets the tail length in milliseconds*/ -#define MS_SPEEX_EC_SET_TAIL_LENGTH MS_FILTER_METHOD(MS_SPEEX_EC_ID,0,int) - -/** sets the minimum delay of the echo if known. This optimizes the convergence*/ -#define MS_SPEEX_EC_SET_DELAY MS_FILTER_METHOD(MS_SPEEX_EC_ID,1,int) - -/** sets the frame size for the AU-MDF algorithm, in number of fft points*/ -#define MS_SPEEX_EC_SET_FRAME_SIZE MS_FILTER_METHOD(MS_SPEEX_EC_ID,2,int) - - -#endif diff --git a/linphone/mediastreamer2/include/mediastreamer2/mstee.h b/linphone/mediastreamer2/include/mediastreamer2/mstee.h deleted file mode 100644 index dd418bfda..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/mstee.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef mstee_h -#define mstee_h - -#include "msfilter.h" - -/*mute/unmute some outputs of the MSTee */ -#define MS_TEE_UNMUTE MS_FILTER_METHOD(MS_TEE_ID,0,int) -#define MS_TEE_MUTE MS_FILTER_METHOD(MS_TEE_ID,1,int) - - - -#endif diff --git a/linphone/mediastreamer2/include/mediastreamer2/msticker.h b/linphone/mediastreamer2/include/mediastreamer2/msticker.h deleted file mode 100644 index 12a430e07..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/msticker.h +++ /dev/null @@ -1,153 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -#ifndef MS_TICKER_H -#define MS_TICKER_H - - -#include "msfilter.h" -#include "mscommon.h" - -/** - * @file msticker.h - * @brief mediastreamer2 msticker.h include file - * - * This file provide the API needed to create, start - * and stop a graph. - * - */ - -/** - * @defgroup mediastreamer2_ticker Ticker API - manage mediastreamer2 graphs. - * @ingroup mediastreamer2_api - * @{ - */ - - -/** - * Structure for method getting time in miliseconds from an external source. - * @var MSTickerTimeFunc - */ -typedef uint64_t (*MSTickerTimeFunc)(void *); - -struct _MSTicker -{ - ms_mutex_t lock; - ms_cond_t cond; - MSList *execution_list; /* the list of source filters to be executed.*/ - ms_thread_t thread; /* the thread ressource*/ - int interval; /* in miliseconds*/ - int exec_id; - uint32_t ticks; - uint64_t time; /* a time since the start of the ticker expressed in milisec*/ - uint64_t orig; /* a relative time to take in account difference between time base given by consecutive get_cur_time_ptr() functions.*/ - MSTickerTimeFunc get_cur_time_ptr; - void *get_cur_time_data; - char *name; - bool_t run; /* flag to indicate whether the ticker must be run or not */ -#ifdef WIN32_TIMERS - HANDLE TimeEvent; -#endif -}; - -/** - * Structure for ticker object. - * @var MSTicker - */ -typedef struct _MSTicker MSTicker; - - -#ifdef __cplusplus -extern "C"{ -#endif - - -/** - * Create a ticker that will be used to start - * and stop a graph. - * - * Returns: MSTicker * if successfull, NULL otherwise. - */ -MSTicker *ms_ticker_new(void); - -/** - * Set a name to the ticker (used for logging) -**/ -void ms_ticker_set_name(MSTicker *ticker, const char *name); - -/** - * Attach a chain of filters to a ticker. - * The processing chain will be executed until ms_ticker_detach - * will be called. - * - * @param ticker A #MSTicker object. - * @param f A #MSFilter object. - * - * Returns: 0 if successfull, -1 otherwise. - */ -int ms_ticker_attach(MSTicker *ticker,MSFilter *f); - -/** - * Dettach a chain of filters to a ticker. - * The processing chain will no more be executed. - * - * @param ticker A #MSTicker object. - * @param f A #MSFilter object. - * - * - * Returns: 0 if successfull, -1 otherwise. - */ -int ms_ticker_detach(MSTicker *ticker,MSFilter *f); - -/** - * Destroy a ticker. - * - * @param ticker A #MSTicker object. - * - */ -void ms_ticker_destroy(MSTicker *ticker); - -/** - * Override MSTicker's time function. - * This can be used to control the ticker from an external time provider, for example the - * clock of a sound card. - * - * @param ticker A #MSTicker object. - * @param func A replacement method for calculating "current time" - * @param user_data Any pointer to user private data. - */ -void ms_ticker_set_time_func(MSTicker *ticker, MSTickerTimeFunc func, void *user_data); - -/** - * Print on stdout all filters of a ticker. (INTERNAL: DO NOT USE) - * - * @param ticker A #MSTicker object. - */ -void ms_ticker_print_graphs(MSTicker *ticker); - -/* private functions:*/ - -#ifdef __cplusplus -} -#endif - -/** @} */ - -#endif diff --git a/linphone/mediastreamer2/include/mediastreamer2/msv4l.h b/linphone/mediastreamer2/include/mediastreamer2/msv4l.h deleted file mode 100644 index 2d7056d0b..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/msv4l.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef msv4l_h -#define msv4l_h - -#include "msfilter.h" - -#define MS_V4L_START MS_FILTER_METHOD_NO_ARG(MS_V4L_ID,0) -#define MS_V4L_STOP MS_FILTER_METHOD_NO_ARG(MS_V4L_ID,1) -#define MS_V4L_SET_DEVICE MS_FILTER_METHOD(MS_V4L_ID,2,int) -#define MS_V4L_SET_IMAGE MS_FILTER_METHOD(MS_V4L_ID,3,char) - -#endif diff --git a/linphone/mediastreamer2/include/mediastreamer2/msvideo.h b/linphone/mediastreamer2/include/mediastreamer2/msvideo.h deleted file mode 100644 index f96129d83..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/msvideo.h +++ /dev/null @@ -1,191 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef msvideo_h -#define msvideo_h - -#include "msfilter.h" - -/* some global constants for video MSFilter(s) */ -#define MS_VIDEO_SIZE_SQCIF_W 128 -#define MS_VIDEO_SIZE_SQCIF_H 96 -#define MS_VIDEO_SIZE_QCIF_W 176 -#define MS_VIDEO_SIZE_QCIF_H 144 -#define MS_VIDEO_SIZE_CIF_W 352 -#define MS_VIDEO_SIZE_CIF_H 288 -#define MS_VIDEO_SIZE_ICIF_W 352 -#define MS_VIDEO_SIZE_ICIF_H 576 -#define MS_VIDEO_SIZE_4CIF_W 704 -#define MS_VIDEO_SIZE_4CIF_H 576 - -#define MS_VIDEO_SIZE_QQVGA_W 160 -#define MS_VIDEO_SIZE_QQVGA_H 120 -#define MS_VIDEO_SIZE_QVGA_W 320 -#define MS_VIDEO_SIZE_QVGA_H 240 -#define MS_VIDEO_SIZE_VGA_W 640 -#define MS_VIDEO_SIZE_VGA_H 480 -#define MS_VIDEO_SIZE_SVGA_W 800 -#define MS_VIDEO_SIZE_SVGA_H 600 - -#define MS_VIDEO_SIZE_NS1_W 324 -#define MS_VIDEO_SIZE_NS1_H 248 - -#define MS_VIDEO_SIZE_QSIF_W 176 -#define MS_VIDEO_SIZE_QSIF_H 120 -#define MS_VIDEO_SIZE_SIF_W 352 -#define MS_VIDEO_SIZE_SIF_H 240 -#define MS_VIDEO_SIZE_ISIF_W 352 -#define MS_VIDEO_SIZE_ISIF_H 480 -#define MS_VIDEO_SIZE_4SIF_W 704 -#define MS_VIDEO_SIZE_4SIF_H 480 - -#define MS_VIDEO_SIZE_288P_W 512 -#define MS_VIDEO_SIZE_288P_H 288 -#define MS_VIDEO_SIZE_448P_W 768 -#define MS_VIDEO_SIZE_448P_H 448 -#define MS_VIDEO_SIZE_576P_W 1024 -#define MS_VIDEO_SIZE_576P_H 576 -#define MS_VIDEO_SIZE_720P_W 1280 -#define MS_VIDEO_SIZE_720P_H 720 -#define MS_VIDEO_SIZE_1080P_W 1920 -#define MS_VIDEO_SIZE_1080P_H 1080 - -#define MS_VIDEO_SIZE_SDTV_W 768 -#define MS_VIDEO_SIZE_SDTV_H 576 -#define MS_VIDEO_SIZE_HDTVP_W 1920 -#define MS_VIDEO_SIZE_HDTVP_H 1200 - -#define MS_VIDEO_SIZE_XGA_W 1024 -#define MS_VIDEO_SIZE_XGA_H 768 -#define MS_VIDEO_SIZE_WXGA_W 1080 -#define MS_VIDEO_SIZE_WXGA_H 768 - -#define MS_VIDEO_SIZE_MAX_W MS_VIDEO_SIZE_1024_W -#define MS_VIDEO_SIZE_MAX_H MS_VIDEO_SIZE_1024_H - - -/* those structs are part of the ABI: don't change their size otherwise binary plugins will be broken*/ - -typedef struct MSVideoSize{ - int width,height; -} MSVideoSize; - -typedef struct MSRect{ - int x,y,w,h; -} MSRect; - -#define MS_VIDEO_SIZE_CIF (MSVideoSize){MS_VIDEO_SIZE_CIF_W,MS_VIDEO_SIZE_CIF_H} -#define MS_VIDEO_SIZE_QCIF (MSVideoSize){MS_VIDEO_SIZE_QCIF_W,MS_VIDEO_SIZE_QCIF_H} -#define MS_VIDEO_SIZE_4CIF (MSVideoSize){MS_VIDEO_SIZE_4CIF_W,MS_VIDEO_SIZE_4CIF_H} - -#define MS_VIDEO_SIZE_QQVGA (MSVideoSize){MS_VIDEO_SIZE_QQVGA_W,MS_VIDEO_SIZE_QQVGA_H} -#define MS_VIDEO_SIZE_QVGA (MSVideoSize){MS_VIDEO_SIZE_QVGA_W,MS_VIDEO_SIZE_QVGA_H} -#define MS_VIDEO_SIZE_VGA (MSVideoSize){MS_VIDEO_SIZE_VGA_W,MS_VIDEO_SIZE_VGA_H} - -#define MS_VIDEO_SIZE_720P (MSVideoSize){MS_VIDEO_SIZE_720P_W, MS_VIDEO_SIZE_720P_H} - -#define MS_VIDEO_SIZE_NS1 (MSVideoSize){MS_VIDEO_SIZE_NS1_W,MS_VIDEO_SIZE_NS1_H} - -#define MS_VIDEO_SIZE_XGA (MSVideoSize){MS_VIDEO_SIZE_XGA_W, MS_VIDEO_SIZE_XGA_H} - -#define MS_VIDEO_SIZE_SVGA (MSVideoSize){MS_VIDEO_SIZE_SVGA_W, MS_VIDEO_SIZE_SVGA_H} - -/*deprecated: use MS_VIDEO_SIZE_SVGA*/ -#define MS_VIDEO_SIZE_800X600_W MS_VIDEO_SIZE_SVGA_W -#define MS_VIDEO_SIZE_800X600_H MS_VIDEO_SIZE_SVGA_H -#define MS_VIDEO_SIZE_800X600 MS_VIDEO_SIZE_SVGA -/*deprecated use MS_VIDEO_SIZE_XGA*/ -#define MS_VIDEO_SIZE_1024_W 1024 -#define MS_VIDEO_SIZE_1024_H 768 -#define MS_VIDEO_SIZE_1024 MS_VIDEO_SIZE_XGA - -typedef enum{ - MS_YUV420P, - MS_YUYV, - MS_RGB24, - MS_RGB24_REV, /*->microsoft down-top bitmaps */ - MS_MJPEG, - MS_UYVY, - MS_YUY2, /* -> same as MS_YUYV */ - MS_PIX_FMT_UNKNOWN -}MSPixFmt; - -typedef struct _MSPicture{ - int w,h; - uint8_t *planes[4]; /*we usually use 3 planes, 4th is for compatibility */ - int strides[4]; /*with ffmpeg's swscale.h */ -}MSPicture; - -typedef struct _MSPicture YuvBuf; /*for backward compatibility*/ - -#ifdef __cplusplus -extern "C"{ -#endif - -int ms_pix_fmt_to_ffmpeg(MSPixFmt fmt); -MSPixFmt ffmpeg_pix_fmt_to_ms(int fmt); -MSPixFmt ms_fourcc_to_pix_fmt(uint32_t fourcc); -void ms_ffmpeg_check_init(void); -int yuv_buf_init_from_mblk(MSPicture *buf, mblk_t *m); -void yuv_buf_init_from_mblk_with_size(MSPicture *buf, mblk_t *m, int w, int h); -mblk_t * yuv_buf_alloc(MSPicture *buf, int w, int h); -void yuv_buf_copy(uint8_t *src_planes[], const int src_strides[], - uint8_t *dst_planes[], const int dst_strides[3], MSVideoSize roi); -void yuv_buf_mirror(YuvBuf *buf); -void rgb24_revert(uint8_t *buf, int w, int h, int linesize); -void rgb24_copy_revert(uint8_t *dstbuf, int dstlsz, - const uint8_t *srcbuf, int srclsz, MSVideoSize roi); - -static inline bool_t ms_video_size_greater_than(MSVideoSize vs1, MSVideoSize vs2){ - return (vs1.width>=vs2.width) && (vs1.height>=vs2.height); -} - -static inline MSVideoSize ms_video_size_max(MSVideoSize vs1, MSVideoSize vs2){ - return ms_video_size_greater_than(vs1,vs2) ? vs1 : vs2; -} - -static inline MSVideoSize ms_video_size_min(MSVideoSize vs1, MSVideoSize vs2){ - return ms_video_size_greater_than(vs1,vs2) ? vs2 : vs1; -} - -static inline bool_t ms_video_size_equal(MSVideoSize vs1, MSVideoSize vs2){ - return vs1.width==vs2.width && vs1.height==vs2.height; -} - -MSVideoSize ms_video_size_get_just_lower_than(MSVideoSize vs); - -#ifdef __cplusplus -} -#endif - -#define MS_FILTER_SET_VIDEO_SIZE MS_FILTER_BASE_METHOD(100,MSVideoSize) -#define MS_FILTER_GET_VIDEO_SIZE MS_FILTER_BASE_METHOD(101,MSVideoSize) - -#define MS_FILTER_SET_PIX_FMT MS_FILTER_BASE_METHOD(102,MSPixFmt) -#define MS_FILTER_GET_PIX_FMT MS_FILTER_BASE_METHOD(103,MSPixFmt) - -#define MS_FILTER_SET_FPS MS_FILTER_BASE_METHOD(104,float) -#define MS_FILTER_GET_FPS MS_FILTER_BASE_METHOD(105,float) - -/* request a video-fast-update (=I frame for H263,MP4V-ES) to a video encoder*/ -#define MS_FILTER_REQ_VFU MS_FILTER_BASE_METHOD_NO_ARG(106) - -#define MS_FILTER_SET_IMAGE MS_FILTER_BASE_METHOD(107,char) - -#endif diff --git a/linphone/mediastreamer2/include/mediastreamer2/msvideoout.h b/linphone/mediastreamer2/include/mediastreamer2/msvideoout.h deleted file mode 100644 index 0384f6d39..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/msvideoout.h +++ /dev/null @@ -1,104 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef msvideoout_h -#define msvideoout_h - -#include -#include - - -struct _MSDisplay; - -typedef enum _MSDisplayEventType{ - MS_DISPLAY_RESIZE_EVENT -}MSDisplayEventType; - -typedef struct _MSDisplayEvent{ - MSDisplayEventType evtype; - int w,h; -}MSDisplayEvent; - -typedef struct _MSDisplayDesc{ - /*init requests setup of the display window at the proper size, given - in frame_buffer argument. Memory buffer (data,strides) must be fulfilled - at return. init() might be called several times upon screen resize*/ - bool_t (*init)(struct _MSDisplay *, MSPicture *frame_buffer); - void (*lock)(struct _MSDisplay *);/*lock before writing to the framebuffer*/ - void (*unlock)(struct _MSDisplay *);/*unlock after writing to the framebuffer*/ - void (*update)(struct _MSDisplay *); /*display the picture to the screen*/ - void (*uninit)(struct _MSDisplay *); - bool_t (*pollevent)(struct _MSDisplay *, MSDisplayEvent *ev); - long default_window_id; -}MSDisplayDesc; - -typedef struct _MSDisplay{ - MSDisplayDesc *desc; - long window_id; /*window id if the display should use an existing window*/ - void *data; - bool_t use_external_window; -} MSDisplay; - - -#define ms_display_init(d,fbuf) (d)->desc->init(d,fbuf) -#define ms_display_lock(d) if ((d)->desc->lock) (d)->desc->lock(d) -#define ms_display_unlock(d) if ((d)->desc->unlock) (d)->desc->unlock(d) -#define ms_display_update(d) if ((d)->desc->update) (d)->desc->update(d) -bool_t ms_display_poll_event(MSDisplay *d, MSDisplayEvent *ev); - -extern MSDisplayDesc ms_sdl_display_desc; - -#if (defined(WIN32) || defined(_WIN32_WCE)) && !defined(MEDIASTREAMER_STATIC) -#if defined(MEDIASTREAMER2_EXPORTS) && defined(INVIDEOUT_C) - #define MSVAR_DECLSPEC __declspec(dllexport) -#else - #define MSVAR_DECLSPEC __declspec(dllimport) -#endif -#else - #define MSVAR_DECLSPEC extern -#endif - -#ifdef __cplusplus -extern "C"{ -#endif - -/*plugins can set their own display using this method:*/ -void ms_display_desc_set_default(MSDisplayDesc *desc); - -MSDisplayDesc * ms_display_desc_get_default(void); -void ms_display_desc_set_default_window_id(MSDisplayDesc *desc, long id); - -MSVAR_DECLSPEC MSDisplayDesc ms_win_display_desc; - -MSDisplay *ms_display_new(MSDisplayDesc *desc); -void ms_display_set_window_id(MSDisplay *d, long window_id); -void ms_display_destroy(MSDisplay *d); - -#define MS_VIDEO_OUT_SET_DISPLAY MS_FILTER_METHOD(MS_VIDEO_OUT_ID,0,MSDisplay*) -#define MS_VIDEO_OUT_HANDLE_RESIZING MS_FILTER_METHOD_NO_ARG(MS_VIDEO_OUT_ID,1) -#define MS_VIDEO_OUT_SET_CORNER MS_FILTER_METHOD(MS_VIDEO_OUT_ID,2,int) -#define MS_VIDEO_OUT_AUTO_FIT MS_FILTER_METHOD(MS_VIDEO_OUT_ID,3,int) -#define MS_VIDEO_OUT_ENABLE_MIRRORING MS_FILTER_METHOD(MS_VIDEO_OUT_ID,4,int) -#define MS_VIDEO_OUT_GET_NATIVE_WINDOW_ID MS_FILTER_METHOD(MS_VIDEO_OUT_ID,5,unsigned long) - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/linphone/mediastreamer2/include/mediastreamer2/msvolume.h b/linphone/mediastreamer2/include/mediastreamer2/msvolume.h deleted file mode 100644 index cf2f02b21..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/msvolume.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef msvolume_h -#define msvolume_h - -#include "msfilter.h" - -/** - * The Volume MSFilter can do: - * - measurements of the input signal power, returned in dbm0 or linear scale - * - apply a gain to the input signal and output this amplified signal to its output. - * By default gain is 1, in which case the filter does not modify the signal (and even does not - * copy the buffers, just post them on its output queue. -**/ - - -/*returns a volume meter in db0 (max=0 db0)*/ -#define MS_VOLUME_GET MS_FILTER_METHOD(MS_VOLUME_ID,0,float) -/*returns a volume in linear scale between 0 and 1 */ -#define MS_VOLUME_GET_LINEAR MS_FILTER_METHOD(MS_VOLUME_ID,1,float) -/* set a gain */ -#define MS_VOLUME_SET_GAIN MS_FILTER_METHOD(MS_VOLUME_ID,2,float) - -#define MS_VOLUME_GET_EA_STATE MS_FILTER_METHOD(MS_VOLUME_ID,3, int) - -#define MS_VOLUME_SET_PEER MS_FILTER_METHOD(MS_VOLUME_ID,4, MSFilter ) - -#define MS_VOLUME_SET_EA_THRESHOLD MS_FILTER_METHOD(MS_VOLUME_ID,5,float) - -#define MS_VOLUME_SET_EA_SPEED MS_FILTER_METHOD(MS_VOLUME_ID,6,float) - -#define MS_VOLUME_SET_EA_FORCE MS_FILTER_METHOD(MS_VOLUME_ID,7,float) - -#define MS_VOLUME_ENABLE_AGC MS_FILTER_METHOD(MS_VOLUME_ID,8,int) - -#define MS_VOLUME_ENABLE_NOISE_GATE MS_FILTER_METHOD(MS_VOLUME_ID,9,int) - -#define MS_VOLUME_SET_NOISE_GATE_THRESHOLD MS_FILTER_METHOD(MS_VOLUME_ID,10,float) - -#define MS_VOLUME_SET_EA_SUSTAIN MS_FILTER_METHOD(MS_VOLUME_ID,11,int) - -#define MS_VOLUME_SET_NOISE_GATE_FLOORGAIN MS_FILTER_METHOD(MS_VOLUME_ID,12,float) - -extern MSFilterDesc ms_volume_desc; - -#endif diff --git a/linphone/mediastreamer2/include/mediastreamer2/mswebcam.h b/linphone/mediastreamer2/include/mediastreamer2/mswebcam.h deleted file mode 100644 index f56f1f81b..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/mswebcam.h +++ /dev/null @@ -1,233 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef webcam_h -#define webcam_h - -#include "mscommon.h" - -/** - * @file mswebcam.h - * @brief mediastreamer2 mswebcam.h include file - * - * This file provide the API needed to manage - * soundcard filters. - * - */ - -/** - * @defgroup mediastreamer2_webcam Camera API - manage video capture devices - * @ingroup mediastreamer2_api - * @{ - */ - -struct _MSWebCamManager{ - MSList *cams; - MSList *descs; -}; - -/** - * Structure for webcam manager object. - * @var MSWebCamManager - */ -typedef struct _MSWebCamManager MSWebCamManager; - - -struct _MSWebCam; - -typedef void (*MSWebCamDetectFunc)(MSWebCamManager *obj); -typedef void (*MSWebCamInitFunc)(struct _MSWebCam *obj); -typedef void (*MSWebCamUninitFunc)(struct _MSWebCam *obj); -typedef struct _MSFilter * (*MSWebCamCreateReaderFunc)(struct _MSWebCam *obj); - -struct _MSWebCamDesc{ - const char *driver_type; - MSWebCamDetectFunc detect; - MSWebCamInitFunc init; - MSWebCamCreateReaderFunc create_reader; - MSWebCamUninitFunc uninit; -}; - -/** - * Structure for sound card description object. - * @var MSWebCamDesc - */ -typedef struct _MSWebCamDesc MSWebCamDesc; - -struct _MSWebCam{ - MSWebCamDesc *desc; - char *name; - char *id; - void *data; -}; - -/** - * Structure for sound card object. - * @var MSWebCam - */ -typedef struct _MSWebCam MSWebCam; - -#ifdef __cplusplus -extern "C"{ -#endif - -/** - * Retreive a webcam manager object. - * - * Returns: MSWebCamManager if successfull, NULL otherwise. - */ -MSWebCamManager * ms_web_cam_manager_get(void); - -/** - * Destroy the webcam manager object. - * - */ -void ms_web_cam_manager_destroy(void); - -/** - * Retreive a webcam object based on its name. - * - * @param m A webcam manager containing webcam. - * @param id A name for card to search. - * - * Returns: MSWebCam if successfull, NULL otherwise. - */ -MSWebCam * ms_web_cam_manager_get_cam(MSWebCamManager *m, const char *id); - -/** - * Retreive the default webcam object. - * - * @param m A webcam manager containing webcams. - * - * Returns: MSWebCam if successfull, NULL otherwise. - */ -MSWebCam * ms_web_cam_manager_get_default_cam(MSWebCamManager *m); - -/** - * Retreive the list of webcam objects. - * - * @param m A webcam manager containing webcams. - * - * Returns: MSList of cards if successfull, NULL otherwise. - */ -const MSList * ms_web_cam_manager_get_list(MSWebCamManager *m); - -/** - * Add a webcam object in a webcam manager's list. - * - * @param m A webcam manager containing webcams - * @param c A web cam object. - * - */ -void ms_web_cam_manager_add_cam(MSWebCamManager *m, MSWebCam *c); - -/** - * Add a webcam object on top of list of the webcam manager's list. - * - * @param m A webcam manager containing webcams - * @param c A web cam object. - * - */ -void ms_web_cam_manager_prepend_cam(MSWebCamManager *m, MSWebCam *c); - - -/** - * Register a webcam descriptor in a webcam manager. - * - * @param m A webcam manager containing sound cards. - * @param desc A webcam descriptor object. - * - */ -void ms_web_cam_manager_register_desc(MSWebCamManager *m, MSWebCamDesc *desc); - - -/** - * Ask all registered MSWebCamDesc to detect the webcams again. - * - * @param m A webcam manager -**/ -void ms_web_cam_manager_reload(MSWebCamManager *m); - -/** - * Create an INPUT filter based on the selected camera. - * - * @param obj A webcam object. - * - * Returns: A MSFilter if successfull, NULL otherwise. - */ -struct _MSFilter * ms_web_cam_create_reader(MSWebCam *obj); - -/** - * Create a new webcam object. - * - * @param desc A webcam description object. - * - * Returns: MSWebCam if successfull, NULL otherwise. - */ -MSWebCam * ms_web_cam_new(MSWebCamDesc *desc); - -/** - * Destroy webcam object. - * - * @param obj A MSWebCam object. - */ -void ms_web_cam_destroy(MSWebCam *obj); - - -/** - * Retreive a webcam's driver type string. - * - * Internal driver types are either: "V4L V4LV2" - * - * @param obj A webcam object. - * - * Returns: a string if successfull, NULL otherwise. - */ -const char *ms_web_cam_get_driver_type(const MSWebCam *obj); - -/** - * Retreive a webcam's name. - * - * @param obj A webcam object. - * - * Returns: a string if successfull, NULL otherwise. - */ -const char *ms_web_cam_get_name(const MSWebCam *obj); - -/** - * Retreive webcam's id: ($driver_type: $name). - * - * @param obj A webcam object. - * - * Returns: A string if successfull, NULL otherwise. - */ -const char *ms_web_cam_get_string_id(MSWebCam *obj); - - -/*specific methods for static image:*/ - -void ms_static_image_set_default_image(const char *path); - -#ifdef __cplusplus -} -#endif - -/** @} */ - -#endif diff --git a/linphone/mediastreamer2/include/mediastreamer2/rfc3984.h b/linphone/mediastreamer2/include/mediastreamer2/rfc3984.h deleted file mode 100644 index aa9a45127..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/rfc3984.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef rfc3984_h -#define rfc3984_h - -#include "mediastreamer2/mscommon.h" -#include "mediastreamer2/msqueue.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -typedef struct Rfc3984Context{ - MSQueue q; - mblk_t *m; - int maxsz; - uint32_t last_ts; - uint8_t mode; - bool_t stap_a_allowed; - uint8_t reserved; -} Rfc3984Context; - -void rfc3984_init(Rfc3984Context *ctx); - -void rfc3984_set_mode(Rfc3984Context *ctx, int mode); - -/* some stupid phones don't decode STAP-A packets ...*/ -void rfc3984_enable_stap_a(Rfc3984Context *ctx, bool_t yesno); - -/*process NALUs and pack them into rtp payloads */ -void rfc3984_pack(Rfc3984Context *ctx, MSQueue *naluq, MSQueue *rtpq, uint32_t ts); - -/*process incoming rtp data and output NALUs, whenever possible*/ -void rfc3984_unpack(Rfc3984Context *ctx, mblk_t *im, MSQueue *naluq); - -void rfc3984_uninit(Rfc3984Context *ctx); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/linphone/mediastreamer2/include/mediastreamer2/waveheader.h b/linphone/mediastreamer2/include/mediastreamer2/waveheader.h deleted file mode 100644 index d929f5c6d..000000000 --- a/linphone/mediastreamer2/include/mediastreamer2/waveheader.h +++ /dev/null @@ -1,96 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* the following code was taken from a free software utility that I don't remember the name. */ -/* sorry */ - -#ifdef HAVE_CONFIG_H -#include "mediastreamer-config.h" -#endif - -#ifndef waveheader_h -#define waveheader_h - -#ifdef swap16 -#else -/* all integer in wav header must be read in least endian order */ -static inline uint16_t swap16(uint16_t a) -{ - return ((a & 0xFF) << 8) | ((a & 0xFF00) >> 8); -} -#endif - -#ifdef swap32 -#else -static inline uint32_t swap32(uint32_t a) -{ - return ((a & 0xFF) << 24) | ((a & 0xFF00) << 8) | - ((a & 0xFF0000) >> 8) | ((a & 0xFF000000) >> 24); -} -#endif - -#ifdef WORDS_BIGENDIAN -#define le_uint32(a) (swap32((a))) -#define le_uint16(a) (swap16((a))) -#define le_int16(a) ( (int16_t) swap16((uint16_t)((a))) ) -#else -#define le_uint32(a) (a) -#define le_uint16(a) (a) -#define le_int16(a) (a) -#endif - -typedef struct _riff_t { - char riff[4] ; /* "RIFF" (ASCII characters) */ - uint32_t len ; /* Length of package (binary, little endian) */ - char wave[4] ; /* "WAVE" (ASCII characters) */ -} riff_t; - -/* The FORMAT chunk */ - -typedef struct _format_t { - char fmt[4] ; /* "fmt_" (ASCII characters) */ - uint32_t len ; /* length of FORMAT chunk (always 0x10) */ - uint16_t type; /* codec type*/ - uint16_t channel ; /* Channel numbers (0x01 = mono, 0x02 = stereo) */ - uint32_t rate ; /* Sample rate (binary, in Hz) */ - uint32_t bps ; /* Average Bytes Per Second */ - uint16_t blockalign ; /*number of bytes per sample */ - uint16_t bitpspl ; /* bits per sample */ -} format_t; - -/* The DATA chunk */ - -typedef struct _data_t { - char data[4] ; /* "data" (ASCII characters) */ - int len ; /* length of data */ -} data_t; - -typedef struct _wave_header_t -{ - riff_t riff_chunk; - format_t format_chunk; - data_t data_chunk; -} wave_header_t; - - -#define wave_header_get_rate(header) le_uint32((header)->format_chunk.rate) -#define wave_header_get_channel(header) le_uint16((header)->format_chunk.channel) -#define wave_header_get_bpsmpl(header) \ - le_uint16((header)->format_chunk.blockalign) -#endif diff --git a/linphone/mediastreamer2/mediastreamer.pc.in b/linphone/mediastreamer2/mediastreamer.pc.in deleted file mode 100644 index 55a763e69..000000000 --- a/linphone/mediastreamer2/mediastreamer.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -# This is a comment -prefix=@prefix@ -exec_prefix=@exec_prefix@ -includedir=@includedir@ - -Name: mediastreamer -Description: A mediastreaming library for telephony applications -Requires: ortp -Version: @MEDIASTREAMER_VERSION@ -Libs: -L@libdir@ -lmediastreamer -Cflags: -I@includedir@ @MS_PUBLIC_CFLAGS@ diff --git a/linphone/mediastreamer2/mediastreamer2.spec.in b/linphone/mediastreamer2/mediastreamer2.spec.in deleted file mode 100644 index ff1e4492e..000000000 --- a/linphone/mediastreamer2/mediastreamer2.spec.in +++ /dev/null @@ -1,81 +0,0 @@ -# -*- rpm-spec -*- -# -# mediastreamer2 -- A mediastreaming library for telephony applications -# - -%ifarch %ix86 -%define mediastreamer2_cpu pentium4 -%endif - -Summary: Audio/Video real-time streaming -Name: mediastreamer2 -Version: @MEDIASTREAMER2_PKGCONFIG_VERSION@ -Release: 1 -License: LGPL -Group: Applications/Communications -URL: http://linphone.org/mediastreamer2/ -Source0: %{name}-@MEDIASTREAMER2_PKGCONFIG_VERSION@.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot -%ifarch %ix86 -BuildArch: i686 -%endif - -%description -Mediastreamer2 is a GPL licensed library to make audio and video -real-time streaming and processing. Written in pure C, it is based -upon the oRTP library. - -%package devel -Summary: Headers, libraries and docs for the mediastreamer2 library -Group: Development/Libraries -Requires: %{name} = %{version}-%{release} - -%description devel -Mediastreamer2 is a GPL licensed library to make audio and video -real-time streaming and processing. Written in pure C, it is based -upon the ortp library. - -This package contains header files and development libraries needed to -develop programs using the mediastreamer2 library. - -%ifarch %ix86 -%define mediastreamer2_arch_cflags -malign-double -march=i686 -mcpu=%{mediastreamer2_cpu} -%else -# Must be non-empty -%define mediastreamer2_arch_cflags -Wall -%endif -%define mediastreamer2_cflags %mediastreamer2_arch_cflags -Wall -g -pipe -pthread -O3 -fomit-frame-pointer -fno-schedule-insns -fschedule-insns2 -fstrict-aliasing - -%prep -%setup -q - -%build -%configure \ ---enable-gtk-doc=no \ ---enable-shared --enable-static -make -j$RPM_BUILD_NCPUS CFLAGS="%mediastreamer2_cflags" CXXFLAGS="%mediastreamer2_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 docs/html -%{_libdir}/*.la -%{_libdir}/*.a -%{_libdir}/*.so -%{_libdir}/pkgconfig/*.pc -%{_includedir} - -%changelog -* Tue Oct 25 2005 Francois-Xavier Kowalski -- Add to mediastreamer2 distribution with "make rpm" target diff --git a/linphone/mediastreamer2/pkg.list b/linphone/mediastreamer2/pkg.list deleted file mode 100644 index cee1171f7..000000000 --- a/linphone/mediastreamer2/pkg.list +++ /dev/null @@ -1,43 +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 - -# Compress man pages -%define __spec_install_post /usr/lib/rpm/brp-compress || : - -# Package all-in one: should be split later on... -%provides ortp-devel - -%postinstall << EOF -ldconfig 2>&1 | logger -i -s -t ${PACKAGE} -makewhatis -u -w 2>&1 | logger -i -s -t ${PACKAGE} -EOF - -%postremove << EOF -ldconfig 2>&1 | logger -i -s -t ${PACKAGE} -makewhatis -u -w 2>&1 | logger -i -s -t ${PACKAGE} -EOF - -%system hpux - -%system all - -%include files.list - -%provides mediastreamer2 -%replaces mediastreamer2 - diff --git a/linphone/mediastreamer2/plugins/.gitignore b/linphone/mediastreamer2/plugins/.gitignore deleted file mode 100644 index 6cecb663c..000000000 --- a/linphone/mediastreamer2/plugins/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -Makefile -Makefile.in -plugins.mk diff --git a/linphone/mediastreamer2/plugins/msilbc/AUTHORS b/linphone/mediastreamer2/plugins/msilbc/AUTHORS deleted file mode 100644 index e69de29bb..000000000 diff --git a/linphone/mediastreamer2/plugins/msilbc/COPYING b/linphone/mediastreamer2/plugins/msilbc/COPYING deleted file mode 100644 index 623b6258a..000000000 --- a/linphone/mediastreamer2/plugins/msilbc/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/linphone/mediastreamer2/plugins/msilbc/ChangeLog b/linphone/mediastreamer2/plugins/msilbc/ChangeLog deleted file mode 100644 index e69de29bb..000000000 diff --git a/linphone/mediastreamer2/plugins/msilbc/INSTALL b/linphone/mediastreamer2/plugins/msilbc/INSTALL deleted file mode 100644 index 23e5f25d0..000000000 --- a/linphone/mediastreamer2/plugins/msilbc/INSTALL +++ /dev/null @@ -1,236 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 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' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' 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 option `--target=TYPE' 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 - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). Here is a another example: - - /bin/bash ./configure CONFIG_SHELL=/bin/bash - -Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent -configuration-related scripts to be executed by `/bin/bash'. - -`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. - diff --git a/linphone/mediastreamer2/plugins/msilbc/Makefile.am b/linphone/mediastreamer2/plugins/msilbc/Makefile.am deleted file mode 100644 index 34b360d4c..000000000 --- a/linphone/mediastreamer2/plugins/msilbc/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -EXTRA_DIST=ilbc-rfc3951.tar.gz - -plugindir=$(PACKAGE_PLUGINS_DIR) - -plugin_LTLIBRARIES=libmsilbc.la - -libmsilbc_la_SOURCES=ilbc.c - -libmsilbc_la_LIBADD=$(ILBC_LIBS) - -AM_CFLAGS=$(ILBC_CFLAGS) \ No newline at end of file diff --git a/linphone/mediastreamer2/plugins/msilbc/NEWS b/linphone/mediastreamer2/plugins/msilbc/NEWS deleted file mode 100644 index e69de29bb..000000000 diff --git a/linphone/mediastreamer2/plugins/msilbc/README b/linphone/mediastreamer2/plugins/msilbc/README deleted file mode 100644 index e18f0b05a..000000000 --- a/linphone/mediastreamer2/plugins/msilbc/README +++ /dev/null @@ -1,13 +0,0 @@ - - -* compile and install the ilbc source: - tar -xvzf ilbc-rfc3951.tar.gz - cd ilbc-rfc2951 - ./configure --prefix=/usr && make - make install (as root) - cd .. - -* compile and install the plugin: - ./configure --prefix= - make - make install diff --git a/linphone/mediastreamer2/plugins/msilbc/configure.ac b/linphone/mediastreamer2/plugins/msilbc/configure.ac deleted file mode 100644 index d8418f211..000000000 --- a/linphone/mediastreamer2/plugins/msilbc/configure.ac +++ /dev/null @@ -1,152 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -AC_INIT([msilbc],[2.0.0]) - -AM_INIT_AUTOMAKE([tar-ustar]) - -AC_CANONICAL_SYSTEM - -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(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] ) - - -dnl Checks for programs. -AC_PROG_CC -AC_PROG_LIBTOOL -AC_ENABLE_SHARED(yes) -AC_ENABLE_STATIC(no) - -if test "$GCC" != "yes" ; then - case $host_os in - *hpux*) - dnl we are probably using HPUX cc compiler, so add a +O2 to CFLAGS - CFLAGS="$CFLAGS +O2 -g " - ;; - esac -else - CFLAGS="$CFLAGS -Wall" -fi - - - -if test $debug_enabled = "yes"; then - CFLAGS="$CFLAGS -DDEBUG" -fi - -dnl Checks for header files. -AC_HEADER_STDC - -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 - CFLAGS="$CFLAGS -D_BIGENDIAN" -fi - -if test $GCC = yes && test $wall_werror = yes; then - CFLAGS="$CFLAGS -Werror " -fi - -PKG_CHECK_MODULES(MEDIASTREAMER, mediastreamer >= 2.0.0) - -AC_ARG_WITH( ilbc, - [ --with-ilbc Sets the installation prefix of ilbc codec, [default=/usr] ], - [ ilbcdir=${withval}],[ ilbcdir=/usr ]) - -if test "$ilbcdir" != "/usr" ; then - ILBC_CFLAGS="$ilbcdir/include" - ILBC_LIBS="$ilbcdir/lib" -fi -ILBC_LIBS="$ILBC_LIBS -lilbc" - -AC_SUBST(ILBC_CFLAGS) -AC_SUBST(ILBC_LIBS) - -CFLAGS="$CFLAGS \$(MEDIASTREAMER_CFLAGS) " -LIBS="$LIBS \$(MEDIASTREAMER_LIBS) " -LDFLAGS="$LDFLAGS -rdynamic " - -dnl define path of plugins: -PACKAGE_PLUGINS_DIR=`eval echo $prefix/lib/mediastreamer/plugins` -AC_DEFINE_UNQUOTED(PACKAGE_PLUGINS_DIR, "$PACKAGE_PLUGINS_DIR" ,[path of plugins]) -AC_SUBST(PACKAGE_PLUGINS_DIR) - -dnl ################################################## -dnl # Check for ESP Packager -dnl ################################################## - -AC_PATH_PROG(EPM,epm,false) -AC_PATH_PROG(MKEPMLIST,mkepmlist,false) -AC_PATH_PROG(EPMINSTALL,epminstall,false) -AM_CONDITIONAL(WITH_EPM,test $EPM != false && test $MKEPMLIST != false && test $EPMINSTALL != false) - - -# Preferred packaging system, as per EPM terminology -case $target in -*-*-linux*) - if test -f /etc/debian_version ; then - EPM_PKG_EXT=deb - else - EPM_PKG_EXT=rpm - fi - ;; -*-hp-hpux*) - EPM_PKG_EXT=depot.gz;; -*-dec-osf*) - EPM_PKG_EXT=setld;; -esac -AC_SUBST(EPM_PKG_EXT) - -# System software User & Group names -case $target in -*-*-linux*) - SYS_USER=root - SYS_GROUP=root - ;; -*-*-hpux*|*-dec-osf*) - SYS_USER=bin - SYS_GROUP=bin - ;; -esac -AC_SUBST(SYS_USER) -AC_SUBST(SYS_GROUP) - -# CPU Architecture -case $target_cpu in -i?86) ARCH=i386;; -*) ARCH=$target_cpu;; -esac -AC_SUBST(ARCH) - -# Various other packaging variables, that can be over-ridden ad `make -# package' time -SUMMARY="A mediastreamer plugin." -AC_SUBST(SUMMARY) -PACKAGER=anonymous -AC_SUBST(PACKAGER) -LICENSE=GPL -AC_SUBST(LICENSE) -VENDOR=Linphone -AC_SUBST(VENDOR) -RELEASE=1 -AC_SUBST(RELEASE) - - -AC_OUTPUT( -Makefile -) diff --git a/linphone/mediastreamer2/plugins/msilbc/ilbc-rfc3951.tar.gz b/linphone/mediastreamer2/plugins/msilbc/ilbc-rfc3951.tar.gz deleted file mode 100644 index e5160f402c2a87e8878765ca1fed39a0a0a721ed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 330306 zcmV(rK<>XEiwFRdbFe}J1MFLCcj89Up0C!g=rHU8UM>cE?2RYnM8?==huZ>9JjZrq zAvK`2E<_UcILYj9->T}CkU*Zx=FRMzb3!H{^`*MHy1MGA>b7N1jfy`r_P>5ruf6zv zK6~&vIy%DN`q8Vs<#Da{`1n{w zb(r~_Kk7cOdj4EdCJWB=Rp>eTJ+I+|;kmP#ZB0YZvstM7)%nkCp$BZrxyu~gOtn^`tzk5;%~k*#2%$Ckclt_(0FELJfV7{0X(VLK~oOB;^bqxL_G zjq0nfOZeXDcP2&D&9c-@Ds2t=XPt9xJZhbGM#byEH)^`8pILUu{i<y3Ke*7|C%U5?+rZ;!^ELBH&J6_d{_mqXu|thM0AeL&_0IG+2u6I2Cv zgLAFbiXXe3lgVJv#rJk!J?XZ!@r62SpBA5ZP)e3g)JdmRbiGaLU_O1_w>XebS1dRf zP@kkIhQ0uo+#Ug?QyRW?(Qdtwg=3IFXac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Db=@|^XD ztOj#!I@8tWpyPU3L|ladgMz$V*F|xzTo*$U zUCYEfcDu9W`xq7oz2JJZx;MBfTH9~9o@TbY=EW6mb5@LiHhZDvVuhOII9$Qnv?Y_q)CCHwy5cOSsf@K0j`h_ksE@Wyr* zkh;`E!s7TK#I$u&4^qWWT-RIBD4PcH2cpu#14j7T|LXti;SbCQ3hiDJ_JQ -#include - -#include "mediastreamer2/msfilter.h" - -typedef struct EncState{ - int nsamples; - int nbytes; - int ms_per_frame; - int ptime; - uint32_t ts; - MSBufferizer bufferizer; - iLBC_Enc_Inst_t ilbc_enc; -}EncState; - -static void enc_init(MSFilter *f){ - EncState *s=ms_new(EncState,1); - s->nsamples=BLOCKL_20MS; - s->nbytes=NO_OF_BYTES_20MS; - s->ms_per_frame=20; - s->ptime=0; - s->ts=0; - ms_bufferizer_init(&s->bufferizer); - f->data=s; -} - -static void enc_uninit(MSFilter *f){ - EncState *s=(EncState*)f->data; - ms_bufferizer_uninit(&s->bufferizer); - ms_free(f->data); -} - -static void enc_preprocess(MSFilter *f){ - EncState *s=(EncState*)f->data; - initEncode(&s->ilbc_enc,s->ms_per_frame); -} - -static int enc_add_fmtp(MSFilter *f, void *arg){ - char buf[64]; - const char *fmtp=(const char *)arg; - EncState *s=(EncState*)f->data; - - memset(buf, '\0', sizeof(buf)); - fmtp_get_value(fmtp, "mode", buf, sizeof(buf)); - if (buf[0]=='\0'){ - ms_warning("unsupported fmtp parameter (%s)!", fmtp); - } - else if (strstr(buf,"20")!=NULL){ - s->nsamples=BLOCKL_20MS; - s->nbytes=NO_OF_BYTES_20MS; - s->ms_per_frame=20; - }else if (strstr(buf,"30")!=NULL){ - s->nsamples=BLOCKL_30MS; - s->nbytes=NO_OF_BYTES_30MS; - s->ms_per_frame=30; - } - return 0; -} - -static int enc_add_attr(MSFilter *f, void *arg){ - const char *fmtp=(const char *)arg; - EncState *s=(EncState*)f->data; - if (strstr(fmtp,"ptime:20")!=NULL){ - s->ptime=20; - }else if (strstr(fmtp,"ptime:30")!=NULL){ - s->ptime=30; - }else if (strstr(fmtp,"ptime:40")!=NULL){ - s->ptime=40; - }else if (strstr(fmtp,"ptime:60")!=NULL){ - s->ptime=60; - }else if (strstr(fmtp,"ptime:80")!=NULL){ - s->ptime=80; - }else if (strstr(fmtp,"ptime:90")!=NULL){ - s->ptime=90; - }else if (strstr(fmtp,"ptime:100")!=NULL){ - s->ptime=100; - }else if (strstr(fmtp,"ptime:120")!=NULL){ - s->ptime=120; - }else if (strstr(fmtp,"ptime:140")!=NULL){ - s->ptime=140; - } - return 0; -} - -static void enc_process(MSFilter *f){ - EncState *s=(EncState*)f->data; - mblk_t *im,*om; - int size=s->nsamples*2; - int16_t samples[1610]; /* BLOCKL_MAX * 7 is the largest size for ptime == 140 */ - float samples2[BLOCKL_MAX]; - int i; - int frame_per_packet=1; - - if (s->ptime>=20 && s->ms_per_frame>0 && s->ptime%s->ms_per_frame==0) - { - frame_per_packet = s->ptime/s->ms_per_frame; - } - - if (frame_per_packet<=0) - frame_per_packet=1; - if (frame_per_packet>7) /* 7*20 == 140 ms max */ - frame_per_packet=7; - - while((im=ms_queue_get(f->inputs[0]))!=NULL){ - ms_bufferizer_put(&s->bufferizer,im); - } - while(ms_bufferizer_read(&s->bufferizer,(uint8_t*)samples,size*frame_per_packet)==(size*frame_per_packet)){ - int k; - om=allocb(s->nbytes*frame_per_packet,0); - for (k=0;knsamples;i++){ - samples2[i]=samples[i+(s->nsamples*k)]; - } - iLBC_encode((uint8_t*)om->b_wptr,samples2,&s->ilbc_enc); - om->b_wptr+=s->nbytes; - s->ts+=s->nsamples; - } - mblk_set_timestamp_info(om,s->ts-s->nsamples); - ms_queue_put(f->outputs[0],om); - } -} - -static MSFilterMethod enc_methods[]={ - { MS_FILTER_ADD_FMTP, enc_add_fmtp }, - { MS_FILTER_ADD_ATTR, enc_add_attr}, - { 0 , NULL } -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_ilbc_enc_desc={ - MS_FILTER_PLUGIN_ID, - "MSIlbcEnc", - "iLBC encoder", - MS_FILTER_ENCODER, - "iLBC", - 1, - 1, - enc_init, - enc_preprocess, - enc_process, - NULL, - enc_uninit, - enc_methods -}; - -#else - -MSFilterDesc ms_ilbc_enc_desc={ - .id=MS_FILTER_PLUGIN_ID, - .name="MSIlbcEnc", - .text="iLBC encoder", - .category=MS_FILTER_ENCODER, - .enc_fmt="iLBC", - .ninputs=1, - .noutputs=1, - .init=enc_init, - .preprocess=enc_preprocess, - .process=enc_process, - .uninit=enc_uninit, - .methods=enc_methods -}; - -#endif - -typedef struct DecState{ - int nsamples; - int nbytes; - int ms_per_frame; - iLBC_Dec_Inst_t ilbc_dec; -}DecState; - - -static void dec_init(MSFilter *f){ - DecState *s=ms_new(DecState,1); - s->nsamples=0; - s->nbytes=0; - s->ms_per_frame=0; - f->data=s; -} - -static void dec_uninit(MSFilter *f){ - ms_free(f->data); -} - -static void dec_process(MSFilter *f){ - DecState *s=(DecState*)f->data; - mblk_t *im,*om; - int nbytes; - float samples[BLOCKL_MAX]; - int i; - - while ((im=ms_queue_get(f->inputs[0]))!=NULL){ - nbytes=msgdsize(im); - if (nbytes<=0) - return; - if (nbytes%38!=0 && nbytes%50!=0) - return; - if (nbytes%38==0 && s->nbytes!=NO_OF_BYTES_20MS) - { - /* not yet configured, or misconfigured */ - s->ms_per_frame=20; - s->nbytes=NO_OF_BYTES_20MS; - s->nsamples=BLOCKL_20MS; - initDecode(&s->ilbc_dec,s->ms_per_frame,0); - } - else if (nbytes%50==0 && s->nbytes!=NO_OF_BYTES_30MS) - { - /* not yet configured, or misconfigured */ - s->ms_per_frame=30; - s->nbytes=NO_OF_BYTES_30MS; - s->nsamples=BLOCKL_30MS; - initDecode(&s->ilbc_dec,s->ms_per_frame,0); - } - if (s->nbytes>0 && nbytes>=s->nbytes){ - int frame_per_packet = nbytes/s->nbytes; - int k; - - for (k=0;knsamples*2,0); - iLBC_decode(samples,(uint8_t*)im->b_rptr+(k*s->nbytes),&s->ilbc_dec,1); - for (i=0;insamples;i++,om->b_wptr+=2){ - *((int16_t*)om->b_wptr)=samples[i]; - } - ms_queue_put(f->outputs[0],om); - } - }else{ - ms_warning("bad iLBC frame !"); - } - freemsg(im); - } -} - -#ifdef _MSC_VER - -MSFilterDesc ms_ilbc_dec_desc={ - MS_FILTER_PLUGIN_ID, - "MSIlbcDec", - "iLBC decoder", - MS_FILTER_DECODER, - "iLBC", - 1, - 1, - dec_init, - NULL, - dec_process, - NULL, - dec_uninit, - NULL -}; - -#else - -MSFilterDesc ms_ilbc_dec_desc={ - .id=MS_FILTER_PLUGIN_ID, - .name="MSIlbcDec", - .text="iLBC decoder", - .category=MS_FILTER_DECODER, - .enc_fmt="iLBC", - .ninputs=1, - .noutputs=1, - .init=dec_init, - .process=dec_process, - .uninit=dec_uninit -}; - -#endif - -#ifdef _MSC_VER -#define MS_PLUGIN_DECLARE(type) __declspec(dllexport) type -#else -#define MS_PLUGIN_DECLARE(type) type -#endif - -MS_PLUGIN_DECLARE(void) libmsilbc_init(){ - ms_filter_register(&ms_ilbc_enc_desc); - ms_filter_register(&ms_ilbc_dec_desc); -} diff --git a/linphone/mediastreamer2/plugins/msx264/AUTHORS b/linphone/mediastreamer2/plugins/msx264/AUTHORS deleted file mode 100644 index 16d2ea646..000000000 --- a/linphone/mediastreamer2/plugins/msx264/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -Simon Morlat \ No newline at end of file diff --git a/linphone/mediastreamer2/plugins/msx264/COPYING b/linphone/mediastreamer2/plugins/msx264/COPYING deleted file mode 100644 index 623b6258a..000000000 --- a/linphone/mediastreamer2/plugins/msx264/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/linphone/mediastreamer2/plugins/msx264/ChangeLog b/linphone/mediastreamer2/plugins/msx264/ChangeLog deleted file mode 100644 index e69de29bb..000000000 diff --git a/linphone/mediastreamer2/plugins/msx264/INSTALL b/linphone/mediastreamer2/plugins/msx264/INSTALL deleted file mode 100644 index 2550dab75..000000000 --- a/linphone/mediastreamer2/plugins/msx264/INSTALL +++ /dev/null @@ -1,302 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007, 2008, 2009 Free Software Foundation, Inc. - - This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. - -Basic Installation -================== - - Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for -instructions specific to this package. - - 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 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. - - Running `configure' might take a while. 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. - - 6. Often, you can also type `make uninstall' to remove the installed - files again. - -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=c99 CFLAGS=-g 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 can use 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 `..'. - - With a non-GNU `make', it is safer 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. - - On MacOS X 10.5 and later systems, you can create libraries and -executables that work on multiple system types--known as "fat" or -"universal" binaries--by specifying multiple `-arch' options to the -compiler but only a single `-arch' option to the preprocessor. Like -this: - - ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CPP="gcc -E" CXXCPP="g++ -E" - - This is not guaranteed to produce working output in all cases, you -may have to build one architecture at a time and combine the results -using the `lipo' tool if you have problems. - -Installation Names -================== - - By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' 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. - -Particular systems -================== - - On HP-UX, the default C compiler is not ANSI C compatible. If GNU -CC is not installed, it is recommended to use the following options in -order to use an ANSI C compiler: - - ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" - -and if that doesn't work, install pre-built binaries of GCC for HP-UX. - - On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot -parse its `' header file. The option `-nodtk' can be used as -a workaround. If GNU CC is not installed, it is therefore recommended -to try - - ./configure CC="cc" - -and if that doesn't work, try - - ./configure CC="cc -nodtk" - - On Solaris, don't put `/usr/ucb' early in your `PATH'. This -directory contains several dysfunctional programs; working variants of -these programs are available in `/usr/bin'. So, if you need `/usr/ucb' -in your `PATH', put it _after_ `/usr/bin'. - - On Haiku, software installed for all users goes in `/boot/common', -not `/usr/local'. It is recommended to use the following options: - - ./configure --prefix=/boot/common - -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 option `--target=TYPE' 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 - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). - -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf bug. Until the bug is fixed you can use this workaround: - - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. - -`--help=short' -`--help=recursive' - Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. - -`--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. - -`--prefix=DIR' - Use DIR as the installation prefix. *Note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. - -`--no-create' -`-n' - Run the configure checks, but stop before creating any output - files. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - diff --git a/linphone/mediastreamer2/plugins/msx264/Makefile.am b/linphone/mediastreamer2/plugins/msx264/Makefile.am deleted file mode 100644 index 3ec7f9edc..000000000 --- a/linphone/mediastreamer2/plugins/msx264/Makefile.am +++ /dev/null @@ -1,48 +0,0 @@ -EXTRA_DIST=autogen.sh - -SUBDIRS=src - - - -INSTALLDIR=$(shell cd $(top_builddir) && pwd)/$(PACKAGE)-install -INSTALLDIR_WITH_PREFIX=$(INSTALLDIR)/$(prefix) -ZIPFILE=$(shell cd $(top_builddir) && pwd)/$(PACKAGE)-win32-$(VERSION).zip -ZIP_EXCLUDED=include - -ISS_SCRIPT=msx264.iss -ISS_SCRIPT_PATH=$(shell cd $(top_srcdir) && pwd)/$(ISS_SCRIPT) -#path to Inno Setup 5 compiler -ISCC=/c/Program\ Files/Inno\ Setup\ 5/ISCC.exe -PACKAGE_WIN32_FILELIST=$(PACKAGE)-win32.filelist - -setup.exe: zip - cd $(INSTALLDIR_WITH_PREFIX) && \ - rm -f $(PACKAGE_WIN32_FILELIST) && \ - for file in `find` ; do \ - if ! test -d $$file ; then \ - echo "Source: $$file; Destdir: {app}\\`dirname $$file`; Flags: ignoreversion" \ - >> $(PACKAGE_WIN32_FILELIST) ;\ - fi \ - done - cp $(ISS_SCRIPT) $(INSTALLDIR_WITH_PREFIX)/. - cd $(INSTALLDIR_WITH_PREFIX) && \ - $(ISCC) $(ISS_SCRIPT) - mv $(INSTALLDIR_WITH_PREFIX)/Output/setup.exe $(PACKAGE)-$(VERSION)-setup.exe - rm -rf $(INSTALLDIR_WITH_PREFIX)/Output - rm -f $(INSTALLDIR_WITH_PREFIX)/$(PACKAGE_WIN32_FILELIST) - rm -f $(INSTALLDIR_WITH_PREFIX)/$(ISS_SCRIPT) - -zip: - rm -f $(ZIPFILE) - rm -rf $(INSTALLDIR) - mkdir -p $(INSTALLDIR) - make install DESTDIR=$(INSTALLDIR) - cp -f $(top_srcdir)/README $(INSTALLDIR_WITH_PREFIX)/. - cp -f $(top_srcdir)/COPYING $(INSTALLDIR_WITH_PREFIX)/. - cd $(INSTALLDIR)/$(prefix) && rm -rf $(ZIP_EXCLUDED) && \ - zip -r $(ZIPFILE) * - -clean-local: - -rm -rf $(PACKAGE)-install - -rm -f $(PACKAGE)-win32-$(VERSION).zip - diff --git a/linphone/mediastreamer2/plugins/msx264/NEWS b/linphone/mediastreamer2/plugins/msx264/NEWS deleted file mode 100644 index a354cdff8..000000000 --- a/linphone/mediastreamer2/plugins/msx264/NEWS +++ /dev/null @@ -1,8 +0,0 @@ -Wednesday December 2, 2009: msx264-1.3.0 - - use new official x264 support of multislicing (forked version no more required) - -Friday July 4, 2009 : msx264-1.2.0 - - modified to compile against new multisliced version of x264 to allow packetization-mode=0 - -Wednesday August 20, 2008: msx264-1.1.0 - - compiled together with x264-snapshot-20080421-2245+multislicing-patch.tar.gz, allows packetization-mode=0 diff --git a/linphone/mediastreamer2/plugins/msx264/README b/linphone/mediastreamer2/plugins/msx264/README deleted file mode 100644 index 291cab2cb..000000000 --- a/linphone/mediastreamer2/plugins/msx264/README +++ /dev/null @@ -1,18 +0,0 @@ -msx264 - a GPL plugin to bring video H264 encoding/decoding capabilities to mediastreamer2 applications. -It is based on ffmpeg for decoding and x264 for encoding. - -It works with x264 version later to september 2009. -So: - -* compile msx264 with ./configure && make && make install - - -A bit of history -**************** - -The multislicing feature of x264 is something that has been contributed several time, but never merged (why ?). -The linphone.org version of x264 was inspired by a patch submitted on x264-devel mailing list: -http://mailman.videolan.org/pipermail/x264-devel/2008-April/004427.html -http://download.savannah.gnu.org/releases/linphone/plugins/sources/x264-snapshot-20090704-linphone-org.tar.gz -This version is no more required since in august 2009, x264 team introduces new parameters -controlling slicing. diff --git a/linphone/mediastreamer2/plugins/msx264/autogen.sh b/linphone/mediastreamer2/plugins/msx264/autogen.sh deleted file mode 100755 index 829a5a0b7..000000000 --- a/linphone/mediastreamer2/plugins/msx264/autogen.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -AM_VERSION=1.10 -if ! type aclocal-$AM_VERSION 1>/dev/null 2>&1; then - ACLOCAL=aclocal - AUTOMAKE=automake -else - ACLOCAL=aclocal-${AM_VERSION} - AUTOMAKE=automake-${AM_VERSION} -fi - -echo "Generating build scripts in this mediastreamer plugin" -set -x -libtoolize --copy --force -$ACLOCAL -$AUTOMAKE --force-missing --add-missing --copy -autoconf - - diff --git a/linphone/mediastreamer2/plugins/msx264/configure.ac b/linphone/mediastreamer2/plugins/msx264/configure.ac deleted file mode 100644 index 191383a13..000000000 --- a/linphone/mediastreamer2/plugins/msx264/configure.ac +++ /dev/null @@ -1,159 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -AC_INIT([msx264],[1.3.0]) - -AM_INIT_AUTOMAKE([tar-ustar]) - -AC_CANONICAL_SYSTEM - -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] -) - - -dnl Checks for programs. -AC_PROG_CC - -AC_LIBTOOL_WIN32_DLL -AC_DISABLE_STATIC -AC_PROG_LIBTOOL - - -case $target_os in - *mingw*) - mingw_found=yes - ;; -esac - -AM_CONDITIONAL(BUILD_WIN32, test x$mingw_found = xyes) - -AC_CONFIG_COMMANDS([libtool-hacking],[ -if test "$mingw_found" = "yes" ; then - AC_MSG_NOTICE([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]) - - -CFLAGS="$CFLAGS -Wall" - - -dnl Checks for header files. -AC_HEADER_STDC - -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 - CFLAGS="$CFLAGS -D_BIGENDIAN" -fi - -if test $GCC = yes && test $wall_werror = yes; then - CFLAGS="$CFLAGS -Werror " -fi - -PKG_CHECK_MODULES(MEDIASTREAMER, mediastreamer >= 2.1.0) - -PKG_CHECK_MODULES(X264, x264 >= 0.67.0) - - -dnl test for ffmpeg presence -PKG_CHECK_MODULES(LIBAVCODEC, [libavcodec >= 50.0.0 ],ffmpeg_found=yes , ffmpeg_found=no) -dnl workaround for debian... -PKG_CHECK_MODULES(LIBAVCODEC, [libavcodec >= 0d.50.0.0 ], ffmpeg_found=yes, ffmpeg_found=no) -if test x$ffmpeg_found = xno ; then - AC_MSG_ERROR([Could not find ffmpeg headers and library. This is mandatory for video support]) -fi - -PKG_CHECK_MODULES(LIBSWSCALE, [libswscale >= 0.7.0]) - - -dnl check for new/old ffmpeg header file layout -CPPFLAGS_save=$CPPFLAGS -CPPFLAGS=$LIBAVCODEC_CFLAGS -AC_CHECK_HEADERS(libavcodec/avcodec.h) -CPPFLAGS=$CPPFLAGS_save - -if test "$hacked_x264" = "yes" ; then - AC_MSG_NOTICE([Trying to compile with multislicing patched version of X264]) - CFLAGS="$CFLAGS -DHACKED_X264" -fi - -LDFLAGS="$LDFLAGS -rdynamic " - -dnl define path of plugins: -PACKAGE_PLUGINS_DIR="\$(libdir)/mediastreamer/plugins" -AC_SUBST(PACKAGE_PLUGINS_DIR) - -dnl ################################################## -dnl # Check for ESP Packager -dnl ################################################## - -AC_PATH_PROG(EPM,epm,false) -AC_PATH_PROG(MKEPMLIST,mkepmlist,false) -AC_PATH_PROG(EPMINSTALL,epminstall,false) -AM_CONDITIONAL(WITH_EPM,test $EPM != false && test $MKEPMLIST != false && test $EPMINSTALL != false) - - -# Preferred packaging system, as per EPM terminology -case $target in -*-*-linux*) - if test -f /etc/debian_version ; then - EPM_PKG_EXT=deb - else - EPM_PKG_EXT=rpm - fi - ;; -*-hp-hpux*) - EPM_PKG_EXT=depot.gz;; -*-dec-osf*) - EPM_PKG_EXT=setld;; -esac -AC_SUBST(EPM_PKG_EXT) - -# System software User & Group names -case $target in -*-*-linux*) - SYS_USER=root - SYS_GROUP=root - ;; -*-*-hpux*|*-dec-osf*) - SYS_USER=bin - SYS_GROUP=bin - ;; -esac -AC_SUBST(SYS_USER) -AC_SUBST(SYS_GROUP) - -# CPU Architecture -case $target_cpu in -i?86) ARCH=i386;; -*) ARCH=$target_cpu;; -esac -AC_SUBST(ARCH) - -# Various other packaging variables, that can be over-ridden ad `make -# package' time -SUMMARY="A H264 codec mediastreamer plugin" -AC_SUBST(SUMMARY) -PACKAGER=anonymous -AC_SUBST(PACKAGER) -LICENSE=GPL -AC_SUBST(LICENSE) -VENDOR=Linphone -AC_SUBST(VENDOR) -RELEASE=1 -AC_SUBST(RELEASE) - - -AC_OUTPUT( -Makefile -src/Makefile -msx264.iss -) diff --git a/linphone/mediastreamer2/plugins/msx264/msx264.iss.in b/linphone/mediastreamer2/plugins/msx264/msx264.iss.in deleted file mode 100644 index 94f282b8e..000000000 --- a/linphone/mediastreamer2/plugins/msx264/msx264.iss.in +++ /dev/null @@ -1,34 +0,0 @@ -; Script generated by the Inno Setup Script Wizard. -; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! - -[Setup] -AppName=msx264 -AppVerName=msx264 version @VERSION@ , an H.264 plugin for linphone. -AppPublisher=linphone.org -AppPublisherURL=http://www.linphone.org -AppSupportURL=http://www.linphone.org -AppUpdatesURL=http://www.linphone.org -DefaultDirName={pf}\Linphone -DefaultGroupName=Linphone -LicenseFile=COPYING -InfoBeforeFile=README -OutputBaseFilename=setup -Compression=lzma -SolidCompression=yes - -[Languages] -Name: "english"; MessagesFile: "compiler:Default.isl" - -[Tasks] -;Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked - -[Files] -#include "msx264-win32.filelist" - -[Icons] -;Name: "{group}\Linphone"; Filename: "{app}\linphone-wx.exe" ; WorkingDir: "{app}" -;Name: "{userdesktop}\Linphone"; Filename: "{app}\linphone-wx.exe"; WorkingDir: "{app}" ; Tasks: desktopicon - -[Run] -;Filename: "{app}\linphone-wx.exe"; Description: "{cm:LaunchProgram,Linphone}"; WorkingDir: "{app}" ; Flags: nowait postinstall skipifsilent - diff --git a/linphone/mediastreamer2/plugins/msx264/src/Makefile.am b/linphone/mediastreamer2/plugins/msx264/src/Makefile.am deleted file mode 100644 index c4c423605..000000000 --- a/linphone/mediastreamer2/plugins/msx264/src/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -pluginsdir=$(PACKAGE_PLUGINS_DIR) - -plugins_LTLIBRARIES=libmsx264.la - -libmsx264_la_SOURCES=msx264.c - -libmsx264_la_LIBADD=\ - $(LIBAVCODEC_LIBS) \ - $(LIBSWSCALE_LIBS) \ - $(MEDIASTREAMER_LIBS) \ - $(X264_LIBS) - -libmsx264_la_LDFLAGS=-no-undefined - -AM_CFLAGS= $(LIBAVCODEC_CFLAGS) \ - $(LIBSWSCALE_CFLAGS) \ - $(MEDIASTREAMER_CFLAGS)\ - $(X264_CFLAGS) - -if BUILD_WIN32 -#hack for mingw to force plugins dll to be where we want them to be. -install-data-hook: - mv $(DESTDIR)$(pluginsdir)/../bin/*.dll \ - $(DESTDIR)$(pluginsdir)/. - rm -f $(DESTDIR)$(pluginsdir)/*.la - rm -f $(DESTDIR)$(pluginsdir)/*.dll.a -endif diff --git a/linphone/mediastreamer2/plugins/msx264/src/msx264.c b/linphone/mediastreamer2/plugins/msx264/src/msx264.c deleted file mode 100644 index 3ad35f217..000000000 --- a/linphone/mediastreamer2/plugins/msx264/src/msx264.c +++ /dev/null @@ -1,563 +0,0 @@ -/* -mediastreamer2 x264 plugin -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/msfilter.h" -#include "mediastreamer2/msticker.h" -#include "mediastreamer2/msvideo.h" -#include "mediastreamer2/rfc3984.h" - -#include "ortp/b64.h" - -#include - -#ifdef HAVE_LIBAVCODEC_AVCODEC_H -#include -#include -#else -#include -#include -#endif - -#define REMOVE_PREVENTING_BYTES 1 - -typedef struct _EncData{ - x264_t *enc; - MSVideoSize vsize; - int bitrate; - float fps; - int mode; - uint64_t framenum; - Rfc3984Context packer; - int keyframe_int; - bool_t generate_keyframe; -}EncData; - - -static void enc_init(MSFilter *f){ - EncData *d=ms_new(EncData,1); - d->enc=NULL; - d->bitrate=384000; - d->vsize=MS_VIDEO_SIZE_CIF; - d->fps=30; - d->keyframe_int=10; /*10 seconds */ - d->mode=0; - d->framenum=0; - d->generate_keyframe=FALSE; - f->data=d; -} - -static void enc_uninit(MSFilter *f){ - EncData *d=(EncData*)f->data; - ms_free(d); -} - -static void enc_preprocess(MSFilter *f){ - EncData *d=(EncData*)f->data; - x264_param_t params; - - rfc3984_init(&d->packer); - rfc3984_set_mode(&d->packer,d->mode); - rfc3984_enable_stap_a(&d->packer,FALSE); - - x264_param_default(¶ms); - params.i_threads=1; - params.i_sync_lookahead=0; - params.i_width=d->vsize.width; - params.i_height=d->vsize.height; - params.i_fps_num=(int)d->fps; - params.i_fps_den=1; - params.i_slice_max_size=ms_get_payload_max_size()-100; /*-100 security margin*/ - /*params.i_level_idc=30;*/ - - params.rc.i_rc_method = X264_RC_ABR; - params.rc.i_bitrate=(int)( ( ((float)d->bitrate)*0.8)/1000.0); - params.rc.f_rate_tolerance=0.1; - params.rc.i_vbv_max_bitrate=(int) (((float)d->bitrate)*0.9/1000.0); - params.rc.i_vbv_buffer_size=params.rc.i_vbv_max_bitrate; - params.rc.f_vbv_buffer_init=0.5; - params.rc.i_lookahead=0; - /*enable this by config ?*/ - /* - params.i_keyint_max = (int)d->fps*d->keyframe_int; - params.i_keyint_min = (int)d->fps; - */ - params.b_repeat_headers=1; - params.b_cabac=0;//disable cabac to be baseline - params.i_bframe=0;/*no B frames*/ - d->enc=x264_encoder_open(¶ms); - if (d->enc==NULL) ms_error("Fail to create x264 encoder."); - d->framenum=0; -} - -static void x264_nals_to_msgb(x264_nal_t *xnals, int num_nals, MSQueue * nalus){ - int i; - mblk_t *m; - /*int bytes;*/ - for (i=0;ib_wptr,xnals[i].p_payload+4,xnals[i].i_payload-4); - m->b_wptr+=xnals[i].i_payload-4; - if (xnals[i].i_type==7) { - ms_message("A SPS is being sent."); - }else if (xnals[i].i_type==8) { - ms_message("A PPS is being sent."); - } - ms_queue_put(nalus,m); - } -} - -static void enc_process(MSFilter *f){ - EncData *d=(EncData*)f->data; - uint32_t ts=f->ticker->time*90LL; - mblk_t *im; - MSPicture pic; - MSQueue nalus; - ms_queue_init(&nalus); - while((im=ms_queue_get(f->inputs[0]))!=NULL){ - if (yuv_buf_init_from_mblk(&pic,im)==0){ - x264_picture_t xpic; - x264_picture_t oxpic; - x264_nal_t *xnals=NULL; - int num_nals=0; - - /*send I frame 2 seconds and 4 seconds after the beginning */ - if (d->framenum==(int)d->fps*2 || d->framenum==(int)d->fps*4) - d->generate_keyframe=TRUE; - - if (d->generate_keyframe){ - xpic.i_type=X264_TYPE_IDR; - d->generate_keyframe=FALSE; - }else xpic.i_type=X264_TYPE_AUTO; - xpic.i_qpplus1=0; - xpic.i_pts=d->framenum; - xpic.param=NULL; - xpic.img.i_csp=X264_CSP_I420; - xpic.img.i_plane=3; - xpic.img.i_stride[0]=pic.strides[0]; - xpic.img.i_stride[1]=pic.strides[1]; - xpic.img.i_stride[2]=pic.strides[2]; - xpic.img.i_stride[3]=0; - xpic.img.plane[0]=pic.planes[0]; - xpic.img.plane[1]=pic.planes[1]; - xpic.img.plane[2]=pic.planes[2]; - xpic.img.plane[3]=0; - if (x264_encoder_encode(d->enc,&xnals,&num_nals,&xpic,&oxpic)>=0){ - x264_nals_to_msgb(xnals,num_nals,&nalus); - rfc3984_pack(&d->packer,&nalus,f->outputs[0],ts); - d->framenum++; - }else{ - ms_error("x264_encoder_encode() error."); - } - } - freemsg(im); - } -} - -static void enc_postprocess(MSFilter *f){ - EncData *d=(EncData*)f->data; - rfc3984_uninit(&d->packer); - if (d->enc!=NULL){ - x264_encoder_close(d->enc); - d->enc=NULL; - } -} - -static int enc_set_br(MSFilter *f, void *arg){ - EncData *d=(EncData*)f->data; - d->bitrate=*(int*)arg; - - if (d->bitrate>=1024000){ - d->vsize=MS_VIDEO_SIZE_VGA; - d->fps=25; - }else if (d->bitrate>=512000){ - d->vsize=MS_VIDEO_SIZE_VGA; - d->fps=15; - }else if (d->bitrate>=384000){ - d->vsize=MS_VIDEO_SIZE_CIF; - d->fps=30; - }else if (d->bitrate>=256000){ - d->vsize=MS_VIDEO_SIZE_CIF; - d->fps=15; - }else if (d->bitrate>=128000){ - d->vsize=MS_VIDEO_SIZE_CIF; - d->fps=15; - }else if (d->bitrate>=64000){ - d->vsize=MS_VIDEO_SIZE_CIF; - d->fps=10; - }else if (d->bitrate>=32000){ - d->vsize=MS_VIDEO_SIZE_QCIF; - d->fps=10; - }else{ - d->vsize=MS_VIDEO_SIZE_QCIF; - d->fps=5; - } - ms_message("bitrate set to %i",d->bitrate); - return 0; -} - -static int enc_set_fps(MSFilter *f, void *arg){ - EncData *d=(EncData*)f->data; - d->fps=*(float*)arg; - return 0; -} - -static int enc_get_fps(MSFilter *f, void *arg){ - EncData *d=(EncData*)f->data; - *(float*)arg=d->fps; - return 0; -} - -static int enc_get_vsize(MSFilter *f, void *arg){ - EncData *d=(EncData*)f->data; - *(MSVideoSize*)arg=d->vsize; - return 0; -} - -static int enc_set_vsize(MSFilter *f, void *arg){ - EncData *d=(EncData*)f->data; - d->vsize=*(MSVideoSize*)arg; - return 0; -} - -static int enc_add_fmtp(MSFilter *f, void *arg){ - EncData *d=(EncData*)f->data; - const char *fmtp=(const char *)arg; - char value[12]; - if (fmtp_get_value(fmtp,"packetization-mode",value,sizeof(value))){ - d->mode=atoi(value); - ms_message("packetization-mode set to %i",d->mode); - } - return 0; -} - -static int enc_req_vfu(MSFilter *f, void *arg){ - EncData *d=(EncData*)f->data; - d->generate_keyframe=TRUE; - return 0; -} - - -static MSFilterMethod enc_methods[]={ - { MS_FILTER_SET_FPS , enc_set_fps }, - { MS_FILTER_SET_BITRATE , enc_set_br }, - { MS_FILTER_GET_FPS , enc_get_fps }, - { MS_FILTER_GET_VIDEO_SIZE, enc_get_vsize }, - { MS_FILTER_SET_VIDEO_SIZE, enc_set_vsize }, - { MS_FILTER_ADD_FMTP , enc_add_fmtp }, - { MS_FILTER_REQ_VFU , enc_req_vfu }, - { 0 , NULL } -}; - -static MSFilterDesc x264_enc_desc={ - .id=MS_FILTER_PLUGIN_ID, - .name="MSX264Enc", - .text="A H264 encoder based on x264 project (with multislicing enabled)", - .category=MS_FILTER_ENCODER, - .enc_fmt="H264", - .ninputs=1, - .noutputs=1, - .init=enc_init, - .preprocess=enc_preprocess, - .process=enc_process, - .postprocess=enc_postprocess, - .uninit=enc_uninit, - .methods=enc_methods -}; - -typedef struct _DecData{ - mblk_t *yuv_msg; - mblk_t *sps,*pps; - Rfc3984Context unpacker; - MSPicture outbuf; - struct SwsContext *sws_ctx; - AVCodecContext av_context; - unsigned int packet_num; - uint8_t *bitstream; - int bitstream_size; -}DecData; - -static void ffmpeg_init(){ - static bool_t done=FALSE; - if (!done){ - avcodec_init(); - avcodec_register_all(); - done=TRUE; - } -} - -static void dec_open(DecData *d){ - AVCodec *codec; - int error; - codec=avcodec_find_decoder(CODEC_ID_H264); - if (codec==NULL) ms_fatal("Could not find H264 decoder in ffmpeg."); - avcodec_get_context_defaults(&d->av_context); - error=avcodec_open(&d->av_context,codec); - if (error!=0){ - ms_fatal("avcodec_open() failed."); - } -} - -static void dec_init(MSFilter *f){ - DecData *d=(DecData*)ms_new(DecData,1); - ffmpeg_init(); - d->yuv_msg=NULL; - d->sps=NULL; - d->pps=NULL; - d->sws_ctx=NULL; - rfc3984_init(&d->unpacker); - d->packet_num=0; - dec_open(d); - d->outbuf.w=0; - d->outbuf.h=0; - d->bitstream_size=65536; - d->bitstream=ms_malloc0(d->bitstream_size); - f->data=d; -} - -static void dec_reinit(DecData *d){ - avcodec_close(&d->av_context); - dec_open(d); -} - -static void dec_uninit(MSFilter *f){ - DecData *d=(DecData*)f->data; - rfc3984_uninit(&d->unpacker); - avcodec_close(&d->av_context); - if (d->yuv_msg) freemsg(d->yuv_msg); - if (d->sps) freemsg(d->sps); - if (d->pps) freemsg(d->pps); - ms_free(d->bitstream); - ms_free(d); -} - -static mblk_t *get_as_yuvmsg(MSFilter *f, DecData *s, AVFrame *orig){ - AVCodecContext *ctx=&s->av_context; - - if (s->outbuf.w!=ctx->width || s->outbuf.h!=ctx->height){ - if (s->sws_ctx!=NULL){ - sws_freeContext(s->sws_ctx); - s->sws_ctx=NULL; - freemsg(s->yuv_msg); - s->yuv_msg=NULL; - } - ms_message("Getting yuv picture of %ix%i",ctx->width,ctx->height); - s->yuv_msg=yuv_buf_alloc(&s->outbuf,ctx->width,ctx->height); - s->outbuf.w=ctx->width; - s->outbuf.h=ctx->height; - s->sws_ctx=sws_getContext(ctx->width,ctx->height,ctx->pix_fmt, - ctx->width,ctx->height,PIX_FMT_YUV420P,SWS_FAST_BILINEAR, - NULL, NULL, NULL); - } - if (sws_scale(s->sws_ctx,orig->data,orig->linesize, 0, - ctx->height, s->outbuf.planes, s->outbuf.strides)<0){ - ms_error("%s: error in sws_scale().",f->desc->name); - } - return dupmsg(s->yuv_msg); -} - -static void update_sps(DecData *d, mblk_t *sps){ - if (d->sps) - freemsg(d->sps); - d->sps=dupb(sps); -} - -static void update_pps(DecData *d, mblk_t *pps){ - if (d->pps) - freemsg(d->pps); - if (pps) d->pps=dupb(pps); - else d->pps=NULL; -} - -static bool_t check_sps_pps_change(DecData *d, mblk_t *sps, mblk_t *pps){ - bool_t ret1=FALSE,ret2=FALSE; - if (d->sps){ - if (sps){ - ret1=(msgdsize(sps)!=msgdsize(d->sps)) || (memcmp(d->sps->b_rptr,sps->b_rptr,msgdsize(sps))!=0); - if (ret1) { - update_sps(d,sps); - ms_message("SPS changed !"); - update_pps(d,NULL); - } - } - }else if (sps) { - ms_message("Receiving first SPS"); - update_sps(d,sps); - } - if (d->pps){ - if (pps){ - ret2=(msgdsize(pps)!=msgdsize(d->pps)) || (memcmp(d->pps->b_rptr,pps->b_rptr,msgdsize(pps))!=0); - if (ret2) { - update_sps(d,pps); - ms_message("PPS changed ! %i,%i",msgdsize(pps),msgdsize(d->pps)); - } - } - }else if (pps) { - ms_message("Receiving first PPS"); - update_pps(d,pps); - } - return ret1 || ret2; -} - -static void enlarge_bitstream(DecData *d, int new_size){ - d->bitstream_size=new_size; - d->bitstream=ms_realloc(d->bitstream,d->bitstream_size); -} - -static int nalusToFrame(DecData *d, MSQueue *naluq, bool_t *new_sps_pps){ - mblk_t *im; - uint8_t *dst=d->bitstream,*src,*end; - int nal_len; - bool_t start_picture=TRUE; - uint8_t nalu_type; - *new_sps_pps=FALSE; - end=d->bitstream+d->bitstream_size; - while((im=ms_queue_get(naluq))!=NULL){ - src=im->b_rptr; - nal_len=im->b_wptr-src; - if (dst+nal_len+100>end){ - int pos=dst-d->bitstream; - enlarge_bitstream(d, d->bitstream_size+nal_len+100); - dst=d->bitstream+pos; - end=d->bitstream+d->bitstream_size; - } - nalu_type=(*src) & ((1<<5)-1); - if (nalu_type==7) - *new_sps_pps=check_sps_pps_change(d,im,NULL) || *new_sps_pps; - if (nalu_type==8) - *new_sps_pps=check_sps_pps_change(d,NULL,im) || *new_sps_pps; - if (start_picture || nalu_type==7/*SPS*/ || nalu_type==8/*PPS*/ ){ - *dst++=0; - start_picture=FALSE; - } - /*prepend nal marker*/ - *dst++=0; - *dst++=0; - *dst++=1; - *dst++=*src++; - while(src<(im->b_wptr-3)){ - if (src[0]==0 && src[1]==0 && src[2]<3){ - *dst++=0; - *dst++=0; - *dst++=3; - src+=2; - } - *dst++=*src++; - } - *dst++=*src++; - *dst++=*src++; - *dst++=*src++; - freemsg(im); - } - return dst-d->bitstream; -} - -static void dec_process(MSFilter *f){ - DecData *d=(DecData*)f->data; - mblk_t *im; - MSQueue nalus; - AVFrame orig; - ms_queue_init(&nalus); - while((im=ms_queue_get(f->inputs[0]))!=NULL){ - /*push the sps/pps given in sprop-parameter-sets if any*/ - if (d->packet_num==0 && d->sps && d->pps){ - mblk_set_timestamp_info(d->sps,mblk_get_timestamp_info(im)); - mblk_set_timestamp_info(d->pps,mblk_get_timestamp_info(im)); - rfc3984_unpack(&d->unpacker,d->sps,&nalus); - rfc3984_unpack(&d->unpacker,d->pps,&nalus); - d->sps=NULL; - d->pps=NULL; - } - rfc3984_unpack(&d->unpacker,im,&nalus); - if (!ms_queue_empty(&nalus)){ - int size; - uint8_t *p,*end; - bool_t need_reinit=FALSE; - - size=nalusToFrame(d,&nalus,&need_reinit); - if (need_reinit) - dec_reinit(d); - p=d->bitstream; - end=d->bitstream+size; - while (end-p>0) { - int len; - int got_picture=0; - AVPacket pkt; - avcodec_get_frame_defaults(&orig); - av_init_packet(&pkt); - pkt.data = p; - pkt.size = end-p; - len=avcodec_decode_video2(&d->av_context,&orig,&got_picture,&pkt); - if (len<=0) { - ms_warning("ms_AVdecoder_process: error %i.",len); - break; - } - if (got_picture) { - ms_queue_put(f->outputs[0],get_as_yuvmsg(f,d,&orig)); - } - p+=len; - } - } - d->packet_num++; - } -} - -static int dec_add_fmtp(MSFilter *f, void *arg){ - DecData *d=(DecData*)f->data; - const char *fmtp=(const char *)arg; - char value[256]; - if (fmtp_get_value(fmtp,"sprop-parameter-sets",value,sizeof(value))){ - char * b64_sps=value; - char * b64_pps=strchr(value,','); - if (b64_pps){ - *b64_pps='\0'; - ++b64_pps; - ms_message("Got sprop-parameter-sets : sps=%s , pps=%s",b64_sps,b64_pps); - d->sps=allocb(sizeof(value),0); - d->sps->b_wptr+=b64_decode(b64_sps,strlen(b64_sps),d->sps->b_wptr,sizeof(value)); - d->pps=allocb(sizeof(value),0); - d->pps->b_wptr+=b64_decode(b64_pps,strlen(b64_pps),d->pps->b_wptr,sizeof(value)); - } - } - return 0; -} - -static MSFilterMethod h264_dec_methods[]={ - { MS_FILTER_ADD_FMTP , dec_add_fmtp }, - { 0 , NULL } -}; - -static MSFilterDesc h264_dec_desc={ - .id=MS_FILTER_PLUGIN_ID, - .name="MSH264Dec", - .text="A H264 decoder based on ffmpeg project.", - .category=MS_FILTER_DECODER, - .enc_fmt="H264", - .ninputs=1, - .noutputs=1, - .init=dec_init, - .process=dec_process, - .uninit=dec_uninit, - .methods=h264_dec_methods -}; - -void libmsx264_init(void){ - ms_filter_register(&x264_enc_desc); - ms_filter_register(&h264_dec_desc); -} diff --git a/linphone/mediastreamer2/src/.gitignore b/linphone/mediastreamer2/src/.gitignore deleted file mode 100644 index 9c4a34a80..000000000 --- a/linphone/mediastreamer2/src/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -Makefile.in -Makefile -.libs -.deps -*.la -*.lo -alldescs.h -filterdescs.txt diff --git a/linphone/mediastreamer2/src/Makefile.am b/linphone/mediastreamer2/src/Makefile.am deleted file mode 100644 index d5bf394ac..000000000 --- a/linphone/mediastreamer2/src/Makefile.am +++ /dev/null @@ -1,188 +0,0 @@ - -EXTRA_DIST= winsnd2.c winsnd.c winvideo.c \ - winvideods.c wincevideods.c dxfilter.h dxfilter.cpp \ - msfileplayer_win.c msfilerec_win.c winsndds.cpp nowebcamCIF.jpg winsnd3.c vfw-missing.h \ - winvideo2.c - -BUILT_SOURCES=alldescs.h - -CLEANFILES=alldescs.h filterdescs.txt - -INCLUDES=-I$(top_srcdir)/include/ - -lib_LTLIBRARIES=libmediastreamer.la - -libmediastreamer_la_SOURCES= mscommon.c \ - msfilter.c \ - msqueue.c \ - msticker.c \ - alaw.c \ - ulaw.c \ - mssndcard.c \ - msrtp.c \ - dtmfgen.c \ - ice.c \ - tee.c \ - msconf.c \ - msjoin.c \ - g711common.h \ - msvolume.c \ - mswebcam.c \ - mtu.c \ - void.c \ - dsptools.c \ - kiss_fft.c \ - _kiss_fft_guts.h \ - kiss_fft.h \ - kiss_fftr.c \ - kiss_fftr.h \ - equalizer.c - -#dummy c++ file to force libtool to use c++ linking (because of msdscap-mingw.cc) -nodist_EXTRA_libmediastreamer_la_SOURCES = dummy.cxx - -libmediastreamer_la_SOURCES+=audiostream.c - - -if BUILD_SPEEX -libmediastreamer_la_SOURCES+=msspeex.c speexec.c -endif - -if BUILD_GSM -libmediastreamer_la_SOURCES+=gsm.c -endif - -if BUILD_WIN32 -libmediastreamer_la_SOURCES+= winsnd3.c \ - msfileplayer_win.c msfilerec_win.c -else -libmediastreamer_la_SOURCES+= msfileplayer.c \ - msfilerec.c -endif - -if BUILD_RESAMPLE -libmediastreamer_la_SOURCES+=msresample.c -endif - -if BUILD_ALSA -libmediastreamer_la_SOURCES+=alsa.c -endif - -if BUILD_OSS -libmediastreamer_la_SOURCES+=oss.c -endif - -if BUILD_ARTS -libmediastreamer_la_SOURCES+=arts.c -endif - -if BUILD_PORTAUDIO -libmediastreamer_la_SOURCES+=pasnd.c -endif - -if BUILD_MACSND -libmediastreamer_la_SOURCES+=macsnd.c -endif - -if BUILD_MACAQSND -libmediastreamer_la_SOURCES+=aqsnd.c -endif - - -if BUILD_VIDEO - -if BUILD_MACOSX -libmediastreamer_la_SOURCES+=msv4m.m -endif - -if BUILD_V4L -libmediastreamer_la_SOURCES+=msv4l.c msv4l2.c -endif - -if BUILD_WIN32 -libmediastreamer_la_SOURCES+=msdscap-mingw.cc -endif - -if BUILD_THEORA -libmediastreamer_la_SOURCES+=theora.c -endif - - -libmediastreamer_la_SOURCES+= videoenc.c \ - videodec.c \ - pixconv.c \ - sizeconv.c \ - rfc2429.h \ - nowebcam.c nowebcam.h \ - videoout.c \ - msvideo.c \ - rfc3984.c \ - mire.c \ - swscale.h ffmpeg-priv.h - -libmediastreamer_la_SOURCES+=videostream.c - -endif - - - - -alldescs.h: Makefile.am $(libmediastreamer_la_SOURCES) - builddir=`pwd` && cd $(srcdir) && \ - awk 'BEGIN { FS="[()]" ; }; /^\t*MS_FILTER_DESC_EXPORT/{ printf("%s\n", $$2) } ' > $$builddir/filterdescs.txt $(libmediastreamer_la_SOURCES) && \ - awk 'BEGIN { print("#include \"mediastreamer2/msfilter.h\"\n") } { printf("extern MSFilterDesc %s;\n",$$1) } ' $$builddir/filterdescs.txt > $$builddir/$@ && \ - awk 'BEGIN { print("MSFilterDesc * ms_filter_descs[]={") } { printf("&%s,\n",$$1) } END{ print("NULL\n};\n") } ' $$builddir/filterdescs.txt >> $$builddir/$@ - - -libmediastreamer_la_LIBADD= $(ORTP_LIBS) \ - $(PORTAUDIO_LIBS) \ - $(ALSA_LIBS) \ - $(ARTS_LIBS) \ - $(SPEEX_LIBS) \ - $(GSM_LIBS) \ - $(LIBV4L1_LIBS) \ - $(LIBV4L2_LIBS) -if !BUILD_WIN32 -libmediastreamer_la_LDFLAGS=-rdynamic -else -libmediastreamer_la_LDFLAGS=-no-undefined -endif - -if BUILD_VIDEO -libmediastreamer_la_LIBADD+= $(VIDEO_LIBS) \ - $(THEORA_LIBS) - - -if BUILD_WIN32 -libmediastreamer_la_LIBADD+= -lole32 \ - -loleaut32\ - -lwinmm \ - -luuid - -endif - -endif -if BUILD_WIN32_WCE -libmediastreamer_la_LIBADD+= -lmmtimer -endif - -AM_CFLAGS= -I$(top_srcdir) \ - $(ORTP_CFLAGS) \ - $(SPEEX_CFLAGS) \ - $(GSM_CFLAGS) \ - $(STRICT_OPTIONS) - -AM_CXXFLAGS= -I$(top_srcdir) \ - $(ORTP_CFLAGS) \ - $(STRICT_OPTIONS) - -if BUILD_VIDEO -AM_CFLAGS+=$(VIDEO_CFLAGS) -endif - -AM_OBJCFLAGS=$(AM_CFLAGS) - -imgdir=$(datadir)/images/ - -img_DATA=nowebcamCIF.jpg - diff --git a/linphone/mediastreamer2/src/_kiss_fft_guts.h b/linphone/mediastreamer2/src/_kiss_fft_guts.h deleted file mode 100644 index 02ad5471f..000000000 --- a/linphone/mediastreamer2/src/_kiss_fft_guts.h +++ /dev/null @@ -1,205 +0,0 @@ -/* -Copyright (c) 2003-2004, Mark Borgerding - -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 author 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. -*/ - -#undef MIN -#undef MAX - -#define MIN(a,b) ((a)<(b) ? (a):(b)) -#define MAX(a,b) ((a)>(b) ? (a):(b)) - -/* kiss_fft.h - defines kiss_fft_scalar as either short or a float type - and defines - typedef struct { kiss_fft_scalar r; kiss_fft_scalar i; }kiss_fft_cpx; */ -#include "kiss_fft.h" -//#include "math_approx.h" - -#define MAXFACTORS 32 -/* e.g. an fft of length 128 has 4 factors - as far as kissfft is concerned - 4*4*4*2 - */ - -struct kiss_fft_state{ - int nfft; - int inverse; - int factors[2*MAXFACTORS]; - kiss_fft_cpx twiddles[1]; -}; - -/* - Explanation of macros dealing with complex math: - - C_MUL(m,a,b) : m = a*b - C_FIXDIV( c , div ) : if a fixed point impl., c /= div. noop otherwise - C_SUB( res, a,b) : res = a - b - C_SUBFROM( res , a) : res -= a - C_ADDTO( res , a) : res += a - * */ -#ifdef MS_FIXED_POINT -# define FRACBITS 15 -# define SAMPPROD ms_int32_t -#define SAMP_MAX 32767 - -#define SAMP_MIN -SAMP_MAX - -#if defined(CHECK_OVERFLOW) -# define CHECK_OVERFLOW_OP(a,op,b) \ - if ( (SAMPPROD)(a) op (SAMPPROD)(b) > SAMP_MAX || (SAMPPROD)(a) op (SAMPPROD)(b) < SAMP_MIN ) { \ - fprintf(stderr,"WARNING:overflow @ " __FILE__ "(%d): (%d " #op" %d) = %ld\n",__LINE__,(a),(b),(SAMPPROD)(a) op (SAMPPROD)(b) ); } -#endif - - -# define smul(a,b) ( (SAMPPROD)(a)*(b) ) -# define sround( x ) (kiss_fft_scalar)( ( (x) + (1<<(FRACBITS-1)) ) >> FRACBITS ) - -# define S_MUL(a,b) sround( smul(a,b) ) - -# define C_MUL(m,a,b) \ - do{ (m).r = sround( smul((a).r,(b).r) - smul((a).i,(b).i) ); \ - (m).i = sround( smul((a).r,(b).i) + smul((a).i,(b).r) ); }while(0) - -# define C_MUL4(m,a,b) \ - do{ (m).r = PSHR32( smul((a).r,(b).r) - smul((a).i,(b).i),17 ); \ - (m).i = PSHR32( smul((a).r,(b).i) + smul((a).i,(b).r),17 ); }while(0) - -# define DIVSCALAR(x,k) \ - (x) = sround( smul( x, SAMP_MAX/k ) ) - -# define C_FIXDIV(c,div) \ - do { DIVSCALAR( (c).r , div); \ - DIVSCALAR( (c).i , div); }while (0) - -# define C_MULBYSCALAR( c, s ) \ - do{ (c).r = sround( smul( (c).r , s ) ) ;\ - (c).i = sround( smul( (c).i , s ) ) ; }while(0) - -#else /* not FIXED_POINT*/ - -# define S_MUL(a,b) ( (a)*(b) ) -#define C_MUL(m,a,b) \ - do{ (m).r = (a).r*(b).r - (a).i*(b).i;\ - (m).i = (a).r*(b).i + (a).i*(b).r; }while(0) - -#define C_MUL4(m,a,b) C_MUL(m,a,b) - -# define C_FIXDIV(c,div) /* NOOP */ -# define C_MULBYSCALAR( c, s ) \ - do{ (c).r *= (s);\ - (c).i *= (s); }while(0) -#endif - -#ifndef CHECK_OVERFLOW_OP -# define CHECK_OVERFLOW_OP(a,op,b) /* noop */ -#endif - -#define C_ADD( res, a,b)\ - do { \ - CHECK_OVERFLOW_OP((a).r,+,(b).r)\ - CHECK_OVERFLOW_OP((a).i,+,(b).i)\ - (res).r=(a).r+(b).r; (res).i=(a).i+(b).i; \ - }while(0) -#define C_SUB( res, a,b)\ - do { \ - CHECK_OVERFLOW_OP((a).r,-,(b).r)\ - CHECK_OVERFLOW_OP((a).i,-,(b).i)\ - (res).r=(a).r-(b).r; (res).i=(a).i-(b).i; \ - }while(0) -#define C_ADDTO( res , a)\ - do { \ - CHECK_OVERFLOW_OP((res).r,+,(a).r)\ - CHECK_OVERFLOW_OP((res).i,+,(a).i)\ - (res).r += (a).r; (res).i += (a).i;\ - }while(0) - -#define C_SUBFROM( res , a)\ - do {\ - CHECK_OVERFLOW_OP((res).r,-,(a).r)\ - CHECK_OVERFLOW_OP((res).i,-,(a).i)\ - (res).r -= (a).r; (res).i -= (a).i; \ - }while(0) - - -#ifdef MS_FIXED_POINT -# define KISS_FFT_COS(phase) floor(MIN(32767,MAX(-32767,.5+32768 * cos (phase)))) -# define KISS_FFT_SIN(phase) floor(MIN(32767,MAX(-32767,.5+32768 * sin (phase)))) -# define HALF_OF(x) ((x)>>1) -#elif defined(USE_SIMD) -# define KISS_FFT_COS(phase) _mm_set1_ps( cos(phase) ) -# define KISS_FFT_SIN(phase) _mm_set1_ps( sin(phase) ) -# define HALF_OF(x) ((x)*_mm_set1_ps(.5)) -#else -# define KISS_FFT_COS(phase) (kiss_fft_scalar) cos(phase) -# define KISS_FFT_SIN(phase) (kiss_fft_scalar) sin(phase) -# define HALF_OF(x) ((x)*.5) -#endif - -#define kf_cexp(x,phase) \ - do{ \ - (x)->r = KISS_FFT_COS(phase);\ - (x)->i = KISS_FFT_SIN(phase);\ - }while(0) - -#ifdef MS_FIXED_POINT - -#define L1 32767 -#define L2 -7651 -#define L3 8277 -#define L4 -626 - -static inline ms_word16_t _ms_cos_pi_2(ms_word16_t x) -{ - ms_word16_t x2; - - x2 = MULT16_16_P15(x,x); - return ADD16(1,MIN16(32766,ADD32(SUB16(L1,x2), MULT16_16_P15(x2, ADD32(L2, MULT16_16_P15(x2, ADD32(L3, MULT16_16_P15(L4, x2)))))))); -} - -static inline ms_word16_t ms_cos_norm(ms_word32_t x) -{ - x = x&0x0001ffff; - if (x>SHL32(EXTEND32(1), 16)) - x = SUB32(SHL32(EXTEND32(1), 17),x); - if (x&0x00007fff) - { - if (xr = ms_cos_norm((phase));\ - (x)->i = ms_cos_norm((phase)-32768);\ -}while(0) - - -/* a debugging function */ -#define pcpx(c)\ - fprintf(stderr,"%g + %gi\n",(double)((c)->r),(double)((c)->i) ) diff --git a/linphone/mediastreamer2/src/alaw.c b/linphone/mediastreamer2/src/alaw.c deleted file mode 100644 index 3ac08a200..000000000 --- a/linphone/mediastreamer2/src/alaw.c +++ /dev/null @@ -1,222 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/msfilter.h" -#include "g711common.h" - -typedef struct _AlawEncData{ - MSBufferizer *bz; - int ptime; - uint32_t ts; -} AlawEncData; - -static AlawEncData * alaw_enc_data_new(){ - AlawEncData *obj=(AlawEncData *)ms_new(AlawEncData,1); - obj->bz=ms_bufferizer_new(); - obj->ptime=0; - obj->ts=0; - return obj; -} - -static void alaw_enc_data_destroy(AlawEncData *obj){ - ms_bufferizer_destroy(obj->bz); - ms_free(obj); -} - -static void alaw_enc_init(MSFilter *obj){ - obj->data=alaw_enc_data_new(); -} - -static void alaw_enc_uninit(MSFilter *obj){ - alaw_enc_data_destroy((AlawEncData*)obj->data); -} - -static void alaw_enc_process(MSFilter *obj){ - AlawEncData *dt=(AlawEncData*)obj->data; - MSBufferizer *bz=dt->bz; - uint8_t buffer[2240]; - int frame_per_packet=2; - int size_of_pcm=320; - - mblk_t *m; - - if (dt->ptime>=10) - { - frame_per_packet = dt->ptime/10; - } - - if (frame_per_packet<=0) - frame_per_packet=1; - if (frame_per_packet>14) /* 7*20 == 140 ms max */ - frame_per_packet=14; - - size_of_pcm = 160*frame_per_packet; /* ex: for 20ms -> 160*2==320 */ - - while((m=ms_queue_get(obj->inputs[0]))!=NULL){ - ms_bufferizer_put(bz,m); - } - while (ms_bufferizer_read(bz,buffer,size_of_pcm)==size_of_pcm){ - mblk_t *o=allocb(size_of_pcm/2,0); - int i; - for (i=0;ib_wptr=s16_to_alaw(((int16_t*)buffer)[i]); - o->b_wptr++; - } - mblk_set_timestamp_info(o,dt->ts); - dt->ts+=size_of_pcm/2; - ms_queue_put(obj->outputs[0],o); - } -} - -static int enc_add_fmtp(MSFilter *f, void *arg){ - const char *fmtp=(const char *)arg; - AlawEncData *s=(AlawEncData*)f->data; - char tmp[30]; - if (fmtp_get_value(fmtp,"ptime",tmp,sizeof(tmp))){ - s->ptime=atoi(tmp); - ms_message("MSAlawEnc: got ptime=%i",s->ptime); - } - return 0; -} - -static int enc_add_attr(MSFilter *f, void *arg){ - const char *fmtp=(const char *)arg; - AlawEncData *s=(AlawEncData*)f->data; - if (strstr(fmtp,"ptime:10")!=NULL){ - s->ptime=10; - }else if (strstr(fmtp,"ptime:20")!=NULL){ - s->ptime=20; - }else if (strstr(fmtp,"ptime:30")!=NULL){ - s->ptime=30; - }else if (strstr(fmtp,"ptime:40")!=NULL){ - s->ptime=40; - }else if (strstr(fmtp,"ptime:50")!=NULL){ - s->ptime=50; - }else if (strstr(fmtp,"ptime:60")!=NULL){ - s->ptime=60; - }else if (strstr(fmtp,"ptime:70")!=NULL){ - s->ptime=70; - }else if (strstr(fmtp,"ptime:80")!=NULL){ - s->ptime=80; - }else if (strstr(fmtp,"ptime:90")!=NULL){ - s->ptime=90; - }else if (strstr(fmtp,"ptime:100")!=NULL){ - s->ptime=100; - }else if (strstr(fmtp,"ptime:110")!=NULL){ - s->ptime=110; - }else if (strstr(fmtp,"ptime:120")!=NULL){ - s->ptime=120; - }else if (strstr(fmtp,"ptime:130")!=NULL){ - s->ptime=130; - }else if (strstr(fmtp,"ptime:140")!=NULL){ - s->ptime=140; - } - return 0; -} - -static MSFilterMethod enc_methods[]={ - { MS_FILTER_ADD_ATTR , enc_add_attr}, - { MS_FILTER_ADD_FMTP , enc_add_fmtp}, - { 0 , NULL } -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_alaw_enc_desc={ - MS_ALAW_ENC_ID, - "MSAlawEnc", - N_("ITU-G.711 alaw encoder"), - MS_FILTER_ENCODER, - "pcma", - 1, - 1, - alaw_enc_init, - NULL, - alaw_enc_process, - NULL, - alaw_enc_uninit, - enc_methods -}; - -#else - -MSFilterDesc ms_alaw_enc_desc={ - .id=MS_ALAW_ENC_ID, - .name="MSAlawEnc", - .text=N_("ITU-G.711 alaw encoder"), - .category=MS_FILTER_ENCODER, - .enc_fmt="pcma", - .ninputs=1, - .noutputs=1, - .init=alaw_enc_init, - .process=alaw_enc_process, - .uninit=alaw_enc_uninit, - .methods=enc_methods -}; - -#endif - -static void alaw_dec_process(MSFilter *obj){ - mblk_t *m; - while((m=ms_queue_get(obj->inputs[0]))!=NULL){ - mblk_t *o; - msgpullup(m,-1); - o=allocb((m->b_wptr-m->b_rptr)*2,0); - for(;m->b_rptrb_wptr;m->b_rptr++,o->b_wptr+=2){ - *((int16_t*)(o->b_wptr))=alaw_to_s16(*m->b_rptr); - } - freemsg(m); - ms_queue_put(obj->outputs[0],o); - } -} - -#ifdef _MSC_VER - -MSFilterDesc ms_alaw_dec_desc={ - MS_ALAW_DEC_ID, - "MSAlawDec", - N_("ITU-G.711 alaw decoder"), - MS_FILTER_DECODER, - "pcma", - 1, - 1, - NULL, - NULL, - alaw_dec_process, - NULL, - NULL -}; - -#else - -MSFilterDesc ms_alaw_dec_desc={ - .id=MS_ALAW_DEC_ID, - .name="MSAlawDec", - .text=N_("ITU-G.711 alaw decoder"), - .category=MS_FILTER_DECODER, - .enc_fmt="pcma", - .ninputs=1, - .noutputs=1, - .process=alaw_dec_process, -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_alaw_dec_desc) -MS_FILTER_DESC_EXPORT(ms_alaw_enc_desc) diff --git a/linphone/mediastreamer2/src/alsa.c b/linphone/mediastreamer2/src/alsa.c deleted file mode 100644 index 65f0df720..000000000 --- a/linphone/mediastreamer2/src/alsa.c +++ /dev/null @@ -1,1050 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - - -#include - - -#include "mediastreamer2/msfilter.h" -#include "mediastreamer2/mssndcard.h" - -//#define THREADED_VERSION - -/*in case of troubles with a particular driver, try incrementing ALSA_PERIOD_SIZE -to 512, 1024, 2048, 4096... -then try incrementing the number of periods*/ -#define ALSA_PERIODS 8 -#define ALSA_PERIOD_SIZE 256 - -/*uncomment the following line if you have problems with an alsa driver -having sound quality trouble:*/ -/*#define EPIPE_BUGFIX 1*/ - -static MSSndCard * alsa_card_new(int id); -static MSSndCard *alsa_card_duplicate(MSSndCard *obj); -static MSFilter * ms_alsa_read_new(const char *dev); -static MSFilter * ms_alsa_write_new(const char *dev); - - -struct _AlsaData{ - char *pcmdev; - char *mixdev; -}; - -typedef struct _AlsaData AlsaData; - - -static int alsa_set_params(snd_pcm_t *pcm_handle, int rw, int bits, int stereo, int rate) -{ - snd_pcm_hw_params_t *hwparams=NULL; - snd_pcm_sw_params_t *swparams=NULL; - int dir; - uint exact_uvalue; - unsigned long exact_ulvalue; - int channels; - int periods=ALSA_PERIODS; - int periodsize=ALSA_PERIOD_SIZE; - int err; - int format; - - /* Allocate the snd_pcm_hw_params_t structure on the stack. */ - snd_pcm_hw_params_alloca(&hwparams); - - /* Init hwparams with full configuration space */ - if (snd_pcm_hw_params_any(pcm_handle, hwparams) < 0) { - ms_warning("alsa_set_params: Cannot configure this PCM device."); - return -1; - } - - if (snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED) < 0) { - ms_warning("alsa_set_params: Error setting access."); - return -1; - } - /* Set sample format */ - format=SND_PCM_FORMAT_S16; - if (snd_pcm_hw_params_set_format(pcm_handle, hwparams, format) < 0) { - ms_warning("alsa_set_params: Error setting format."); - return -1; - } - /* Set number of channels */ - if (stereo) channels=2; - else channels=1; - if (snd_pcm_hw_params_set_channels(pcm_handle, hwparams, channels) < 0) { - ms_warning("alsa_set_params: Error setting channels."); - return -1; - } - /* Set sample rate. If the exact rate is not supported */ - /* by the hardware, use nearest possible rate. */ - exact_uvalue=rate; - dir=0; - if ((err=snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams, &exact_uvalue, &dir))<0){ - ms_warning("alsa_set_params: Error setting rate to %i:%s",rate,snd_strerror(err)); - return -1; - } - if (dir != 0) { - ms_warning("alsa_set_params: The rate %d Hz is not supported by your hardware.\n " - "==> Using %d Hz instead.", rate, exact_uvalue); - } - /* choose greater period size when rate is high */ - periodsize=periodsize*(rate/8000); - - /* Set buffer size (in frames). The resulting latency is given by */ - /* latency = periodsize * periods / (rate * bytes_per_frame) */ - /* set period size */ - exact_ulvalue=periodsize; - dir=0; - if (snd_pcm_hw_params_set_period_size_near(pcm_handle, hwparams, &exact_ulvalue, &dir) < 0) { - ms_warning("alsa_set_params: Error setting period size."); - return -1; - } - if (dir != 0) { - ms_warning("alsa_set_params: The period size %d is not supported by your hardware.\n " - "==> Using %d instead.", periodsize, (int)exact_ulvalue); - } - ms_warning("alsa_set_params: periodsize:%d Using %d", periodsize, (int)exact_ulvalue); - periodsize=exact_ulvalue; - /* Set number of periods. Periods used to be called fragments. */ - exact_uvalue=periods; - dir=0; - if (snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &exact_uvalue, &dir) < 0) { - ms_warning("alsa_set_params: Error setting periods."); - return -1; - } - ms_warning("alsa_set_params: period:%d Using %d", periods, exact_uvalue); - if (dir != 0) { - ms_warning("alsa_set_params: The number of periods %d is not supported by your hardware.\n " - "==> Using %d instead.", periods, exact_uvalue); - } - /* Apply HW parameter settings to */ - /* PCM device and prepare device */ - if ((err=snd_pcm_hw_params(pcm_handle, hwparams)) < 0) { - ms_warning("alsa_set_params: Error setting HW params:%s",snd_strerror(err)); - return -1; - } - /*prepare sw params */ - if (rw){ - snd_pcm_sw_params_alloca(&swparams); - snd_pcm_sw_params_current(pcm_handle, swparams); - if ((err=snd_pcm_sw_params_set_start_threshold(pcm_handle, swparams,periodsize*2 ))<0){ - ms_warning("alsa_set_params: Error setting start threshold:%s",snd_strerror(err)); - } - if ((err=snd_pcm_sw_params_set_stop_threshold(pcm_handle, swparams,periodsize*periods ))<0){ - ms_warning("alsa_set_params: Error setting stop threshold:%s",snd_strerror(err)); - } - if ((err=snd_pcm_sw_params(pcm_handle, swparams))<0){ - ms_warning("alsa_set_params: Error setting SW params:%s",snd_strerror(err)); - return -1; - } - } - return 0; -} - -#ifdef EPIPE_BUGFIX -static void alsa_fill_w (snd_pcm_t *pcm_handle) -{ - snd_pcm_hw_params_t *hwparams=NULL; - int channels; - snd_pcm_uframes_t buffer_size; - int buffer_size_bytes; - void *buffer; - - /* Allocate the snd_pcm_hw_params_t structure on the stack. */ - snd_pcm_hw_params_alloca(&hwparams); - snd_pcm_hw_params_current(pcm_handle, hwparams); - - /* get channels */ - snd_pcm_hw_params_get_channels (hwparams, &channels); - - /* get buffer size */ - snd_pcm_hw_params_get_buffer_size (hwparams, &buffer_size); - - /* fill half */ - buffer_size /= 2; - - /* allocate buffer assuming 2 bytes per sample */ - buffer_size_bytes = buffer_size * channels * 2; - buffer = alloca (buffer_size_bytes); - memset (buffer, 0, buffer_size_bytes); - - /* write data */ - snd_pcm_writei(pcm_handle, buffer, buffer_size); -} -#endif - -static snd_pcm_t * alsa_open_r(const char *pcmdev,int bits,int stereo,int rate) -{ - snd_pcm_t *pcm_handle; - int err; - - ms_message("alsa_open_r: opening %s at %iHz, bits=%i, stereo=%i",pcmdev,rate,bits,stereo); - - -#ifndef THREADED_VERSION - if (snd_pcm_open(&pcm_handle, pcmdev,SND_PCM_STREAM_CAPTURE,SND_PCM_NONBLOCK) < 0) { - ms_warning("alsa_open_r: Error opening PCM device %s",pcmdev ); - return NULL; - } -#else - /* want blocking mode for threaded version */ - if (snd_pcm_open(&pcm_handle, pcmdev,SND_PCM_STREAM_CAPTURE,0) < 0) { - ms_warning("alsa_open_r: Error opening PCM device %s",pcmdev ); - return NULL; - } -#endif - - { - struct timeval tv1; - struct timeval tv2; - struct timezone tz; - int diff = 0; - err = gettimeofday(&tv1, &tz); - while (1) { - if (!(alsa_set_params(pcm_handle,0,bits,stereo,rate)<0)){ - ms_message("alsa_open_r: Audio params set"); - break; - } - if (!gettimeofday(&tv2, &tz) && !err) { - diff = ((tv2.tv_sec - tv1.tv_sec) * 1000000) + (tv2.tv_usec - tv1.tv_usec); - } else { - diff = -1; - } - if ((diff < 0) || (diff > 3000000)) { /* 3 secondes */ - ms_error("alsa_open_r: Error setting params for more than 3 seconds"); - snd_pcm_close(pcm_handle); - return NULL; - } - ms_warning("alsa_open_r: Error setting params (for %d micros)", diff); - usleep(200000); - } - } - - err=snd_pcm_start(pcm_handle); - if (err<0){ - ms_warning("snd_pcm_start() failed: %s", snd_strerror(err)); - } - return pcm_handle; -} - -static snd_pcm_t * alsa_open_w(const char *pcmdev,int bits,int stereo,int rate) -{ - snd_pcm_t *pcm_handle; - - if (snd_pcm_open(&pcm_handle, pcmdev,SND_PCM_STREAM_PLAYBACK,SND_PCM_NONBLOCK) < 0) { - ms_warning("alsa_open_w: Error opening PCM device %s",pcmdev ); - return NULL; - } - - { - struct timeval tv1; - struct timeval tv2; - struct timezone tz; - int diff = 0; - int err; - err = gettimeofday(&tv1, &tz); - while (1) { - if (!(alsa_set_params(pcm_handle,1,bits,stereo,rate)<0)){ - ms_message("alsa_open_w: Audio params set"); - break; - } - if (!gettimeofday(&tv2, &tz) && !err) { - diff = ((tv2.tv_sec - tv1.tv_sec) * 1000000) + (tv2.tv_usec - tv1.tv_usec); - } else { - diff = -1; - } - if ((diff < 0) || (diff > 3000000)) { /* 3 secondes */ - ms_error("alsa_open_w: Error setting params for more than 3 seconds"); - snd_pcm_close(pcm_handle); - return NULL; - } - ms_warning("alsa_open_w: Error setting params (for %d micros)", diff); - usleep(200000); - } - } - - return pcm_handle; -} - -static int alsa_can_read(snd_pcm_t *dev) -{ - snd_pcm_sframes_t avail; - int err; - - avail = snd_pcm_avail_update(dev); - /* A buggy driver does not return an error while being in Xrun */ - if (avail >= 0 && snd_pcm_state(dev) == SND_PCM_STATE_XRUN) avail=-EPIPE; - if (avail < 0) { - ms_error("snd_pcm_avail_update: %s", snd_strerror(avail)); // most probably -EPIPE - /* overrun occured, snd_pcm_state() would return SND_PCM_STATE_XRUN - FIXME: handle other error conditions*/ - ms_error("*** alsa_can_read fixup, trying to recover"); - snd_pcm_drain(dev); /* Ignore possible error, at least -EAGAIN.*/ - err = snd_pcm_recover(dev, avail, 0); - if (err){ - ms_error("snd_pcm_recover() failed with err %d: %s", err, snd_strerror(err)); - return -1; - } - err = snd_pcm_start(dev); - if (err){ - ms_error("snd_pcm_start() failed with err %d: %s", err, snd_strerror(err)); - return -1; - } - ms_message("Recovery done"); - } - return avail; -} - -static int alsa_read(snd_pcm_t *handle,unsigned char *buf,int nsamples) -{ - int err; - err=snd_pcm_readi(handle,buf,nsamples); - if (err<0) { - ms_warning("alsa_read: snd_pcm_readi() returned %i",err); - if (err==-EPIPE){ - snd_pcm_prepare(handle); - err=snd_pcm_readi(handle,buf,nsamples); - if (err<0) ms_warning("alsa_read: snd_pcm_readi() failed:%s.",snd_strerror(err)); - }else if (err!=-EWOULDBLOCK){ - ms_warning("alsa_read: snd_pcm_readi() failed:%s.",snd_strerror(err)); - } - }else if (err==0){ - ms_warning("alsa_read: snd_pcm_readi() returned 0"); - } - return err; -} - - -static int alsa_write(snd_pcm_t *handle,unsigned char *buf,int nsamples) -{ - int err; - if ((err=snd_pcm_writei(handle,buf,nsamples))<0){ - if (err==-EPIPE){ - snd_pcm_prepare(handle); -#ifdef EPIPE_BUGFIX - alsa_fill_w (handle); -#endif - err=snd_pcm_writei(handle,buf,nsamples); - if (err<0) ms_warning("alsa_card_write: Error writing sound buffer (nsamples=%i):%s",nsamples,snd_strerror(err)); - }else if (err!=-EWOULDBLOCK){ - ms_warning("alsa_card_write: snd_pcm_writei() failed:%s.",snd_strerror(err)); - } - }else if (err!=nsamples) { - ms_debug("Only %i samples written instead of %i",err,nsamples); - } - return err; -} - - -static snd_mixer_t *alsa_mixer_open(const char *mixdev){ - snd_mixer_t *mixer=NULL; - int err; - err=snd_mixer_open(&mixer,0); - if (err<0){ - ms_warning("Could not open alsa mixer: %s",snd_strerror(err)); - return NULL; - } - if ((err = snd_mixer_attach (mixer, mixdev)) < 0){ - ms_warning("Could not attach mixer to card: %s",snd_strerror(err)); - snd_mixer_close(mixer); - return NULL; - } - if ((err = snd_mixer_selem_register (mixer, NULL, NULL)) < 0){ - ms_warning("snd_mixer_selem_register: %s",snd_strerror(err)); - snd_mixer_close(mixer); - return NULL; - } - if ((err = snd_mixer_load (mixer)) < 0){ - ms_warning("snd_mixer_load: %s",snd_strerror(err)); - snd_mixer_close(mixer); - return NULL; - } - return mixer; -} - -static void alsa_mixer_close(snd_mixer_t *mix){ - snd_mixer_close(mix); -} - -typedef enum {CAPTURE, PLAYBACK, CAPTURE_SWITCH, PLAYBACK_SWITCH} MixerAction; - -static int get_mixer_element(snd_mixer_t *mixer,const char *name, MixerAction action){ - long value=0; - const char *elemname; - snd_mixer_elem_t *elem; - int err; - long sndMixerPMin=0; - long sndMixerPMax=0; - long newvol=0; - elem=snd_mixer_first_elem(mixer); - while (elem!=NULL){ - elemname=snd_mixer_selem_get_name(elem); - //ms_message("Found alsa mixer element %s.",elemname); - if (strcmp(elemname,name)==0){ - switch (action){ - case CAPTURE: - if (snd_mixer_selem_has_capture_volume(elem)){ - snd_mixer_selem_get_capture_volume_range(elem, &sndMixerPMin, &sndMixerPMax); - err=snd_mixer_selem_get_capture_volume(elem,SND_MIXER_SCHN_UNKNOWN,&newvol); - newvol-=sndMixerPMin; - value=(100*newvol)/(sndMixerPMax-sndMixerPMin); - if (err<0) ms_warning("Could not get capture volume for %s:%s",name,snd_strerror(err)); - //else ms_message("Successfully get capture level for %s.",elemname); - break; - } - break; - case PLAYBACK: - if (snd_mixer_selem_has_playback_volume(elem)){ - snd_mixer_selem_get_playback_volume_range(elem, &sndMixerPMin, &sndMixerPMax); - err=snd_mixer_selem_get_playback_volume(elem,SND_MIXER_SCHN_FRONT_LEFT,&newvol); - newvol-=sndMixerPMin; - value=(100*newvol)/(sndMixerPMax-sndMixerPMin); - if (err<0) ms_warning("Could not get playback volume for %s:%s",name,snd_strerror(err)); - //else ms_message("Successfully get playback level for %s.",elemname); - break; - } - break; - case CAPTURE_SWITCH: - - break; - case PLAYBACK_SWITCH: - - break; - } - } - elem=snd_mixer_elem_next(elem); - } - - return value; -} - - -static void set_mixer_element(snd_mixer_t *mixer,const char *name, int level,MixerAction action){ - const char *elemname; - snd_mixer_elem_t *elem; - long sndMixerPMin=0; - long sndMixerPMax=0; - long newvol=0; - - elem=snd_mixer_first_elem(mixer); - - while (elem!=NULL){ - elemname=snd_mixer_selem_get_name(elem); - //ms_message("Found alsa mixer element %s.",elemname); - if (strcmp(elemname,name)==0){ - switch(action){ - case CAPTURE: - if (snd_mixer_selem_has_capture_volume(elem)){ - snd_mixer_selem_get_capture_volume_range(elem, &sndMixerPMin, &sndMixerPMax); - newvol=(((sndMixerPMax-sndMixerPMin)*level)/100)+sndMixerPMin; - snd_mixer_selem_set_capture_volume_all(elem,newvol); - //ms_message("Successfully set capture level for %s.",elemname); - return; - } - break; - case PLAYBACK: - if (snd_mixer_selem_has_playback_volume(elem)){ - snd_mixer_selem_get_playback_volume_range(elem, &sndMixerPMin, &sndMixerPMax); - newvol=(((sndMixerPMax-sndMixerPMin)*level)/100)+sndMixerPMin; - snd_mixer_selem_set_playback_volume_all(elem,newvol); - //ms_message("Successfully set playback level for %s.",elemname); - return; - } - break; - case CAPTURE_SWITCH: - if (snd_mixer_selem_has_capture_switch(elem)){ - snd_mixer_selem_set_capture_switch_all(elem,level); - //ms_message("Successfully set capture switch for %s.",elemname); - } - break; - case PLAYBACK_SWITCH: - if (snd_mixer_selem_has_playback_switch(elem)){ - snd_mixer_selem_set_playback_switch_all(elem,level); - //ms_message("Successfully set capture switch for %s.",elemname); - } - break; - - } - } - elem=snd_mixer_elem_next(elem); - } - - return ; -} - - -static void alsa_card_set_level(MSSndCard *obj,MSSndCardMixerElem e,int a) -{ - snd_mixer_t *mixer; - AlsaData *ad=(AlsaData*)obj->data; - mixer=alsa_mixer_open(ad->mixdev); - if (mixer==NULL) return ; - switch(e){ - case MS_SND_CARD_MASTER: - set_mixer_element(mixer,"Master",a,PLAYBACK); - break; - case MS_SND_CARD_CAPTURE: - set_mixer_element(mixer,"Capture",a,CAPTURE); - break; - case MS_SND_CARD_PLAYBACK: - set_mixer_element(mixer,"PCM",a,PLAYBACK); - break; - default: - ms_warning("alsa_card_set_level: unsupported command."); - } - alsa_mixer_close(mixer); -} - -static int alsa_card_get_level(MSSndCard *obj, MSSndCardMixerElem e) -{ - snd_mixer_t *mixer; - AlsaData *ad=(AlsaData*)obj->data; - int value = -1; - mixer=alsa_mixer_open(ad->mixdev); - if (mixer==NULL) return 0; - switch(e){ - case MS_SND_CARD_MASTER: - value=get_mixer_element(mixer,"Master",PLAYBACK); - break; - case MS_SND_CARD_CAPTURE: - value=get_mixer_element(mixer,"Capture",CAPTURE); - break; - case MS_SND_CARD_PLAYBACK: - value=get_mixer_element(mixer,"PCM",PLAYBACK); - break; - default: - ms_warning("alsa_card_set_level: unsupported command."); - } - alsa_mixer_close(mixer); - return value; -} - -static void alsa_card_set_source(MSSndCard *obj,MSSndCardCapture source) -{ - snd_mixer_t *mixer; - AlsaData *ad=(AlsaData*)obj->data; - mixer=alsa_mixer_open(ad->mixdev); - if (mixer==NULL) return; - switch (source){ - case MS_SND_CARD_MIC: - set_mixer_element(mixer,"Mic",1,CAPTURE_SWITCH); - set_mixer_element(mixer,"Capture",1,CAPTURE_SWITCH); - break; - case MS_SND_CARD_LINE: - set_mixer_element(mixer,"Line",1,CAPTURE_SWITCH); - set_mixer_element(mixer,"Capture",1,CAPTURE_SWITCH); - break; - } - alsa_mixer_close(mixer); -} - -static MSFilter *alsa_card_create_reader(MSSndCard *card) -{ - AlsaData *ad=(AlsaData*)card->data; - MSFilter *f=ms_alsa_read_new(ad->pcmdev); - return f; -} - -static MSFilter *alsa_card_create_writer(MSSndCard *card) -{ - AlsaData *ad=(AlsaData*)card->data; - MSFilter *f=ms_alsa_write_new(ad->pcmdev); - return f; -} - - -static void alsa_card_init(MSSndCard *obj){ - AlsaData *ad=ms_new0(AlsaData,1); - obj->data=ad; -} - -static void alsa_card_uninit(MSSndCard *obj){ - AlsaData *ad=(AlsaData*)obj->data; - if (ad->pcmdev!=NULL) ms_free(ad->pcmdev); - if (ad->mixdev!=NULL) ms_free(ad->mixdev); - ms_free(ad); -} - -static void alsa_card_detect(MSSndCardManager *m){ - int i; - for (i=-1;i<10;i++){ - MSSndCard *card=alsa_card_new(i); - if (card!=NULL) - ms_snd_card_manager_add_card(m,card); - } -} - -MSSndCardDesc alsa_card_desc={ - .driver_type="ALSA", - .detect=alsa_card_detect, - .init=alsa_card_init, - .set_level=alsa_card_set_level, - .get_level=alsa_card_get_level, - .set_capture=alsa_card_set_source, - .set_control=NULL, - .get_control=NULL, - .create_reader=alsa_card_create_reader, - .create_writer=alsa_card_create_writer, - .uninit=alsa_card_uninit, - .duplicate=alsa_card_duplicate -}; - -static MSSndCard *alsa_card_duplicate(MSSndCard *obj){ - MSSndCard *card=ms_snd_card_new(&alsa_card_desc); - AlsaData* dcard=(AlsaData*)card->data; - AlsaData* dobj=(AlsaData*)obj->data; - card->name=ms_strdup(obj->name); - card->id=ms_strdup(obj->id); - dcard->pcmdev=ms_strdup(dobj->pcmdev); - dcard->mixdev=ms_strdup(dobj->mixdev); - return card; -} - -MSSndCard * ms_alsa_card_new_custom(const char *pcmdev, const char *mixdev){ - MSSndCard * obj; - AlsaData *ad; - obj=ms_snd_card_new(&alsa_card_desc); - ad=(AlsaData*)obj->data; - obj->name=ms_strdup(pcmdev); - ad->pcmdev=ms_strdup(pcmdev); - ad->mixdev=ms_strdup(mixdev); - return obj; -} - -static unsigned int get_card_capabilities(const char *devname){ - snd_pcm_t *pcm_handle; - unsigned int ret=0; - if (snd_pcm_open(&pcm_handle,devname,SND_PCM_STREAM_CAPTURE,SND_PCM_NONBLOCK)==0) { - ret|=MS_SND_CARD_CAP_CAPTURE; - snd_pcm_close(pcm_handle); - } - if (snd_pcm_open(&pcm_handle,devname,SND_PCM_STREAM_PLAYBACK,SND_PCM_NONBLOCK)==0) { - ret|=MS_SND_CARD_CAP_PLAYBACK; - snd_pcm_close(pcm_handle); - } - return ret; -} - -static MSSndCard * alsa_card_new(int id) -{ - MSSndCard * obj; - char *name=NULL; - AlsaData *ad; - int err; - - if (id!=-1){ - err=snd_card_get_name(id,&name); - if (err<0) { - return NULL; - } - } - obj=ms_snd_card_new(&alsa_card_desc); - ad=(AlsaData*)obj->data; - if (id==-1) { - /* the default pcm device */ - obj->name=ms_strdup("default device"); - ad->pcmdev=ms_strdup("default"); - ad->mixdev=ms_strdup("default"); - }else{ - /* remove trailing spaces from card name */ - char *pos1, *pos2; - pos1=ms_strdup(name); - pos2=pos1+strlen(pos1)-1; - for (; pos2>pos1 && *pos2==' '; pos2--) *pos2='\0'; - obj->name=pos1; - ad->pcmdev=ms_strdup_printf("default:%i",id); - ad->mixdev=ms_strdup_printf("default:%i",id); - { - snd_mixer_t *mixer; - mixer = alsa_mixer_open(ad->mixdev); - if (mixer==NULL) { - ms_free(ad->mixdev); - ad->mixdev=ms_strdup_printf("hw:%i",id); - } else { - alsa_mixer_close(mixer); - } - } - } - /*check card capabilities: */ - obj->capabilities=get_card_capabilities(ad->pcmdev); - if (obj->capabilities==0){ - ms_warning("Strange, sound card %s does not seems to be capable of anything, retrying with plughw...",obj->name); - /*retry with plughw: this workarounds an alsa bug*/ - ms_free(ad->pcmdev); - ad->pcmdev=ms_strdup_printf("plughw:%i",id); - obj->capabilities=get_card_capabilities(ad->pcmdev); - if (obj->capabilities==0){ - ms_warning("Strange, sound card %s seems totally unusable.",obj->name); - } - } - free(name); - /*ms_message("alsa device %s found",obj->name);*/ - return obj; -} - -struct _AlsaReadData{ - char *pcmdev; - snd_pcm_t *handle; - int rate; - int nchannels; - -#ifdef THREADED_VERSION - ms_thread_t thread; - ms_mutex_t mutex; - MSBufferizer * bufferizer; - bool_t read_started; - bool_t write_started; -#endif -}; - -typedef struct _AlsaReadData AlsaReadData; - -void alsa_read_init(MSFilter *obj){ - AlsaReadData *ad=ms_new(AlsaReadData,1); - ad->pcmdev=NULL; - ad->handle=NULL; - ad->rate=8000; - ad->nchannels=1; - obj->data=ad; - -#ifdef THREADED_VERSION - ad->read_started=FALSE; - ad->write_started=FALSE; - ad->bufferizer=ms_bufferizer_new(); - ms_mutex_init(&ad->mutex,NULL); - ad->thread=0; -#endif -} - -#ifdef THREADED_VERSION - -static void * alsa_write_thread(void *p){ - AlsaReadData *ad=(AlsaReadData*)p; - int samples=(160*ad->rate)/8000; - int err; - int count=0; - mblk_t *om=NULL; - struct timeval timeout; - if (ad->handle==NULL && ad->pcmdev!=NULL){ - ad->handle=alsa_open_r(ad->pcmdev,16,ad->nchannels==2,ad->rate); - } - if (ad->handle==NULL) return NULL; - - while (ad->read_started) - { - count = alsa_can_read(ad->handle,samples); - if (count==24) - { /* keep this value for this driver */ } - else if (count<=0) - { - count = samples; - } - else if (count>0) - { - //ms_warning("%i count", count); - //count = samples; - } - - int size=count*2; - om=allocb(size,0); - - if ((err=alsa_read(ad->handle,om->b_wptr,count))<=0) - { - ms_warning("nothing to read"); - //ms_warning("Fail to read samples %i", count); - freemsg(om); /* leak fixed */ - continue; - } - //ms_warning(" read %i", err); - - size=err*2; - om->b_wptr+=size; - - ms_mutex_lock(&ad->mutex); - ms_bufferizer_put(ad->bufferizer,om); - ms_mutex_unlock(&ad->mutex); - - if (count==24) - { - timeout.tv_sec = 0; - timeout.tv_usec = 2000; - select(0, 0, NULL, NULL, &timeout ); - } - else - { - /* select will be less active than locking on "read" */ - timeout.tv_sec = 0; - timeout.tv_usec = 5000; - select(0, 0, NULL, NULL, &timeout ); - } - } - - if (ad->handle!=NULL) snd_pcm_close(ad->handle); - ad->handle=NULL; - return NULL; -} - -static void alsa_start_r(AlsaReadData *d){ - if (d->read_started==FALSE){ - d->read_started=TRUE; - ms_thread_create(&d->thread,NULL,alsa_write_thread,d); - }else d->read_started=TRUE; -} - -static void alsa_stop_r(AlsaReadData *d){ - d->read_started=FALSE; - if (d->thread!=0) - { - ms_thread_join(d->thread,NULL); - d->thread=0; - } -} -#endif - -#ifdef THREADED_VERSION -void alsa_read_preprocess(MSFilter *obj){ - AlsaReadData *ad=(AlsaReadData*)obj->data; - alsa_start_r(ad); -} -#endif - -void alsa_read_postprocess(MSFilter *obj){ - AlsaReadData *ad=(AlsaReadData*)obj->data; -#ifdef THREADED_VERSION - alsa_stop_r(ad); -#endif - if (ad->handle!=NULL) snd_pcm_close(ad->handle); - ad->handle=NULL; -} - -void alsa_read_uninit(MSFilter *obj){ - AlsaReadData *ad=(AlsaReadData*)obj->data; -#ifdef THREADED_VERSION - alsa_stop_r(ad); -#endif - if (ad->pcmdev!=NULL) ms_free(ad->pcmdev); - if (ad->handle!=NULL) snd_pcm_close(ad->handle); -#ifdef THREADED_VERSION - ms_bufferizer_destroy(ad->bufferizer); - ms_mutex_destroy(&ad->mutex); -#endif - ms_free(ad); -} - -#ifndef THREADED_VERSION -void alsa_read_process(MSFilter *obj){ - AlsaReadData *ad=(AlsaReadData*)obj->data; - int samples=(128*ad->rate)/8000; - int err; - mblk_t *om=NULL; - if (ad->handle==NULL && ad->pcmdev!=NULL){ - ad->handle=alsa_open_r(ad->pcmdev,16,ad->nchannels==2,ad->rate); - } - if (ad->handle==NULL) return; - while (alsa_can_read(ad->handle)>=samples){ - - int size=samples*2; - om=allocb(size,0); - if ((err=alsa_read(ad->handle,om->b_wptr,samples))<=0) { - ms_warning("Fail to read samples"); - freemsg(om); - return; - } - size=err*2; - om->b_wptr+=size; - /*ms_message("alsa_read_process: Outputing %i bytes",size);*/ - ms_queue_put(obj->outputs[0],om); - } -} -#endif - -#ifdef THREADED_VERSION -void alsa_read_process(MSFilter *obj){ - AlsaReadData *ad=(AlsaReadData*)obj->data; - mblk_t *om=NULL; - int samples=(160*ad->rate)/8000; - - ms_mutex_lock(&ad->mutex); - while (ms_bufferizer_get_avail(ad->bufferizer)>=samples*2){ - - om=allocb(samples*2,0); - ms_bufferizer_read(ad->bufferizer,om->b_wptr,samples*2); - om->b_wptr+=samples*2; - /*ms_message("alsa_read_process: Outputing %i bytes",size);*/ - ms_queue_put(obj->outputs[0],om); - } - ms_mutex_unlock(&ad->mutex); -} -#endif - -static int alsa_read_get_sample_rate(MSFilter *obj, void *param){ - AlsaReadData *ad=(AlsaReadData*)obj->data; - *((int*)param)=ad->rate; - return 0; -} - -static int alsa_read_set_sample_rate(MSFilter *obj, void *param){ - AlsaReadData *ad=(AlsaReadData*)obj->data; - ad->rate=*((int*)param); - return 0; -} - -static int alsa_read_set_nchannels(MSFilter *obj, void *param){ - AlsaReadData *ad=(AlsaReadData*)obj->data; - ad->nchannels=*((int*)param); - return 0; -} - -MSFilterMethod alsa_read_methods[]={ - {MS_FILTER_GET_SAMPLE_RATE, alsa_read_get_sample_rate}, - {MS_FILTER_SET_SAMPLE_RATE, alsa_read_set_sample_rate}, - {MS_FILTER_SET_NCHANNELS, alsa_read_set_nchannels}, - {0,NULL} -}; - -MSFilterDesc alsa_read_desc={ - .id=MS_ALSA_READ_ID, - .name="MSAlsaRead", - .text=N_("Alsa sound source"), - .category=MS_FILTER_OTHER, - .ninputs=0, - .noutputs=1, - .init=alsa_read_init, -#ifdef THREADED_VERSION - .preprocess=alsa_read_preprocess, -#endif - .process=alsa_read_process, - .postprocess=alsa_read_postprocess, - .uninit=alsa_read_uninit, - .methods=alsa_read_methods -}; - -static MSFilter * ms_alsa_read_new(const char *dev){ - MSFilter *f=ms_filter_new_from_desc(&alsa_read_desc); - AlsaReadData *ad=(AlsaReadData*)f->data; - ad->pcmdev=ms_strdup(dev); - return f; -} - -typedef struct _AlsaReadData AlsaWriteData; - -void alsa_write_init(MSFilter *obj){ - AlsaWriteData *ad=ms_new(AlsaWriteData,1); - ad->pcmdev=NULL; - ad->handle=NULL; - ad->rate=8000; - ad->nchannels=1; - obj->data=ad; -} - -void alsa_write_postprocess(MSFilter *obj){ - AlsaReadData *ad=(AlsaReadData*)obj->data; - if (ad->handle!=NULL) snd_pcm_close(ad->handle); - ad->handle=NULL; -} - -void alsa_write_uninit(MSFilter *obj){ - AlsaWriteData *ad=(AlsaWriteData*)obj->data; - if (ad->pcmdev!=NULL) ms_free(ad->pcmdev); - if (ad->handle!=NULL) snd_pcm_close(ad->handle); - ms_free(ad); -} - -static int alsa_write_get_sample_rate(MSFilter *obj, void *data){ - AlsaWriteData *ad=(AlsaWriteData*)obj->data; - *((int*)data)=ad->rate; - return 0; -} - -int alsa_write_set_sample_rate(MSFilter *obj, void *data){ - int *rate=(int*)data; - AlsaWriteData *ad=(AlsaWriteData*)obj->data; - ad->rate=*rate; - return 0; -} - -int alsa_write_set_nchannels(MSFilter *obj, void *data){ - int *n=(int*)data; - AlsaWriteData *ad=(AlsaWriteData*)obj->data; - ad->nchannels=*n; - return 0; -} - -void alsa_write_process(MSFilter *obj){ - AlsaWriteData *ad=(AlsaWriteData*)obj->data; - mblk_t *im=NULL; - int size; - int samples; - int err; - if (ad->handle==NULL && ad->pcmdev!=NULL){ - ad->handle=alsa_open_w(ad->pcmdev,16,ad->nchannels==2,ad->rate); -#ifdef EPIPE_BUGFIX - alsa_fill_w (ad->pcmdev); -#endif - } - if (ad->handle==NULL) { - ms_queue_flush(obj->inputs[0]); - return; - } - while ((im=ms_queue_get(obj->inputs[0]))!=NULL){ - while((size=im->b_wptr-im->b_rptr)>0){ - samples=size/(2*ad->nchannels); - err=alsa_write(ad->handle,im->b_rptr,samples); - if (err>0) { - im->b_rptr+=err*(2*ad->nchannels); - } - else break; - } - freemsg(im); - } -} - -MSFilterMethod alsa_write_methods[]={ - {MS_FILTER_GET_SAMPLE_RATE, alsa_write_get_sample_rate}, - {MS_FILTER_SET_SAMPLE_RATE, alsa_write_set_sample_rate}, - {MS_FILTER_SET_NCHANNELS, alsa_write_set_nchannels}, - {0,NULL} -}; - -MSFilterDesc alsa_write_desc={ - .id=MS_ALSA_WRITE_ID, - .name="MSAlsaWrite", - .text=N_("Alsa sound output"), - .category=MS_FILTER_OTHER, - .ninputs=1, - .noutputs=0, - .init=alsa_write_init, - .process=alsa_write_process, - .postprocess=alsa_write_postprocess, - .uninit=alsa_write_uninit, - .methods=alsa_write_methods -}; - - -static MSFilter * ms_alsa_write_new(const char *dev){ - MSFilter *f=ms_filter_new_from_desc(&alsa_write_desc); - AlsaWriteData *ad=(AlsaWriteData*)f->data; - ad->pcmdev=ms_strdup(dev); - return f; -} - - -MS_FILTER_DESC_EXPORT(alsa_write_desc) - -MS_FILTER_DESC_EXPORT(alsa_read_desc) - diff --git a/linphone/mediastreamer2/src/aqsnd.c b/linphone/mediastreamer2/src/aqsnd.c deleted file mode 100644 index 0c7f06bd8..000000000 --- a/linphone/mediastreamer2/src/aqsnd.c +++ /dev/null @@ -1,955 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* this file is specifically distributed under a BSD license */ - -/** -* Copyright (C) 2008 Hiroki Mori (himori@users.sourceforge.net) -* 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 of the nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY ``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 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. -**/ - -/* - This is MacOS X Audio Queue Service support code for mediastreamer2. - Audio Queue Support MacOS X 10.5 or later. - http://developer.apple.com/documentation/MusicAudio/Conceptual/AudioQueueProgrammingGuide/ - */ - -#include -#if (!defined(__AudioHardware_h__) & !defined(__IPHONE_3_0)) -#include "AudioHardware.h" -#endif - -#include "mediastreamer2/mssndcard.h" -#include "mediastreamer2/msfilter.h" - -MSFilter *ms_aq_read_new(MSSndCard * card); -MSFilter *ms_aq_write_new(MSSndCard * card); - -#define kSecondsPerBuffer 0.02 /*0.04 */ -#define kNumberAudioOutDataBuffers 4 -#define kNumberAudioInDataBuffers 4 - -float gain_volume_in=1.0; -float gain_volume_out=1.0; -bool gain_changed_in = true; -bool gain_changed_out = true; - -typedef struct AQData { - CFStringRef uidname; - AudioStreamBasicDescription devicereadFormat; - AudioStreamBasicDescription devicewriteFormat; - - int rate; - int bits; - bool_t stereo; - - ms_mutex_t mutex; - queue_t rq; - bool_t read_started; - bool_t write_started; - - AudioConverterRef readAudioConverter; - AudioQueueRef readQueue; - AudioStreamBasicDescription readAudioFormat; - UInt32 readBufferByteSize; - - AudioConverterRef writeAudioConverter; - AudioQueueRef writeQueue; - AudioStreamBasicDescription writeAudioFormat; - UInt32 writeBufferByteSize; - AudioQueueBufferRef writeBuffers[kNumberAudioOutDataBuffers]; - int curWriteBuffer; - MSBufferizer *bufferizer; -} AQData; - - - -/* - mediastreamer2 function - */ - -typedef struct AqSndDsCard { - CFStringRef uidname; - AudioStreamBasicDescription devicereadFormat; - AudioStreamBasicDescription devicewriteFormat; - int removed; -} AqSndDsCard; - -static void aqcard_set_level(MSSndCard * card, MSSndCardMixerElem e, - int percent) -{ - switch(e){ - case MS_SND_CARD_PLAYBACK: - case MS_SND_CARD_MASTER: - gain_volume_out =((float)percent)/100.0f; - gain_changed_out = true; - return; - case MS_SND_CARD_CAPTURE: - gain_volume_in =((float)percent)/100.0f; - gain_changed_in = true; - return; - default: - ms_warning("aqcard_set_level: unsupported command."); - } -} - -static int aqcard_get_level(MSSndCard * card, MSSndCardMixerElem e) -{ - switch(e){ - case MS_SND_CARD_PLAYBACK: - case MS_SND_CARD_MASTER: - { - } - return (int)(gain_volume_out*100.0f); - case MS_SND_CARD_CAPTURE: - return (int)(gain_volume_in*100.0f); - default: - ms_warning("aqcard_get_level: unsupported command."); - } - return -1; -} - -static void aqcard_set_source(MSSndCard * card, MSSndCardCapture source) -{ -} - -static void aqcard_init(MSSndCard * card) -{ - AqSndDsCard *c = (AqSndDsCard *) ms_new(AqSndDsCard, 1); - c->removed = 0; - card->data = c; -} - -static void aqcard_uninit(MSSndCard * card) -{ - AqSndDsCard *d = (AqSndDsCard *) card->data; - if (d->uidname != NULL) - CFRelease(d->uidname); - ms_free(d); -} - -static void aqcard_detect(MSSndCardManager * m); -static MSSndCard *aqcard_duplicate(MSSndCard * obj); - -MSSndCardDesc aq_card_desc = { - .driver_type = "AQ", - .detect = aqcard_detect, - .init = aqcard_init, - .set_level = aqcard_set_level, - .get_level = aqcard_get_level, - .set_capture = aqcard_set_source, - .set_control = NULL, - .get_control = NULL, - .create_reader = ms_aq_read_new, - .create_writer = ms_aq_write_new, - .uninit = aqcard_uninit, - .duplicate = aqcard_duplicate -}; - -static MSSndCard *aqcard_duplicate(MSSndCard * obj) -{ - MSSndCard *card = ms_snd_card_new(&aq_card_desc); - card->name = ms_strdup(obj->name); - card->data = ms_new(AqSndDsCard, 1); - memcpy(card->data, obj->data, sizeof(AqSndDsCard)); - return card; -} - -static MSSndCard *aq_card_new(const char *name, CFStringRef uidname, - AudioStreamBasicDescription * - devicereadFormat, - AudioStreamBasicDescription * - devicewriteFormat, unsigned cap) -{ - MSSndCard *card = ms_snd_card_new(&aq_card_desc); - AqSndDsCard *d = (AqSndDsCard *) card->data; - d->uidname = uidname; - memcpy(&d->devicereadFormat, devicereadFormat, - sizeof(AudioStreamBasicDescription)); - memcpy(&d->devicewriteFormat, devicewriteFormat, - sizeof(AudioStreamBasicDescription)); - card->name = ms_strdup(name); - card->capabilities = cap; - return card; -} - -static void show_format(char *name, - AudioStreamBasicDescription * deviceFormat) -{ - ms_debug("Format for %s", name); - ms_debug("mSampleRate = %g", deviceFormat->mSampleRate); - char *the4CCString = (char *) &deviceFormat->mFormatID; - char outName[5]; - outName[0] = the4CCString[0]; - outName[1] = the4CCString[1]; - outName[2] = the4CCString[2]; - outName[3] = the4CCString[3]; - outName[4] = 0; - ms_debug("mFormatID = %s", outName); - ms_debug("mFormatFlags = %08lX", deviceFormat->mFormatFlags); - ms_debug("mBytesPerPacket = %ld", deviceFormat->mBytesPerPacket); - ms_debug("mFramesPerPacket = %ld", deviceFormat->mFramesPerPacket); - ms_debug("mChannelsPerFrame = %ld", deviceFormat->mChannelsPerFrame); - ms_debug("mBytesPerFrame = %ld", deviceFormat->mBytesPerFrame); - ms_debug("mBitsPerChannel = %ld", deviceFormat->mBitsPerChannel); -} - -static void aqcard_detect(MSSndCardManager * m) -{ - OSStatus err; - UInt32 slen; - int count; - Boolean writable; - int i; - writable = 0; - slen = 0; - err = - AudioHardwareGetPropertyInfo(kAudioHardwarePropertyDevices, &slen, - &writable); - if (err != kAudioHardwareNoError) { - ms_error("get kAudioHardwarePropertyDevices error %ld", err); - return; - } - AudioDeviceID V[slen / sizeof(AudioDeviceID)]; - err = - AudioHardwareGetProperty(kAudioHardwarePropertyDevices, &slen, V); - if (err != kAudioHardwareNoError) { - ms_error("get kAudioHardwarePropertyDevices error %ld", err); - return; - } - count = slen / sizeof(AudioDeviceID); - for (i = 0; i < count; i++) { - char devname[256]; - char uidname[256]; - int cap = 0; - slen = 256; - err = - AudioDeviceGetProperty(V[i], 0, FALSE, - kAudioDevicePropertyDeviceName, &slen, - devname); - if (err != kAudioHardwareNoError) { - ms_error("get kAudioDevicePropertyDeviceName error %ld", err); - continue; - } - slen = strlen(devname); - /* trim whitespace */ - while ((slen > 0) && (devname[slen - 1] == ' ')) { - slen--; - } - devname[slen] = '\0'; - - err = - AudioDeviceGetPropertyInfo(V[i], 0, FALSE, - kAudioDevicePropertyStreamConfiguration, - &slen, &writable); - if (err != kAudioHardwareNoError) { - ms_error("get kAudioDevicePropertyDeviceName error %ld", err); - continue; - } - AudioBufferList *buflist = ms_new(slen, 1); - if (buflist == NULL) { - ms_error("alloc AudioBufferList %ld", err); - continue; - } - - err = - AudioDeviceGetProperty(V[i], 0, FALSE, - kAudioDevicePropertyStreamConfiguration, - &slen, buflist); - if (err != kAudioHardwareNoError) { - ms_error("get kAudioDevicePropertyDeviceName error %ld", err); - ms_free(buflist); - continue; - } - - UInt32 j; - for (j = 0; j < buflist->mNumberBuffers; j++) { - if (buflist->mBuffers[j].mNumberChannels > 0) { - cap = MS_SND_CARD_CAP_PLAYBACK; - break; - } - } - - ms_free(buflist); - - err = - AudioDeviceGetPropertyInfo(V[i], 0, TRUE, - kAudioDevicePropertyStreamConfiguration, - &slen, &writable); - if (err != kAudioHardwareNoError) { - ms_error("get kAudioDevicePropertyDeviceName error %ld", err); - continue; - } - buflist = ms_new(slen, 1); - if (buflist == NULL) { - ms_error("alloc error %ld", err); - continue; - } - - err = - AudioDeviceGetProperty(V[i], 0, TRUE, - kAudioDevicePropertyStreamConfiguration, - &slen, buflist); - if (err != kAudioHardwareNoError) { - ms_error("get kAudioDevicePropertyDeviceName error %ld", err); - ms_free(buflist); - continue; - } - - for (j = 0; j < buflist->mNumberBuffers; j++) { - if (buflist->mBuffers[j].mNumberChannels > 0) { - cap |= MS_SND_CARD_CAP_CAPTURE; - break; - } - } - - ms_free(buflist); - - CFStringRef dUID; - dUID = NULL; - slen = sizeof(CFStringRef); - err = - AudioDeviceGetProperty(V[i], 0, false, - kAudioDevicePropertyDeviceUID, &slen, - &dUID); - if (err != kAudioHardwareNoError) { - ms_error("get kAudioHardwarePropertyDevices error %ld", err); - continue; - } - CFStringGetCString(dUID, uidname, 256, - CFStringGetSystemEncoding()); - ms_message("AQ: devname:%s uidname:%s", devname, uidname); - - AudioStreamBasicDescription devicereadFormat; - AudioStreamBasicDescription devicewriteFormat; - slen = sizeof(devicewriteFormat); - err = AudioDeviceGetProperty(V[i], 0, false, - kAudioDevicePropertyStreamFormat, - &slen, &devicewriteFormat); - if (err == kAudioHardwareNoError) { - show_format("output device", &devicewriteFormat); - } - slen = sizeof(devicereadFormat); - err = AudioDeviceGetProperty(V[i], 0, true, - kAudioDevicePropertyStreamFormat, - &slen, &devicereadFormat); - if (err == kAudioHardwareNoError) { - show_format("input device", &devicereadFormat); - } - - MSSndCard *card = aq_card_new(devname, dUID, &devicereadFormat, - &devicewriteFormat, cap); - ms_snd_card_manager_add_card(m, card); - } -} - - -/* - Audio Queue recode callback - */ - -static void readCallback(void *aqData, - AudioQueueRef inAQ, - AudioQueueBufferRef inBuffer, - const AudioTimeStamp * inStartTime, - UInt32 inNumPackets, - const AudioStreamPacketDescription * inPacketDesc) -{ - AQData *d = (AQData *) aqData; - OSStatus err; - mblk_t *rm = NULL; - - UInt32 len = - (inBuffer->mAudioDataByteSize * d->readAudioFormat.mSampleRate / - 1) / d->devicereadFormat.mSampleRate / - d->devicereadFormat.mChannelsPerFrame; - - ms_mutex_lock(&d->mutex); - if (d->read_started == FALSE) { - ms_mutex_unlock(&d->mutex); - return; - } - - rm = allocb(len, 0); - - err = AudioConverterConvertBuffer(d->readAudioConverter, - inBuffer->mAudioDataByteSize, - inBuffer->mAudioData, - &len, rm->b_wptr); - if (err != noErr) { - ms_error("readCallback: AudioConverterConvertBuffer %d", err); - ms_warning("readCallback: inBuffer->mAudioDataByteSize = %d", - inBuffer->mAudioDataByteSize); - ms_warning("readCallback: outlen = %d", len); - ms_warning("readCallback: origlen = %i", - (inBuffer->mAudioDataByteSize * - d->readAudioFormat.mSampleRate / 1) / - d->devicereadFormat.mSampleRate / - d->devicereadFormat.mChannelsPerFrame); - freeb(rm); - } else { - - rm->b_wptr += len; - if (gain_volume_in != 1.0f) - { - int16_t *ptr=(int16_t *)rm->b_rptr; - for (;ptr<(int16_t *)rm->b_wptr;ptr++) - { - *ptr=(int16_t)(((float)(*ptr))*gain_volume_in); - } - } - putq(&d->rq, rm); - } - - err = AudioQueueEnqueueBuffer(d->readQueue, inBuffer, 0, NULL); - if (err != noErr) { - ms_error("readCallback:AudioQueueEnqueueBuffer %d", err); - } - ms_mutex_unlock(&d->mutex); -} - -/* - Audio Queue play callback - */ - -static void writeCallback(void *aqData, - AudioQueueRef inAQ, AudioQueueBufferRef inBuffer) -{ - AQData *d = (AQData *) aqData; - OSStatus err; - - int len = - (d->writeBufferByteSize * d->writeAudioFormat.mSampleRate / 1) / - d->devicewriteFormat.mSampleRate / - d->devicewriteFormat.mChannelsPerFrame; - - ms_mutex_lock(&d->mutex); - if (d->write_started == FALSE) { - ms_mutex_unlock(&d->mutex); - return; - } - if (d->bufferizer->size >= len) { - UInt32 bsize = d->writeBufferByteSize; - uint8_t *pData = ms_malloc(len); - - ms_bufferizer_read(d->bufferizer, pData, len); - err = AudioConverterConvertBuffer(d->writeAudioConverter, - len, - pData, - &bsize, inBuffer->mAudioData); - if (err != noErr) { - ms_error("writeCallback: AudioConverterConvertBuffer %d", err); - } - ms_free(pData); - - if (bsize != d->writeBufferByteSize) - ms_warning("d->writeBufferByteSize = %i len = %i bsize = %i", - d->writeBufferByteSize, len, bsize); - } else { - memset(inBuffer->mAudioData, 0, d->writeBufferByteSize); - } - inBuffer->mAudioDataByteSize = d->writeBufferByteSize; - - if (gain_changed_out == true) - { - AudioQueueSetParameter (d->writeQueue, - kAudioQueueParam_Volume, - gain_volume_out); - gain_changed_out = false; - } - - err = AudioQueueEnqueueBuffer(d->writeQueue, inBuffer, 0, NULL); - if (err != noErr) { - ms_error("AudioQueueEnqueueBuffer %d", err); - } - ms_mutex_unlock(&d->mutex); -} - -void putWriteAQ(void *aqData, int queuenum) -{ - AQData *d = (AQData *) aqData; - OSStatus err; - err = AudioQueueEnqueueBuffer(d->writeQueue, - d->writeBuffers[queuenum], 0, NULL); - if (err != noErr) { - ms_error("AudioQueueEnqueueBuffer %d", err); - } -} - -/* - play buffer setup function - */ - -void setupWrite(MSFilter * f) -{ - AQData *d = (AQData *) f->data; - OSStatus err; - - int bufferIndex; - - for (bufferIndex = 0; bufferIndex < kNumberAudioOutDataBuffers; - ++bufferIndex) { - - err = AudioQueueAllocateBuffer(d->writeQueue, - d->writeBufferByteSize, - &d->writeBuffers[bufferIndex] - ); - if (err != noErr) { - ms_error("setupWrite:AudioQueueAllocateBuffer %d", err); - } - } -} - -/* - recode buffer setup function - */ - -void setupRead(MSFilter * f) -{ - AQData *d = (AQData *) f->data; - OSStatus err; - - // allocate and enqueue buffers - int bufferIndex; - - for (bufferIndex = 0; bufferIndex < kNumberAudioInDataBuffers; - ++bufferIndex) { - - AudioQueueBufferRef buffer; - - err = AudioQueueAllocateBuffer(d->readQueue, - d->readBufferByteSize, &buffer); - if (err != noErr) { - ms_error("setupRead:AudioQueueAllocateBuffer %d", err); - } - - err = AudioQueueEnqueueBuffer(d->readQueue, buffer, 0, NULL); - if (err != noErr) { - ms_error("AudioQueueEnqueueBuffer %d", err); - } - } -} - - -static void aq_start_r(MSFilter * f) -{ - AQData *d = (AQData *) f->data; - if (d->read_started == FALSE) { - OSStatus aqresult; - - d->readAudioFormat.mSampleRate = d->rate; - d->readAudioFormat.mFormatID = kAudioFormatLinearPCM; - d->readAudioFormat.mFormatFlags = - kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked; - d->readAudioFormat.mFramesPerPacket = 1; - d->readAudioFormat.mChannelsPerFrame = 1; - d->readAudioFormat.mBitsPerChannel = d->bits; - d->readAudioFormat.mBytesPerPacket = d->bits / 8; - d->readAudioFormat.mBytesPerFrame = d->bits / 8; - - //show_format("input device", &d->devicereadFormat); - //show_format("data from input filter", &d->readAudioFormat); - - memcpy(&d->devicereadFormat, &d->readAudioFormat, - sizeof(d->readAudioFormat)); - d->readBufferByteSize = - kSecondsPerBuffer * d->devicereadFormat.mSampleRate * - (d->devicereadFormat.mBitsPerChannel / 8) * - d->devicereadFormat.mChannelsPerFrame; - - aqresult = AudioConverterNew(&d->devicereadFormat, - &d->readAudioFormat, - &d->readAudioConverter); - if (aqresult != noErr) { - ms_error("d->readAudioConverter = %d", aqresult); - d->readAudioConverter = NULL; - } - - aqresult = AudioQueueNewInput(&d->devicereadFormat, readCallback, d, // userData - NULL, // run loop - NULL, // run loop mode - 0, // flags - &d->readQueue); - if (aqresult != noErr) { - ms_error("AudioQueueNewInput = %d", aqresult); - } - - char uidname[256]; - CFStringGetCString(d->uidname, uidname, 256, - CFStringGetSystemEncoding()); - ms_message("AQ: using uidname:%s", uidname); - aqresult = - AudioQueueSetProperty(d->readQueue, - kAudioQueueProperty_CurrentDevice, - &d->uidname, sizeof(CFStringRef)); - if (aqresult != noErr) { - ms_error - ("AudioQueueSetProperty on kAudioQueueProperty_CurrentDevice %d", - aqresult); - } - - setupRead(f); - AudioQueueStart(d->readQueue, NULL // start time. NULL means ASAP. - ); - if (aqresult != noErr) { - ms_error("AudioQueueStart %d", aqresult); - } - d->read_started = TRUE; - } -} - -static void aq_stop_r(MSFilter * f) -{ - AQData *d = (AQData *) f->data; - - if (d->read_started == TRUE) { - ms_mutex_lock(&d->mutex); - d->read_started = FALSE; /* avoid a deadlock related to buffer conversion in callback */ - ms_mutex_unlock(&d->mutex); - AudioConverterDispose(d->readAudioConverter); - AudioQueueStop(d->readQueue, true); - AudioQueueDispose(d->readQueue, true); - } -} - -static void aq_start_w(MSFilter * f) -{ - AQData *d = (AQData *) f->data; - if (d->write_started == FALSE) { - OSStatus aqresult; - - d->writeAudioFormat.mSampleRate = d->rate; - d->writeAudioFormat.mFormatID = kAudioFormatLinearPCM; - d->writeAudioFormat.mFormatFlags = - kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked; - d->writeAudioFormat.mFramesPerPacket = 1; - d->writeAudioFormat.mChannelsPerFrame = 1; - d->writeAudioFormat.mBitsPerChannel = d->bits; - d->writeAudioFormat.mBytesPerPacket = d->bits / 8; - d->writeAudioFormat.mBytesPerFrame = d->bits / 8; - - //show_format("data provided to output filter", &d->writeAudioFormat); - //show_format("output device", &d->devicewriteFormat); - - memcpy(&d->devicewriteFormat, &d->writeAudioFormat, - sizeof(d->writeAudioFormat)); - d->writeBufferByteSize = - kSecondsPerBuffer * d->devicewriteFormat.mSampleRate * - (d->devicewriteFormat.mBitsPerChannel / 8) * - d->devicewriteFormat.mChannelsPerFrame; - - aqresult = AudioConverterNew(&d->writeAudioFormat, - &d->devicewriteFormat, - &d->writeAudioConverter); - if (aqresult != noErr) { - ms_error("d->writeAudioConverter = %d", aqresult); - d->writeAudioConverter = NULL; - } - // create the playback audio queue object - aqresult = AudioQueueNewOutput(&d->devicewriteFormat, writeCallback, d, NULL, /*CFRunLoopGetCurrent () */ - NULL, /*kCFRunLoopCommonModes */ - 0, // run loop flags - &d->writeQueue); - if (aqresult != noErr) { - ms_error("AudioQueueNewOutput = %d", aqresult); - } - - AudioQueueSetParameter (d->writeQueue, - kAudioQueueParam_Volume, - gain_volume_out); - - char uidname[256]; - CFStringGetCString(d->uidname, uidname, 256, - CFStringGetSystemEncoding()); - ms_message("AQ: using uidname:%s", uidname); - aqresult = - AudioQueueSetProperty(d->writeQueue, - kAudioQueueProperty_CurrentDevice, - &d->uidname, sizeof(CFStringRef)); - if (aqresult != noErr) { - ms_error - ("AudioQueueSetProperty on kAudioQueueProperty_CurrentDevice %d", - aqresult); - } - setupWrite(f); - d->curWriteBuffer = 0; - } -} - -static void aq_stop_w(MSFilter * f) -{ - AQData *d = (AQData *) f->data; - if (d->write_started == TRUE) { - ms_mutex_lock(&d->mutex); - d->write_started = FALSE; /* avoid a deadlock related to buffer conversion in callback */ - ms_mutex_unlock(&d->mutex); - AudioConverterDispose(d->writeAudioConverter); - AudioQueueStop(d->writeQueue, true); - - AudioQueueDispose(d->writeQueue, true); - } -} - -static mblk_t *aq_get(MSFilter * f) -{ - AQData *d = (AQData *) f->data; - mblk_t *m; - ms_mutex_lock(&d->mutex); - m = getq(&d->rq); - ms_mutex_unlock(&d->mutex); - return m; -} - -static void aq_put(MSFilter * f, mblk_t * m) -{ - AQData *d = (AQData *) f->data; - ms_mutex_lock(&d->mutex); - ms_bufferizer_put(d->bufferizer, m); - ms_mutex_unlock(&d->mutex); - - int len = - (d->writeBufferByteSize * d->writeAudioFormat.mSampleRate / 1) / - d->devicewriteFormat.mSampleRate / - d->devicewriteFormat.mChannelsPerFrame; - if (d->write_started == FALSE && d->bufferizer->size >= len) { - AudioQueueBufferRef curbuf = d->writeBuffers[d->curWriteBuffer]; - OSStatus err; - UInt32 bsize = d->writeBufferByteSize; - uint8_t *pData = ms_malloc(len); - - ms_bufferizer_read(d->bufferizer, pData, len); - err = AudioConverterConvertBuffer(d->writeAudioConverter, - len, - pData, - &bsize, curbuf->mAudioData); - if (err != noErr) { - ms_error("writeCallback: AudioConverterConvertBuffer %d", err); - } - ms_free(pData); - - if (bsize != d->writeBufferByteSize) - ms_warning("d->writeBufferByteSize = %i len = %i bsize = %i", - d->writeBufferByteSize, len, bsize); - - curbuf->mAudioDataByteSize = d->writeBufferByteSize; - putWriteAQ(d, d->curWriteBuffer); - ++d->curWriteBuffer; - } - if (d->write_started == FALSE - && d->curWriteBuffer == kNumberAudioOutDataBuffers - 1) { - OSStatus err; - err = AudioQueueStart(d->writeQueue, NULL // start time. NULL means ASAP. - ); - if (err != noErr) { - ms_error("AudioQueueStart %d", err); - } - d->write_started = TRUE; - } -} - -static void aq_init(MSFilter * f) -{ - AQData *d = ms_new(AQData, 1); - d->bits = 16; - d->rate = 8000; - d->stereo = FALSE; - - d->read_started = FALSE; - d->write_started = FALSE; - qinit(&d->rq); - d->bufferizer = ms_bufferizer_new(); - ms_mutex_init(&d->mutex, NULL); - f->data = d; -} - -static void aq_uninit(MSFilter * f) -{ - AQData *d = (AQData *) f->data; - flushq(&d->rq, 0); - ms_bufferizer_destroy(d->bufferizer); - ms_mutex_destroy(&d->mutex); - if (d->uidname != NULL) - CFRelease(d->uidname); - ms_free(d); -} - -static void aq_read_preprocess(MSFilter * f) -{ - aq_start_r(f); -} - -static void aq_read_postprocess(MSFilter * f) -{ - aq_stop_r(f); -} - -static void aq_read_process(MSFilter * f) -{ - mblk_t *m; - while ((m = aq_get(f)) != NULL) { - ms_queue_put(f->outputs[0], m); - } -} - -static void aq_write_preprocess(MSFilter * f) -{ - aq_start_w(f); -} - -static void aq_write_postprocess(MSFilter * f) -{ - aq_stop_w(f); -} - -static void aq_write_process(MSFilter * f) -{ - mblk_t *m; - while ((m = ms_queue_get(f->inputs[0])) != NULL) { - aq_put(f, m); - } -} - -static int set_rate(MSFilter * f, void *arg) -{ - AQData *d = (AQData *) f->data; - d->rate = *((int *) arg); - return 0; -} - -static int read_get_rate(MSFilter * f, void *arg) -{ - AQData *d = (AQData *) f->data; - *((int *) arg) = d->rate; - return 0; -} - -static int write_get_rate(MSFilter * f, void *arg) -{ - AQData *d = (AQData *) f->data; - *((int *) arg) = d->rate; - return 0; -} - -/* -static int set_nchannels(MSFilter *f, void *arg){ - AQData *d=(AQData*)f->data; - d->stereo=(*((int*)arg)==2); - return 0; -} -*/ - -static MSFilterMethod aq_read_methods[] = { - {MS_FILTER_SET_SAMPLE_RATE, set_rate}, - {MS_FILTER_GET_SAMPLE_RATE, read_get_rate}, -/* not support yet - { MS_FILTER_SET_NCHANNELS , set_nchannels }, -*/ - {0, NULL} -}; - -MSFilterDesc aq_read_desc = { - .id = MS_AQ_READ_ID, - .name = "MSAQRead", - .text = N_("Sound capture filter for MacOS X Audio Queue Service"), - .category = MS_FILTER_OTHER, - .ninputs = 0, - .noutputs = 1, - .init = aq_init, - .preprocess = aq_read_preprocess, - .process = aq_read_process, - .postprocess = aq_read_postprocess, - .uninit = aq_uninit, - .methods = aq_read_methods -}; - -static MSFilterMethod aq_write_methods[] = { - {MS_FILTER_SET_SAMPLE_RATE, set_rate}, - {MS_FILTER_GET_SAMPLE_RATE, write_get_rate}, -/* not support yet - { MS_FILTER_SET_NCHANNELS , set_nchannels }, -*/ - {0, NULL} -}; - -MSFilterDesc aq_write_desc = { - .id = MS_AQ_WRITE_ID, - .name = "MSAQWrite", - .text = N_("Sound playback filter for MacOS X Audio Queue Service"), - .category = MS_FILTER_OTHER, - .ninputs = 1, - .noutputs = 0, - .init = aq_init, - .preprocess = aq_write_preprocess, - .process = aq_write_process, - .postprocess = aq_write_postprocess, - .uninit = aq_uninit, - .methods = aq_write_methods -}; - -MSFilter *ms_aq_read_new(MSSndCard * card) -{ - MSFilter *f = ms_filter_new_from_desc(&aq_read_desc); - AqSndDsCard *wc = (AqSndDsCard *) card->data; - AQData *d = (AQData *) f->data; - d->uidname = CFStringCreateCopy(NULL, wc->uidname); - memcpy(&d->devicereadFormat, &wc->devicereadFormat, - sizeof(AudioStreamBasicDescription)); - memcpy(&d->devicewriteFormat, &wc->devicewriteFormat, - sizeof(AudioStreamBasicDescription)); - return f; -} - - -MSFilter *ms_aq_write_new(MSSndCard * card) -{ - MSFilter *f = ms_filter_new_from_desc(&aq_write_desc); - AqSndDsCard *wc = (AqSndDsCard *) card->data; - AQData *d = (AQData *) f->data; - d->uidname = CFStringCreateCopy(NULL, wc->uidname); - memcpy(&d->devicereadFormat, &wc->devicereadFormat, - sizeof(AudioStreamBasicDescription)); - memcpy(&d->devicewriteFormat, &wc->devicewriteFormat, - sizeof(AudioStreamBasicDescription)); - return f; -} - -MS_FILTER_DESC_EXPORT(aq_read_desc) -MS_FILTER_DESC_EXPORT(aq_write_desc) diff --git a/linphone/mediastreamer2/src/arts.c b/linphone/mediastreamer2/src/arts.c deleted file mode 100644 index e6fcec820..000000000 --- a/linphone/mediastreamer2/src/arts.c +++ /dev/null @@ -1,207 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include - -#include "mediastreamer2/mssndcard.h" -#include "mediastreamer2/msfilter.h" - -extern MSSndCardDesc arts_card_desc; - -static int arts_users=0; -static void check_arts_init(){ - if (arts_users==0){ - arts_init(); - } - arts_users++; -} - -static void check_arts_uninit(){ - arts_users--; - if (arts_users==0){ - arts_free(); - } -} - - -typedef struct ArtsState{ - int rate; - int nchannels; - int bits; - int bsize; - arts_stream_t stream; - mblk_t *msg; -} ArtsState; - -static void reader_init(MSFilter *f){ - ArtsState *s=ms_new(ArtsState,1); - s->rate=8000; - s->nchannels=1; - s->bits=16; - s->bsize=512; - s->stream=NULL; - s->msg=NULL; - f->data=s; -} - -static void reader_uninit(MSFilter *f){ - ArtsState *s=(ArtsState *)f->data; - ms_free(s); -} - -static void configure(arts_stream_t stream){ - int ret; - int latency=50; - ret=arts_stream_set(stream,ARTS_P_BUFFER_TIME,latency); - if (ret!=latency) ms_message("Arts set latency to %i",ret); - arts_stream_set(stream,ARTS_P_BLOCKING,0); -} - -static void reader_preprocess(MSFilter *f){ - ArtsState *s=(ArtsState *)f->data; - check_arts_init(); - s->stream=arts_record_stream(s->rate,s->bits,s->nchannels, "linphone"); - s->bsize=512*s->rate/8000; - if (s->stream!=NULL) configure(s->stream); -} - -static void reader_process(MSFilter *f){ - int err; - ArtsState *s=(ArtsState *)f->data; - if (s->stream!=NULL){ - mblk_t *om=s->msg; - if (om==NULL) om=allocb(s->bsize,0); - err=arts_read(s->stream,om->b_wptr,s->bsize); - if (err>0){ - om->b_wptr+=err; - ms_queue_put(f->outputs[0],om); - om=NULL; - } - s->msg=om; - } -} - -static void reader_postprocess(MSFilter *f){ - ArtsState *s=(ArtsState *)f->data; - if (s->stream) arts_close_stream(s->stream); - s->stream=NULL; - check_arts_uninit(); -} - -static void writer_preprocess(MSFilter *f){ - ArtsState *s=(ArtsState *)f->data; - check_arts_init(); - s->stream=arts_play_stream(s->rate,s->bits,s->nchannels, "linphone"); - s->bsize=512*s->rate/8000; - if (s->stream!=NULL) configure(s->stream); -} - -static void writer_process(MSFilter *f){ - ArtsState *s=(ArtsState *)f->data; - int err; - mblk_t *im; - - if (s->stream==NULL){ - ms_queue_flush(f->inputs[0]); - return; - } - while ((im=ms_queue_get(f->inputs[0]))!=NULL){ - err=arts_write(s->stream,im->b_rptr,im->b_wptr-im->b_rptr); - if (err<0){ - ms_warning("arts_write error"); - } - freemsg(im); - } -} - -static int reader_set_sr(MSFilter *f, void *arg){ - ArtsState *s=(ArtsState *)f->data; - s->rate=*(int*)arg; - return 0; -} - -static int reader_set_nchannels(MSFilter *f, void *arg){ - ArtsState *s=(ArtsState *)f->data; - s->nchannels=*(int*)arg; - return 0; -} - -static MSFilterMethod methods[]={ - { MS_FILTER_SET_SAMPLE_RATE , reader_set_sr }, - { MS_FILTER_SET_NCHANNELS , reader_set_nchannels }, - { 0 , NULL } -}; - -MSFilterDesc ms_arts_read_desc={ - .id=MS_ARTS_READ_ID, - .name="MSArtsRead", - .category=MS_FILTER_OTHER, - .ninputs=0, - .noutputs=1, - .init=reader_init, - .preprocess=reader_preprocess, - .process=reader_process, - .postprocess=reader_postprocess, - .uninit=reader_uninit, - .methods=methods -}; - -MSFilterDesc ms_arts_write_desc={ - .id=MS_ARTS_WRITE_ID, - .name="MSArtsWrite", - .category=MS_FILTER_OTHER, - .ninputs=1, - .noutputs=0, - .init=reader_init, /*the read and the write method do the same*/ - .preprocess=writer_preprocess, - .process=writer_process, - .postprocess=reader_postprocess,/*the read and the write method do the same*/ - .uninit=reader_uninit,/*the read and the write method do the same*/ - .methods=methods /*the read and the write method do the same*/ -}; - -static void arts_card_detect(MSSndCardManager *m){ - if (arts_init()==0){ - MSSndCard *card=ms_snd_card_new(&arts_card_desc); - card->name=ms_strdup("arts driver"); - ms_snd_card_manager_add_card(ms_snd_card_manager_get(),card); - arts_free(); - } -} - -static MSFilter * arts_card_create_reader(MSSndCard *card){ - return ms_filter_new(MS_ARTS_READ_ID); -} - -static MSFilter * arts_card_create_writer(MSSndCard *card){ - return ms_filter_new(MS_ARTS_WRITE_ID); -} - -MSSndCardDesc arts_card_desc={ - .driver_type="aRts", - .detect=arts_card_detect, - .set_control=NULL, - .get_control=NULL, - .create_reader=arts_card_create_reader, - .create_writer=arts_card_create_writer, - .duplicate=NULL -}; - -MS_FILTER_DESC_EXPORT(ms_arts_read_desc) -MS_FILTER_DESC_EXPORT(ms_arts_write_desc) diff --git a/linphone/mediastreamer2/src/audiostream.c b/linphone/mediastreamer2/src/audiostream.c deleted file mode 100644 index ac9222d60..000000000 --- a/linphone/mediastreamer2/src/audiostream.c +++ /dev/null @@ -1,604 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -#ifdef HAVE_CONFIG_H -#include "mediastreamer-config.h" -#endif - -#include "mediastreamer2/mediastream.h" - -#include "mediastreamer2/dtmfgen.h" -#include "mediastreamer2/mssndcard.h" -#include "mediastreamer2/msrtp.h" -#include "mediastreamer2/msfileplayer.h" -#include "mediastreamer2/msfilerec.h" -#include "mediastreamer2/msvolume.h" -#include "mediastreamer2/msequalizer.h" -#include "mediastreamer2/msspeexec.h" - -#ifdef INET6 - #include -#ifndef WIN32 - #include - #include -#endif -#endif - - -#define MAX_RTP_SIZE 1500 - - -/* this code is not part of the library itself, it is part of the mediastream program */ -void audio_stream_free(AudioStream *stream) -{ - if (stream->session!=NULL) rtp_session_destroy(stream->session); - if (stream->rtpsend!=NULL) ms_filter_destroy(stream->rtpsend); - if (stream->rtprecv!=NULL) ms_filter_destroy(stream->rtprecv); - if (stream->soundread!=NULL) ms_filter_destroy(stream->soundread); - if (stream->soundwrite!=NULL) ms_filter_destroy(stream->soundwrite); - if (stream->encoder!=NULL) ms_filter_destroy(stream->encoder); - if (stream->decoder!=NULL) ms_filter_destroy(stream->decoder); - if (stream->dtmfgen!=NULL) ms_filter_destroy(stream->dtmfgen); - if (stream->ec!=NULL) ms_filter_destroy(stream->ec); - if (stream->volrecv!=NULL) ms_filter_destroy(stream->volrecv); - if (stream->volsend!=NULL) ms_filter_destroy(stream->volsend); - if (stream->equalizer!=NULL) ms_filter_destroy(stream->equalizer); - if (stream->ticker!=NULL) ms_ticker_destroy(stream->ticker); - if (stream->read_resampler!=NULL) ms_filter_destroy(stream->read_resampler); - if (stream->write_resampler!=NULL) ms_filter_destroy(stream->write_resampler); - ms_free(stream); -} - -static int dtmf_tab[16]={'0','1','2','3','4','5','6','7','8','9','*','#','A','B','C','D'}; - -static void on_dtmf_received(RtpSession *s, int dtmf, void * user_data) -{ - AudioStream *stream=(AudioStream*)user_data; - if (dtmf>15){ - ms_warning("Unsupported telephone-event type."); - return; - } - ms_message("Receiving dtmf %c.",dtmf_tab[dtmf]); - if (stream->dtmfgen!=NULL && stream->play_dtmfs){ - ms_filter_call_method(stream->dtmfgen,MS_DTMF_GEN_PUT,&dtmf_tab[dtmf]); - } -} - -#if 0 - -static void on_timestamp_jump(RtpSession *s,uint32_t* ts, void * user_data) -{ - ms_warning("The remote sip-phone has send data with a future timestamp: %u," - "resynchronising session.",*ts); - rtp_session_reset(s); -} - -#endif - - -bool_t ms_is_ipv6(const char *remote){ - bool_t ret=FALSE; -#ifdef INET6 - struct addrinfo hints, *res0; - - int err; - memset(&hints, 0, sizeof(hints)); - hints.ai_family = PF_UNSPEC; - hints.ai_socktype = SOCK_DGRAM; - err = getaddrinfo(remote,"8000", &hints, &res0); - if (err!=0) { - ms_warning ("get_local_addr_for: %s", gai_strerror(err)); - return FALSE; - } - ret=(res0->ai_addr->sa_family==AF_INET6); - freeaddrinfo(res0); -#endif - return ret; -} - -static void audio_stream_configure_resampler(MSFilter *resampler,MSFilter *from,MSFilter *to) { - int from_rate=0, to_rate=0; - ms_filter_call_method(from,MS_FILTER_GET_SAMPLE_RATE,&from_rate); - ms_filter_call_method(to,MS_FILTER_GET_SAMPLE_RATE,&to_rate); - ms_filter_call_method(resampler,MS_FILTER_SET_SAMPLE_RATE,&from_rate); - ms_filter_call_method(resampler,MS_FILTER_SET_OUTPUT_SAMPLE_RATE,&to_rate); - ms_debug("configuring from rate[%i] to rate [%i]",from_rate,to_rate); -} - -RtpSession * create_duplex_rtpsession( int locport, bool_t ipv6){ - RtpSession *rtpr; - rtpr=rtp_session_new(RTP_SESSION_SENDRECV); - rtp_session_set_recv_buf_size(rtpr,MAX_RTP_SIZE); - rtp_session_set_scheduling_mode(rtpr,0); - rtp_session_set_blocking_mode(rtpr,0); - rtp_session_enable_adaptive_jitter_compensation(rtpr,TRUE); - rtp_session_set_symmetric_rtp(rtpr,TRUE); - rtp_session_set_local_addr(rtpr,ipv6 ? "::" : "0.0.0.0",locport); - rtp_session_signal_connect(rtpr,"timestamp_jump",(RtpCallback)rtp_session_resync,(long)NULL); - rtp_session_signal_connect(rtpr,"ssrc_changed",(RtpCallback)rtp_session_resync,(long)NULL); - return rtpr; -} - -#if defined(_WIN32_WCE) -time_t -ms_time (time_t *t) -{ - DWORD timemillis = GetTickCount(); - if (timemillis>0) - { - if (t!=NULL) - *t = timemillis/1000; - } - return timemillis/1000; -} -#endif - -bool_t audio_stream_alive(AudioStream * stream, int timeout){ - RtpSession *session=stream->session; - const rtp_stats_t *stats=rtp_session_get_stats(session); - if (stats->recv!=0){ - if (stats->recv!=stream->last_packet_count){ - stream->last_packet_count=stats->recv; - stream->last_packet_time=ms_time(NULL); - }else{ - if (ms_time(NULL)-stream->last_packet_time>timeout){ - /* more than timeout seconds of inactivity*/ - return FALSE; - } - } - } - return TRUE; -} - -/*this function must be called from the MSTicker thread: -it replaces one filter by another one. -This is a dirty hack that works anyway. -It would be interesting to have something that does the job -simplier within the MSTicker api -*/ -void audio_stream_change_decoder(AudioStream *stream, int payload){ - RtpSession *session=stream->session; - RtpProfile *prof=rtp_session_get_profile(session); - PayloadType *pt=rtp_profile_get_payload(prof,payload); - if (pt!=NULL){ - MSFilter *dec=ms_filter_create_decoder(pt->mime_type); - if (dec!=NULL){ - ms_filter_unlink(stream->rtprecv, 0, stream->decoder, 0); - ms_filter_unlink(stream->decoder,0,stream->dtmfgen,0); - ms_filter_postprocess(stream->decoder); - ms_filter_destroy(stream->decoder); - stream->decoder=dec; - if (pt->recv_fmtp!=NULL) - ms_filter_call_method(stream->decoder,MS_FILTER_ADD_FMTP,(void*)pt->recv_fmtp); - ms_filter_link (stream->rtprecv, 0, stream->decoder, 0); - ms_filter_link (stream->decoder,0 , stream->dtmfgen, 0); - ms_filter_preprocess(stream->decoder,stream->ticker); - - }else{ - ms_warning("No decoder found for %s",pt->mime_type); - } - }else{ - ms_warning("No payload defined with number %i",payload); - } -} - -static void payload_type_changed(RtpSession *session, unsigned long data){ - AudioStream *stream=(AudioStream*)data; - int pt=rtp_session_get_recv_payload_type(stream->session); - audio_stream_change_decoder(stream,pt); -} - - -int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char *remip,int remport, - int rem_rtcp_port, int payload,int jitt_comp, const char *infile, const char *outfile, - MSSndCard *playcard, MSSndCard *captcard, bool_t use_ec) -{ - RtpSession *rtps=stream->session; - PayloadType *pt; - int tmp; - MSConnectionHelper h; - - rtp_session_set_profile(rtps,profile); - if (remport>0) rtp_session_set_remote_addr_full(rtps,remip,remport,rem_rtcp_port); - rtp_session_set_payload_type(rtps,payload); - rtp_session_set_jitter_compensation(rtps,jitt_comp); - - if (remport>0) - ms_filter_call_method(stream->rtpsend,MS_RTP_SEND_SET_SESSION,rtps); - stream->rtprecv=ms_filter_new(MS_RTP_RECV_ID); - ms_filter_call_method(stream->rtprecv,MS_RTP_RECV_SET_SESSION,rtps); - stream->session=rtps; - - stream->dtmfgen=ms_filter_new(MS_DTMF_GEN_ID); - rtp_session_signal_connect(rtps,"telephone-event",(RtpCallback)on_dtmf_received,(unsigned long)stream); - rtp_session_signal_connect(rtps,"payload_type_changed",(RtpCallback)payload_type_changed,(unsigned long)stream); - - /* creates the local part */ - if (captcard!=NULL) stream->soundread=ms_snd_card_create_reader(captcard); - else { - stream->soundread=ms_filter_new(MS_FILE_PLAYER_ID); - stream->read_resampler=ms_filter_new(MS_RESAMPLE_ID); - if (infile!=NULL) audio_stream_play(stream,infile); - } - if (playcard!=NULL) stream->soundwrite=ms_snd_card_create_writer(playcard); - else { - stream->soundwrite=ms_filter_new(MS_FILE_REC_ID); - if (outfile!=NULL) audio_stream_record(stream,outfile); - } - - /* creates the couple of encoder/decoder */ - pt=rtp_profile_get_payload(profile,payload); - if (pt==NULL){ - ms_error("audiostream.c: undefined payload type."); - return -1; - } - stream->encoder=ms_filter_create_encoder(pt->mime_type); - stream->decoder=ms_filter_create_decoder(pt->mime_type); - if ((stream->encoder==NULL) || (stream->decoder==NULL)){ - /* big problem: we have not a registered codec for this payload...*/ - ms_error("mediastream.c: No decoder available for payload %i.",payload); - return -1; - } - - if (use_ec) { - stream->ec=ms_filter_new(MS_SPEEX_EC_ID); - ms_filter_call_method(stream->ec,MS_FILTER_SET_SAMPLE_RATE,&pt->clock_rate); - if (stream->ec_tail_len!=0) - ms_filter_call_method(stream->ec,MS_SPEEX_EC_SET_TAIL_LENGTH,&stream->ec_tail_len); - if (stream->ec_delay!=0) - ms_filter_call_method(stream->ec,MS_SPEEX_EC_SET_DELAY,&stream->ec_delay); - if (stream->ec_framesize!=0) - ms_filter_call_method(stream->ec,MS_SPEEX_EC_SET_FRAME_SIZE,&stream->ec_framesize); - } - - if (stream->el_type!=ELInactive || stream->use_gc || stream->use_ng){ - stream->volsend=ms_filter_new(MS_VOLUME_ID); - stream->volrecv=ms_filter_new(MS_VOLUME_ID); - if (stream->el_type!=ELInactive){ - if (stream->el_type==ELControlSpeaker) - ms_filter_call_method(stream->volrecv,MS_VOLUME_SET_PEER,stream->volsend); - else ms_filter_call_method(stream->volsend,MS_VOLUME_SET_PEER,stream->volrecv); - } - if (stream->use_ng){ - int tmp=1; - ms_filter_call_method(stream->volsend,MS_VOLUME_ENABLE_NOISE_GATE,&tmp); - } - } - - if (stream->use_agc){ - int tmp=1; - if (stream->volsend==NULL) - stream->volsend=ms_filter_new(MS_VOLUME_ID); - ms_filter_call_method(stream->volsend,MS_VOLUME_ENABLE_AGC,&tmp); - } - - /* give the sound filters some properties */ - if (ms_filter_call_method(stream->soundread,MS_FILTER_SET_SAMPLE_RATE,&pt->clock_rate) != 0) { - /* need to add resampler*/ - if (stream->read_resampler == NULL) stream->read_resampler=ms_filter_new(MS_RESAMPLE_ID); - } - - if (ms_filter_call_method(stream->soundwrite,MS_FILTER_SET_SAMPLE_RATE,&pt->clock_rate) != 0) { - /* need to add resampler*/ - if (stream->write_resampler == NULL) stream->write_resampler=ms_filter_new(MS_RESAMPLE_ID); - } - - - tmp=1; - ms_filter_call_method(stream->soundwrite,MS_FILTER_SET_NCHANNELS, &tmp); - - /* give the encoder/decoder some parameters*/ - ms_filter_call_method(stream->encoder,MS_FILTER_SET_SAMPLE_RATE,&pt->clock_rate); - ms_message("Payload's bitrate is %i",pt->normal_bitrate); - if (pt->normal_bitrate>0){ - ms_message("Setting audio encoder network bitrate to %i",pt->normal_bitrate); - ms_filter_call_method(stream->encoder,MS_FILTER_SET_BITRATE,&pt->normal_bitrate); - } - ms_filter_call_method(stream->decoder,MS_FILTER_SET_SAMPLE_RATE,&pt->clock_rate); - - if (pt->send_fmtp!=NULL) ms_filter_call_method(stream->encoder,MS_FILTER_ADD_FMTP, (void*)pt->send_fmtp); - if (pt->recv_fmtp!=NULL) ms_filter_call_method(stream->decoder,MS_FILTER_ADD_FMTP,(void*)pt->recv_fmtp); - - /*create the equalizer*/ - stream->equalizer=ms_filter_new(MS_EQUALIZER_ID); - tmp=stream->eq_active; - ms_filter_call_method(stream->equalizer,MS_EQUALIZER_SET_ACTIVE,&tmp); - /*configure resampler if needed*/ - if (stream->read_resampler){ - audio_stream_configure_resampler(stream->read_resampler,stream->soundread,stream->rtpsend); - } - - if (stream->write_resampler){ - audio_stream_configure_resampler(stream->write_resampler,stream->rtprecv,stream->soundwrite); - } - /* and then connect all */ - /* tip: draw yourself the picture if you don't understand */ - - /*sending graph*/ - ms_connection_helper_start(&h); - ms_connection_helper_link(&h,stream->soundread,-1,0); - if (stream->read_resampler) - ms_connection_helper_link(&h,stream->read_resampler,0,0); - if (stream->ec) - ms_connection_helper_link(&h,stream->ec,1,1); - if (stream->volsend) - ms_connection_helper_link(&h,stream->volsend,0,0); - ms_connection_helper_link(&h,stream->encoder,0,0); - ms_connection_helper_link(&h,stream->rtpsend,0,-1); - - /*receiving graph*/ - ms_connection_helper_start(&h); - ms_connection_helper_link(&h,stream->rtprecv,-1,0); - ms_connection_helper_link(&h,stream->decoder,0,0); - ms_connection_helper_link(&h,stream->dtmfgen,0,0); - if (stream->equalizer) - ms_connection_helper_link(&h,stream->equalizer,0,0); - if (stream->volrecv) - ms_connection_helper_link(&h,stream->volrecv,0,0); - if (stream->ec) - ms_connection_helper_link(&h,stream->ec,0,0); - if (stream->write_resampler) - ms_connection_helper_link(&h,stream->write_resampler,0,0); - ms_connection_helper_link(&h,stream->soundwrite,0,-1); - - /* create ticker */ - stream->ticker=ms_ticker_new(); - ms_ticker_set_name(stream->ticker,"Audio MSTicker"); - ms_ticker_attach(stream->ticker,stream->soundread); - ms_ticker_attach(stream->ticker,stream->rtprecv); - - return 0; -} - - -int audio_stream_start_with_files(AudioStream *stream, RtpProfile *prof,const char *remip, int remport, - int rem_rtcp_port, int pt,int jitt_comp, const char *infile, const char * outfile) -{ - return audio_stream_start_full(stream,prof,remip,remport,rem_rtcp_port,pt,jitt_comp,infile,outfile,NULL,NULL,FALSE); -} - -AudioStream * audio_stream_start(RtpProfile *prof,int locport,const char *remip,int remport,int profile,int jitt_comp,bool_t use_ec) -{ - MSSndCard *sndcard_playback; - MSSndCard *sndcard_capture; - AudioStream *stream; - sndcard_capture=ms_snd_card_manager_get_default_capture_card(ms_snd_card_manager_get()); - sndcard_playback=ms_snd_card_manager_get_default_playback_card(ms_snd_card_manager_get()); - if (sndcard_capture==NULL || sndcard_playback==NULL) - return NULL; - stream=audio_stream_new(locport, ms_is_ipv6(remip)); - if (audio_stream_start_full(stream,prof,remip,remport,remport+1,profile,jitt_comp,NULL,NULL,sndcard_playback,sndcard_capture,use_ec)==0) return stream; - audio_stream_free(stream); - return NULL; -} - -AudioStream *audio_stream_start_with_sndcards(RtpProfile *prof,int locport,const char *remip,int remport,int profile,int jitt_comp,MSSndCard *playcard, MSSndCard *captcard, bool_t use_ec) -{ - AudioStream *stream; - if (playcard==NULL) { - ms_error("No playback card."); - return NULL; - } - if (captcard==NULL) { - ms_error("No capture card."); - return NULL; - } - stream=audio_stream_new(locport, ms_is_ipv6(remip)); - if (audio_stream_start_full(stream,prof,remip,remport,remport+1,profile,jitt_comp,NULL,NULL,playcard,captcard,use_ec)==0) return stream; - audio_stream_free(stream); - return NULL; -} - -void audio_stream_set_rtcp_information(AudioStream *st, const char *cname, const char *tool){ - if (st->session!=NULL){ - rtp_session_set_source_description(st->session,cname,NULL,NULL,NULL,NULL,tool , "This is free software (GPL) !"); - } -} - -void audio_stream_play(AudioStream *st, const char *name){ - if (ms_filter_get_id(st->soundread)==MS_FILE_PLAYER_ID){ - ms_filter_call_method_noarg(st->soundread,MS_FILE_PLAYER_CLOSE); - ms_filter_call_method(st->soundread,MS_FILE_PLAYER_OPEN,(void*)name); - if (st->read_resampler){ - audio_stream_configure_resampler(st,st->soundread,st->rtpsend); - } - ms_filter_call_method_noarg(st->soundread,MS_FILE_PLAYER_START); - }else{ - ms_error("Cannot play file: the stream hasn't been started with" - " audio_stream_start_with_files"); - } -} - -void audio_stream_record(AudioStream *st, const char *name){ - if (ms_filter_get_id(st->soundwrite)==MS_FILE_REC_ID){ - ms_filter_call_method_noarg(st->soundwrite,MS_FILE_REC_CLOSE); - ms_filter_call_method(st->soundwrite,MS_FILE_REC_OPEN,(void*)name); - ms_filter_call_method_noarg(st->soundwrite,MS_FILE_REC_START); - }else{ - ms_error("Cannot record file: the stream hasn't been started with" - " audio_stream_start_with_files"); - } -} - - -AudioStream *audio_stream_new(int locport, bool_t ipv6){ - AudioStream *stream=(AudioStream *)ms_new0(AudioStream,1); - stream->session=create_duplex_rtpsession(locport,ipv6); - stream->rtpsend=ms_filter_new(MS_RTP_SEND_ID); - stream->play_dtmfs=TRUE; - stream->use_gc=FALSE; - stream->use_agc=FALSE; - stream->use_ng=FALSE; - return stream; -} - -void audio_stream_play_received_dtmfs(AudioStream *st, bool_t yesno){ - st->play_dtmfs=yesno; -} - -int audio_stream_start_now(AudioStream *stream, RtpProfile * prof, const char *remip, int remport, int rem_rtcp_port, int payload_type, int jitt_comp, MSSndCard *playcard, MSSndCard *captcard, bool_t use_ec){ - return audio_stream_start_full(stream,prof,remip,remport,rem_rtcp_port, - payload_type,jitt_comp,NULL,NULL,playcard,captcard,use_ec); -} - -void audio_stream_set_relay_session_id(AudioStream *stream, const char *id){ - ms_filter_call_method(stream->rtpsend, MS_RTP_SEND_SET_RELAY_SESSION_ID,(void*)id); -} - -void audio_stream_set_echo_canceller_params(AudioStream *st, int tail_len_ms, int delay_ms, int framesize){ - st->ec_tail_len=tail_len_ms; - st->ec_delay=delay_ms; - st->ec_framesize=framesize; -} - -void audio_stream_enable_echo_limiter(AudioStream *stream, EchoLimiterType type){ - stream->el_type=type; -} - -void audio_stream_enable_gain_control(AudioStream *stream, bool_t val){ - stream->use_gc=val; -} - -void audio_stream_enable_automatic_gain_control(AudioStream *stream, bool_t val){ - stream->use_agc=val; -} - -void audio_stream_enable_noise_gate(AudioStream *stream, bool_t val){ - stream->use_ng=val; -} - -void audio_stream_set_mic_gain(AudioStream *stream, float gain){ - if (stream->volsend){ - ms_filter_call_method(stream->volsend,MS_VOLUME_SET_GAIN,&gain); - }else ms_warning("Could not apply gain: gain control wasn't activated. " - "Use audio_stream_enable_gain_control() before starting the stream."); -} - -void audio_stream_enable_equalizer(AudioStream *stream, bool_t enabled){ - stream->eq_active=enabled; - if (stream->equalizer){ - int tmp=enabled; - ms_filter_call_method(stream->equalizer,MS_EQUALIZER_SET_ACTIVE,&tmp); - } -} - -void audio_stream_equalizer_set_gain(AudioStream *stream, int frequency, float gain, int freq_width){ - if (stream->equalizer){ - MSEqualizerGain d; - d.frequency=frequency; - d.gain=gain; - d.width=freq_width; - ms_filter_call_method(stream->equalizer,MS_EQUALIZER_SET_GAIN,&d); - } -} - -void audio_stream_stop(AudioStream * stream) -{ - if (stream->ticker){ - MSConnectionHelper h; - ms_ticker_detach(stream->ticker,stream->soundread); - ms_ticker_detach(stream->ticker,stream->rtprecv); - - rtp_stats_display(rtp_session_get_stats(stream->session),"Audio session's RTP statistics"); - - /*dismantle the outgoing graph*/ - ms_connection_helper_start(&h); - ms_connection_helper_unlink(&h,stream->soundread,-1,0); - if (stream->read_resampler!=NULL) - ms_connection_helper_unlink(&h,stream->read_resampler,0,0); - if (stream->ec!=NULL) - ms_connection_helper_unlink(&h,stream->ec,1,1); - if (stream->volsend!=NULL) - ms_connection_helper_unlink(&h,stream->volsend,0,0); - ms_connection_helper_unlink(&h,stream->encoder,0,0); - ms_connection_helper_unlink(&h,stream->rtpsend,0,-1); - - /*dismantle the receiving graph*/ - ms_connection_helper_start(&h); - ms_connection_helper_unlink(&h,stream->rtprecv,-1,0); - ms_connection_helper_unlink(&h,stream->decoder,0,0); - ms_connection_helper_unlink(&h,stream->dtmfgen,0,0); - if (stream->equalizer) - ms_connection_helper_unlink(&h,stream->equalizer,0,0); - if (stream->volrecv!=NULL) - ms_connection_helper_unlink(&h,stream->volrecv,0,0); - if (stream->ec!=NULL) - ms_connection_helper_unlink(&h,stream->ec,0,0); - if (stream->write_resampler!=NULL) - ms_connection_helper_unlink(&h,stream->write_resampler,0,0); - ms_connection_helper_unlink(&h,stream->soundwrite,0,-1); - - } - audio_stream_free(stream); -} - -RingStream * ring_start(const char *file, int interval, MSSndCard *sndcard){ - return ring_start_with_cb(file,interval,sndcard,NULL,NULL); -} - -RingStream * ring_start_with_cb(const char *file,int interval,MSSndCard *sndcard, MSFilterNotifyFunc func,void * user_data) -{ - RingStream *stream; - int tmp; - stream=(RingStream *)ms_new0(RingStream,1); - stream->source=ms_filter_new(MS_FILE_PLAYER_ID); - if (ms_filter_call_method(stream->source,MS_FILE_PLAYER_OPEN,(void*)file)<0){ - ms_filter_destroy(stream->source); - ms_free(stream); - return NULL; - } - ms_filter_call_method(stream->source,MS_FILE_PLAYER_LOOP,&interval); - ms_filter_call_method_noarg(stream->source,MS_FILE_PLAYER_START); - if (func!=NULL) - ms_filter_set_notify_callback(stream->source,func,user_data); - stream->sndwrite=ms_snd_card_create_writer(sndcard); - ms_filter_call_method(stream->source,MS_FILTER_GET_SAMPLE_RATE,&tmp); - ms_filter_call_method(stream->sndwrite,MS_FILTER_SET_SAMPLE_RATE,&tmp); - ms_filter_call_method(stream->source,MS_FILTER_GET_NCHANNELS,&tmp); - ms_filter_call_method(stream->sndwrite,MS_FILTER_SET_NCHANNELS,&tmp); - stream->ticker=ms_ticker_new(); - ms_ticker_set_name(stream->ticker,"Audio (ring) MSTicker"); - ms_filter_link(stream->source,0,stream->sndwrite,0); - ms_ticker_attach(stream->ticker,stream->source); - return stream; -} - -void ring_stop(RingStream *stream){ - ms_ticker_detach(stream->ticker,stream->source); - ms_filter_unlink(stream->source,0,stream->sndwrite,0); - ms_ticker_destroy(stream->ticker); - ms_filter_destroy(stream->source); - ms_filter_destroy(stream->sndwrite); - ms_free(stream); -#ifdef _WIN32_WCE - ms_warning("Sleeping a bit after closing the audio device..."); - ms_sleep(1); -#endif -} - - -int audio_stream_send_dtmf(AudioStream *stream, char dtmf) -{ - if (stream->rtpsend) - ms_filter_call_method(stream->rtpsend,MS_RTP_SEND_SEND_DTMF,&dtmf); - if (stream->dtmfgen) - ms_filter_call_method(stream->dtmfgen,MS_DTMF_GEN_PUT,&dtmf); - return 0; -} diff --git a/linphone/mediastreamer2/src/dsptools.c b/linphone/mediastreamer2/src/dsptools.c deleted file mode 100644 index 71ea227a3..000000000 --- a/linphone/mediastreamer2/src/dsptools.c +++ /dev/null @@ -1,386 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2009 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* This file contains useful DSP routines from the speex project. -*/ - -/* Copyright (C) 2002-2006 Jean-Marc Valin - File: filters.c - Various analysis/synthesis filters - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Xiph.org Foundation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include - -#ifdef HAVE_ALLOCA_H -#include -#else -#if !defined(__APPLE__) -#include -#endif -#endif - -#define ALLOC(var,size,type) var = alloca(sizeof(type)*(size)) - -#if 0 -//#ifdef ARCH_BFIN - -static void filter_mem16(const ms_word16_t *_x, const ms_coef_t *num, const ms_coef_t *den, ms_word16_t *_y, int N, int ord, ms_mem_t *mem) -{ - VARDECL(ms_word32_t *xy2); - VARDECL(ms_word32_t *numden_a); - ms_word32_t *xy; - ms_word16_t *numden; - int i; - - ALLOC(xy2, (N+1), ms_word32_t); - ALLOC(numden_a, (2*ord+2), ms_word32_t); - xy = xy2+1; - numden = (ms_word16_t*) numden_a; - - for (i=0;i=0;--j){ - acc+=num[j]*mem[j]; - mem[j+1]=mem[j]; - } - y[i]=acc; - } -} - -#else - -void ms_fir_mem16(const ms_word16_t *x, const ms_coef_t *num, ms_word16_t *y, int N, int ord, ms_mem_t *mem){ - int i,j; - ms_word16_t xi; - ms_word32_t acc; - int shift=0; /* REVISIT: empiric value...*/ - - for(i=0;i>shift; - for(j=ord-2;j>=0;--j){ - acc+=(((ms_word32_t)num[j])*mem[j])>>shift; - mem[j+1]=mem[j]; - } - y[i]=(ms_word16_t)SATURATE16(acc>>14,32767); - } -} - - -#endif - -#endif - -#endif - -#ifdef MS_FIXED_POINT -static int maximize_range(ms_word16_t *in, ms_word16_t *out, ms_word16_t bound, int len) -{ - int i, shift; - ms_word16_t max_val = 0; - for (i=0;imax_val) - max_val = in[i]; - if (-in[i]>max_val) - max_val = -in[i]; - } - shift=0; - while (max_val <= (bound>>1) && max_val != 0) - { - max_val <<= 1; - shift++; - } - for (i=0;iforward = kiss_fftr_alloc(size,0,NULL,NULL); - table->backward = kiss_fftr_alloc(size,1,NULL,NULL); - table->N = size; - return table; -} - -void ms_fft_destroy(void *table) -{ - struct kiss_config *t = (struct kiss_config *)table; - kiss_fftr_free(t->forward); - kiss_fftr_free(t->backward); - ms_free(table); -} - -#ifdef MS_FIXED_POINT - -void ms_fft(void *table, ms_word16_t *in, ms_word16_t *out) -{ - int shift; - struct kiss_config *t = (struct kiss_config *)table; - shift = maximize_range(in, in, 32000, t->N); - kiss_fftr2(t->forward, in, out); - renorm_range(in, in, shift, t->N); - renorm_range(out, out, shift, t->N); -} - -#else - -void ms_fft(void *table, ms_word16_t *in, ms_word16_t *out) -{ - int i; - float scale; - struct kiss_config *t = (struct kiss_config *)table; - scale = 1./t->N; - kiss_fftr2(t->forward, in, out); - for (i=0;iN;i++) - out[i] *= scale; -} -#endif - -void ms_ifft(void *table, ms_word16_t *in, ms_word16_t *out) -{ - struct kiss_config *t = (struct kiss_config *)table; - kiss_fftri2(t->backward, in, out); -} diff --git a/linphone/mediastreamer2/src/dtmfgen.c b/linphone/mediastreamer2/src/dtmfgen.c deleted file mode 100644 index 74cbeb17e..000000000 --- a/linphone/mediastreamer2/src/dtmfgen.c +++ /dev/null @@ -1,204 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/dtmfgen.h" - - -#include - -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - -struct DtmfGenState{ - int rate; - int dur; - int pos; - float highfreq; - float lowfreq; - char dtmf; -}; - -typedef struct DtmfGenState DtmfGenState; - -static void dtmfgen_init(MSFilter *f){ - DtmfGenState *s=(DtmfGenState *)ms_new(DtmfGenState,1); - s->rate=8000; - s->dur=s->rate/10; - s->pos=0; - s->dtmf=0; - f->data=s; -} - -static void dtmfgen_uninit(MSFilter *f){ - ms_free(f->data); -} - -static int dtmfgen_put(MSFilter *f, void *arg){ - DtmfGenState *s=(DtmfGenState*)f->data; - const char *dtmf=(char*)arg; - s->pos=0; - switch(dtmf[0]){ - case '0': - s->lowfreq=941; - s->highfreq=1336; - break; - case '1': - s->lowfreq=697; - s->highfreq=1209; - break; - case '2': - s->lowfreq=697; - s->highfreq=1336; - break; - case '3': - s->lowfreq=697; - s->highfreq=1477; - break; - case '4': - s->lowfreq=770; - s->highfreq=1209; - break; - case '5': - s->lowfreq=770; - s->highfreq=1336; - break; - case '6': - s->lowfreq=770; - s->highfreq=1477; - break; - case '7': - s->lowfreq=852; - s->highfreq=1209; - break; - case '8': - s->lowfreq=852; - s->highfreq=1336; - break; - case '9': - s->lowfreq=852; - s->highfreq=1477; - break; - case '*': - s->lowfreq=941; - s->highfreq=1209; - break; - case '#': - s->lowfreq=941; - s->highfreq=1477; - break; - case 'A': - s->lowfreq=697; - s->highfreq=1633; - break; - case 'B': - s->lowfreq=770; - s->highfreq=1633; - break; - case 'C': - s->lowfreq=852; - s->highfreq=1633; - break; - case 'D': - s->lowfreq=941; - s->highfreq=1633; - break; - default: - ms_warning("Not a dtmf key."); - return -1; - } - s->lowfreq=s->lowfreq/s->rate; - s->highfreq=s->highfreq/s->rate; - - s->dtmf=dtmf[0]; - return 0; -} - -static int dtmfgen_set_rate(MSFilter *f, void *arg){ - DtmfGenState *s=(DtmfGenState*)f->data; - s->rate=*((int*)arg); - s->dur=s->rate/10; - return 0; -} - -static void dtmfgen_process(MSFilter *f){ - mblk_t *m; - DtmfGenState *s=(DtmfGenState*)f->data; - - while((m=ms_queue_get(f->inputs[0]))!=NULL){ - if (s->dtmf!=0){ - int nsamples=(m->b_wptr-m->b_rptr)/2; - int i; - int16_t *sample=(int16_t*)m->b_rptr; - for (i=0;iposdur;i++,s->pos++){ - sample[i]=(int16_t)(10000.0*sin(2*M_PI*(float)s->pos*s->lowfreq)); - sample[i]+=(int16_t)(10000.0*sin(2*M_PI*(float)s->pos*s->highfreq)); - } - if (s->pos==s->dur){ - s->pos=0; - s->dtmf=0; - } - } - ms_queue_put(f->outputs[0],m); - } -} - -MSFilterMethod dtmfgen_methods[]={ - { MS_FILTER_SET_SAMPLE_RATE , dtmfgen_set_rate }, - { MS_DTMF_GEN_PUT , dtmfgen_put }, - { 0 , NULL } -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_dtmf_gen_desc={ - MS_DTMF_GEN_ID, - "MSDtmfGen", - N_("DTMF generator"), - MS_FILTER_OTHER, - NULL, - 1, - 1, - dtmfgen_init, - NULL, - dtmfgen_process, - NULL, - dtmfgen_uninit, - dtmfgen_methods -}; - -#else - -MSFilterDesc ms_dtmf_gen_desc={ - .id=MS_DTMF_GEN_ID, - .name="MSDtmfGen", - .text=N_("DTMF generator"), - .category=MS_FILTER_OTHER, - .ninputs=1, - .noutputs=1, - .init=dtmfgen_init, - .process=dtmfgen_process, - .uninit=dtmfgen_uninit, - .methods=dtmfgen_methods -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_dtmf_gen_desc) - diff --git a/linphone/mediastreamer2/src/dxfilter.cpp b/linphone/mediastreamer2/src/dxfilter.cpp deleted file mode 100644 index 262d5fe53..000000000 --- a/linphone/mediastreamer2/src/dxfilter.cpp +++ /dev/null @@ -1,884 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifdef VIDEO_ENABLED - -#if !defined(_WIN32_WCE) //Allready defined for wince -#define UNICODE -#endif - -#include -#include - -#if !defined(_WIN32_WCE) -EXTERN_C const CLSID CLSID_NullRenderer; -#endif -#include "dxfilter.h" - -#pragma warning(disable: 4800) - - -const AMOVIESETUP_PIN psudDXFilterPins[] = -{ { L"Input" // strName - , FALSE // bRendered - , FALSE // bOutput - , FALSE // bZero - , FALSE // bMany - , &CLSID_NULL // clsConnectsToFilter - , L"" // strConnectsToPin - , 0 // nTypes - , NULL // lpTypes - } -, { L"Output" // strName - , FALSE // bRendered - , TRUE // bOutput - , FALSE // bZero - , FALSE // bMany - , &CLSID_NULL // clsConnectsToFilter - , L"" // strConnectsToPin - , 0 // nTypes - , NULL // lpTypes - } -}; - -const AMOVIESETUP_FILTER sudDXFilter = -{ &CLSID_DXFilter // clsID -, L"DXFilter for mediastreamer2" // strName -, MERIT_DO_NOT_USE // dwMerit -, 2 // nPins -, psudDXFilterPins }; // lpPin - - -// Needed for the CreateInstance mechanism -CFactoryTemplate g_Templates[]= -{ - { L"DirectX Filter for mediastreamer2" - , &CLSID_DXFilter - , CDXFilter::CreateInstance - , NULL - , &sudDXFilter } - -}; - -int g_cTemplates = sizeof(g_Templates)/sizeof(g_Templates[0]); - - -//////////////////////////////////////////////////////////////////////// -// -// Exported entry points for registration and unregistration -// (in this case they only call through to default implementations). -// -//////////////////////////////////////////////////////////////////////// - -STDAPI DllRegisterServer() -{ - return AMovieDllRegisterServer2(TRUE); -} - -STDAPI DllUnregisterServer() -{ - return AMovieDllRegisterServer2(FALSE); -} - -// -// DllEntryPoint -// -extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID); - -BOOL APIENTRY DllMain(HANDLE hModule, - DWORD dwReason, - LPVOID lpReserved) -{ - return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved); -} - -// -// CreateInstance -// -// Provide the way for COM to create a CDXFilter object -// -CUnknown * WINAPI CDXFilter::CreateInstance(LPUNKNOWN punk, HRESULT *phr) -{ - /* ASSERT(phr); */ - - // assuming we don't want to modify the data - CDXFilter *pNewObject = new CDXFilter(punk, phr, FALSE); - - if(pNewObject == NULL) { - if (phr) - *phr = E_OUTOFMEMORY; - } - - return pNewObject; - -} // CreateInstance - - -//---------------------------------------------------------------------------- -// -//---------------------------------------------------------------------------- - -CDXFilter::CDXFilter( IUnknown * pOuter, HRESULT * phr, BOOL ModifiesData ) - : CTransInPlaceFilter( TEXT("DXFilter"), (IUnknown*) pOuter, - CLSID_DXFilter, phr -#if !defined(_WIN32_WCE) - ,(BOOL)ModifiesData -#endif - ) - , m_callback( NULL ) -{ - // this is used to override the input pin with our own - m_pInput = (CTransInPlaceInputPin*) new CDXFilterInPin( this, phr ); - if( !m_pInput ) - { - if (phr) - *phr = E_OUTOFMEMORY; - } - - // Ensure that the output pin gets created. This is necessary because our - // SetDeliveryBuffer() method assumes that the input/output pins are created, but - // the output pin isn't created until GetPin() is called. The - // CTransInPlaceFilter::GetPin() method will create the output pin, since we - // have not already created one. - IPin *pOutput = GetPin(1); - // The pointer is not AddRef'ed by GetPin(), so don't release it -} - -STDMETHODIMP CDXFilter::NonDelegatingQueryInterface( REFIID riid, void ** ppv) -{ - CheckPointer(ppv,E_POINTER); - - if(riid == IID_IDXFilter) { - return GetInterface((IDXFilter *) this, ppv); - } - else { - return CTransInPlaceFilter::NonDelegatingQueryInterface(riid, ppv); - } -} - - -//---------------------------------------------------------------------------- -// This is where you force the sample grabber to connect with one type -// or the other. What you do here is crucial to what type of data your -// app will be dealing with in the sample grabber's callback. For instance, -// if you don't enforce right-side-up video in this call, you may not get -// right-side-up video in your callback. It all depends on what you do here. -//---------------------------------------------------------------------------- - -HRESULT CDXFilter::CheckInputType( const CMediaType * pmt ) -{ - CheckPointer(pmt,E_POINTER); - CAutoLock lock( &m_Lock ); - - // if the major type is not set, then accept anything - - GUID g = *m_mtAccept.Type( ); - if( g == GUID_NULL ) - { - return NOERROR; - } - - // if the major type is set, don't accept anything else - - if( g != *pmt->Type( ) ) - { - return VFW_E_INVALID_MEDIA_TYPE; - } - - // subtypes must match, if set. if not set, accept anything - VIDEOINFO *pvi = (VIDEOINFO *)pmt->Format(); - - g = *m_mtAccept.Subtype( ); - if( g == GUID_NULL ) - { - return NOERROR; - } -#if 0 - if( MEDIASUBTYPE_RGB24 == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_YVU9 == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_Y411 == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_Y41P == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_YUY2 == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_YVYU == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_UYVY == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_Y211 == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_YV12 == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_CLJR == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_IF09 == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_CPLA == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_MJPG == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_TVMJ == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_WAKE == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_CFCC == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_IJPG == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_Plum == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_RGB1 == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_RGB1 == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_RGB1 == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_RGB4 == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_RGB8 == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_RGB565 == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_RGB555 == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_RGB24 == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_RGB32 == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_Overlay == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_MPEG1Packet == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_MPEG1Payload == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_MPEG1AudioPayload == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIATYPE_MPEG1SystemStream == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_MPEG1System == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_MPEG1VideoCD == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_MPEG1Video == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_Avi == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_Asf == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_QTMovie == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_QTRpza == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_QTSmc == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_QTRle == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_QTJpeg == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_PCM == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_WAVE == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_AU == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_AIFF == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_DssVideo == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_VPVideo == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_VPVBI == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_VPVideo == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_VPVideo == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_VPVideo == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_VPVideo == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; - if( MEDIASUBTYPE_VPVideo == *pmt->Subtype( ) ) - return VFW_E_INVALID_MEDIA_TYPE; -#endif - - if( g != *pmt->Subtype( ) ) - { - return VFW_E_INVALID_MEDIA_TYPE; - } - - // format types must match, if one is set - - g = *m_mtAccept.FormatType( ); - if( g == GUID_NULL ) - { - return NOERROR; - } - if( g != *pmt->FormatType( ) ) - { - return VFW_E_INVALID_MEDIA_TYPE; - } - - // at this point, for this sample code, this is good enough, - // but you may want to make it more strict - - //compare sizes - //VIDEOINFO *pvi = (VIDEOINFO *)pmt->Format(); - VIDEOINFO *pvi2 = (VIDEOINFO *)m_mtAccept.Format(); - if (pvi2==NULL) - return NOERROR; - - if (pvi==NULL) - return VFW_E_INVALID_MEDIA_TYPE; -#if !defined(_WIN32_WCE) - if (pvi->bmiHeader.biCompression!=pvi2->bmiHeader.biCompression) - return VFW_E_INVALID_MEDIA_TYPE; -#endif - if (pvi->bmiHeader.biBitCount!=pvi2->bmiHeader.biBitCount) - return VFW_E_INVALID_MEDIA_TYPE; - if (pvi->bmiHeader.biWidth!=pvi2->bmiHeader.biWidth) - return VFW_E_INVALID_MEDIA_TYPE; - if (pvi->bmiHeader.biHeight!=pvi2->bmiHeader.biHeight) - return VFW_E_INVALID_MEDIA_TYPE; - if (pvi->bmiHeader.biSizeImage!=pvi2->bmiHeader.biSizeImage) - return VFW_E_INVALID_MEDIA_TYPE; - - return NOERROR; -} - - -//---------------------------------------------------------------------------- -// This bit is almost straight out of the base classes. -// We override this so we can handle Transform( )'s error -// result differently. -//---------------------------------------------------------------------------- - -HRESULT CDXFilter::Receive( IMediaSample * pms ) -{ - CheckPointer(pms,E_POINTER); - - HRESULT hr; - AM_SAMPLE2_PROPERTIES * const pProps = m_pInput->SampleProps(); - - if (pProps->dwStreamId != AM_STREAM_MEDIA) - { - if( m_pOutput->IsConnected() ) - return m_pOutput->Deliver(pms); - else - return NOERROR; - } - -#if !defined(_WIN32_WCE) - if (UsingDifferentAllocators()) - { - // We have to copy the data. - - pms = Copy(pms); - - if (pms == NULL) - { - return E_UNEXPECTED; - } - } -#endif - - // have the derived class transform the data - hr = Transform(pms); - - if (FAILED(hr)) - { - //DbgLog((LOG_TRACE, 1, TEXT("Error from TransInPlace"))); -#if !defined(_WIN32_WCE) - if (UsingDifferentAllocators()) - { - pms->Release(); - } -#endif - return hr; - } - - if (hr == NOERROR) - { - hr = m_pOutput->Deliver(pms); - } - - // release the output buffer. If the connected pin still needs it, - // it will have addrefed it itself. -#if !defined(_WIN32_WCE) - if (UsingDifferentAllocators()) - { - pms->Release(); - } -#endif - return hr; -} - - -//---------------------------------------------------------------------------- -// Transform -//---------------------------------------------------------------------------- - -HRESULT CDXFilter::Transform ( IMediaSample * pms ) -{ - CheckPointer(pms,E_POINTER); - CAutoLock lock( &m_Lock ); - - if( m_callback ) - { - REFERENCE_TIME StartTime, StopTime; - pms->GetTime( &StartTime, &StopTime); - - StartTime += m_pInput->CurrentStartTime( ); - StopTime += m_pInput->CurrentStartTime( ); - - BOOL * pTypeChanged = &((CDXFilterInPin*) m_pInput)->m_bMediaTypeChanged; - - HRESULT hr = m_callback( pms, &StartTime, &StopTime, *pTypeChanged ); - - *pTypeChanged = FALSE; // now that we notified user, we can clear it - - return hr; - } - - return NOERROR; -} - - -//---------------------------------------------------------------------------- -// SetAcceptedMediaType -//---------------------------------------------------------------------------- - -STDMETHODIMP CDXFilter::SetAcceptedMediaType( const CMediaType * pmt ) -{ - CAutoLock lock( &m_Lock ); - - if( !pmt ) - { - m_mtAccept = CMediaType( ); - return NOERROR; - } - - HRESULT hr; -#if !defined(_WIN32_WCE) - hr = CopyMediaType( &m_mtAccept, pmt ); -#else - hr=S_OK; - CopyMediaType( &m_mtAccept, pmt ); -#endif - return hr; -} - -//---------------------------------------------------------------------------- -// GetAcceptedMediaType -//---------------------------------------------------------------------------- - -STDMETHODIMP CDXFilter::GetConnectedMediaType( CMediaType * pmt ) -{ - if( !m_pInput || !m_pInput->IsConnected( ) ) - { - return VFW_E_NOT_CONNECTED; - } - - return m_pInput->ConnectionMediaType( pmt ); -} - - -//---------------------------------------------------------------------------- -// SetCallback -//---------------------------------------------------------------------------- - -STDMETHODIMP CDXFilter::SetCallback( SAMPLECALLBACK Callback ) -{ - CAutoLock lock( &m_Lock ); - - m_callback = Callback; - - return NOERROR; -} - - -//---------------------------------------------------------------------------- -// inform the input pin of the allocator buffer we wish to use. See the -// input pin's SetDeliverBuffer method for comments. -//---------------------------------------------------------------------------- - -STDMETHODIMP CDXFilter::SetDeliveryBuffer( ALLOCATOR_PROPERTIES props, BYTE * m_pBuffer ) -{ - // have the input/output pins been created? - if( !InputPin( ) || !OutputPin( ) ) - { - return E_POINTER; - } - - // they can't be connected if we're going to be changing delivery buffers - // - if( InputPin( )->IsConnected( ) || OutputPin( )->IsConnected( ) ) - { - return E_INVALIDARG; - } - - return ((CDXFilterInPin*)m_pInput)->SetDeliveryBuffer( props, m_pBuffer ); -} - - -//---------------------------------------------------------------------------- -// used to help speed input pin connection times. We return a partially -// specified media type - only the main type is specified. If we return -// anything BUT a major type, some codecs written improperly will crash -//---------------------------------------------------------------------------- - -HRESULT CDXFilterInPin::GetMediaType( int iPosition, CMediaType * pMediaType ) -{ - CheckPointer(pMediaType,E_POINTER); - - if (iPosition < 0) { - return E_INVALIDARG; - } - if (iPosition > 0) { - return VFW_S_NO_MORE_ITEMS; - } - - *pMediaType = CMediaType( ); - pMediaType->SetType( ((CDXFilter*)m_pFilter)->m_mtAccept.Type( ) ); - - return S_OK; -} - - -//---------------------------------------------------------------------------- -// override the CTransInPlaceInputPin's method, and return a new enumerator -// if the input pin is disconnected. This will allow GetMediaType to be -// called. If we didn't do this, EnumMediaTypes returns a failure code -// and GetMediaType is never called. -//---------------------------------------------------------------------------- - -STDMETHODIMP CDXFilterInPin::EnumMediaTypes( IEnumMediaTypes **ppEnum ) -{ - CheckPointer(ppEnum,E_POINTER); - ValidateReadWritePtr(ppEnum,sizeof(IEnumMediaTypes *)); - - // if the output pin isn't connected yet, offer the possibly - // partially specified media type that has been set by the user - - if( !((CDXFilter*)m_pTIPFilter)->OutputPin( )->IsConnected() ) - { - // Create a new reference counted enumerator - - *ppEnum = new CEnumMediaTypes( this, NULL ); - - return (*ppEnum) ? NOERROR : E_OUTOFMEMORY; - } - - // if the output pin is connected, offer it's fully qualified media type - - return ((CDXFilter*)m_pTIPFilter)->OutputPin( )->GetConnected()->EnumMediaTypes( ppEnum ); -} - - -//---------------------------------------------------------------------------- -// -//---------------------------------------------------------------------------- - -STDMETHODIMP CDXFilterInPin::NotifyAllocator( IMemAllocator *pAllocator, BOOL bReadOnly ) -{ - if( m_pPrivateAllocator ) - { - if( pAllocator != m_pPrivateAllocator ) - { - return E_FAIL; - } - else - { -#if !defined(_WIN32_WCE) - // if the upstream guy wants to be read only and we don't, then that's bad - // if the upstream guy doesn't request read only, but we do, that's okay - if( bReadOnly && !DXFilter( )->IsReadOnly( ) ) - { - return E_FAIL; - } -#endif - } - } - - return CTransInPlaceInputPin::NotifyAllocator( pAllocator, bReadOnly ); -} - - -//---------------------------------------------------------------------------- -// -//---------------------------------------------------------------------------- - -STDMETHODIMP CDXFilterInPin::GetAllocator( IMemAllocator **ppAllocator ) -{ - if( m_pPrivateAllocator ) - { - CheckPointer(ppAllocator,E_POINTER); - - *ppAllocator = m_pPrivateAllocator; - m_pPrivateAllocator->AddRef( ); - return NOERROR; - } - else - { - return CTransInPlaceInputPin::GetAllocator( ppAllocator ); - } -} - -//---------------------------------------------------------------------------- -// GetAllocatorRequirements: The upstream filter calls this to get our -// filter's allocator requirements. If the app has set the buffer, then -// we return those props. Otherwise, we use the default TransInPlace behavior. -//---------------------------------------------------------------------------- - -HRESULT CDXFilterInPin::GetAllocatorRequirements( ALLOCATOR_PROPERTIES *pProps ) -{ - CheckPointer(pProps,E_POINTER); - - if (m_pPrivateAllocator) - { - *pProps = m_allocprops; - return S_OK; - } - else - { - return CTransInPlaceInputPin::GetAllocatorRequirements(pProps); - } -} - - - - -//---------------------------------------------------------------------------- -// -//---------------------------------------------------------------------------- - -HRESULT CDXFilterInPin::SetDeliveryBuffer( ALLOCATOR_PROPERTIES props, BYTE * pBuffer ) -{ - // don't allow more than one buffer - - if( props.cBuffers != 1 ) - { - return E_INVALIDARG; - } - if( !pBuffer ) - { - return E_POINTER; - } - - m_allocprops = props; - m_pBuffer = pBuffer; - - // If there is an existing allocator, make sure that it is released - // to prevent a memory leak - if (m_pPrivateAllocator) - { - m_pPrivateAllocator->Release(); - m_pPrivateAllocator = NULL; - } - - HRESULT hr = S_OK; - - m_pPrivateAllocator = new CDXFilterAllocator( this, &hr ); - if( !m_pPrivateAllocator ) - { - return E_OUTOFMEMORY; - } - - m_pPrivateAllocator->AddRef( ); - return hr; -} - - -//---------------------------------------------------------------------------- -// -//---------------------------------------------------------------------------- - -HRESULT CDXFilterInPin::SetMediaType( const CMediaType *pmt ) -{ - m_bMediaTypeChanged = TRUE; - - return CTransInPlaceInputPin::SetMediaType( pmt ); -} - - -//---------------------------------------------------------------------------- -// don't allocate the memory, just use the buffer the app provided -//---------------------------------------------------------------------------- - -HRESULT CDXFilterAllocator::Alloc( ) -{ - // look at the base class code to see where this came from! - - CAutoLock lck(this); - - // Check he has called SetProperties - HRESULT hr = CBaseAllocator::Alloc(); - if (FAILED(hr)) { - return hr; - } - - // If the requirements haven't changed then don't reallocate - if (hr == S_FALSE) { - /* ASSERT(m_pBuffer); */ - return NOERROR; - } - /* ASSERT(hr == S_OK); we use this fact in the loop below */ - - // Free the old resources - if (m_pBuffer) { - ReallyFree(); - } - - // Compute the aligned size - LONG lAlignedSize = m_lSize + m_lPrefix; - if (m_lAlignment > 1) - { - LONG lRemainder = lAlignedSize % m_lAlignment; - if (lRemainder != 0) - { - lAlignedSize += (m_lAlignment - lRemainder); - } - } - - // Create the contiguous memory block for the samples - // making sure it's properly aligned (64K should be enough!) - /* ASSERT(lAlignedSize % m_lAlignment == 0); */ - - // don't create the buffer - use what was passed to us - // - m_pBuffer = m_pPin->m_pBuffer; - - if (m_pBuffer == NULL) { - return E_OUTOFMEMORY; - } - - LPBYTE pNext = m_pBuffer; - CMediaSample *pSample; - - /* ASSERT(m_lAllocated == 0); */ - - // Create the new samples - we have allocated m_lSize bytes for each sample - // plus m_lPrefix bytes per sample as a prefix. We set the pointer to - // the memory after the prefix - so that GetPointer() will return a pointer - // to m_lSize bytes. - for (; m_lAllocated < m_lCount; m_lAllocated++, pNext += lAlignedSize) - { - pSample = new CMediaSample( - NAME("Sample Grabber memory media sample"), - this, - &hr, - pNext + m_lPrefix, // GetPointer() value - m_lSize); // not including prefix - - /* ASSERT(SUCCEEDED(hr)); */ - if (pSample == NULL) - return E_OUTOFMEMORY; - - // This CANNOT fail - m_lFree.Add(pSample); - } - - m_bChanged = FALSE; - return NOERROR; -} - - -//---------------------------------------------------------------------------- -// don't really free the memory -//---------------------------------------------------------------------------- - -void CDXFilterAllocator::ReallyFree() -{ - // look at the base class code to see where this came from! - - // Should never be deleting this unless all buffers are freed - - /* ASSERT(m_lAllocated == m_lFree.GetCount()); */ - - // Free up all the CMediaSamples - - CMediaSample *pSample; - for (;;) - { - pSample = m_lFree.RemoveHead(); - if (pSample != NULL) - { - delete pSample; - } - else - { - break; - } - } - - m_lAllocated = 0; - - // don't free the buffer - let the app do it -} - - -//---------------------------------------------------------------------------- -// SetProperties: Called by the upstream filter to set the allocator -// properties. The application has already allocated the buffer, so we reject -// anything that is not compatible with that, and return the actual props. -//---------------------------------------------------------------------------- - -HRESULT CDXFilterAllocator::SetProperties( - ALLOCATOR_PROPERTIES *pRequest, - ALLOCATOR_PROPERTIES *pActual -) -{ - HRESULT hr = CMemAllocator::SetProperties(pRequest, pActual); - - if (FAILED(hr)) - { - return hr; - } - - ALLOCATOR_PROPERTIES *pRequired = &(m_pPin->m_allocprops); - if (pRequest->cbAlign != pRequired->cbAlign) - { - return VFW_E_BADALIGN; - } - if (pRequest->cbPrefix != pRequired->cbPrefix) - { - return E_FAIL; - } - if (pRequest->cbBuffer > pRequired->cbBuffer) - { - return E_FAIL; - } - if (pRequest->cBuffers > pRequired->cBuffers) - { - return E_FAIL; - } - - *pActual = *pRequired; - - m_lCount = pRequired->cBuffers; - m_lSize = pRequired->cbBuffer; - m_lAlignment = pRequired->cbAlign; - m_lPrefix = pRequired->cbPrefix; - - return S_OK; -} - -#endif diff --git a/linphone/mediastreamer2/src/dxfilter.h b/linphone/mediastreamer2/src/dxfilter.h deleted file mode 100644 index cc63f0de9..000000000 --- a/linphone/mediastreamer2/src/dxfilter.h +++ /dev/null @@ -1,231 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -// {4D6410BE-7643-4f43-B55F-8821A6FFB50A} -DEFINE_GUID(CLSID_DXFilter, -0x4d6410be, 0x7643, 0x4f43, 0xb5, 0x5f, 0x88, 0x21, 0xa6, 0xff, 0xb5, 0xa); - -// {52A7F345-CD92-442c-89C1-632C16AD5003} -DEFINE_GUID(IID_IDXFilter, -0x52a7f345, 0xcd92, 0x442c, 0x89, 0xc1, 0x63, 0x2c, 0x16, 0xad, 0x50, 0x3); - - -// We define a callback typedef for this example. -// Normally, you would make the DXFilter support a COM interface, -// and in one of its methods you would pass in a pointer to a COM interface -// used for calling back. See the DirectX documentation for the DXFilter -// for more information. - -typedef HRESULT (*SAMPLECALLBACK) ( - IMediaSample * pSample, - REFERENCE_TIME * StartTime, - REFERENCE_TIME * StopTime, - BOOL TypeChanged ); - - -// We define the interface the app can use to program us -MIDL_INTERFACE("6B652FFF-11FE-4FCE-92AD-0266B5D7C78F") -IDXFilter : public IUnknown -{ - public: - - virtual HRESULT STDMETHODCALLTYPE SetAcceptedMediaType( - const CMediaType *pType) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetConnectedMediaType( - CMediaType *pType) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetCallback( - SAMPLECALLBACK Callback) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDeliveryBuffer( - ALLOCATOR_PROPERTIES props, - BYTE *pBuffer) = 0; -}; - - -class CDXFilterInPin; -class CDXFilter; - -//---------------------------------------------------------------------------- -// This is a special allocator that KNOWS that the person who is creating it -// will only create one of them. It allocates CMediaSamples that only -// reference the buffer location that is set in the pin's renderer's -// data variable -//---------------------------------------------------------------------------- - -class CDXFilterAllocator : public CMemAllocator -{ - friend class CDXFilterInPin; - friend class CDXFilter; - -protected: - - // our pin who created us - // - CDXFilterInPin * m_pPin; - -public: - - CDXFilterAllocator( CDXFilterInPin * pParent, HRESULT *phr ) - : CMemAllocator( TEXT("DXFilterAllocator\0"), NULL, phr ) - , m_pPin( pParent ) - { - }; - - ~CDXFilterAllocator( ) - { - // wipe out m_pBuffer before we try to delete it. It's not an allocated - // buffer, and the default destructor will try to free it! - m_pBuffer = NULL; - } - - HRESULT Alloc( ); - - void ReallyFree(); - - // Override this to reject anything that does not match the actual buffer - // that was created by the application - STDMETHODIMP SetProperties(ALLOCATOR_PROPERTIES *pRequest, ALLOCATOR_PROPERTIES *pActual); - -}; - -//---------------------------------------------------------------------------- -// we override the input pin class so we can provide a media type -// to speed up connection times. When you try to connect a filesourceasync -// to a transform filter, DirectShow will insert a splitter and then -// start trying codecs, both audio and video, video codecs first. If -// your sample grabber's set to connect to audio, unless we do this, it -// will try all the video codecs first. Connection times are sped up x10 -// for audio with just this minor modification! -//---------------------------------------------------------------------------- - -class CDXFilterInPin : public CTransInPlaceInputPin -{ - friend class CDXFilterAllocator; - friend class CDXFilter; - - CDXFilterAllocator * m_pPrivateAllocator; - ALLOCATOR_PROPERTIES m_allocprops; - BYTE * m_pBuffer; - BOOL m_bMediaTypeChanged; - -protected: - - CDXFilter * DXFilter( ) { return (CDXFilter*) m_pFilter; } - HRESULT SetDeliveryBuffer( ALLOCATOR_PROPERTIES props, BYTE * m_pBuffer ); - -public: - - CDXFilterInPin( CTransInPlaceFilter * pFilter, HRESULT * pHr ) - : CTransInPlaceInputPin( TEXT("DXFilterInputPin\0"), pFilter, pHr, L"Input\0" ) - , m_pPrivateAllocator( NULL ) - , m_pBuffer( NULL ) - , m_bMediaTypeChanged( FALSE ) - { - memset( &m_allocprops, 0, sizeof( m_allocprops ) ); - } - - ~CDXFilterInPin( ) - { - if( m_pPrivateAllocator ) delete m_pPrivateAllocator; - } - - // override to provide major media type for fast connects - - HRESULT GetMediaType( int iPosition, CMediaType *pMediaType ); - - // override this or GetMediaType is never called - - STDMETHODIMP EnumMediaTypes( IEnumMediaTypes **ppEnum ); - - // override this to refuse any allocators besides - // the one the user wants, if this is set - - STDMETHODIMP NotifyAllocator( IMemAllocator *pAllocator, BOOL bReadOnly ); - - // override this so we always return the special allocator, if necessary - - STDMETHODIMP GetAllocator( IMemAllocator **ppAllocator ); - - HRESULT SetMediaType( const CMediaType *pmt ); - - // we override this to tell whoever's upstream of us what kind of - // properties we're going to demand to have - // - STDMETHODIMP GetAllocatorRequirements( ALLOCATOR_PROPERTIES *pProps ); - - - -}; - -//---------------------------------------------------------------------------- -// -//---------------------------------------------------------------------------- - -class CDXFilter : public CTransInPlaceFilter, - public IDXFilter -{ - friend class CDXFilterInPin; - friend class CDXFilterAllocator; - -protected: - - CMediaType m_mtAccept; - SAMPLECALLBACK m_callback; - CCritSec m_Lock; // serialize access to our data - -#if !defined(_WIN32_WCE) - BOOL IsReadOnly( ) { return !m_bModifiesData; } -#endif - - // PURE, override this to ensure we get - // connected with the right media type - HRESULT CheckInputType( const CMediaType * pmt ); - - // PURE, override this to callback - // the user when a sample is received - HRESULT Transform( IMediaSample * pms ); - - // override this so we can return S_FALSE directly. - // The base class CTransInPlace - // Transform( ) method is called by it's - // Receive( ) method. There is no way - // to get Transform( ) to return an S_FALSE value - // (which means "stop giving me data"), - // to Receive( ) and get Receive( ) to return S_FALSE as well. - - HRESULT Receive( IMediaSample * pms ); - -public: - - static CUnknown *WINAPI CreateInstance(LPUNKNOWN punk, HRESULT *phr); - - // Expose IDXFilter - STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void ** ppv); - DECLARE_IUNKNOWN; - - CDXFilter( IUnknown * pOuter, HRESULT * pHr, BOOL ModifiesData ); - - // IDXFilter - STDMETHODIMP SetAcceptedMediaType( const CMediaType * pmt ); - STDMETHODIMP GetConnectedMediaType( CMediaType * pmt ); - STDMETHODIMP SetCallback( SAMPLECALLBACK Callback ); - STDMETHODIMP SetDeliveryBuffer( ALLOCATOR_PROPERTIES props, BYTE * m_pBuffer ); -}; diff --git a/linphone/mediastreamer2/src/equalizer.c b/linphone/mediastreamer2/src/equalizer.c deleted file mode 100644 index 95a60649f..000000000 --- a/linphone/mediastreamer2/src/equalizer.c +++ /dev/null @@ -1,368 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2009 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include - -#include - -#ifdef _MSC_VER -#include -#define alloca _alloca -#endif - -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - -#ifdef MS_FIXED_POINT -#define GAIN_ZERODB 20000 -#else -#define GAIN_ZERODB 1.0 -#endif - -#define TAPS 128 - -typedef struct _EqualizerState{ - int rate; - int nfft; /*number of fft points in time*/ - ms_word16_t *fft_cpx; - int fir_len; - ms_word16_t *fir; - ms_mem_t *mem; /*memories for filtering computations*/ - bool_t needs_update; - bool_t active; -} EqualizerState; - -static void equalizer_state_flatten(EqualizerState *s){ - int i; - ms_word16_t val=GAIN_ZERODB/s->nfft; - s->fft_cpx[0]=val; - for(i=1;infft;i+=2) - s->fft_cpx[i]=val; -} - -/* TODO: rate also beyond 8000 */ -static EqualizerState * equalizer_state_new(int nfft){ - EqualizerState *s=(EqualizerState *)ms_new0(EqualizerState,1); - s->rate=8000; - s->nfft=nfft; - s->fft_cpx=(ms_word16_t*)ms_new0(ms_word16_t,s->nfft); - equalizer_state_flatten(s); - s->fir_len=s->nfft; - s->fir=(ms_word16_t*)ms_new(ms_word16_t,s->fir_len); - s->mem=(ms_mem_t*)ms_new0(ms_mem_t,s->fir_len); - s->needs_update=TRUE; - s->active=TRUE; - return s; -} - -static void equalizer_state_destroy(EqualizerState *s){ - ms_free(s->fft_cpx); - ms_free(s->fir); - ms_free(s->mem); - ms_free(s); -} - -static int equalizer_state_hz_to_index(EqualizerState *s, int hz){ - int ret; - if (hz<0){ - ms_error("Bad frequency value %i",hz); - return -1; - } - if (hz>(s->rate/2)){ - hz=(s->rate/2); - } - /*round to nearest integer*/ - ret=((hz*s->nfft)+(s->rate/2))/s->rate; - if (ret==s->nfft/2) ret=(s->nfft/2)-1; - return ret; -} - -static int equalizer_state_index2hz(EqualizerState *s, int index){ - return (index * s->rate + s->nfft/2) / s->nfft; -} - -static float gain_float(ms_word16_t val){ - return (float)val/GAIN_ZERODB; -} - -static float equalizer_state_get(EqualizerState *s, int freqhz){ - int idx=equalizer_state_hz_to_index(s,freqhz); - if (idx>=0) return gain_float(s->fft_cpx[idx*2])*s->nfft; - return 0; -} - -/* The natural peaking equalizer amplitude transfer function is multiplied to the discrete f-points. - * Note that for PEQ no sqrt is needed for the overall calculation, applying it to gain yields the - * same response. - */ -static float equalizer_compute_gainpoint(int f, int freq_0, float sqrt_gain, int freq_bw) -{ - float k1, k2; - k1 = ((float)(f*f)-(float)(freq_0*freq_0)); - k1*= k1; - k2 = (float)(f*freq_bw); - k2*= k2; - return (k1+k2*sqrt_gain)/(k1+k2/sqrt_gain); -} - -static void equalizer_point_set(EqualizerState *s, int i, int f, float gain){ - ms_message("Setting gain %f for freq_index %i (%i Hz)\n",gain,i,f); - s->fft_cpx[1+((i-1)*2)] = (s->fft_cpx[1+((i-1)*2)]*(int)(gain*32768))/32768; -} - -static void equalizer_state_set(EqualizerState *s, int freq_0, float gain, int freq_bw){ - //int low,high; - int i, f; - int delta_f = equalizer_state_index2hz(s, 1); - float sqrt_gain = sqrt(gain); - int mid = equalizer_state_hz_to_index(s, freq_0); - freq_bw-= delta_f/2; /* subtract a constant - compensates for limited fft steepness at low f */ - if (freq_bw < delta_f/2) - freq_bw = delta_f/2; - i = mid; - f = equalizer_state_index2hz(s, i); - equalizer_point_set(s, i, f, gain); /* gain according to argument */ - do { /* note: to better accomodate limited fft steepness, -delta is applied in f-calc ... */ - i++; - f = equalizer_state_index2hz(s, i); - gain = equalizer_compute_gainpoint(f-delta_f, freq_0, sqrt_gain, freq_bw); - equalizer_point_set(s, i, f, gain); - } - while (i < s->nfft/2 && (gain>1.1 || gain<0.9)); - i = mid; - do { /* ... and here +delta, as to */ - i--; - f = equalizer_state_index2hz(s, i); - gain = equalizer_compute_gainpoint(f+delta_f, freq_0, sqrt_gain, freq_bw); - equalizer_point_set(s, i, f, gain); - } - while (i>=0 && (gain>1.1 || gain<0.9)); - s->needs_update=TRUE; -} - -static void dump_table(ms_word16_t *t, int len){ - int i; - for(i=0;infft); - ms_message("Spectral domain:"); - dump_table(s->fft_cpx,s->nfft); - ms_ifft(fft_handle,s->fft_cpx,s->fir); - ms_fft_destroy(fft_handle); - /* - ms_message("Inverse fft result:"); - dump_table(s->fir,s->fir_len); - */ - time_shift(s->fir,s->fir_len); - /* - ms_message("Time shifted:"); - dump_table(s->fir,s->fir_len); - */ - norm_and_apodize(s->fir,s->fir_len); - ms_message("Apodized impulse response:"); - dump_table(s->fir,s->fir_len); - s->needs_update=FALSE; -} - - - -#ifdef MS_FIXED_POINT -#define INT16_TO_WORD16(i,w,l) w=(i) -#define WORD16_TO_INT16(i,w,l) i=(w) -#else - -static void int16_to_word16(const int16_t *is, ms_word16_t *w, int l){ - int i; - for(i=0;ineeds_update) - equalizer_state_compute_impulse_response(s); - ms_word16_t *w; - INT16_TO_WORD16(samples,w,nsamples); - ms_fir_mem16(w,s->fir,w,nsamples,s->fir_len,s->mem); - WORD16_TO_INT16(w,samples,nsamples); -} - - -static void equalizer_init(MSFilter *f){ - f->data=equalizer_state_new(TAPS); -} - -static void equalizer_uninit(MSFilter *f){ - equalizer_state_destroy((EqualizerState*)f->data); -} - -static void equalizer_process(MSFilter *f){ - mblk_t *m; - EqualizerState *s=(EqualizerState*)f->data; - while((m=ms_queue_get(f->inputs[0]))!=NULL){ - if (s->active){ - equalizer_state_run(s,(int16_t*)m->b_rptr,(m->b_wptr-m->b_rptr)/2); - } - ms_queue_put(f->outputs[0],m); - } -} - -static int equalizer_set_gain(MSFilter *f, void *data){ - EqualizerState *s=(EqualizerState*)f->data; - MSEqualizerGain *d=(MSEqualizerGain*)data; - equalizer_state_set(s,d->frequency,d->gain,d->width); - return 0; -} - -static int equalizer_get_gain(MSFilter *f, void *data){ - EqualizerState *s=(EqualizerState*)f->data; - MSEqualizerGain *d=(MSEqualizerGain*)data; - d->gain=equalizer_state_get(s,d->frequency); - d->width=0; - return 0; -} - -static int equalizer_set_rate(MSFilter *f, void *data){ - EqualizerState *s=(EqualizerState*)f->data; - s->rate=*(int*)data; - s->needs_update=TRUE; - return 0; -} - -static int equalizer_set_active(MSFilter *f, void *data){ - EqualizerState *s=(EqualizerState*)f->data; - s->active=*(int*)data; - return 0; -} - -static int equalizer_dump(MSFilter *f, void *data){ - EqualizerState *s=(EqualizerState*)f->data; - float *t=(float*)data; - int i; - *t=s->fft_cpx[0]; - t++; - for (i=1;infft;i+=2){ - *t=((float)s->fft_cpx[i]*(float)s->nfft)/(float)GAIN_ZERODB; - t++; - } - return 0; -} - -static int equalizer_get_nfreqs(MSFilter *f, void *data){ - EqualizerState *s=(EqualizerState*)f->data; - *(int*)data=s->nfft/2; - return 0; -} - -static MSFilterMethod equalizer_methods[]={ - { MS_EQUALIZER_SET_GAIN , equalizer_set_gain }, - { MS_EQUALIZER_GET_GAIN , equalizer_get_gain }, - { MS_EQUALIZER_SET_ACTIVE , equalizer_set_active }, - { MS_FILTER_SET_SAMPLE_RATE , equalizer_set_rate }, - { MS_EQUALIZER_DUMP_STATE , equalizer_dump }, - { MS_EQUALIZER_GET_NUM_FREQUENCIES, equalizer_get_nfreqs }, - { 0 , NULL } -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_equalizer_desc={ - MS_EQUALIZER_ID, - "MSEqualizer", - N_("Parametric sound equalizer."), - MS_FILTER_OTHER, - NULL, - 1, - 1, - equalizer_init, - NULL, - equalizer_process, - NULL, - equalizer_uninit, - equalizer_methods -}; - -#else - -MSFilterDesc ms_equalizer_desc={ - .id= MS_EQUALIZER_ID, - .name="MSEqualizer", - .text=N_("Parametric sound equalizer."), - .category=MS_FILTER_OTHER, - .ninputs=1, - .noutputs=1, - .init=equalizer_init, - .process=equalizer_process, - .uninit=equalizer_uninit, - .methods=equalizer_methods -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_equalizer_desc) diff --git a/linphone/mediastreamer2/src/ffmpeg-priv.h b/linphone/mediastreamer2/src/ffmpeg-priv.h deleted file mode 100644 index 5aefaf656..000000000 --- a/linphone/mediastreamer2/src/ffmpeg-priv.h +++ /dev/null @@ -1,66 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef FFMPEG_PRIV_H -#define FFMPEG_PRIV_H - -#ifdef HAVE_CONFIG_H -#include "mediastreamer-config.h" -#endif - -#if defined(HAVE_LIBAVCODEC_AVCODEC_H) -/* new layout */ -# include -# include -#else -/* old layout */ -# include -# include -#endif - -#if defined(HAVE_LIBSWSCALE_SWSCALE_H) -/* new layout */ -# include -# elif !defined(HAVE_LIBAVCODEC_AVCODEC_H) -/* old layout */ -# include -#else -/* swscale.h not delivered: use linphone private version */ -# include "swscale.h" -#endif - - -#if LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(52,24,0) -/*should work as long as nobody uses avformat.h*/ -typedef struct AVPacket{ - uint8_t *data; - int size; -}AVPacket; - -static inline void av_init_packet(AVPacket *pkt){ - -} -static inline int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, - int *got_picture_ptr, - AVPacket *avpkt){ - return avcodec_decode_video(avctx,picture, got_picture_ptr,avpkt->data,avpkt->size); -} -#endif - -#endif /* FFMPEG_PRIV_H */ diff --git a/linphone/mediastreamer2/src/g711common.h b/linphone/mediastreamer2/src/g711common.h deleted file mode 100644 index 3f2c9e330..000000000 --- a/linphone/mediastreamer2/src/g711common.h +++ /dev/null @@ -1,171 +0,0 @@ -/* - * PCM - A-Law conversion - * Copyright (c) 2000 by Abramo Bagnara - * - * Wrapper for linphone Codec class by Simon Morlat - */ - -static inline int val_seg(int val) -{ - int r = 0; - val >>= 7; - if (val & 0xf0) { - val >>= 4; - r += 4; - } - if (val & 0x0c) { - val >>= 2; - r += 2; - } - if (val & 0x02) - r += 1; - return r; -} - -/* - * s16_to_alaw() - Convert a 16-bit linear PCM value to 8-bit A-law - * - * s16_to_alaw() accepts an 16-bit integer and encodes it as A-law data. - * - * Linear Input Code Compressed Code - * ------------------------ --------------- - * 0000000wxyza 000wxyz - * 0000001wxyza 001wxyz - * 000001wxyzab 010wxyz - * 00001wxyzabc 011wxyz - * 0001wxyzabcd 100wxyz - * 001wxyzabcde 101wxyz - * 01wxyzabcdef 110wxyz - * 1wxyzabcdefg 111wxyz - * - * For further information see John C. Bellamy's Digital Telephony, 1982, - * John Wiley & Sons, pps 98-111 and 472-476. - */ - -static inline unsigned char s16_to_alaw(int pcm_val) -{ - int mask; - int seg; - unsigned char aval; - - if (pcm_val >= 0) { - mask = 0xD5; - } else { - mask = 0x55; - pcm_val = -pcm_val; - if (pcm_val > 0x7fff) - pcm_val = 0x7fff; - } - - if (pcm_val < 256) - aval = pcm_val >> 4; - else { - /* Convert the scaled magnitude to segment number. */ - seg = val_seg(pcm_val); - aval = (seg << 4) | ((pcm_val >> (seg + 3)) & 0x0f); - } - return aval ^ mask; -} - -/* - * alaw_to_s16() - Convert an A-law value to 16-bit linear PCM - * - */ -static inline int alaw_to_s16(unsigned char a_val) -{ - int t; - int seg; - - a_val ^= 0x55; - t = a_val & 0x7f; - if (t < 16) - t = (t << 4) + 8; - else { - seg = (t >> 4) & 0x07; - t = ((t & 0x0f) << 4) + 0x108; - t <<= seg -1; - } - return ((a_val & 0x80) ? t : -t); -} -/* - * s16_to_ulaw() - Convert a linear PCM value to u-law - * - * In order to simplify the encoding process, the original linear magnitude - * is biased by adding 33 which shifts the encoding range from (0 - 8158) to - * (33 - 8191). The result can be seen in the following encoding table: - * - * Biased Linear Input Code Compressed Code - * ------------------------ --------------- - * 00000001wxyza 000wxyz - * 0000001wxyzab 001wxyz - * 000001wxyzabc 010wxyz - * 00001wxyzabcd 011wxyz - * 0001wxyzabcde 100wxyz - * 001wxyzabcdef 101wxyz - * 01wxyzabcdefg 110wxyz - * 1wxyzabcdefgh 111wxyz - * - * Each biased linear code has a leading 1 which identifies the segment - * number. The value of the segment number is equal to 7 minus the number - * of leading 0's. The quantization interval is directly available as the - * four bits wxyz. * The trailing bits (a - h) are ignored. - * - * Ordinarily the complement of the resulting code word is used for - * transmission, and so the code word is complemented before it is returned. - * - * For further information see John C. Bellamy's Digital Telephony, 1982, - * John Wiley & Sons, pps 98-111 and 472-476. - */ - -static inline unsigned char s16_to_ulaw(int pcm_val) /* 2's complement (16-bit range) */ -{ - int mask; - int seg; - unsigned char uval; - - if (pcm_val < 0) { - pcm_val = 0x84 - pcm_val; - mask = 0x7f; - } else { - pcm_val += 0x84; - mask = 0xff; - } - if (pcm_val > 0x7fff) - pcm_val = 0x7fff; - - /* Convert the scaled magnitude to segment number. */ - seg = val_seg(pcm_val); - - /* - * Combine the sign, segment, quantization bits; - * and complement the code word. - */ - uval = (seg << 4) | ((pcm_val >> (seg + 3)) & 0x0f); - return uval ^ mask; -} - -/* - * ulaw_to_s16() - Convert a u-law value to 16-bit linear PCM - * - * First, a biased linear code is derived from the code word. An unbiased - * output can then be obtained by subtracting 33 from the biased code. - * - * Note that this function expects to be passed the complement of the - * original code word. This is in keeping with ISDN conventions. - */ -static inline int ulaw_to_s16(unsigned char u_val) -{ - int t; - - /* Complement to obtain normal u-law value. */ - u_val = ~u_val; - - /* - * Extract and bias the quantization bits. Then - * shift up by the segment number and subtract out the bias. - */ - t = ((u_val & 0x0f) << 3) + 0x84; - t <<= (u_val & 0x70) >> 4; - - return ((u_val & 0x80) ? (0x84 - t) : (t - 0x84)); -} diff --git a/linphone/mediastreamer2/src/gsm.c b/linphone/mediastreamer2/src/gsm.c deleted file mode 100644 index 6cc62ec7d..000000000 --- a/linphone/mediastreamer2/src/gsm.c +++ /dev/null @@ -1,165 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/msfilter.h" - -#include - -typedef struct EncState{ - gsm state; - uint32_t ts; - MSBufferizer *bufferizer; -} EncState; - -static void enc_init(MSFilter *f){ - EncState *s=(EncState *)ms_new(EncState,1); - s->state=gsm_create(); - s->ts=0; - s->bufferizer=ms_bufferizer_new(); - f->data=s; -} - -static void enc_uninit(MSFilter *f){ - EncState *s=(EncState*)f->data; - gsm_destroy(s->state); - ms_bufferizer_destroy(s->bufferizer); - ms_free(s); -} - - - -static void enc_process(MSFilter *f){ - EncState *s=(EncState*)f->data; - mblk_t *im; - int16_t buf[160]; - - while((im=ms_queue_get(f->inputs[0]))!=NULL){ - ms_bufferizer_put(s->bufferizer,im); - } - while(ms_bufferizer_read(s->bufferizer,(uint8_t*)buf,sizeof(buf))==sizeof(buf)) { - mblk_t *om=allocb(33,0); - gsm_encode(s->state,(gsm_signal*)buf,(gsm_byte*)om->b_wptr); - om->b_wptr+=33; - mblk_set_timestamp_info(om,s->ts); - ms_queue_put(f->outputs[0],om); - s->ts+=sizeof(buf)/2; - } -} - -#ifdef _MSC_VER - -MSFilterDesc ms_gsm_enc_desc={ - MS_GSM_ENC_ID, - "MSGsmEnc", - N_("The GSM full-rate codec"), - MS_FILTER_ENCODER, - "gsm", - 1, - 1, - enc_init, - NULL, - enc_process, - NULL, - enc_uninit, - NULL -}; - -#else - -MSFilterDesc ms_gsm_enc_desc={ - .id=MS_GSM_ENC_ID, - .name="MSGsmEnc", - .text=N_("The GSM full-rate codec"), - .category=MS_FILTER_ENCODER, - .enc_fmt="gsm", - .ninputs=1, - .noutputs=1, - .init=enc_init, - .process=enc_process, - .uninit=enc_uninit, -}; - -#endif - -static void dec_init(MSFilter *f){ - f->data=gsm_create(); -} - -static void dec_uninit(MSFilter *f){ - gsm s=(gsm)f->data; - gsm_destroy(s); -} - - -static void dec_process(MSFilter *f){ - gsm s=(gsm)f->data; - mblk_t *im; - mblk_t *om; - const int frsz=160*2; - - while((im=ms_queue_get(f->inputs[0]))!=NULL){ - om=allocb(frsz,0); - if (gsm_decode(s,(gsm_byte*)im->b_rptr,(gsm_signal*)om->b_wptr)<0){ - ms_warning("gsm_decode error!"); - freemsg(om); - }else{ - om->b_wptr+=frsz; - ms_queue_put(f->outputs[0],om); - } - freemsg(im); - } -} - -#ifdef _MSC_VER - -MSFilterDesc ms_gsm_dec_desc={ - MS_GSM_DEC_ID, - "MSGsmDec", - N_("The GSM codec"), - MS_FILTER_DECODER, - "gsm", - 1, - 1, - dec_init, - NULL, - dec_process, - NULL, - dec_uninit, - NULL -}; - -#else - -MSFilterDesc ms_gsm_dec_desc={ - .id=MS_GSM_DEC_ID, - .name="MSGsmDec", - .text=N_("The GSM codec"), - .category=MS_FILTER_DECODER, - .enc_fmt="gsm", - .ninputs=1, - .noutputs=1, - .init=dec_init, - .process=dec_process, - .uninit=dec_uninit -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_gsm_dec_desc) -MS_FILTER_DESC_EXPORT(ms_gsm_enc_desc) diff --git a/linphone/mediastreamer2/src/ice.c b/linphone/mediastreamer2/src/ice.c deleted file mode 100644 index 4f26c4215..000000000 --- a/linphone/mediastreamer2/src/ice.c +++ /dev/null @@ -1,1381 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#if !defined(WIN32) && !defined(_WIN32_WCE) -#ifdef __APPLE__ -#include -#endif -#include -#include -#endif - -#include "mediastreamer2/msticker.h" -#include "mediastreamer2/ice.h" -#include "mediastreamer2/mscommon.h" - -static void -ice_sendtest( struct IceCheckList *checklist, struct CandidatePair *remote_candidate, Socket myFd, StunAddress4 *dest, - const StunAtrString *username, const StunAtrString *password, - UInt96 *tid) -{ - StunMessage req; - char buf[STUN_MAX_MESSAGE_SIZE]; - int len = STUN_MAX_MESSAGE_SIZE; - - memset(&req, 0, sizeof(StunMessage)); - - stunBuildReqSimple( &req, username, FALSE, FALSE, 1); - req.hasMessageIntegrity=TRUE; - - /* 7.1.1.1 - The attribute MUST be set equal to the priority that would be - assigned, based on the algorithm in Section 4.1.2, to a peer - reflexive candidate, should one be learned as a consequence of this - check */ - req.hasPriority = TRUE; - - req.priority.priority = (110 << 24) | (255 << 16) | (255 << 8) - | (256 - remote_candidate->remote_candidate.component_id); - - /* TODO: put this parameter only for the candidate selected */ - if (remote_candidate->nominated_pair==1) - req.hasUseCandidate = TRUE; - - if (remote_candidate->rem_controlling==1) - { - req.hasIceControlled = TRUE; - req.iceControlled.value = checklist->tiebreak_value; - } - else - { - req.hasIceControlling = TRUE; - req.iceControlling.value = checklist->tiebreak_value; - } - - /* TODO: not yet implemented? */ - req.hasFingerprint = TRUE; - - len = stunEncodeMessage( &req, buf, len, password ); - - memcpy(tid , &(req.msgHdr.tr_id), sizeof(req.msgHdr.tr_id)); - - sendMessage( myFd, buf, len, dest->addr, dest->port ); -} - -static int ice_restart(struct IceCheckList *checklist) -{ - struct CandidatePair *remote_candidates = NULL; - int pos; - - int count_waiting=0; - int count=0; - - if (checklist==NULL) - return 0; - remote_candidates = checklist->cand_pairs; - if (remote_candidates==NULL) - return 0; - - for (pos=0;pos<10 && remote_candidates[pos].remote_candidate.conn_addr[0]!='\0';pos++) - { - if (strcasecmp(remote_candidates[pos].local_candidate.cand_type, "srflx")==0) - { - /* search for a highest priority "equivalent" pair */ - int pos2; - for (pos2=0;pos2 remove the one with lowest priority */ - if (strcasecmp(remote_candidates[pos].remote_candidate.conn_addr, - remote_candidates[pos2].remote_candidate.conn_addr)==0) - { - /* useless cpair */ - ms_message("ice.c: Removing useless pair (idx=%i)", pos); - remote_candidates[pos].connectivity_check = ICE_PRUNED; - - } - - } - - } - } - } - - /* no currently nominated pair */ - checklist->nominated_pair_index = -1; - - for (pos=0;pos<10 && remote_candidates[pos].remote_candidate.conn_addr[0]!='\0';pos++) - { - if (remote_candidates[pos].connectivity_check == ICE_PRUNED) - continue; - if (remote_candidates[pos].connectivity_check == ICE_FROZEN) - remote_candidates[pos].connectivity_check = ICE_WAITING; - } - - checklist->Ta = 40; - for (pos=0;pos<10 && remote_candidates[pos].remote_candidate.conn_addr[0]!='\0';pos++) - { - if (remote_candidates[pos].connectivity_check == ICE_PRUNED) - continue; - if (remote_candidates[pos].connectivity_check == ICE_WAITING) - count_waiting++; - count++; - } - checklist->RTO = MAX(200, count*checklist->Ta*count_waiting); - return 0; -} - -static int ice_sound_send_stun_request(RtpSession *session, struct IceCheckList *checklist, uint64_t ctime) -{ - struct CandidatePair *remote_candidates = NULL; - - if (checklist==NULL) - return 0; - remote_candidates = checklist->cand_pairs; - if (remote_candidates==NULL) - return 0; - - { - struct CandidatePair *cand_pair; - int media_socket = rtp_session_get_rtp_socket(session); - StunAddress4 stunServerAddr; - StunAtrString username; - StunAtrString password; - bool_t res; - int pos; - - /* prepare ONCE tie-break value */ - if (checklist->tiebreak_value==0) { - checklist->tiebreak_value = random() * (0x7fffffffffffffffLL /0x7fff); - } - - cand_pair=NULL; - for (pos=0;pos<10 && remote_candidates[pos].remote_candidate.conn_addr[0]!='\0';pos++) - { - cand_pair = &remote_candidates[pos]; - if (cand_pair->connectivity_check == ICE_PRUNED) - { - cand_pair=NULL; - continue; - } - if (cand_pair->connectivity_check == ICE_WAITING) - break; - if (cand_pair->connectivity_check == ICE_IN_PROGRESS) - break; - if (cand_pair->connectivity_check == ICE_SUCCEEDED) - break; - cand_pair=NULL; - } - - if (cand_pair==NULL) - return 0; /* nothing to do: every pair is FAILED, FROZEN or PRUNED */ - - /* start first WAITING pair */ - cand_pair=NULL; - for (pos=0;pos<10 && remote_candidates[pos].remote_candidate.conn_addr[0]!='\0';pos++) - { - cand_pair = &remote_candidates[pos]; - if (cand_pair->connectivity_check == ICE_PRUNED) - { - cand_pair=NULL; - continue; - } - if (cand_pair->connectivity_check == ICE_WAITING) - break; - cand_pair=NULL; - } - - if (cand_pair!=NULL) - { - cand_pair->connectivity_check = ICE_IN_PROGRESS; - cand_pair->retransmission_number=0; - cand_pair->retransmission_time=ctime+checklist->RTO; - /* keep same rem_controlling for retransmission */ - cand_pair->rem_controlling = checklist->rem_controlling; - } - - /* try no nominate a pair if we are ready */ - if (cand_pair==NULL && checklist->nominated_pair_index<0) - { - for (pos=0;pos<10 && remote_candidates[pos].remote_candidate.conn_addr[0]!='\0';pos++) - { - cand_pair = &remote_candidates[pos]; - if (cand_pair->connectivity_check == ICE_PRUNED) - { - cand_pair=NULL; - continue; - } - if (cand_pair->connectivity_check == ICE_SUCCEEDED) - { - break; - } - cand_pair=NULL; - } - - /* ALWAYS accept "host" candidate that have succeeded */ - if (cand_pair!=NULL - && (strcasecmp(cand_pair->remote_candidate.cand_type, "host")==0)) - { - checklist->nominated_pair_index = pos; - cand_pair->nominated_pair = 1; - cand_pair->connectivity_check = ICE_IN_PROGRESS; - cand_pair->retransmission_number=0; - cand_pair->retransmission_time=ctime+checklist->RTO; - /* keep same rem_controlling for retransmission */ - cand_pair->rem_controlling = checklist->rem_controlling; - /* send a new STUN with USE-CANDIDATE */ - ms_message("ice.c: nominating pair -> %i (%s:%i:%s -> %s:%i:%s) nominated=%s", - pos, - cand_pair->local_candidate.conn_addr, - cand_pair->local_candidate.conn_port, - cand_pair->local_candidate.cand_type, - cand_pair->remote_candidate.conn_addr, - cand_pair->remote_candidate.conn_port, - cand_pair->remote_candidate.cand_type, - cand_pair->nominated_pair==0?"FALSE":"TRUE"); - checklist->keepalive_time=ctime+15*1000; - } - else if (cand_pair!=NULL) - { - struct CandidatePair *cand_pair2=NULL; - int pos2; - for (pos2=0;pos2connectivity_check == ICE_PRUNED) - { - cand_pair2=NULL; - continue; - } - if (cand_pair2->connectivity_check == ICE_IN_PROGRESS - ||cand_pair2->connectivity_check == ICE_WAITING) - { - break; - } - cand_pair2=NULL; - } - - if (cand_pair2!=NULL) - { - /* a better candidate is still tested */ - cand_pair=NULL; - } - else - { - checklist->nominated_pair_index = pos; - cand_pair->nominated_pair = 1; - cand_pair->connectivity_check = ICE_IN_PROGRESS; - cand_pair->retransmission_number=0; - cand_pair->retransmission_time=ctime+checklist->RTO; - /* keep same rem_controlling for retransmission */ - cand_pair->rem_controlling = checklist->rem_controlling; - /* send a new STUN with USE-CANDIDATE */ - ms_message("ice.c: nominating pair -> %i (%s:%i:%s -> %s:%i:%s) nominated=%s", - pos, - cand_pair->local_candidate.conn_addr, - cand_pair->local_candidate.conn_port, - cand_pair->local_candidate.cand_type, - cand_pair->remote_candidate.conn_addr, - cand_pair->remote_candidate.conn_port, - cand_pair->remote_candidate.cand_type, - cand_pair->nominated_pair==0?"FALSE":"TRUE"); - checklist->keepalive_time=ctime+15*1000; - } - } - } - - if (cand_pair==NULL) - { - /* no WAITING pair: retransmit after RTO */ - for (pos=0;pos<10 && remote_candidates[pos].remote_candidate.conn_addr[0]!='\0';pos++) - { - cand_pair = &remote_candidates[pos]; - if (cand_pair->connectivity_check == ICE_PRUNED) - { - cand_pair=NULL; - continue; - } - if (cand_pair->connectivity_check == ICE_IN_PROGRESS - && ctime > cand_pair->retransmission_time) - { - if (cand_pair->retransmission_number>7) - { - ms_message("ice.c: ICE_FAILED for candidate pair! %s:%i -> %s:%i", - cand_pair->local_candidate.conn_addr, - cand_pair->local_candidate.conn_port, - cand_pair->remote_candidate.conn_addr, - cand_pair->remote_candidate.conn_port); - - cand_pair->connectivity_check = ICE_FAILED; - cand_pair=NULL; - continue; - } - - cand_pair->retransmission_number++; - cand_pair->retransmission_time=ctime+checklist->RTO; - break; - } - cand_pair=NULL; - } - } - - if (cand_pair==NULL) - { - if (checklist->nominated_pair_index<0) - return 0; - - /* send STUN indication each 15 seconds: keepalive */ - if (ctime>checklist->keepalive_time) - { - checklist->keepalive_time=ctime+15*1000; - for (pos=0;pos<10 && remote_candidates[pos].remote_candidate.conn_addr[0]!='\0';pos++) - { - cand_pair = &remote_candidates[pos]; - if (cand_pair->connectivity_check == ICE_SUCCEEDED) - { - res = stunParseServerName(cand_pair->remote_candidate.conn_addr, - &stunServerAddr); - if ( res == TRUE ) - { - StunMessage req; - char buf[STUN_MAX_MESSAGE_SIZE]; - int len = STUN_MAX_MESSAGE_SIZE; - stunServerAddr.port = cand_pair->remote_candidate.conn_port; - memset(&req, 0, sizeof(StunMessage)); - stunBuildReqSimple( &req, NULL, FALSE, FALSE, 1); - req.msgHdr.msgType = (STUN_METHOD_BINDING|STUN_INDICATION); - req.hasFingerprint = TRUE; - len = stunEncodeMessage( &req, buf, len, NULL); - sendMessage( media_socket, buf, len, stunServerAddr.addr, stunServerAddr.port ); - } - } - } - } - - return 0; - } - - username.sizeValue = 0; - password.sizeValue = 0; - - /* username comes from "ice-ufrag" (rfrag:lfrag) */ - /* ufrag and pwd are in first row only */ - snprintf(username.value, sizeof(username.value), "%s:%s", - checklist->rem_ice_ufrag, - checklist->loc_ice_ufrag); - username.sizeValue = (uint16_t)strlen(username.value); - - - snprintf(password.value, sizeof(password.value), "%s", - checklist->rem_ice_pwd); - password.sizeValue = (uint16_t)strlen(password.value); - - - res = stunParseServerName(cand_pair->remote_candidate.conn_addr, - &stunServerAddr); - if ( res == TRUE ) - { - ms_message("ice.c: STUN REQ (%s) -> %i (%s:%i:%s -> %s:%i:%s) nominated=%s", - cand_pair->nominated_pair==0?"":"USE-CANDIDATE", - pos, - cand_pair->local_candidate.conn_addr, - cand_pair->local_candidate.conn_port, - cand_pair->local_candidate.cand_type, - cand_pair->remote_candidate.conn_addr, - cand_pair->remote_candidate.conn_port, - cand_pair->remote_candidate.cand_type, - cand_pair->nominated_pair==0?"FALSE":"TRUE"); - stunServerAddr.port = cand_pair->remote_candidate.conn_port; - ice_sendtest(checklist, cand_pair, media_socket, &stunServerAddr, &username, &password, - &(cand_pair->tid)); - } - } - - return 0; -} - -#if 0 -static int -_ice_get_localip_for (struct sockaddr_storage *saddr, size_t saddr_len, char *loc, int size) -{ - int err, tmp; - int sock; - struct sockaddr_storage addr; - socklen_t addr_len; - - strcpy (loc, "127.0.0.1"); /* always fallback to local loopback */ - - sock = socket (saddr->ss_family, SOCK_DGRAM, 0); - tmp = 1; - err = setsockopt (sock, SOL_SOCKET, SO_REUSEADDR, (const char *) &tmp, sizeof (int)); - if (err < 0) - { - ms_error("ice.c: Error in setsockopt"); - closesocket (sock); - return -1; - } - err = connect (sock, (struct sockaddr*)saddr, saddr_len); - if (err < 0) - { - ms_error("ice.c: Error in connect"); - closesocket (sock); - return -1; - } - addr_len = sizeof (addr); - err = getsockname (sock, (struct sockaddr *) &addr, (socklen_t*)&addr_len); - if (err != 0) - { - ms_error("ice.c: Error in getsockname"); - closesocket (sock); - return -1; - } - - err = getnameinfo ((struct sockaddr *) &addr, addr_len, loc, size, NULL, 0, NI_NUMERICHOST); - if (err != 0) - { - ms_error("ice.c: Error in getnameinfo"); - closesocket (sock); - return -1; - } - closesocket (sock); - /* ms_message("ice.c: Outgoing interface for sending STUN answer is %s", loc); */ - return 0; -} - -#endif - -static void -_ice_createErrorResponse(StunMessage *response, int cl, int number, const char* msg) -{ - response->msgHdr.msgType = (STUN_METHOD_BINDING | STUN_ERR_RESP); - response->hasErrorCode = TRUE; - response->errorCode.errorClass = cl; - response->errorCode.number = number; - strcpy(response->errorCode.reason, msg); - response->errorCode.sizeReason = strlen(msg); - response->hasFingerprint = TRUE; -} - -static int ice_process_stun_message(RtpSession *session, struct IceCheckList *checklist, OrtpEvent *evt) -{ - struct CandidatePair *remote_candidates = NULL; - StunMessage msg; - bool_t res; - int highest_priority_success=-1; - OrtpEventData *evt_data = ortp_event_get_data(evt); - mblk_t *mp = evt_data->packet; - struct sockaddr_in *udp_remote; - char src6host[NI_MAXHOST]; - int recvport = 0; - int i; - - udp_remote = (struct sockaddr_in*)&evt_data->ep->addr; - - memset( &msg, 0 , sizeof(msg) ); - res = stunParseMessage((char*)mp->b_rptr, mp->b_wptr-mp->b_rptr, &msg); - if (!res) - { - ms_error("ice.c: Malformed STUN packet."); - return -1; - } - - if (checklist==NULL) - { - ms_error("ice.c: dropping STUN packet: ice is not configured"); - return -1; - } - - remote_candidates = checklist->cand_pairs; - if (remote_candidates==NULL) - { - ms_error("ice.c: dropping STUN packet: ice is not configured"); - return -1; - } - - /* prepare ONCE tie-break value */ - if (checklist->tiebreak_value==0) { - checklist->tiebreak_value = random() * (0x7fffffffffffffffLL/0x7fff); - } - - memset (src6host, 0, sizeof (src6host)); - - { - struct sockaddr_storage *aaddr = (struct sockaddr_storage *)&evt_data->ep->addr; - if (aaddr->ss_family==AF_INET) - recvport = ntohs (((struct sockaddr_in *) udp_remote)->sin_port); - else - recvport = ntohs (((struct sockaddr_in6 *) &evt_data->ep->addr)->sin6_port); - } - i = getnameinfo ((struct sockaddr*)&evt_data->ep->addr, evt_data->ep->addrlen, - src6host, NI_MAXHOST, - NULL, 0, NI_NUMERICHOST); - if (i != 0) - { - ms_error("ice.c: Error with getnameinfo"); - return -1; - } - - if (STUN_IS_REQUEST(msg.msgHdr.msgType)) - ms_message("ice.c: STUN_CONNECTIVITYCHECK: Request received from: %s:%i", - src6host, recvport); - else if (STUN_IS_INDICATION(msg.msgHdr.msgType)) - ms_message("ice.c: SUN_INDICATION: Request Indication received from: %s:%i", - src6host, recvport); - else - ms_message("ice.c: STUN_ANSWER: Answer received from: %s:%i", - src6host, recvport); - - { - int pos; - for (pos=0;pos<10 && remote_candidates[pos].remote_candidate.conn_addr[0]!='\0';pos++) - { - struct CandidatePair *cand_pair = &remote_candidates[pos]; - - if (cand_pair->connectivity_check == ICE_SUCCEEDED) - { - highest_priority_success=pos; - break; - } - } - } - - if (STUN_IS_INDICATION(msg.msgHdr.msgType)) - { - ms_message("ice.c: STUN INDICATION <- (?:?:? <- %s:%i:?)", src6host, recvport); - return 0; - } - else if (STUN_IS_REQUEST(msg.msgHdr.msgType)) - { - StunMessage resp; - StunAtrString hmacPassword; - StunAddress4 remote_addr; - int rtp_socket; - - memset( &resp, 0 , sizeof(resp)); - remote_addr.addr = ntohl(udp_remote->sin_addr.s_addr); - remote_addr.port = ntohs(udp_remote->sin_port); - - rtp_socket = rtp_session_get_rtp_socket(session); - - resp.msgHdr.magic_cookie = ntohl(msg.msgHdr.magic_cookie); - for (i=0; i<12; i++ ) - { - resp.msgHdr.tr_id.octet[i] = msg.msgHdr.tr_id.octet[i]; - } - - /* check mandatory params */ - - if (!msg.hasUsername) - { - char buf[STUN_MAX_MESSAGE_SIZE]; - int len = sizeof(buf); - ms_error("ice.c: STUN REQ <- Missing USERNAME attribute in connectivity check"); - _ice_createErrorResponse(&resp, 4, 32, "Missing USERNAME attribute"); - len = stunEncodeMessage(&resp, buf, len, &hmacPassword ); - if (len) - sendMessage( rtp_socket, buf, len, remote_addr.addr, remote_addr.port); - return -1; - } - if (!msg.hasMessageIntegrity) - { - char buf[STUN_MAX_MESSAGE_SIZE]; - int len = sizeof(buf); - ms_error("ice.c: STUN REQ <- Missing MESSAGEINTEGRITY attribute in connectivity check"); - _ice_createErrorResponse(&resp, 4, 1, "Missing MESSAGEINTEGRITY attribute"); - len = stunEncodeMessage(&resp, buf, len, &hmacPassword ); - if (len) - sendMessage( rtp_socket, buf, len, remote_addr.addr, remote_addr.port); - return -1; - } - - /* - The password associated with that transport address ID is used to verify - the MESSAGE-INTEGRITY attribute, if one was present in the request. - */ - { - char hmac[20]; - /* remove length of fingerprint if present */ - if (msg.hasFingerprint==TRUE) - { - char *lenpos = (char *)mp->b_rptr + sizeof(uint16_t); - uint16_t newlen = htons(msg.msgHdr.msgLength-8); /* remove fingerprint size */ - memcpy(lenpos, &newlen, sizeof(uint16_t)); - stunCalculateIntegrity_shortterm(hmac, (char*)mp->b_rptr, mp->b_wptr-mp->b_rptr-24-8, checklist->loc_ice_pwd); - } - else - stunCalculateIntegrity_shortterm(hmac, (char*)mp->b_rptr, mp->b_wptr-mp->b_rptr-24, checklist->loc_ice_pwd); - if (memcmp(msg.messageIntegrity.hash, hmac, 20)!=0) - { - char buf[STUN_MAX_MESSAGE_SIZE]; - int len = sizeof(buf); - ms_error("ice.c: STUN REQ <- Wrong MESSAGEINTEGRITY attribute in connectivity check"); - _ice_createErrorResponse(&resp, 4, 1, "Wrong MESSAGEINTEGRITY attribute"); - len = stunEncodeMessage(&resp, buf, len, &hmacPassword ); - if (len) - sendMessage( rtp_socket, buf, len, remote_addr.addr, remote_addr.port); - return -1; - } - if (msg.hasFingerprint==TRUE) - { - char *lenpos = (char *)mp->b_rptr + sizeof(uint16_t); - uint16_t newlen = htons(msg.msgHdr.msgLength); /* add back fingerprint size */ - memcpy(lenpos, &newlen, sizeof(uint16_t)); - } - } - - - /* 7.2.1.1. Detecting and Repairing Role Conflicts */ - /* TODO */ - if (!msg.hasIceControlling && !msg.hasIceControlled) - { - char buf[STUN_MAX_MESSAGE_SIZE]; - int len = sizeof(buf); - ms_error("ice.c: STUN REQ <- Missing either ICE-CONTROLLING or ICE-CONTROLLED attribute"); - _ice_createErrorResponse(&resp, 4, 87, "Missing either ICE-CONTROLLING or ICE-CONTROLLED attribute"); - len = stunEncodeMessage(&resp, buf, len, &hmacPassword ); - if (len) - sendMessage( rtp_socket, buf, len, remote_addr.addr, remote_addr.port); - return -1; - } - - if (checklist->rem_controlling==0 && msg.hasIceControlling) { - /* If the agent's tie-breaker is larger than or equal - to the contents of the ICE-CONTROLLING attribute - -> send 487, and do not change ROLE */ - if (checklist->tiebreak_value >= msg.iceControlling.value) { - char buf[STUN_MAX_MESSAGE_SIZE]; - int len = sizeof(buf); - ms_error("ice.c: STUN REQ <- 487 Role Conflict"); - _ice_createErrorResponse(&resp, 4, 87, "Role Conflict"); - len = stunEncodeMessage(&resp, buf, len, &hmacPassword ); - if (len) - sendMessage( rtp_socket, buf, len, remote_addr.addr, remote_addr.port); - return -1; - } - else { - int pos; - for (pos=0;pos<10 && remote_candidates[pos].remote_candidate.conn_addr[0]!='\0';pos++) - { - /* controller agent */ - uint64_t G = remote_candidates[pos].remote_candidate.priority; - /* controlled agent */ - uint64_t D = remote_candidates[pos].local_candidate.priority; - remote_candidates[pos].pair_priority = (MIN(G, D))<<32 | (MAX(G, D))<<1 | (G>D?1:0); - } - checklist->rem_controlling = 1; - /* reset all to initial WAITING state? */ - ms_message("ice.c: STUN REQ <- tiebreaker -> reset all to ICE_WAITING state"); - for (pos=0;pos<10 && remote_candidates[pos].remote_candidate.conn_addr[0]!='\0';pos++) - { - if (remote_candidates[pos].connectivity_check == ICE_PRUNED) - continue; - remote_candidates[pos].connectivity_check = ICE_WAITING; - memset(&remote_candidates[pos].tid , 0, sizeof(remote_candidates[pos].tid)); - remote_candidates[pos].retransmission_time = 0; - remote_candidates[pos].retransmission_number = 0; - } - } - } - - if (checklist->rem_controlling==1 && msg.hasIceControlled) { - - /* If the agent's tie-breaker is larger than or equal - to the contents of the ICE-CONTROLLED attribute - -> change ROLE */ - if (checklist->tiebreak_value >= msg.iceControlled.value) { - int pos; - for (pos=0;pos<10 && remote_candidates[pos].remote_candidate.conn_addr[0]!='\0';pos++) - { - /* controller agent */ - uint64_t G = remote_candidates[pos].local_candidate.priority; - /* controlled agent */ - uint64_t D = remote_candidates[pos].remote_candidate.priority; - remote_candidates[pos].pair_priority = (MIN(G, D))<<32 | (MAX(G, D))<<1 | (G>D?1:0); - } - checklist->rem_controlling = 0; - /* reset all to initial WAITING state? */ - ms_message("ice.c: STUN REQ <- tiebreaker -> reset all to ICE_WAITING state"); - for (pos=0;pos<10 && remote_candidates[pos].remote_candidate.conn_addr[0]!='\0';pos++) - { - if (remote_candidates[pos].connectivity_check == ICE_PRUNED) - continue; - remote_candidates[pos].connectivity_check = ICE_WAITING; - memset(&remote_candidates[pos].tid , 0, sizeof(remote_candidates[pos].tid)); - remote_candidates[pos].retransmission_time = 0; - remote_candidates[pos].retransmission_number = 0; - } - } - else { - char buf[STUN_MAX_MESSAGE_SIZE]; - int len = sizeof(buf); - ms_error("ice.c: STUN REQ <- 487 Role Conflict"); - _ice_createErrorResponse(&resp, 4, 87, "Role Conflict"); - len = stunEncodeMessage(&resp, buf, len, &hmacPassword ); - if (len) - sendMessage( rtp_socket, buf, len, remote_addr.addr, remote_addr.port); - return -1; - } - } - - { - struct CandidatePair *cand_pair; - int pos; - cand_pair=NULL; - for (pos=0;pos<10 && remote_candidates[pos].remote_candidate.conn_addr[0]!='\0';pos++) - { - cand_pair = &remote_candidates[pos]; - /* connectivity check is coming from a known remote candidate? - we should also check the port... - */ - if (strcmp(cand_pair->remote_candidate.conn_addr, src6host)==0 - && cand_pair->remote_candidate.conn_port==recvport) - { - ms_message("ice.c: STUN REQ (%s) <- %i (%s:%i:%s <- %s:%i:%s) from known peer", - msg.hasUseCandidate==0?"":"USE-CANDIDATE", - pos, - cand_pair->local_candidate.conn_addr, - cand_pair->local_candidate.conn_port, - cand_pair->local_candidate.cand_type, - cand_pair->remote_candidate.conn_addr, - cand_pair->remote_candidate.conn_port, - cand_pair->remote_candidate.cand_type); - if (cand_pair->connectivity_check==ICE_FROZEN - || cand_pair->connectivity_check==ICE_IN_PROGRESS - || cand_pair->connectivity_check==ICE_FAILED) - { - cand_pair->connectivity_check = ICE_WAITING; - if (msg.hasUseCandidate==TRUE && checklist->rem_controlling==0) - cand_pair->nominated_pair = 1; - } - else if (cand_pair->connectivity_check==ICE_SUCCEEDED) - { - if (msg.hasUseCandidate==TRUE && checklist->rem_controlling==0) - { - cand_pair->nominated_pair = 1; - - /* USE-CANDIDATE is in STUN request and we already succeeded on that link */ - ms_message("ice.c: ICE CONCLUDED == %i (%s:%i:%s <- %s:%i:%s nominated=%s)", - pos, - cand_pair->local_candidate.conn_addr, - cand_pair->local_candidate.conn_port, - cand_pair->local_candidate.cand_type, - cand_pair->remote_candidate.conn_addr, - cand_pair->remote_candidate.conn_port, - cand_pair->remote_candidate.cand_type, - cand_pair->nominated_pair==0?"FALSE":"TRUE"); - memcpy(&session->rtp.rem_addr, &evt_data->ep->addr, evt_data->ep->addrlen); - session->rtp.rem_addrlen=evt_data->ep->addrlen; - } - } - break; - } - cand_pair=NULL; - } - if (cand_pair==NULL) - { - struct CandidatePair new_pair; - memset(&new_pair, 0, sizeof(struct CandidatePair)); - - ms_message("ice.c: STUN REQ <- connectivity check received from an unknow candidate (%s:%i)", src6host, recvport); - /* TODO: add the peer-reflexive candidate */ - - memcpy(&new_pair.local_candidate, &remote_candidates[0].local_candidate, sizeof(new_pair.local_candidate)); - - new_pair.remote_candidate.foundation = 6; - new_pair.remote_candidate.component_id = remote_candidates[0].remote_candidate.component_id; - - /* -> no known base address for peer */ - - new_pair.remote_candidate.conn_port = recvport; - snprintf(new_pair.remote_candidate.conn_addr, sizeof(new_pair.remote_candidate.conn_addr), - "%s", src6host); - - /* take it from PRIORITY STUN attr */ - new_pair.remote_candidate.priority = msg.priority.priority; - if (new_pair.remote_candidate.priority==0) - { - uint32_t type_preference = 110; - uint32_t interface_preference = 255; - uint32_t stun_priority=255; - new_pair.remote_candidate.priority = (type_preference << 24) | (interface_preference << 16) | (stun_priority << 8) - | (256 - new_pair.remote_candidate.component_id); - } - - snprintf(new_pair.remote_candidate.cand_type, sizeof(cand_pair->remote_candidate.cand_type), - "prflx"); - snprintf (new_pair.remote_candidate.transport, - sizeof (new_pair.remote_candidate.transport), - "UDP"); - - if (checklist->rem_controlling==0) - { - uint64_t G = new_pair.local_candidate.priority; - /* controlled agent */ - uint64_t D = new_pair.remote_candidate.priority; - new_pair.pair_priority = (MIN(G, D))<<32 | (MAX(G, D))<<1 | (G>D?1:0); - } - else - { - uint64_t G = new_pair.remote_candidate.priority; - /* controlled agent */ - uint64_t D = new_pair.local_candidate.priority; - new_pair.pair_priority = (MIN(G, D))<<32 | (MAX(G, D))<<1 | (G>D?1:0); - } - new_pair.connectivity_check = ICE_WAITING; - /* insert new pair candidate */ - if (msg.hasUseCandidate==TRUE && checklist->rem_controlling==0) - { - new_pair.nominated_pair = 1; - } - - for (pos=0;pos<10 && remote_candidates[pos].remote_candidate.conn_addr[0]!='\0';pos++) - { - if (pos==9) - { - ms_message("ice.c: STUN REQ (%s) <- X (%s:%i:%s <- %s:%i:%s) no room for new remote reflexive candidate", - msg.hasUseCandidate==0?"":"USE-CANDIDATE", - new_pair.local_candidate.conn_addr, - new_pair.local_candidate.conn_port, - new_pair.local_candidate.cand_type, - new_pair.remote_candidate.conn_addr, - new_pair.remote_candidate.conn_port, - new_pair.remote_candidate.cand_type); - break; - } - if (new_pair.pair_priority > remote_candidates[pos].pair_priority) - { - /* move upper data */ - memmove(&remote_candidates[pos+1], &remote_candidates[pos], sizeof(struct CandidatePair)*(10-pos-1)); - memcpy(&remote_candidates[pos], &new_pair, sizeof(struct CandidatePair)); - - if (checklist->nominated_pair_index>=pos) - checklist->nominated_pair_index++; - ms_message("ice.c: STUN REQ (%s) <- %i (%s:%i:%s <- %s:%i:%s) new learned remote reflexive candidate", - msg.hasUseCandidate==0?"":"USE-CANDIDATE", - pos, - new_pair.local_candidate.conn_addr, - new_pair.local_candidate.conn_port, - new_pair.local_candidate.cand_type, - new_pair.remote_candidate.conn_addr, - new_pair.remote_candidate.conn_port, - new_pair.remote_candidate.cand_type); - break; - } - } - } - } - - { - uint32_t cookie = 0x2112A442; - resp.hasXorMappedAddress = TRUE; - resp.xorMappedAddress.ipv4.port = remote_addr.port^(cookie>>16); - resp.xorMappedAddress.ipv4.addr = remote_addr.addr^cookie; - } - - resp.msgHdr.msgType = (STUN_METHOD_BINDING | STUN_SUCCESS_RESP); - - resp.hasUsername = TRUE; - memcpy(resp.username.value, msg.username.value, msg.username.sizeValue ); - resp.username.sizeValue = msg.username.sizeValue; - - /* ? any messageintegrity in response? */ - resp.hasMessageIntegrity = TRUE; - - { - const char serverName[] = "mediastreamer2 " STUN_VERSION; - resp.hasSoftware = TRUE; - memcpy( resp.softwareName.value, serverName, sizeof(serverName)); - resp.softwareName.sizeValue = sizeof(serverName); - } - - resp.hasFingerprint = TRUE; - - { - char buf[STUN_MAX_MESSAGE_SIZE]; - int len = sizeof(buf); - len = stunEncodeMessage( &resp, buf, len, &hmacPassword ); - if (len) - sendMessage( rtp_socket, buf, len, remote_addr.addr, remote_addr.port); - } - } - else if (STUN_IS_SUCCESS_RESP(msg.msgHdr.msgType)) - { - /* set state to RECV-VALID or VALID */ - StunMessage resp; - StunAddress4 mappedAddr; - memset(&resp, 0, sizeof(StunMessage)); - res = stunParseMessage((char*)mp->b_rptr, mp->b_wptr-mp->b_rptr, - &resp ); - if (!res) - { - ms_error("ice.c: STUN RESP <- Bad format for STUN answer."); - return -1; - } - - if (resp.hasXorMappedAddress!=TRUE) - { - ms_error("ice.c: STUN RESP <- Missing XOR-MAPPED-ADDRESS in STUN answer."); - return -1; - } - - { - uint32_t cookie = 0x2112A442; - uint16_t cookie16 = 0x2112A442 >> 16; - mappedAddr.port = resp.xorMappedAddress.ipv4.port^cookie16; - mappedAddr.addr = resp.xorMappedAddress.ipv4.addr^cookie; - } - - { - struct in_addr inaddr; - char mapped_addr[64]; - struct CandidatePair *cand_pair=NULL; - int pos; - inaddr.s_addr = htonl (mappedAddr.addr); - snprintf(mapped_addr, sizeof(mapped_addr), - "%s", inet_ntoa (inaddr)); - - for (pos=0;pos<10 && remote_candidates[pos].remote_candidate.conn_addr[0]!='\0';pos++) - { - cand_pair = &remote_candidates[pos]; - - if (memcmp(&(cand_pair->tid), &(resp.msgHdr.tr_id), sizeof(resp.msgHdr.tr_id))==0) - { - break; - } - cand_pair = NULL; - } - - if (cand_pair==NULL) - { - ms_message("ice.c: STUN RESP (%s) <- no transaction for STUN answer?", - msg.hasUseCandidate==0?"":"USE-CANDIDATE"); - } - else if (strcmp(src6host, cand_pair->remote_candidate.conn_addr)!=0 - || recvport!=cand_pair->remote_candidate.conn_port) - { - /* 7.1.2.2. Success Cases - -> must be a security issue: refuse non-symmetric answer */ - ms_message("ice.c: STUN RESP (%s) <- %i (%s:%i:%s <- %s:%i:%s nominated=%s) refused because non-symmetric", - msg.hasUseCandidate==0?"":"USE-CANDIDATE", - pos, - cand_pair->local_candidate.conn_addr, - cand_pair->local_candidate.conn_port, - cand_pair->local_candidate.cand_type, - cand_pair->remote_candidate.conn_addr, - cand_pair->remote_candidate.conn_port, - cand_pair->remote_candidate.cand_type, - cand_pair->nominated_pair==0?"FALSE":"TRUE"); - cand_pair->connectivity_check = ICE_FAILED; - } - else - { - /* Youhouhouhou */ - ms_message("ice.c: STUN RESP (%s) <- %i (%s:%i:%s <- %s:%i:%s nominated=%s)", - msg.hasUseCandidate==0?"":"USE-CANDIDATE", - pos, - cand_pair->local_candidate.conn_addr, - cand_pair->local_candidate.conn_port, - cand_pair->local_candidate.cand_type, - cand_pair->remote_candidate.conn_addr, - cand_pair->remote_candidate.conn_port, - cand_pair->remote_candidate.cand_type, - cand_pair->nominated_pair==0?"FALSE":"TRUE"); - if (cand_pair->connectivity_check != ICE_SUCCEEDED) - { - if (checklist->rem_controlling==1 && cand_pair->nominated_pair>0) - { - /* USE-CANDIDATE was in previous STUN request sent */ - ms_message("ice.c: ICE CONCLUDED == %i (%s:%i:%s <- %s:%i:%s nominated=%s)", - pos, - cand_pair->local_candidate.conn_addr, - cand_pair->local_candidate.conn_port, - cand_pair->local_candidate.cand_type, - cand_pair->remote_candidate.conn_addr, - cand_pair->remote_candidate.conn_port, - cand_pair->remote_candidate.cand_type, - cand_pair->nominated_pair==0?"FALSE":"TRUE"); - memcpy(&session->rtp.rem_addr, &evt_data->ep->addr, evt_data->ep->addrlen); - session->rtp.rem_addrlen=evt_data->ep->addrlen; - } - - if (cand_pair->nominated_pair>0 && checklist->rem_controlling==0) - { - /* USE-CANDIDATE is in STUN request and we already succeeded on that link */ - ms_message("ice.c: ICE CONCLUDED == %i (%s:%i:%s <- %s:%i:%s nominated=%s)", - pos, - cand_pair->local_candidate.conn_addr, - cand_pair->local_candidate.conn_port, - cand_pair->local_candidate.cand_type, - cand_pair->remote_candidate.conn_addr, - cand_pair->remote_candidate.conn_port, - cand_pair->remote_candidate.cand_type, - cand_pair->nominated_pair==0?"FALSE":"TRUE"); - memcpy(&session->rtp.rem_addr, &evt_data->ep->addr, evt_data->ep->addrlen); - session->rtp.rem_addrlen=evt_data->ep->addrlen; - } - - cand_pair->connectivity_check = ICE_FAILED; - if (mappedAddr.port == cand_pair->local_candidate.conn_port - && strcmp(mapped_addr, cand_pair->local_candidate.conn_addr)==0) - { - /* no peer-reflexive candidate was discovered */ - cand_pair->connectivity_check = ICE_SUCCEEDED; - } - else - { - int pos2; - for (pos2=0;pos2<10 && remote_candidates[pos2].remote_candidate.conn_addr[0]!='\0';pos2++) - { - if (mappedAddr.port == remote_candidates[pos2].local_candidate.conn_port - && strcmp(mapped_addr, remote_candidates[pos2].local_candidate.conn_addr)==0 - && cand_pair->remote_candidate.conn_port == remote_candidates[pos2].remote_candidate.conn_port - && strcmp(cand_pair->remote_candidate.conn_addr, remote_candidates[pos2].remote_candidate.conn_addr)==0) - { - if (remote_candidates[pos2].connectivity_check==ICE_PRUNED - ||remote_candidates[pos2].connectivity_check==ICE_FROZEN - ||remote_candidates[pos2].connectivity_check==ICE_FAILED - || remote_candidates[pos2].connectivity_check==ICE_IN_PROGRESS) - remote_candidates[pos2].connectivity_check = ICE_WAITING; /* trigger check */ - /* - ms_message("ice.c: STUN RESP (%s) <- %i (%s:%i:%s <- %s:%i:%s) found candidate pair matching XOR-MAPPED-ADDRESS", - msg.hasUseCandidate==0?"":"USE-CANDIDATE", - pos, - cand_pair->local_candidate.conn_addr, - cand_pair->local_candidate.conn_port, - cand_pair->local_candidate.cand_type, - cand_pair->remote_candidate.conn_addr, - cand_pair->remote_candidate.conn_port, - cand_pair->remote_candidate.cand_type); - */ - break; - } - } - if (pos2==10 || remote_candidates[pos2].remote_candidate.conn_addr[0]=='\0') - { - struct CandidatePair new_pair; - memset(&new_pair, 0, sizeof(struct CandidatePair)); - - /* 7.1.2.2.1. Discovering Peer Reflexive Candidates */ - /* If IP & port were different than mappedAddr, there was A NAT - between me and remote destination. */ - memcpy(&new_pair.remote_candidate, &cand_pair->remote_candidate, sizeof(new_pair.remote_candidate)); - - new_pair.local_candidate.foundation = 6; - new_pair.local_candidate.component_id = cand_pair->local_candidate.component_id; - - /* what is my base address? */ - new_pair.local_candidate.rel_port = cand_pair->local_candidate.conn_port; - snprintf(new_pair.local_candidate.rel_addr, sizeof(new_pair.local_candidate.rel_addr), - "%s", cand_pair->local_candidate.conn_addr); - - new_pair.local_candidate.conn_port = mappedAddr.port; - snprintf(new_pair.local_candidate.conn_addr, sizeof(new_pair.local_candidate.conn_addr), - "%s", mapped_addr); - - new_pair.remote_candidate.priority = (110 << 24) | (255 << 16) | (255 << 8) - | (256 - new_pair.remote_candidate.component_id); - - snprintf(new_pair.local_candidate.cand_type, sizeof(cand_pair->local_candidate.cand_type), - "prflx"); - snprintf (new_pair.local_candidate.transport, - sizeof (new_pair.local_candidate.transport), - "UDP"); - - if (checklist->rem_controlling==0) - { - uint64_t G = new_pair.local_candidate.priority; - /* controlled agent */ - uint64_t D = new_pair.remote_candidate.priority; - new_pair.pair_priority = (MIN(G, D))<<32 | (MAX(G, D))<<1 | (G>D?1:0); - } - else - { - uint64_t G = new_pair.remote_candidate.priority; - /* controlled agent */ - uint64_t D = new_pair.local_candidate.priority; - new_pair.pair_priority = (MIN(G, D))<<32 | (MAX(G, D))<<1 | (G>D?1:0); - } - new_pair.connectivity_check = ICE_WAITING; - /* insert new pair candidate */ - for (pos2=0;pos2<10 && remote_candidates[pos2].remote_candidate.conn_addr[0]!='\0';pos2++) - { - if (pos2==9) - { - ms_message("ice.c: STUN RESP (%s) <- %i (%s:%i:%s <- %s:%i:%s) no room for new local peer-reflexive candidate", - msg.hasUseCandidate==0?"":"USE-CANDIDATE", - pos2, - new_pair.local_candidate.conn_addr, - new_pair.local_candidate.conn_port, - new_pair.local_candidate.cand_type, - new_pair.remote_candidate.conn_addr, - new_pair.remote_candidate.conn_port, - new_pair.remote_candidate.cand_type); - break; - } - if (new_pair.pair_priority > remote_candidates[pos2].pair_priority) - { - /* move upper data */ - memmove(&remote_candidates[pos2+1], &remote_candidates[pos2], sizeof(struct CandidatePair)*(10-pos2-1)); - memcpy(&remote_candidates[pos2], &new_pair, sizeof(struct CandidatePair)); - - if (checklist->nominated_pair_index>=pos2) - checklist->nominated_pair_index++; - ms_message("ice.c: STUN RESP (%s) <- %i (%s:%i:%s <- %s:%i:%s) new discovered local peer-reflexive candidate", - msg.hasUseCandidate==0?"":"USE-CANDIDATE", - pos2, - new_pair.local_candidate.conn_addr, - new_pair.local_candidate.conn_port, - new_pair.local_candidate.cand_type, - new_pair.remote_candidate.conn_addr, - new_pair.remote_candidate.conn_port, - new_pair.remote_candidate.cand_type); - break; - } - } - } - } - } - } - } - } - else if (STUN_IS_ERR_RESP(msg.msgHdr.msgType)) - { - int pos; - StunMessage resp; - memset(&resp, 0, sizeof(StunMessage)); - res = stunParseMessage((char*)mp->b_rptr, mp->b_wptr-mp->b_rptr, - &resp ); - if (!res) - { - ms_error("ice.c: ERROR_RESPONSE: Bad format for STUN answer."); - return -1; - } - - for (pos=0;pos<10 && remote_candidates[pos].remote_candidate.conn_addr[0]!='\0';pos++) - { - struct CandidatePair *cand_pair = &remote_candidates[pos]; - - if (memcmp(&(cand_pair->tid), &(resp.msgHdr.tr_id), sizeof(resp.msgHdr.tr_id))==0) - { - cand_pair->connectivity_check = ICE_FAILED; - ms_message("ice.c: ERROR_RESPONSE: ICE_FAILED for candidate pair! %s:%i -> %s:%i", - cand_pair->local_candidate.conn_addr, - cand_pair->local_candidate.conn_port, - cand_pair->remote_candidate.conn_addr, - cand_pair->remote_candidate.conn_port); - if (resp.hasErrorCode==TRUE && resp.errorCode.errorClass==4 && resp.errorCode.number==87) - { - if (remote_candidates[pos].rem_controlling==1) - { - int pos2; - for (pos2=0;pos2<10 && remote_candidates[pos2].remote_candidate.conn_addr[0]!='\0';pos2++) - { - /* controller agent */ - uint64_t G = remote_candidates[pos2].local_candidate.priority; - /* controlled agent */ - uint64_t D = remote_candidates[pos2].remote_candidate.priority; - remote_candidates[pos2].pair_priority = (MIN(G, D))<<32 | (MAX(G, D))<<1 | (G>D?1:0); - } - checklist->rem_controlling=0; - } - else - { - int pos2; - for (pos2=0;pos2<10 && remote_candidates[pos2].remote_candidate.conn_addr[0]!='\0';pos2++) - { - /* controller agent */ - uint64_t G = remote_candidates[pos2].remote_candidate.priority; - /* controlled agent */ - uint64_t D = remote_candidates[pos2].local_candidate.priority; - remote_candidates[pos2].pair_priority = (MIN(G, D))<<32 | (MAX(G, D))<<1 | (G>D?1:0); - } - checklist->rem_controlling=1; - } - /* reset all to initial WAITING state? */ - ms_message("ice.c: ERROR_RESPONSE: 487 -> reset all to ICE_WAITING state"); - for (pos=0;pos<10 && remote_candidates[pos].remote_candidate.conn_addr[0]!='\0';pos++) - { - if (remote_candidates[pos].connectivity_check == ICE_PRUNED) - continue; - remote_candidates[pos].connectivity_check = ICE_WAITING; - memset(&remote_candidates[pos].tid , 0, sizeof(remote_candidates[pos].tid)); - remote_candidates[pos].retransmission_time = 0; - remote_candidates[pos].retransmission_number = 0; - } - } - } - } - } - - return 0; -} - - - - -struct IceData { - RtpSession *session; - OrtpEvQueue *ortp_event; - struct IceCheckList *check_lists; /* table of 10 cpair */ - int rate; -}; - -typedef struct IceData IceData; - -static void ice_init(MSFilter * f) -{ - IceData *d = (IceData *)ms_new(IceData, 1); - - d->ortp_event = ortp_ev_queue_new(); - d->session = NULL; - d->check_lists = NULL; - d->rate = 8000; - f->data = d; -} - -static void ice_postprocess(MSFilter * f) -{ - IceData *d = (IceData *) f->data; - if (d->session!=NULL && d->ortp_event!=NULL) - rtp_session_unregister_event_queue(d->session, d->ortp_event); -} - -static void ice_uninit(MSFilter * f) -{ - IceData *d = (IceData *) f->data; - if (d->ortp_event!=NULL) - ortp_ev_queue_destroy(d->ortp_event); - ms_free(f->data); -} - -static int ice_set_session(MSFilter * f, void *arg) -{ - IceData *d = (IceData *) f->data; - RtpSession *s = (RtpSession *) arg; - PayloadType *pt = rtp_profile_get_payload(rtp_session_get_profile(s), - rtp_session_get_recv_payload_type - (s)); - if (pt != NULL) { - if (strcasecmp("g722", pt->mime_type)==0 ) - d->rate=8000; - else d->rate = pt->clock_rate; - } else { - ms_warning("Receiving undefined payload type ?"); - } - d->session = s; - - return 0; -} - -static int ice_set_sdpcandidates(MSFilter * f, void *arg) -{ - IceData *d = (IceData *) f->data; - struct IceCheckList *scs = NULL; - - if (d == NULL) - return -1; - - scs = (struct IceCheckList *) arg; - d->check_lists = scs; - ice_restart(d->check_lists); - return 0; -} - -static void ice_preprocess(MSFilter * f){ - IceData *d = (IceData *) f->data; - if (d->session!=NULL && d->ortp_event!=NULL) - rtp_session_register_event_queue(d->session, d->ortp_event); -} - -static void ice_process(MSFilter * f) -{ - IceData *d = (IceData *) f->data; - - if (d->session == NULL) - return; - - /* check received STUN request */ - if (d->ortp_event!=NULL) - { - OrtpEvent *evt = ortp_ev_queue_get(d->ortp_event); - - while (evt != NULL) { - if (ortp_event_get_type(evt) == - ORTP_EVENT_STUN_PACKET_RECEIVED) { - ice_process_stun_message(d->session, d->check_lists, evt); - } - if (ortp_event_get_type(evt) == - ORTP_EVENT_TELEPHONE_EVENT) { - } - - ortp_event_destroy(evt); - evt = ortp_ev_queue_get(d->ortp_event); - } - } - - ice_sound_send_stun_request(d->session, d->check_lists, f->ticker->time); -} - -static MSFilterMethod ice_methods[] = { - {MS_ICE_SET_SESSION, ice_set_session}, - {MS_ICE_SET_CANDIDATEPAIRS, ice_set_sdpcandidates}, - {0, NULL} -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_ice_desc = { - MS_ICE_ID, - "MSIce", - N_("ICE filter"), - MS_FILTER_OTHER, - NULL, - 0, - 0, - ice_init, - ice_preprocess, - ice_process, - ice_postprocess, - ice_uninit, - ice_methods -}; - -#else - -MSFilterDesc ms_ice_desc = { - .id = MS_ICE_ID, - .name = "MSIce", - .text = N_("ICE filter"), - .category = MS_FILTER_OTHER, - .ninputs = 0, - .noutputs = 0, - .init = ice_init, - .preprocess = ice_preprocess, - .process = ice_process, - .postprocess=ice_postprocess, - .uninit = ice_uninit, - .methods = ice_methods -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_ice_desc) diff --git a/linphone/mediastreamer2/src/kiss_fft.c b/linphone/mediastreamer2/src/kiss_fft.c deleted file mode 100644 index 27c16085d..000000000 --- a/linphone/mediastreamer2/src/kiss_fft.c +++ /dev/null @@ -1,519 +0,0 @@ -/* -Copyright (c) 2003-2004, Mark Borgerding -Copyright (c) 2005-2007, Jean-Marc Valin - -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 author 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. -*/ - - - -#include "_kiss_fft_guts.h" - - -/* The guts header contains all the multiplication and addition macros that are defined for - fixed or floating point complex numbers. It also delares the kf_ internal functions. - */ - -static void kf_bfly2( - kiss_fft_cpx * Fout, - const size_t fstride, - const kiss_fft_cfg st, - int m, - int N, - int mm - ) -{ - kiss_fft_cpx * Fout2; - kiss_fft_cpx * tw1; - kiss_fft_cpx t; - if (!st->inverse) { - int i,j; - kiss_fft_cpx * Fout_beg = Fout; - for (i=0;itwiddles; - for(j=0;jr , tw1->r),MULT16_16(Fout2->i , tw1->i)), 1); - ti = SHR32(ADD32(MULT16_16(Fout2->i , tw1->r),MULT16_16(Fout2->r , tw1->i)), 1); - tw1 += fstride; - Fout2->r = PSHR32(SUB32(SHL32(EXTEND32(Fout->r), 14), tr), 15); - Fout2->i = PSHR32(SUB32(SHL32(EXTEND32(Fout->i), 14), ti), 15); - Fout->r = PSHR32(ADD32(SHL32(EXTEND32(Fout->r), 14), tr), 15); - Fout->i = PSHR32(ADD32(SHL32(EXTEND32(Fout->i), 14), ti), 15); - ++Fout2; - ++Fout; - } - } - } else { - int i,j; - kiss_fft_cpx * Fout_beg = Fout; - for (i=0;itwiddles; - for(j=0;jinverse) - { - kiss_fft_cpx * Fout_beg = Fout; - for (i=0;itwiddles; - for (j=0;jtwiddles; - for (j=0;jr = PSHR16(Fout->r, 2); - Fout->i = PSHR16(Fout->i, 2); - C_SUB( scratch[5] , *Fout, scratch[1] ); - C_ADDTO(*Fout, scratch[1]); - C_ADD( scratch[3] , scratch[0] , scratch[2] ); - C_SUB( scratch[4] , scratch[0] , scratch[2] ); - Fout[m2].r = PSHR16(Fout[m2].r, 2); - Fout[m2].i = PSHR16(Fout[m2].i, 2); - C_SUB( Fout[m2], *Fout, scratch[3] ); - tw1 += fstride; - tw2 += fstride*2; - tw3 += fstride*3; - C_ADDTO( *Fout , scratch[3] ); - - Fout[m].r = scratch[5].r + scratch[4].i; - Fout[m].i = scratch[5].i - scratch[4].r; - Fout[m3].r = scratch[5].r - scratch[4].i; - Fout[m3].i = scratch[5].i + scratch[4].r; - ++Fout; - } - } - } -} - -static void kf_bfly3( - kiss_fft_cpx * Fout, - const size_t fstride, - const kiss_fft_cfg st, - size_t m - ) -{ - size_t k=m; - const size_t m2 = 2*m; - kiss_fft_cpx *tw1,*tw2; - kiss_fft_cpx scratch[5]; - kiss_fft_cpx epi3; - epi3 = st->twiddles[fstride*m]; - - tw1=tw2=st->twiddles; - - do{ - if (!st->inverse) { - C_FIXDIV(*Fout,3); C_FIXDIV(Fout[m],3); C_FIXDIV(Fout[m2],3); - } - - C_MUL(scratch[1],Fout[m] , *tw1); - C_MUL(scratch[2],Fout[m2] , *tw2); - - C_ADD(scratch[3],scratch[1],scratch[2]); - C_SUB(scratch[0],scratch[1],scratch[2]); - tw1 += fstride; - tw2 += fstride*2; - - Fout[m].r = Fout->r - HALF_OF(scratch[3].r); - Fout[m].i = Fout->i - HALF_OF(scratch[3].i); - - C_MULBYSCALAR( scratch[0] , epi3.i ); - - C_ADDTO(*Fout,scratch[3]); - - Fout[m2].r = Fout[m].r + scratch[0].i; - Fout[m2].i = Fout[m].i - scratch[0].r; - - Fout[m].r -= scratch[0].i; - Fout[m].i += scratch[0].r; - - ++Fout; - }while(--k); -} - -static void kf_bfly5( - kiss_fft_cpx * Fout, - const size_t fstride, - const kiss_fft_cfg st, - int m - ) -{ - kiss_fft_cpx *Fout0,*Fout1,*Fout2,*Fout3,*Fout4; - int u; - kiss_fft_cpx scratch[13]; - kiss_fft_cpx * twiddles = st->twiddles; - kiss_fft_cpx *tw; - kiss_fft_cpx ya,yb; - ya = twiddles[fstride*m]; - yb = twiddles[fstride*2*m]; - - Fout0=Fout; - Fout1=Fout0+m; - Fout2=Fout0+2*m; - Fout3=Fout0+3*m; - Fout4=Fout0+4*m; - - tw=st->twiddles; - for ( u=0; uinverse) { - C_FIXDIV( *Fout0,5); C_FIXDIV( *Fout1,5); C_FIXDIV( *Fout2,5); C_FIXDIV( *Fout3,5); C_FIXDIV( *Fout4,5); - } - scratch[0] = *Fout0; - - C_MUL(scratch[1] ,*Fout1, tw[u*fstride]); - C_MUL(scratch[2] ,*Fout2, tw[2*u*fstride]); - C_MUL(scratch[3] ,*Fout3, tw[3*u*fstride]); - C_MUL(scratch[4] ,*Fout4, tw[4*u*fstride]); - - C_ADD( scratch[7],scratch[1],scratch[4]); - C_SUB( scratch[10],scratch[1],scratch[4]); - C_ADD( scratch[8],scratch[2],scratch[3]); - C_SUB( scratch[9],scratch[2],scratch[3]); - - Fout0->r += scratch[7].r + scratch[8].r; - Fout0->i += scratch[7].i + scratch[8].i; - - scratch[5].r = scratch[0].r + S_MUL(scratch[7].r,ya.r) + S_MUL(scratch[8].r,yb.r); - scratch[5].i = scratch[0].i + S_MUL(scratch[7].i,ya.r) + S_MUL(scratch[8].i,yb.r); - - scratch[6].r = S_MUL(scratch[10].i,ya.i) + S_MUL(scratch[9].i,yb.i); - scratch[6].i = -S_MUL(scratch[10].r,ya.i) - S_MUL(scratch[9].r,yb.i); - - C_SUB(*Fout1,scratch[5],scratch[6]); - C_ADD(*Fout4,scratch[5],scratch[6]); - - scratch[11].r = scratch[0].r + S_MUL(scratch[7].r,yb.r) + S_MUL(scratch[8].r,ya.r); - scratch[11].i = scratch[0].i + S_MUL(scratch[7].i,yb.r) + S_MUL(scratch[8].i,ya.r); - scratch[12].r = - S_MUL(scratch[10].i,yb.i) + S_MUL(scratch[9].i,ya.i); - scratch[12].i = S_MUL(scratch[10].r,yb.i) - S_MUL(scratch[9].r,ya.i); - - C_ADD(*Fout2,scratch[11],scratch[12]); - C_SUB(*Fout3,scratch[11],scratch[12]); - - ++Fout0;++Fout1;++Fout2;++Fout3;++Fout4; - } -} - -/* perform the butterfly for one stage of a mixed radix FFT */ -static void kf_bfly_generic( - kiss_fft_cpx * Fout, - const size_t fstride, - const kiss_fft_cfg st, - int m, - int p - ) -{ - int u,k,q1,q; - kiss_fft_cpx * twiddles = st->twiddles; - kiss_fft_cpx t; - kiss_fft_cpx scratchbuf[17]; - int Norig = st->nfft; - - /*CHECKBUF(scratchbuf,nscratchbuf,p);*/ - if (p>17) - ms_fatal("KissFFT: max radix supported is 17"); - - for ( u=0; uinverse) { - C_FIXDIV(scratchbuf[q1],p); - } - k += m; - } - - k=u; - for ( q1=0 ; q1

=Norig) twidx-=Norig; - C_MUL(t,scratchbuf[q] , twiddles[twidx] ); - C_ADDTO( Fout[ k ] ,t); - } - k += m; - } - } -} - -static -void kf_shuffle( - kiss_fft_cpx * Fout, - const kiss_fft_cpx * f, - const size_t fstride, - int in_stride, - int * factors, - const kiss_fft_cfg st - ) -{ - const int p=*factors++; /* the radix */ - const int m=*factors++; /* stage's fft length/p */ - - /*printf ("fft %d %d %d %d %d %d\n", p*m, m, p, s2, fstride*in_stride, N);*/ - if (m==1) - { - int j; - for (j=0;j32000 || (int32_t)p*(int32_t)p > n) - p = n; /* no more factors, skip to end */ - } - n /= p; - *facbuf++ = p; - *facbuf++ = n; - } while (n > 1); -} -/* - * - * User-callable function to allocate all necessary storage space for the fft. - * - * The return value is a contiguous block of memory, allocated with malloc. As such, - * It can be freed with free(), rather than a kiss_fft-specific function. - * */ -kiss_fft_cfg kiss_fft_alloc(int nfft,int inverse_fft,void * mem,size_t * lenmem ) -{ - kiss_fft_cfg st=NULL; - size_t memneeded = sizeof(struct kiss_fft_state) - + sizeof(kiss_fft_cpx)*(nfft-1); /* twiddle factors*/ - - if ( lenmem==NULL ) { - st = ( kiss_fft_cfg)KISS_FFT_MALLOC( memneeded ); - }else{ - if (mem != NULL && *lenmem >= memneeded) - st = (kiss_fft_cfg)mem; - *lenmem = memneeded; - } - if (st) { - int i; - st->nfft=nfft; - st->inverse = inverse_fft; -#ifdef MS_FIXED_POINT - for (i=0;iinverse) - phase = -phase; - kf_cexp2(st->twiddles+i, DIV32(SHL32(phase,17),nfft)); - } -#else - for (i=0;iinverse) - phase *= -1; - kf_cexp(st->twiddles+i, phase ); - } -#endif - kf_factor(nfft,st->factors); - } - return st; -} - - - - -void kiss_fft_stride(kiss_fft_cfg st,const kiss_fft_cpx *fin,kiss_fft_cpx *fout,int in_stride) -{ - if (fin == fout) - { - ms_fatal("In-place FFT not supported"); - /*CHECKBUF(tmpbuf,ntmpbuf,st->nfft); - kf_work(tmpbuf,fin,1,in_stride, st->factors,st); - SPEEX_MOVE(fout,tmpbuf,st->nfft);*/ - } else { - kf_shuffle( fout, fin, 1,in_stride, st->factors,st); - kf_work( fout, fin, 1,in_stride, st->factors,st, 1, in_stride, 1); - } -} - -void kiss_fft(kiss_fft_cfg cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout) -{ - kiss_fft_stride(cfg,fin,fout,1); -} - diff --git a/linphone/mediastreamer2/src/kiss_fft.h b/linphone/mediastreamer2/src/kiss_fft.h deleted file mode 100644 index 9db74941d..000000000 --- a/linphone/mediastreamer2/src/kiss_fft.h +++ /dev/null @@ -1,114 +0,0 @@ -#ifndef KISS_FFT_H -#define KISS_FFT_H - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - ATTENTION! - If you would like a : - -- a utility that will handle the caching of fft objects - -- real-only (no imaginary time component ) FFT - -- a multi-dimensional FFT - -- a command-line utility to perform ffts - -- a command-line utility to perform fast-convolution filtering - - Then see kfc.h kiss_fftr.h kiss_fftnd.h fftutil.c kiss_fastfir.c - in the tools/ directory. -*/ - -#ifdef USE_SIMD -# include -# define kiss_fft_scalar __m128 -#define KISS_FFT_MALLOC(nbytes) memalign(16,nbytes) -#else -#define KISS_FFT_MALLOC ms_malloc -#endif - - -#ifdef MS_FIXED_POINT -# define kiss_fft_scalar short -#else -# ifndef kiss_fft_scalar -/* default is float */ -# define kiss_fft_scalar float -# endif -#endif - -typedef struct { - kiss_fft_scalar r; - kiss_fft_scalar i; -}kiss_fft_cpx; - -typedef struct kiss_fft_state* kiss_fft_cfg; - -/* add a prefix to these function to avoid collision with the ones defined in speex*/ -#define kiss_fft_alloc ms_kiss_fft_alloc -#define kiss_fft ms_kiss_fft -#define kiss_fft_stride ms_kiss_fft_stride -#define kiss_fft_cleanup ms_kiss_fft_cleanup - - -/* - * kiss_fft_alloc - * - * Initialize a FFT (or IFFT) algorithm's cfg/state buffer. - * - * typical usage: kiss_fft_cfg mycfg=kiss_fft_alloc(1024,0,NULL,NULL); - * - * The return value from fft_alloc is a cfg buffer used internally - * by the fft routine or NULL. - * - * If lenmem is NULL, then kiss_fft_alloc will allocate a cfg buffer using malloc. - * The returned value should be free()d when done to avoid memory leaks. - * - * The state can be placed in a user supplied buffer 'mem': - * If lenmem is not NULL and mem is not NULL and *lenmem is large enough, - * then the function places the cfg in mem and the size used in *lenmem - * and returns mem. - * - * If lenmem is not NULL and ( mem is NULL or *lenmem is not large enough), - * then the function returns NULL and places the minimum cfg - * buffer size in *lenmem. - * */ - -kiss_fft_cfg kiss_fft_alloc(int nfft,int inverse_fft,void * mem,size_t * lenmem); - -/* - * kiss_fft(cfg,in_out_buf) - * - * Perform an FFT on a complex input bufferb. - * for a forward FFT, - * fin should be f[0] , f[1] , ... ,f[nfft-1] - * fout will be F[0] , F[1] , ... ,F[nfft-1] - * Note that each element is complex and can be accessed like - f[k].r and f[k].i - * */ -void kiss_fft(kiss_fft_cfg cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout); - -/* - A more generic version of the above function. It reads its input from every Nth sample. - * */ -void kiss_fft_stride(kiss_fft_cfg cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout,int fin_stride); - -/* If kiss_fft_alloc allocated a buffer, it is one contiguous - buffer and can be simply free()d when no longer needed*/ -#define kiss_fft_free ms_free - -/* - Cleans up some memory that gets managed internally. Not necessary to call, but it might clean up - your compiler output to call this before you exit. -*/ -void kiss_fft_cleanup(void); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/linphone/mediastreamer2/src/kiss_fftr.c b/linphone/mediastreamer2/src/kiss_fftr.c deleted file mode 100644 index a8ab42a64..000000000 --- a/linphone/mediastreamer2/src/kiss_fftr.c +++ /dev/null @@ -1,294 +0,0 @@ -/* -Copyright (c) 2003-2004, Mark Borgerding - -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 author 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. -*/ - - - -#include "kiss_fftr.h" -#include "_kiss_fft_guts.h" - -struct kiss_fftr_state{ - kiss_fft_cfg substate; - kiss_fft_cpx * tmpbuf; - kiss_fft_cpx * super_twiddles; -#ifdef USE_SIMD - long pad; -#endif -}; - -kiss_fftr_cfg kiss_fftr_alloc(int nfft,int inverse_fft,void * mem,size_t * lenmem) -{ - int i; - kiss_fftr_cfg st = NULL; - size_t subsize, memneeded; - - if (nfft & 1) { - ms_warning("Real FFT optimization must be even"); - return NULL; - } - nfft >>= 1; - - kiss_fft_alloc (nfft, inverse_fft, NULL, &subsize); - memneeded = sizeof(struct kiss_fftr_state) + subsize + sizeof(kiss_fft_cpx) * ( nfft * 2); - - if (lenmem == NULL) { - st = (kiss_fftr_cfg) KISS_FFT_MALLOC (memneeded); - } else { - if (*lenmem >= memneeded) - st = (kiss_fftr_cfg) mem; - *lenmem = memneeded; - } - if (!st) - return NULL; - - st->substate = (kiss_fft_cfg) (st + 1); /*just beyond kiss_fftr_state struct */ - st->tmpbuf = (kiss_fft_cpx *) (((char *) st->substate) + subsize); - st->super_twiddles = st->tmpbuf + nfft; - kiss_fft_alloc(nfft, inverse_fft, st->substate, &subsize); - -#ifdef MS_FIXED_POINT - for (i=0;i>1); - if (!inverse_fft) - phase = -phase; - kf_cexp2(st->super_twiddles+i, DIV32(SHL32(phase,16),nfft)); - } -#else - for (i=0;isuper_twiddles+i, phase ); - } -#endif - return st; -} - -void kiss_fftr(kiss_fftr_cfg st,const kiss_fft_scalar *timedata,kiss_fft_cpx *freqdata) -{ - /* input buffer timedata is stored row-wise */ - int k,ncfft; - kiss_fft_cpx fpnk,fpk,f1k,f2k,tw,tdc; - - if ( st->substate->inverse) { - ms_fatal("kiss fft usage error: improper alloc\n"); - } - - ncfft = st->substate->nfft; - - /*perform the parallel fft of two real signals packed in real,imag*/ - kiss_fft( st->substate , (const kiss_fft_cpx*)timedata, st->tmpbuf ); - /* The real part of the DC element of the frequency spectrum in st->tmpbuf - * contains the sum of the even-numbered elements of the input time sequence - * The imag part is the sum of the odd-numbered elements - * - * The sum of tdc.r and tdc.i is the sum of the input time sequence. - * yielding DC of input time sequence - * The difference of tdc.r - tdc.i is the sum of the input (dot product) [1,-1,1,-1... - * yielding Nyquist bin of input time sequence - */ - - tdc.r = st->tmpbuf[0].r; - tdc.i = st->tmpbuf[0].i; - C_FIXDIV(tdc,2); - CHECK_OVERFLOW_OP(tdc.r ,+, tdc.i); - CHECK_OVERFLOW_OP(tdc.r ,-, tdc.i); - freqdata[0].r = tdc.r + tdc.i; - freqdata[ncfft].r = tdc.r - tdc.i; -#ifdef USE_SIMD - freqdata[ncfft].i = freqdata[0].i = _mm_set1_ps(0); -#else - freqdata[ncfft].i = freqdata[0].i = 0; -#endif - - for ( k=1;k <= ncfft/2 ; ++k ) { - fpk = st->tmpbuf[k]; - fpnk.r = st->tmpbuf[ncfft-k].r; - fpnk.i = - st->tmpbuf[ncfft-k].i; - C_FIXDIV(fpk,2); - C_FIXDIV(fpnk,2); - - C_ADD( f1k, fpk , fpnk ); - C_SUB( f2k, fpk , fpnk ); - C_MUL( tw , f2k , st->super_twiddles[k]); - - freqdata[k].r = HALF_OF(f1k.r + tw.r); - freqdata[k].i = HALF_OF(f1k.i + tw.i); - freqdata[ncfft-k].r = HALF_OF(f1k.r - tw.r); - freqdata[ncfft-k].i = HALF_OF(tw.i - f1k.i); - } -} - -void kiss_fftri(kiss_fftr_cfg st,const kiss_fft_cpx *freqdata, kiss_fft_scalar *timedata) -{ - /* input buffer timedata is stored row-wise */ - int k, ncfft; - - if (st->substate->inverse == 0) { - ms_fatal("kiss fft usage error: improper alloc\n"); - } - - ncfft = st->substate->nfft; - - st->tmpbuf[0].r = freqdata[0].r + freqdata[ncfft].r; - st->tmpbuf[0].i = freqdata[0].r - freqdata[ncfft].r; - /*C_FIXDIV(st->tmpbuf[0],2);*/ - - for (k = 1; k <= ncfft / 2; ++k) { - kiss_fft_cpx fk, fnkc, fek, fok, tmp; - fk = freqdata[k]; - fnkc.r = freqdata[ncfft - k].r; - fnkc.i = -freqdata[ncfft - k].i; - /*C_FIXDIV( fk , 2 ); - C_FIXDIV( fnkc , 2 );*/ - - C_ADD (fek, fk, fnkc); - C_SUB (tmp, fk, fnkc); - C_MUL (fok, tmp, st->super_twiddles[k]); - C_ADD (st->tmpbuf[k], fek, fok); - C_SUB (st->tmpbuf[ncfft - k], fek, fok); -#ifdef USE_SIMD - st->tmpbuf[ncfft - k].i *= _mm_set1_ps(-1.0); -#else - st->tmpbuf[ncfft - k].i *= -1; -#endif - } - kiss_fft (st->substate, st->tmpbuf, (kiss_fft_cpx *) timedata); -} - -void kiss_fftr2(kiss_fftr_cfg st,const kiss_fft_scalar *timedata,kiss_fft_scalar *freqdata) -{ - /* input buffer timedata is stored row-wise */ - int k,ncfft; - kiss_fft_cpx f2k,tdc; - ms_word32_t f1kr, f1ki, twr, twi; - - if ( st->substate->inverse) { - ms_fatal("kiss fft usage error: improper alloc\n"); - } - - ncfft = st->substate->nfft; - - /*perform the parallel fft of two real signals packed in real,imag*/ - kiss_fft( st->substate , (const kiss_fft_cpx*)timedata, st->tmpbuf ); - /* The real part of the DC element of the frequency spectrum in st->tmpbuf - * contains the sum of the even-numbered elements of the input time sequence - * The imag part is the sum of the odd-numbered elements - * - * The sum of tdc.r and tdc.i is the sum of the input time sequence. - * yielding DC of input time sequence - * The difference of tdc.r - tdc.i is the sum of the input (dot product) [1,-1,1,-1... - * yielding Nyquist bin of input time sequence - */ - - tdc.r = st->tmpbuf[0].r; - tdc.i = st->tmpbuf[0].i; - C_FIXDIV(tdc,2); - CHECK_OVERFLOW_OP(tdc.r ,+, tdc.i); - CHECK_OVERFLOW_OP(tdc.r ,-, tdc.i); - freqdata[0] = tdc.r + tdc.i; - freqdata[2*ncfft-1] = tdc.r - tdc.i; - - for ( k=1;k <= ncfft/2 ; ++k ) - { - /*fpk = st->tmpbuf[k]; - fpnk.r = st->tmpbuf[ncfft-k].r; - fpnk.i = - st->tmpbuf[ncfft-k].i; - C_FIXDIV(fpk,2); - C_FIXDIV(fpnk,2); - - C_ADD( f1k, fpk , fpnk ); - C_SUB( f2k, fpk , fpnk ); - - C_MUL( tw , f2k , st->super_twiddles[k]); - - freqdata[2*k-1] = HALF_OF(f1k.r + tw.r); - freqdata[2*k] = HALF_OF(f1k.i + tw.i); - freqdata[2*(ncfft-k)-1] = HALF_OF(f1k.r - tw.r); - freqdata[2*(ncfft-k)] = HALF_OF(tw.i - f1k.i); - */ - - /*f1k.r = PSHR32(ADD32(EXTEND32(st->tmpbuf[k].r), EXTEND32(st->tmpbuf[ncfft-k].r)),1); - f1k.i = PSHR32(SUB32(EXTEND32(st->tmpbuf[k].i), EXTEND32(st->tmpbuf[ncfft-k].i)),1); - f2k.r = PSHR32(SUB32(EXTEND32(st->tmpbuf[k].r), EXTEND32(st->tmpbuf[ncfft-k].r)),1); - f2k.i = SHR32(ADD32(EXTEND32(st->tmpbuf[k].i), EXTEND32(st->tmpbuf[ncfft-k].i)),1); - - C_MUL( tw , f2k , st->super_twiddles[k]); - - freqdata[2*k-1] = HALF_OF(f1k.r + tw.r); - freqdata[2*k] = HALF_OF(f1k.i + tw.i); - freqdata[2*(ncfft-k)-1] = HALF_OF(f1k.r - tw.r); - freqdata[2*(ncfft-k)] = HALF_OF(tw.i - f1k.i); - */ - f2k.r = SHR32(SUB32(EXTEND32(st->tmpbuf[k].r), EXTEND32(st->tmpbuf[ncfft-k].r)),1); - f2k.i = PSHR32(ADD32(EXTEND32(st->tmpbuf[k].i), EXTEND32(st->tmpbuf[ncfft-k].i)),1); - - f1kr = SHL32(ADD32(EXTEND32(st->tmpbuf[k].r), EXTEND32(st->tmpbuf[ncfft-k].r)),13); - f1ki = SHL32(SUB32(EXTEND32(st->tmpbuf[k].i), EXTEND32(st->tmpbuf[ncfft-k].i)),13); - - twr = SHR32(SUB32(MULT16_16(f2k.r,st->super_twiddles[k].r),MULT16_16(f2k.i,st->super_twiddles[k].i)), 1); - twi = SHR32(ADD32(MULT16_16(f2k.i,st->super_twiddles[k].r),MULT16_16(f2k.r,st->super_twiddles[k].i)), 1); - -#ifdef MS_FIXED_POINT - freqdata[2*k-1] = PSHR32(f1kr + twr, 15); - freqdata[2*k] = PSHR32(f1ki + twi, 15); - freqdata[2*(ncfft-k)-1] = PSHR32(f1kr - twr, 15); - freqdata[2*(ncfft-k)] = PSHR32(twi - f1ki, 15); -#else - freqdata[2*k-1] = .5f*(f1kr + twr); - freqdata[2*k] = .5f*(f1ki + twi); - freqdata[2*(ncfft-k)-1] = .5f*(f1kr - twr); - freqdata[2*(ncfft-k)] = .5f*(twi - f1ki); - -#endif - } -} - -void kiss_fftri2(kiss_fftr_cfg st,const kiss_fft_scalar *freqdata,kiss_fft_scalar *timedata) -{ - /* input buffer timedata is stored row-wise */ - int k, ncfft; - - if (st->substate->inverse == 0) { - ms_fatal ("kiss fft usage error: improper alloc\n"); - } - - ncfft = st->substate->nfft; - - st->tmpbuf[0].r = freqdata[0] + freqdata[2*ncfft-1]; - st->tmpbuf[0].i = freqdata[0] - freqdata[2*ncfft-1]; - /*C_FIXDIV(st->tmpbuf[0],2);*/ - - for (k = 1; k <= ncfft / 2; ++k) { - kiss_fft_cpx fk, fnkc, fek, fok, tmp; - fk.r = freqdata[2*k-1]; - fk.i = freqdata[2*k]; - fnkc.r = freqdata[2*(ncfft - k)-1]; - fnkc.i = -freqdata[2*(ncfft - k)]; - /*C_FIXDIV( fk , 2 ); - C_FIXDIV( fnkc , 2 );*/ - - C_ADD (fek, fk, fnkc); - C_SUB (tmp, fk, fnkc); - C_MUL (fok, tmp, st->super_twiddles[k]); - C_ADD (st->tmpbuf[k], fek, fok); - C_SUB (st->tmpbuf[ncfft - k], fek, fok); -#ifdef USE_SIMD - st->tmpbuf[ncfft - k].i *= _mm_set1_ps(-1.0); -#else - st->tmpbuf[ncfft - k].i *= -1; -#endif - } - kiss_fft (st->substate, st->tmpbuf, (kiss_fft_cpx *) timedata); -} diff --git a/linphone/mediastreamer2/src/kiss_fftr.h b/linphone/mediastreamer2/src/kiss_fftr.h deleted file mode 100644 index 5f1650cfe..000000000 --- a/linphone/mediastreamer2/src/kiss_fftr.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef KISS_FTR_H -#define KISS_FTR_H - -#include "kiss_fft.h" -#ifdef __cplusplus -extern "C" { -#endif - -#define kiss_fftr_alloc ms_kiss_fftr_alloc -#define kiss_fftr ms_kiss_fftr -#define kiss_fftr2 ms_kiss_fftr2 -#define kiss_fftri ms_kiss_fftri -#define kiss_fftri2 ms_kiss_fftri2 - - -/* - - Real optimized version can save about 45% cpu time vs. complex fft of a real seq. - - - - */ - -typedef struct kiss_fftr_state *kiss_fftr_cfg; - - -kiss_fftr_cfg kiss_fftr_alloc(int nfft,int inverse_fft,void * mem, size_t * lenmem); -/* - nfft must be even - - If you don't care to allocate space, use mem = lenmem = NULL -*/ - - -void kiss_fftr(kiss_fftr_cfg cfg,const kiss_fft_scalar *timedata,kiss_fft_cpx *freqdata); -/* - input timedata has nfft scalar points - output freqdata has nfft/2+1 complex points -*/ - -void kiss_fftr2(kiss_fftr_cfg st,const kiss_fft_scalar *timedata,kiss_fft_scalar *freqdata); - -void kiss_fftri(kiss_fftr_cfg cfg,const kiss_fft_cpx *freqdata,kiss_fft_scalar *timedata); - -void kiss_fftri2(kiss_fftr_cfg st,const kiss_fft_scalar *freqdata, kiss_fft_scalar *timedata); - -/* - input freqdata has nfft/2+1 complex points - output timedata has nfft scalar points -*/ - -#define kiss_fftr_free ms_free - -#ifdef __cplusplus -} -#endif -#endif diff --git a/linphone/mediastreamer2/src/macsnd.c b/linphone/mediastreamer2/src/macsnd.c deleted file mode 100644 index 102a9f4a7..000000000 --- a/linphone/mediastreamer2/src/macsnd.c +++ /dev/null @@ -1,710 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* this file is specifically distributed under a BSD license */ - -/** -* Copyright (C) 2007 Hiroki Mori (himori@users.sourceforge.net) -* 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 of the nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY ``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 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. -**/ -#include -#include -#include - -#include "mediastreamer2/mssndcard.h" -#include "mediastreamer2/msfilter.h" - -MSFilter *ms_ca_read_new(MSSndCard *card); -MSFilter *ms_ca_write_new(MSSndCard *card); - -typedef struct CAData{ - char *pcmdev; - char *mixdev; - AudioUnit caOutAudioUnit; - AudioUnit caInAudioUnit; - AudioStreamBasicDescription caOutASBD; - AudioStreamBasicDescription caInASBD; - AURenderCallbackStruct caOutRenderCallback; - AURenderCallbackStruct caInRenderCallback; - AudioConverterRef caOutConverter; - AudioConverterRef caInConverter; - int pcmfd; - int rate; - int bits; - ms_mutex_t mutex; - queue_t rq; - MSBufferizer * bufferizer; - bool_t read_started; - bool_t write_started; - bool_t stereo; - void *caSourceBuffer; - AudioBufferList *fAudioBuffer, *fMSBuffer; -} CAData; - -// Convenience function to dispose of our audio buffers -void DestroyAudioBufferList(AudioBufferList* list) -{ - UInt32 i; - - if(list) { - for(i = 0; i < list->mNumberBuffers; i++) { - if(list->mBuffers[i].mData) - free(list->mBuffers[i].mData); - } - free(list); - } -} - -// Convenience function to allocate our audio buffers -AudioBufferList *AllocateAudioBufferList(UInt32 numChannels, UInt32 size) -{ - AudioBufferList* list; - UInt32 i; - - list = (AudioBufferList*)calloc(1, sizeof(AudioBufferList) + numChannels * sizeof(AudioBuffer)); - if(list == NULL) - return NULL; - - list->mNumberBuffers = numChannels; - for(i = 0; i < numChannels; ++i) { - list->mBuffers[i].mNumberChannels = 1; - list->mBuffers[i].mDataByteSize = size; - list->mBuffers[i].mData = malloc(size); - if(list->mBuffers[i].mData == NULL) { - DestroyAudioBufferList(list); - return NULL; - } - } - return list; -} - -OSStatus writeACInputProc ( - AudioConverterRef inAudioConverter, - UInt32 *ioNumberDataPackets, - AudioBufferList *ioData, - AudioStreamPacketDescription **outDataPacketDescription, - void* inUserData) -{ - OSStatus err = noErr; - CAData *d=(CAData*)inUserData; - UInt32 packetSize = (d->bits / 8) * (d->stereo ? 2 : 1); -// ms_error("writeACInputProc %d", *ioNumberDataPackets); - - if(*ioNumberDataPackets) { - if(d->caSourceBuffer != NULL) { - free(d->caSourceBuffer); - d->caSourceBuffer = NULL; - } - - d->caSourceBuffer = (void *) calloc (1, *ioNumberDataPackets * packetSize); - - ioData->mBuffers[0].mData = d->caSourceBuffer; // tell the Audio Converter where it's source data is - - ms_mutex_lock(&d->mutex); - int readsize = ms_bufferizer_read(d->bufferizer,d->caSourceBuffer,*ioNumberDataPackets * packetSize); - ms_mutex_unlock(&d->mutex); - if(readsize != *ioNumberDataPackets * packetSize) { - /* ms_error("ms_bufferizer_read error request = %d result = %d", *ioNumberDataPackets * packetSize, readsize); */ - memset(d->caSourceBuffer, 0, *ioNumberDataPackets * packetSize); - ioData->mBuffers[0].mDataByteSize = *ioNumberDataPackets * packetSize; // tell the Audio Converter how much source data there is - } else { - ioData->mBuffers[0].mDataByteSize = readsize; // tell the Audio Converter how much source data there is - } - } - - return err; -} - -OSStatus readACInputProc (AudioConverterRef inAudioConverter, - UInt32* ioNumberDataPackets, - AudioBufferList* ioData, - AudioStreamPacketDescription** ioASPD, - void* inUserData) -{ - CAData *d=(CAData*)inUserData; - AudioBufferList* l_inputABL = d->fAudioBuffer; - UInt32 totalInputBufferSizeBytes = ((*ioNumberDataPackets) * sizeof (float)); - int counter = d->caInASBD.mChannelsPerFrame; - ioData->mNumberBuffers = d->caInASBD.mChannelsPerFrame; - - while (--counter >= 0) { - AudioBuffer* l_ioD_AB = &(ioData->mBuffers[counter]); - l_ioD_AB->mNumberChannels = 1; - l_ioD_AB->mData = (float*)(l_inputABL->mBuffers[counter].mData); - l_ioD_AB->mDataByteSize = totalInputBufferSizeBytes; - } - - return (noErr); -} - -OSStatus readRenderProc(void *inRefCon, - AudioUnitRenderActionFlags *inActionFlags, - const AudioTimeStamp *inTimeStamp, - UInt32 inBusNumber, - UInt32 inNumFrames, - AudioBufferList *ioData) -{ - CAData *d=(CAData*)inRefCon; - OSStatus err = noErr; - - // Render into audio buffer - err = AudioUnitRender(d->caInAudioUnit, inActionFlags, inTimeStamp, inBusNumber, - inNumFrames, d->fAudioBuffer); - if(err != noErr) - ms_error("AudioUnitRender %d size = %d", err, d->fAudioBuffer->mBuffers[0].mDataByteSize); - - UInt32 AvailableOutputBytes = inNumFrames * sizeof (float); - UInt32 propertySize = sizeof (AvailableOutputBytes); - err = AudioConverterGetProperty (d->caInConverter, - kAudioConverterPropertyCalculateOutputBufferSize, - &propertySize, - &AvailableOutputBytes); - - if(err != noErr) - ms_error("AudioConverterGetProperty %d", err); - - UInt32 ActualOutputFrames = AvailableOutputBytes / sizeof (short); - err = AudioConverterFillComplexBuffer (d->caInConverter, - (AudioConverterComplexInputDataProc)(readACInputProc), - inRefCon, - &ActualOutputFrames, - d->fMSBuffer, - NULL); - if(err != noErr) - ms_error("readRenderProc:AudioConverterFillComplexBuffer %08x mNumberBuffers = %d", err, ioData->mNumberBuffers); - - mblk_t *rm=NULL; - rm=allocb(d->fMSBuffer->mBuffers[0].mDataByteSize,0); - memcpy(rm->b_wptr, d->fMSBuffer->mBuffers[0].mData, d->fMSBuffer->mBuffers[0].mDataByteSize); -// memset(rm->b_wptr, 0, d->fMSBuffer->mBuffers[0].mDataByteSize); - rm->b_wptr+=d->fMSBuffer->mBuffers[0].mDataByteSize; - ms_mutex_lock(&d->mutex); - putq(&d->rq,rm); - ms_mutex_unlock(&d->mutex); - rm=NULL; - - return err; -} - -OSStatus writeRenderProc(void *inRefCon, - AudioUnitRenderActionFlags *inActionFlags, - const AudioTimeStamp *inTimeStamp, - UInt32 inBusNumber, - UInt32 inNumFrames, - AudioBufferList *ioData) -{ - OSStatus err= noErr; - void *inInputDataProcUserData=NULL; - CAData *d=(CAData*)inRefCon; - if(d->write_started != FALSE) { - AudioStreamPacketDescription* outPacketDescription = NULL; - err = AudioConverterFillComplexBuffer(d->caOutConverter, writeACInputProc, inRefCon, - &inNumFrames, ioData, outPacketDescription); - if(err != noErr) - ms_error("writeRenderProc:AudioConverterFillComplexBuffer err %08x %d", err, ioData->mNumberBuffers); - } - return err; -} - -static void ca_set_level(MSSndCard *card, MSSndCardMixerElem e, int percent) -{ - CAData *d=(CAData*)card->data; -} - -static int ca_get_level(MSSndCard *card, MSSndCardMixerElem e) -{ - CAData *d=(CAData*)card->data; - return 0; -} - -static void ca_set_source(MSSndCard *card, MSSndCardCapture source) -{ - CAData *d=(CAData*)card->data; -} - -static void ca_init(MSSndCard *card){ - ms_debug("ca_init"); - OSStatus result; - UInt32 param; - AudioDeviceID fInputDeviceID; - CAData *d=ms_new(CAData,1); - - ComponentDescription desc; - - // Get Default Output audio unit - desc.componentType = kAudioUnitType_Output; - desc.componentSubType = kAudioUnitSubType_DefaultOutput; - desc.componentManufacturer = kAudioUnitManufacturer_Apple; - desc.componentFlags = 0; - desc.componentFlagsMask = 0; - - Component comp = FindNextComponent(NULL, &desc); - if (comp == NULL) return; - - result = OpenAComponent(comp, &d->caOutAudioUnit); - if(result != noErr) return; - - // Get Default Input audio unit - desc.componentType = kAudioUnitType_Output; - desc.componentSubType = kAudioUnitSubType_HALOutput; - desc.componentManufacturer = kAudioUnitManufacturer_Apple; - desc.componentFlags = 0; - desc.componentFlagsMask = 0; - - comp = FindNextComponent(NULL, &desc); - if (comp == NULL) return; - - result = OpenAComponent(comp, &d->caInAudioUnit); - if(result != noErr) return; - - AudioUnitInitialize(d->caOutAudioUnit); - AudioUnitInitialize(d->caInAudioUnit); - - UInt32 asbdsize = sizeof(AudioStreamBasicDescription); - memset((char *)&d->caOutASBD, 0, asbdsize); - memset((char *)&d->caInASBD, 0, asbdsize); - - // Setup Output audio unit - result = AudioUnitGetProperty (d->caOutAudioUnit, - kAudioUnitProperty_StreamFormat, - kAudioUnitScope_Output, - 0, - &d->caOutASBD, - &asbdsize); - ms_message("AudioUnitGetProperty %i %x", result, result); - result = AudioUnitSetProperty (d->caOutAudioUnit, - kAudioUnitProperty_StreamFormat, - kAudioUnitScope_Input, - 0, - &d->caOutASBD, - asbdsize); - ms_message("AudioUnitSetProperty %i %x", result, result); - - // Setup Input audio unit - // Enable input on the AUHAL - param = 1; - result = AudioUnitSetProperty(d->caInAudioUnit, - kAudioOutputUnitProperty_EnableIO, - kAudioUnitScope_Input, - 1, - ¶m, - sizeof(UInt32)); - ms_message("AudioUnitSetProperty %i %x", result, result); - -// Select the default input device - param = sizeof(AudioDeviceID); - result = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultInputDevice, - ¶m, - &fInputDeviceID); - ms_message("AudioHardwareGetProperty %i %x", result, result); - - // Set the current device to the default input unit. - result = AudioUnitSetProperty(d->caInAudioUnit, - kAudioOutputUnitProperty_CurrentDevice, - kAudioUnitScope_Global, - 0, - &fInputDeviceID, - sizeof(AudioDeviceID)); - ms_message("AudioUnitSetProperty %i %x", result, result); - - AudioStreamBasicDescription tmpASBD; - result = AudioUnitGetProperty (d->caInAudioUnit, - kAudioUnitProperty_StreamFormat, - kAudioUnitScope_Input, - 0, - &tmpASBD, - &asbdsize); - ms_message("AudioUnitGetProperty %i %x", result, result); - - int fAudioChannels = 1; - d->caInASBD.mChannelsPerFrame = fAudioChannels; - d->caInASBD.mSampleRate = tmpASBD.mSampleRate; - d->caInASBD.mFormatID = kAudioFormatLinearPCM; - d->caInASBD.mFormatFlags = kAudioFormatFlagIsFloat | kAudioFormatFlagIsPacked | - kAudioFormatFlagIsNonInterleaved; - if (d->caInASBD.mFormatID == kAudioFormatLinearPCM && fAudioChannels == 1) - d->caInASBD.mFormatFlags &= ~kLinearPCMFormatFlagIsNonInterleaved; - d->caInASBD.mFormatFlags = kAudioFormatFlagIsFloat; - if (htonl(0x1234) == 0x1234) - d->caInASBD.mFormatFlags |= kAudioFormatFlagIsBigEndian; - d->caInASBD.mBitsPerChannel = sizeof(Float32) * 8; - d->caInASBD.mBytesPerFrame = d->caInASBD.mBitsPerChannel / 8; - d->caInASBD.mFramesPerPacket = 1; - d->caInASBD.mBytesPerPacket = d->caInASBD.mBytesPerFrame; - - result = AudioUnitSetProperty(d->caInAudioUnit, - kAudioUnitProperty_StreamFormat, - kAudioUnitScope_Output, - 1, - &d->caInASBD, - sizeof(AudioStreamBasicDescription)); - ms_message("AudioUnitGetProperty %i %x", result, result); - - d->caSourceBuffer=NULL; - - // Get the number of frames in the IO buffer(s) - param = sizeof(UInt32); - UInt32 fAudioSamples; - result = AudioUnitGetProperty(d->caInAudioUnit, - kAudioDevicePropertyBufferFrameSize, - kAudioUnitScope_Global, - 0, - &fAudioSamples, - ¶m); - if(result != noErr) - { - fprintf(stderr, "failed to get audio sample size\n"); - return; - } - // Allocate our low device audio buffers - d->fAudioBuffer = AllocateAudioBufferList(d->caInASBD.mChannelsPerFrame, - fAudioSamples * d->caInASBD.mBytesPerFrame); - if(d->fAudioBuffer == NULL) - { - fprintf(stderr, "failed to allocate buffers\n"); - return; - } - // Allocate our low device audio buffers - d->fMSBuffer = AllocateAudioBufferList(d->caInASBD.mChannelsPerFrame, - fAudioSamples * d->caInASBD.mBytesPerFrame); - if(d->fMSBuffer == NULL) - { - fprintf(stderr, "failed to allocate buffers\n"); - return; - } - - d->pcmdev=NULL; - d->mixdev=NULL; - d->pcmfd=-1; - d->read_started=FALSE; - d->write_started=FALSE; - d->bits=16; - d->rate=8000; - d->stereo=FALSE; - qinit(&d->rq); - d->bufferizer=ms_bufferizer_new(); - ms_mutex_init(&d->mutex,NULL); - card->data=d; -} - -static void ca_uninit(MSSndCard *card){ - CAData *d=(CAData*)card->data; - if (d->pcmdev!=NULL) ms_free(d->pcmdev); - if (d->mixdev!=NULL) ms_free(d->mixdev); - ms_bufferizer_destroy(d->bufferizer); - flushq(&d->rq,0); - ms_mutex_destroy(&d->mutex); - ms_free(d); -} - -static void ca_detect(MSSndCardManager *m); -static MSSndCard *ca_duplicate(MSSndCard *obj); - -MSSndCardDesc ca_card_desc={ - .driver_type="CA", - .detect=ca_detect, - .init=ca_init, - .set_level=ca_set_level, - .get_level=ca_get_level, - .set_capture=ca_set_source, - .set_control=NULL, - .get_control=NULL, - .create_reader=ms_ca_read_new, - .create_writer=ms_ca_write_new, - .uninit=ca_uninit, - .duplicate=ca_duplicate -}; - -static MSSndCard *ca_duplicate(MSSndCard *obj){ - MSSndCard *card=ms_snd_card_new(&ca_card_desc); - CAData *dcard=(CAData*)card->data; - CAData *dobj=(CAData*)obj->data; - dcard->pcmdev=ms_strdup(dobj->pcmdev); - dcard->mixdev=ms_strdup(dobj->mixdev); - card->name=ms_strdup(obj->name); - return card; -} - -static MSSndCard *ca_card_new(){ - MSSndCard *card=ms_snd_card_new(&ca_card_desc); - card->name=ms_strdup("Core Audio"); - return card; -} - -static void ca_detect(MSSndCardManager *m){ - ms_debug("ca_detect"); - MSSndCard *card=ca_card_new(); - ms_snd_card_manager_add_card(m,card); -} - -static void ca_start_r(MSSndCard *card){ - OSStatus err= noErr; - CAData *d=(CAData*)card->data; - ms_debug("ca_start_r"); - - if (d->read_started==FALSE){ - AudioStreamBasicDescription outASBD; - outASBD = d->caInASBD; - outASBD.mSampleRate = d->rate; - outASBD.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked; - if (htonl(0x1234) == 0x1234) - outASBD.mFormatFlags |= kLinearPCMFormatFlagIsBigEndian; - outASBD.mBytesPerPacket = (d->bits / 8) * outASBD.mChannelsPerFrame; - outASBD.mBytesPerFrame = (d->bits / 8) * outASBD.mChannelsPerFrame; - outASBD.mFramesPerPacket = 1; - outASBD.mBitsPerChannel = d->bits; - - err = AudioConverterNew( &d->caInASBD, &outASBD, &d->caInConverter); - if(err != noErr) - ms_error("AudioConverterNew %x %d", err, outASBD.mBytesPerFrame); - else - CAShow(d->caInConverter); - - d->caInRenderCallback.inputProc = readRenderProc; - d->caInRenderCallback.inputProcRefCon = d; - err = AudioUnitSetProperty(d->caInAudioUnit, - kAudioOutputUnitProperty_SetInputCallback, - kAudioUnitScope_Global, - 0, - &d->caInRenderCallback, - sizeof(AURenderCallbackStruct)); - - if(AudioOutputUnitStart(d->caInAudioUnit) == noErr) - d->read_started = TRUE; - } -} - -static void ca_stop_r(MSSndCard *card){ - CAData *d=(CAData*)card->data; - OSErr err; - if(d->read_started == TRUE) { - if(AudioOutputUnitStop(d->caInAudioUnit) == noErr) - d->read_started=FALSE; - } -} - -static void ca_start_w(MSSndCard *card){ - OSStatus err= noErr; - ms_debug("ca_start_w"); - CAData *d=(CAData*)card->data; - if (d->write_started==FALSE){ - AudioStreamBasicDescription inASBD; - inASBD = d->caOutASBD; - inASBD.mSampleRate = d->rate; - inASBD.mFormatID = kAudioFormatLinearPCM; - // http://developer.apple.com/documentation/MusicAudio/Reference/CoreAudioDataTypesRef/Reference/reference.html - inASBD.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked; - if (htonl(0x1234) == 0x1234) - inASBD.mFormatFlags |= kLinearPCMFormatFlagIsBigEndian; - inASBD.mChannelsPerFrame = d->stereo ? 2 : 1; - inASBD.mBytesPerPacket = (d->bits / 8) * inASBD.mChannelsPerFrame; - inASBD.mBytesPerFrame = (d->bits / 8) * inASBD.mChannelsPerFrame; - inASBD.mFramesPerPacket = 1; - inASBD.mBitsPerChannel = d->bits; - - - err = AudioConverterNew( &inASBD, &d->caOutASBD, &d->caOutConverter); - if(err != noErr) - ms_error("AudioConverterNew %x %d", err, inASBD.mBytesPerFrame); - else - CAShow(d->caOutConverter); - - if (inASBD.mChannelsPerFrame == 1 && d->caOutASBD.mChannelsPerFrame == 2) - { - if (d->caOutConverter) - { - // This should be as large as the number of output channels, - // each element specifies which input channel's data is routed to that output channel - SInt32 channelMap[] = { 0, 0 }; - err = AudioConverterSetProperty(d->caOutConverter, kAudioConverterChannelMap, 2*sizeof(SInt32), channelMap); - } - } - - memset((char*)&d->caOutRenderCallback, 0, sizeof(AURenderCallbackStruct)); - d->caOutRenderCallback.inputProc = writeRenderProc; - d->caOutRenderCallback.inputProcRefCon = d; - err = AudioUnitSetProperty (d->caOutAudioUnit, - kAudioUnitProperty_SetRenderCallback, - kAudioUnitScope_Input, - 0, - &d->caOutRenderCallback, - sizeof(AURenderCallbackStruct)); - if(err != noErr) - ms_error("AudioUnitSetProperty %x", err); - - if(err == noErr) { - if(AudioOutputUnitStart(d->caOutAudioUnit) == noErr) - d->write_started=TRUE; - } - } -} - -static void ca_stop_w(MSSndCard *card){ - CAData *d=(CAData*)card->data; - OSErr err; - if(d->write_started == TRUE) { - if(AudioOutputUnitStop(d->caOutAudioUnit) == noErr) - d->write_started=FALSE; - } -} - -static mblk_t *ca_get(MSSndCard *card){ - CAData *d=(CAData*)card->data; - mblk_t *m; - ms_mutex_lock(&d->mutex); - m=getq(&d->rq); - ms_mutex_unlock(&d->mutex); - return m; -} - -static void ca_put(MSSndCard *card, mblk_t *m){ - CAData *d=(CAData*)card->data; - ms_mutex_lock(&d->mutex); - ms_bufferizer_put(d->bufferizer,m); - ms_mutex_unlock(&d->mutex); -} - - -static void ca_read_preprocess(MSFilter *f){ - MSSndCard *card=(MSSndCard*)f->data; - ca_start_r(card); -} - -static void ca_read_postprocess(MSFilter *f){ - MSSndCard *card=(MSSndCard*)f->data; - ca_stop_r(card); -} - -static void ca_read_process(MSFilter *f){ - MSSndCard *card=(MSSndCard*)f->data; - mblk_t *m; - while((m=ca_get(card))!=NULL){ - ms_queue_put(f->outputs[0],m); - } -} - -static void ca_write_preprocess(MSFilter *f){ - ms_debug("ca_write_preprocess"); - MSSndCard *card=(MSSndCard*)f->data; - ca_start_w(card); -} - -static void ca_write_postprocess(MSFilter *f){ - ms_debug("ca_write_postprocess"); - MSSndCard *card=(MSSndCard*)f->data; - ca_stop_w(card); -} - -static void ca_write_process(MSFilter *f){ -// ms_debug("ca_write_process"); - MSSndCard *card=(MSSndCard*)f->data; - mblk_t *m; - while((m=ms_queue_get(f->inputs[0]))!=NULL){ - ca_put(card,m); - } -} - -static int set_rate(MSFilter *f, void *arg){ - ms_debug("set_rate %d", *((int*)arg)); - MSSndCard *card=(MSSndCard*)f->data; - CAData *d=(CAData*)card->data; - d->rate=*((int*)arg); - return 0; -} - -static int set_nchannels(MSFilter *f, void *arg){ - ms_debug("set_nchannels %d", *((int*)arg)); - MSSndCard *card=(MSSndCard*)f->data; - CAData *d=(CAData*)card->data; - d->stereo=(*((int*)arg)==2); - return 0; -} - -static MSFilterMethod ca_methods[]={ - { MS_FILTER_SET_SAMPLE_RATE , set_rate }, - { MS_FILTER_SET_NCHANNELS , set_nchannels }, - { 0 , NULL } -}; - -MSFilterDesc ca_read_desc={ - .id=MS_CA_READ_ID, - .name="MSCARead", - .text=N_("Sound capture filter for MacOS X Core Audio drivers"), - .category=MS_FILTER_OTHER, - .ninputs=0, - .noutputs=1, - .preprocess=ca_read_preprocess, - .process=ca_read_process, - .postprocess=ca_read_postprocess, - .methods=ca_methods -}; - - -MSFilterDesc ca_write_desc={ - .id=MS_CA_WRITE_ID, - .name="MSCAWrite", - .text=N_("Sound playback filter for MacOS X Core Audio drivers"), - .category=MS_FILTER_OTHER, - .ninputs=1, - .noutputs=0, - .preprocess=ca_write_preprocess, - .process=ca_write_process, - .postprocess=ca_write_postprocess, - .methods=ca_methods -}; - -MSFilter *ms_ca_read_new(MSSndCard *card){ - ms_debug("ms_ca_read_new"); - MSFilter *f=ms_filter_new_from_desc(&ca_read_desc); - f->data=card; - return f; -} - - -MSFilter *ms_ca_write_new(MSSndCard *card){ - ms_debug("ms_ca_write_new"); - MSFilter *f=ms_filter_new_from_desc(&ca_write_desc); - f->data=card; - return f; -} - -MS_FILTER_DESC_EXPORT(ca_read_desc) -MS_FILTER_DESC_EXPORT(ca_write_desc) diff --git a/linphone/mediastreamer2/src/mire.c b/linphone/mediastreamer2/src/mire.c deleted file mode 100644 index 27363ec20..000000000 --- a/linphone/mediastreamer2/src/mire.c +++ /dev/null @@ -1,164 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifdef HAVE_CONFIG_H -#include "mediastreamer-config.h" -#endif - -#include "mediastreamer2/mscommon.h" -#include "mediastreamer2/msvideo.h" -#include "mediastreamer2/msfilter.h" -#include "mediastreamer2/msticker.h" -#include "mediastreamer2/mswebcam.h" - - -typedef struct _MireData{ - MSVideoSize vsize; - MSPicture pict; - int index; - uint64_t starttime; - float fps; - mblk_t *pic; -}MireData; - -void mire_init(MSFilter *f){ - MireData *d=(MireData*)ms_new(MireData,1); - d->vsize.width=MS_VIDEO_SIZE_CIF_W; - d->vsize.height=MS_VIDEO_SIZE_CIF_H; - d->fps=15; - d->index=0; - d->starttime=0; - d->pic=NULL; - f->data=d; -} - -void mire_uninit(MSFilter *f){ - ms_free(f->data); -} - -void mire_preprocess(MSFilter *f){ - MireData *d=(MireData*)f->data; - d->pic=yuv_buf_alloc(&d->pict,d->vsize.width,d->vsize.height); - memset(d->pic->b_rptr,0,d->pic->b_wptr-d->pic->b_rptr); - d->starttime=f->ticker->time; -} - -void plane_draw(uint8_t *p, int w, int h, int lsz, int index){ - int i,j; - for(i=0;ipict.planes[0],d->pict.w,d->pict.h,d->pict.strides[0],d->index*2); - plane_draw(d->pict.planes[1],d->pict.w/2,d->pict.h/2,d->pict.strides[1],d->index); - plane_draw(d->pict.planes[2],d->pict.w/2,d->pict.h/2,d->pict.strides[2],d->index); -} - -void mire_process(MSFilter *f){ - MireData *d=(MireData*)f->data; - float elapsed=(float)(f->ticker->time-d->starttime); - if ((elapsed*d->fps/1000.0)>d->index){ - mire_draw(d); - ms_queue_put(f->outputs[0],dupb(d->pic)); - d->index++; - } -} - -void mire_postprocess(MSFilter *f){ - MireData *d=(MireData*)f->data; - if (d->pic) { - freemsg(d->pic); - d->pic=NULL; - } -} - -int mire_set_vsize(MSFilter *f, void* data){ - MireData *d=(MireData*)f->data; - d->vsize=*(MSVideoSize*)data; - return 0; -} - -int mire_set_fps(MSFilter *f, void* data){ - MireData *d=(MireData*)f->data; - d->fps=*(float*)data; - return 0; -} - -int mire_get_fmt(MSFilter *f, void* data){ - *(MSPixFmt*)data=MS_YUV420P; - return 0; -} - -MSFilterMethod mire_methods[]={ - { MS_FILTER_SET_VIDEO_SIZE, mire_set_vsize }, - { MS_FILTER_SET_FPS , mire_set_fps }, - { MS_FILTER_GET_PIX_FMT , mire_get_fmt }, - { 0,0 } -}; - -MSFilterDesc ms_mire_desc={ - MS_MIRE_ID, - "MSMire", - "A filter that outputs synthetic moving picture", - MS_FILTER_OTHER, - NULL, - 0, - 1, - mire_init, - mire_preprocess, - mire_process, - mire_postprocess, - mire_uninit, - mire_methods -}; - -MS_FILTER_DESC_EXPORT(ms_mire_desc) - -static void mire_detect(MSWebCamManager *obj); - -static void mire_cam_init(MSWebCam *cam){ - cam->name=ms_strdup("Mire (synthetic moving picture)"); -} - - -static MSFilter *mire_create_reader(MSWebCam *obj){ - return ms_filter_new_from_desc(&ms_mire_desc); -} - -MSWebCamDesc mire_desc={ - "Mire", - &mire_detect, - &mire_cam_init, - &mire_create_reader, - NULL -}; - -static void mire_detect(MSWebCamManager *obj){ - char *debug=getenv("DEBUG"); - if (debug && atoi(debug)==1){ - MSWebCam *cam=ms_web_cam_new(&mire_desc); - ms_web_cam_manager_add_cam(obj,cam); - } -} - diff --git a/linphone/mediastreamer2/src/mscommon.c b/linphone/mediastreamer2/src/mscommon.c deleted file mode 100644 index 3138c3539..000000000 --- a/linphone/mediastreamer2/src/mscommon.c +++ /dev/null @@ -1,589 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifdef HAVE_CONFIG_H -#include "mediastreamer-config.h" -#endif - -extern void __register_ffmpeg_encoders_if_possible(void); - -#include "mediastreamer2/mscommon.h" -#include "mediastreamer2/msfilter.h" - -#include "alldescs.h" -#include "mediastreamer2/mssndcard.h" -#include "mediastreamer2/mswebcam.h" - -#if !defined(_WIN32_WCE) -#include -#endif -#ifndef WIN32 -#include -#else -#ifndef PACKAGE_PLUGINS_DIR -#if defined(WIN32) || defined(_WIN32_WCE) -#define PACKAGE_PLUGINS_DIR "plugins\\" -#else -#define PACKAGE_PLUGINS_DIR "." -#endif -#endif -#endif -#ifdef HAVE_DLOPEN -#include -#endif - -#if defined(__APPLE__) && !defined(__GNUC__) -#import -#include -#endif - -MSList *ms_list_new(void *data){ - MSList *new_elem=(MSList *)ms_new(MSList,1); - new_elem->prev=new_elem->next=NULL; - new_elem->data=data; - return new_elem; -} - -MSList * ms_list_append(MSList *elem, void * data){ - MSList *new_elem=ms_list_new(data); - MSList *it=elem; - if (elem==NULL) return new_elem; - while (it->next!=NULL) it=ms_list_next(it); - it->next=new_elem; - new_elem->prev=it; - return elem; -} - -MSList * ms_list_prepend(MSList *elem, void *data){ - MSList *new_elem=ms_list_new(data); - if (elem!=NULL) { - new_elem->next=elem; - elem->prev=new_elem; - } - return new_elem; -} - - -MSList * ms_list_concat(MSList *first, MSList *second){ - MSList *it=first; - if (it==NULL) return second; - while(it->next!=NULL) it=ms_list_next(it); - it->next=second; - second->prev=it; - return first; -} - -MSList * ms_list_free(MSList *list){ - MSList *elem = list; - MSList *tmp; - if (list==NULL) return NULL; - while(elem->next!=NULL) { - tmp = elem; - elem = elem->next; - ms_free(tmp); - } - ms_free(elem); - return NULL; -} - -MSList * ms_list_remove(MSList *first, void *data){ - MSList *it; - it=ms_list_find(first,data); - if (it) return ms_list_remove_link(first,it); - else { - ms_warning("ms_list_remove: no element with %p data was in the list", data); - return first; - } -} - -int ms_list_size(const MSList *first){ - int n=0; - while(first!=NULL){ - ++n; - first=first->next; - } - return n; -} - -void ms_list_for_each(const MSList *list, void (*func)(void *)){ - for(;list!=NULL;list=list->next){ - func(list->data); - } -} - -void ms_list_for_each2(const MSList *list, void (*func)(void *, void *), void *user_data){ - for(;list!=NULL;list=list->next){ - func(list->data,user_data); - } -} - -MSList *ms_list_remove_link(MSList *list, MSList *elem){ - MSList *ret; - if (elem==list){ - ret=elem->next; - elem->prev=NULL; - elem->next=NULL; - if (ret!=NULL) ret->prev=NULL; - ms_free(elem); - return ret; - } - elem->prev->next=elem->next; - if (elem->next!=NULL) elem->next->prev=elem->prev; - elem->next=NULL; - elem->prev=NULL; - ms_free(elem); - return list; -} - -MSList *ms_list_find(MSList *list, void *data){ - for(;list!=NULL;list=list->next){ - if (list->data==data) return list; - } - return NULL; -} - -MSList *ms_list_find_custom(MSList *list, int (*compare_func)(const void *, const void*), void *user_data){ - for(;list!=NULL;list=list->next){ - if (compare_func(list->data,user_data)==0) return list; - } - return NULL; -} - -void * ms_list_nth_data(const MSList *list, int index){ - int i; - for(i=0;list!=NULL;list=list->next,++i){ - if (i==index) return list->data; - } - ms_error("ms_list_nth_data: no such index in list."); - return NULL; -} - -int ms_list_position(const MSList *list, MSList *elem){ - int i; - for(i=0;list!=NULL;list=list->next,++i){ - if (elem==list) return i; - } - ms_error("ms_list_position: no such element in list."); - return -1; -} - -int ms_list_index(const MSList *list, void *data){ - int i; - for(i=0;list!=NULL;list=list->next,++i){ - if (data==list->data) return i; - } - ms_error("ms_list_index: no such element in list."); - return -1; -} - -MSList *ms_list_insert_sorted(MSList *list, void *data, int (*compare_func)(const void *, const void*)){ - MSList *it,*previt=NULL; - MSList *nelem; - MSList *ret=list; - if (list==NULL) return ms_list_append(list,data); - else{ - nelem=ms_list_new(data); - for(it=list;it!=NULL;it=it->next){ - previt=it; - if (compare_func(data,it->data)<=0){ - nelem->prev=it->prev; - nelem->next=it; - if (it->prev!=NULL) - it->prev->next=nelem; - else{ - ret=nelem; - } - it->prev=nelem; - return ret; - } - } - previt->next=nelem; - nelem->prev=previt; - } - return ret; -} - -MSList *ms_list_insert(MSList *list, MSList *before, void *data){ - MSList *elem; - if (list==NULL || before==NULL) return ms_list_append(list,data); - for(elem=list;elem!=NULL;elem=ms_list_next(elem)){ - if (elem==before){ - if (elem->prev==NULL) - return ms_list_prepend(list,data); - else{ - MSList *nelem=ms_list_new(data); - nelem->prev=elem->prev; - nelem->next=elem; - elem->prev->next=nelem; - elem->prev=nelem; - } - } - } - return list; -} - -MSList *ms_list_copy(const MSList *list){ - MSList *copy=NULL; - const MSList *iter; - for(iter=list;iter!=NULL;iter=ms_list_next(iter)){ - copy=ms_list_append(copy,iter->data); - } - return copy; -} - - -#ifdef __APPLE__ -#define PLUGINS_EXT ".dylib" -#else -#define PLUGINS_EXT ".so" -#endif - -typedef void (*init_func_t)(void); - -int ms_load_plugins(const char *dir){ - int num=0; -#if defined(WIN32) && !defined(_WIN32_WCE) - WIN32_FIND_DATA FileData; - HANDLE hSearch; - char szDirPath[1024]; - char szPluginFile[1024]; - BOOL fFinished = FALSE; - const char *tmp=getenv("DEBUG"); - BOOL debug=(tmp!=NULL && atoi(tmp)==1); - snprintf(szDirPath, sizeof(szDirPath), "%s", dir); - - // Start searching for .dll files in the current directory. - - snprintf(szDirPath, sizeof(szDirPath), "%s\\*.dll", dir); - hSearch = FindFirstFile(szDirPath, &FileData); - if (hSearch == INVALID_HANDLE_VALUE) - { - ms_message("no plugin (*.dll) found in %s.", szDirPath); - return 0; - } - snprintf(szDirPath, sizeof(szDirPath), "%s", dir); - - while (!fFinished) - { - /* load library */ - HINSTANCE os_handle; - UINT em; - if (!debug) em = SetErrorMode (SEM_FAILCRITICALERRORS); - - snprintf(szPluginFile, sizeof(szPluginFile), "%s\\%s", szDirPath, FileData.cFileName); - os_handle = LoadLibraryEx (szPluginFile, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); - if (os_handle==NULL) - { - ms_message("Fail to load plugin %s with altered search path: error %i",szPluginFile,GetLastError()); - os_handle = LoadLibraryEx (szPluginFile, NULL, 0); - } - if (!debug) SetErrorMode (em); - if (os_handle==NULL) - ms_error("Fail to load plugin %s", szPluginFile); - else{ - init_func_t initroutine; - char szPluginName[256]; - char szMethodName[256]; - char *minus; - snprintf(szPluginName, 256, "%s", FileData.cFileName); - /*on mingw, dll names might be libsomething-3.dll. We must skip the -X.dll stuff*/ - minus=strchr(szPluginName,'-'); - if (minus) *minus='\0'; - else szPluginName[strlen(szPluginName)-4]='\0'; /*remove .dll*/ - snprintf(szMethodName, 256, "%s_init", szPluginName); - initroutine = (init_func_t) GetProcAddress (os_handle, szMethodName); - if (initroutine!=NULL){ - initroutine(); - ms_message("Plugin loaded (%s)", szPluginFile); - num++; - }else{ - ms_warning("Could not locate init routine of plugin %s. Should be %s", - szPluginFile, szMethodName); - } - } - if (!FindNextFile(hSearch, &FileData)) { - if (GetLastError() == ERROR_NO_MORE_FILES){ - fFinished = TRUE; - } - else - { - ms_error("couldn't find next plugin dll."); - fFinished = TRUE; - } - } - } - /* Close the search handle. */ - FindClose(hSearch); - -#elif HAVE_DLOPEN - DIR *ds; - struct dirent *de; - char *fullpath; - ds=opendir(dir); - if (ds==NULL){ - ms_message("Cannot open directory %s: %s",dir,strerror(errno)); - return -1; - } - while( (de=readdir(ds))!=NULL){ - if ((de->d_type==DT_REG && strstr(de->d_name,PLUGINS_EXT)!=NULL) - || (de->d_type==DT_UNKNOWN && strstr(de->d_name,PLUGINS_EXT)==de->d_name+strlen(de->d_name)-strlen(PLUGINS_EXT))) { - void *handle; - fullpath=ms_strdup_printf("%s/%s",dir,de->d_name); - ms_message("Loading plugin %s...",fullpath); - - if ( (handle=dlopen(fullpath,RTLD_NOW))==NULL){ - ms_warning("Fail to load plugin %s : %s",fullpath,dlerror()); - }else { - char *initroutine_name=ms_malloc0(strlen(de->d_name)+10); - char *p; - void *initroutine=NULL; - strcpy(initroutine_name,de->d_name); - p=strstr(initroutine_name,PLUGINS_EXT); - if (p!=NULL){ - strcpy(p,"_init"); - initroutine=dlsym(handle,initroutine_name); - } - -#ifdef __APPLE__ - if (initroutine==NULL){ - /* on macosx: library name are libxxxx.1.2.3.dylib */ - /* -> MUST remove the .1.2.3 */ - p=strstr(initroutine_name,"."); - if (p!=NULL) - { - strcpy(p,"_init"); - initroutine=dlsym(handle,initroutine_name); - } - } -#endif - - if (initroutine!=NULL){ - init_func_t func=(init_func_t)initroutine; - func(); - ms_message("Plugin loaded (%s)", fullpath); - num++; - }else{ - ms_warning("Could not locate init routine of plugin %s",de->d_name); - } - ms_free(initroutine_name); - } - ms_free(fullpath); - } - } - closedir(ds); -#else - ms_warning("no loadable plugin support: plugins cannot be loaded."); - num=-1; -#endif - return num; -} - - -#ifdef __ALSA_ENABLED__ -extern MSSndCardDesc alsa_card_desc; -#endif - -#ifdef HAVE_SYS_SOUNDCARD_H -extern MSSndCardDesc oss_card_desc; -#endif - -#ifdef __ARTS_ENABLED__ -extern MSSndCardDesc arts_card_desc; -#endif - -#ifdef WIN32 -extern MSSndCardDesc winsnd_card_desc; -#endif - -#ifdef __DIRECTSOUND_ENABLED__ -extern MSSndCardDesc winsndds_card_desc; -#endif - -#ifdef __MACSND_ENABLED__ -extern MSSndCardDesc ca_card_desc; -#endif - -#ifdef __PORTAUDIO_ENABLED__ -extern MSSndCardDesc pasnd_card_desc; -#endif - -#ifdef __MAC_AQ_ENABLED__ -extern MSSndCardDesc aq_card_desc; -#endif - -static MSSndCardDesc * ms_snd_card_descs[]={ -#ifdef __ALSA_ENABLED__ - &alsa_card_desc, -#endif -#ifdef HAVE_SYS_SOUNDCARD_H - &oss_card_desc, -#endif -#ifdef __ARTS_ENABLED__ - &arts_card_desc, -#endif -#ifdef WIN32 - &winsnd_card_desc, -#endif -#ifdef __DIRECTSOUND_ENABLED__ - &winsndds_card_desc, -#endif -#ifdef __PORTAUDIO_ENABLED__ - &pasnd_card_desc, -#endif -#ifdef __MACSND_ENABLED__ - &ca_card_desc, -#endif -#ifdef __MAC_AQ_ENABLED__ - &aq_card_desc, -#endif - NULL -}; - -#ifdef VIDEO_ENABLED - -#ifdef __linux -extern MSWebCamDesc v4l_desc; -#endif - -#ifdef HAVE_LINUX_VIDEODEV2_H -extern MSWebCamDesc v4l2_card_desc; -#endif - -#ifdef WIN32 -extern MSWebCamDesc ms_vfw_cam_desc; -#endif -#if defined(WIN32) && defined(HAVE_DIRECTSHOW) -extern MSWebCamDesc ms_directx_cam_desc; -#endif - -#ifdef __MINGW32__ -extern MSWebCamDesc ms_dshow_cam_desc; -#endif - -#ifdef __APPLE__ -extern MSWebCamDesc ms_v4m_cam_desc; -#endif - -#if !defined(NO_FFMPEG) -extern MSWebCamDesc static_image_desc; -extern MSWebCamDesc mire_desc; -#endif - -static MSWebCamDesc * ms_web_cam_descs[]={ -#ifdef HAVE_LINUX_VIDEODEV2_H - &v4l2_card_desc, -#endif -#ifdef __linux - &v4l_desc, -#endif -#if defined(WIN32) && defined(HAVE_DIRECTSHOW) - &ms_directx_cam_desc, -#endif -#if defined(WIN32) && defined(HAVE_VFW) - &ms_vfw_cam_desc, -#endif -#ifdef __MINGW32__ - &ms_dshow_cam_desc, -#endif -#ifdef __APPLE__ - &ms_v4m_cam_desc, -#endif - -#if !defined(NO_FFMPEG) - &mire_desc, - &static_image_desc, -#endif - NULL -}; - -#endif - -void ms_init(){ - int i; - MSSndCardManager *cm; - -#if !defined(_WIN32_WCE) - if (getenv("MEDIASTREAMER_DEBUG")!=NULL){ - ortp_set_log_level_mask(ORTP_DEBUG|ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL); - } -#endif - ms_message("Registering all filters..."); - /* register builtin MSFilter's */ - for (i=0;ms_filter_descs[i]!=NULL;i++){ - ms_filter_register(ms_filter_descs[i]); - } - ms_message("Registering all soundcard handlers"); - cm=ms_snd_card_manager_get(); - for (i=0;ms_snd_card_descs[i]!=NULL;i++){ - ms_snd_card_manager_register_desc(cm,ms_snd_card_descs[i]); - } - -#ifdef VIDEO_ENABLED - ms_message("Registering all webcam handlers"); - { - MSWebCamManager *wm; - wm=ms_web_cam_manager_get(); - for (i=0;ms_web_cam_descs[i]!=NULL;i++){ - ms_web_cam_manager_register_desc(wm,ms_web_cam_descs[i]); - } - } -#if !defined(NO_FFMPEG) - __register_ffmpeg_encoders_if_possible(); -#endif -#endif - ms_message("Loading plugins"); - ms_load_plugins(PACKAGE_PLUGINS_DIR); - ms_message("ms_init() done"); -} - -void ms_exit(){ - ms_filter_unregister_all(); - ms_snd_card_manager_destroy(); -#ifdef VIDEO_ENABLED - ms_web_cam_manager_destroy(); -#endif -} - -void ms_sleep(int seconds){ -#ifdef WIN32 - Sleep(seconds*1000); -#else - struct timespec ts,rem; - int err; - ts.tv_sec=seconds; - ts.tv_nsec=0; - do { - err=nanosleep(&ts,&rem); - ts=rem; - }while(err==-1 && errno==EINTR); -#endif -} - -#define DEFAULT_MAX_PAYLOAD_SIZE 1440 - -static int max_payload_size=DEFAULT_MAX_PAYLOAD_SIZE; - -int ms_get_payload_max_size(){ - return max_payload_size; -} - -void ms_set_payload_max_size(int size){ - if (size<=0) size=DEFAULT_MAX_PAYLOAD_SIZE; - max_payload_size=size; -} diff --git a/linphone/mediastreamer2/src/msconf.c b/linphone/mediastreamer2/src/msconf.c deleted file mode 100644 index 46541fd98..000000000 --- a/linphone/mediastreamer2/src/msconf.c +++ /dev/null @@ -1,820 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -#ifdef HAVE_CONFIG_H -#include "mediastreamer-config.h" -#endif - -#include "mediastreamer2/msfilter.h" -#include - -#if defined(_WIN32_WCE) -#define DISABLE_SPEEX -#endif - -#ifndef HAVE_SPEEXDSP -#define DISABLE_SPEEX -#endif - -#ifndef DISABLE_SPEEX -#include -#endif - -#define CONF_NSAMPLES 160*4*4 /* (CONF_GRAN/2) */ -#ifndef CONF_MAX_PINS -#define CONF_MAX_PINS 128 -#endif - -static const float max_e=(float)32767*32767; -static const float coef=(float)0.01; - -typedef struct Channel{ - MSBufferizer buff; - int16_t input[CONF_NSAMPLES]; - bool_t has_contributed; - bool_t is_used; - - int is_speaking; - int count_speaking; - - int count; - int missed; - - int stat_discarded; - int stat_missed; - int stat_processed; - -#ifndef DISABLE_SPEEX - SpeexPreprocessState *speex_pp; -#endif - - float energy; - double average_psd; - -} Channel; - -typedef struct ConfState{ - Channel channels[CONF_MAX_PINS]; - int sum[CONF_NSAMPLES]; - int enable_directmode; - int enable_vad; - - int enable_halfduplex; - int vad_prob_start; - int vad_prob_continue; - - int agc_level; - int max_gain; - int mix_mode; - int samplerate; - - int adaptative_msconf_buf; - int conf_gran; - int conf_nsamples; -} ConfState; - - -static void channel_init(ConfState *s, Channel *chan, int pos){ -#ifndef DISABLE_SPEEX - float f; - int val; -#endif - memset(chan, 0, sizeof(Channel)); - ms_bufferizer_init(&chan->buff); -#ifndef DISABLE_SPEEX - chan->speex_pp = speex_preprocess_state_init(s->conf_gran/2, s->samplerate); - if (chan->speex_pp==NULL) - return; - - /* configure sound card input on pin 0 */ - val=0; - if (pos==0) - val=1; - - if (s->enable_halfduplex>0 && pos%2==1) - val=1; - - speex_preprocess_ctl(chan->speex_pp, SPEEX_PREPROCESS_SET_DENOISE, &val); - val = -30; - speex_preprocess_ctl(chan->speex_pp, SPEEX_PREPROCESS_SET_NOISE_SUPPRESS, &val); - - /* enable VAD only on incoming RTP stream */ - val=0; - if (pos%2==1 || (pos==0 && s->enable_halfduplex>0)) - { - val=1; - } - - speex_preprocess_ctl(chan->speex_pp, SPEEX_PREPROCESS_SET_VAD, &val); - if (s->vad_prob_start>0 && s->vad_prob_continue>0) - { - val = s->vad_prob_start; // xx% - speex_preprocess_ctl(chan->speex_pp, SPEEX_PREPROCESS_SET_PROB_START, &val); - val = s->vad_prob_continue; // xx% - speex_preprocess_ctl(chan->speex_pp, SPEEX_PREPROCESS_SET_PROB_CONTINUE, &val); - } - - /* enable AGC only on local soundcard */ - val=0; - f=12000; - if (s->agc_level>0 && pos==0) - val=1; - else if (pos==0 && s->enable_halfduplex>0) - val=1; - else if ( pos%2==1 && s->enable_halfduplex>0) - val=1; //1; should not do that - if (s->agc_level>0) - f=(float)s->agc_level; - - - speex_preprocess_ctl(chan->speex_pp, SPEEX_PREPROCESS_SET_AGC, &val); - speex_preprocess_ctl(chan->speex_pp, SPEEX_PREPROCESS_SET_AGC_LEVEL, &f); - - val=s->max_gain; - if ( pos%2==1 && s->enable_halfduplex>0) - val=1; - - speex_preprocess_ctl(chan->speex_pp, SPEEX_PREPROCESS_SET_AGC_MAX_GAIN, &val); - - val=0; -#if 0 - val=1; // do more testing -#endif - speex_preprocess_ctl(chan->speex_pp, SPEEX_PREPROCESS_SET_DEREVERB, &val); - f=(float).4; - speex_preprocess_ctl(chan->speex_pp, SPEEX_PREPROCESS_SET_DEREVERB_DECAY, &f); - f=(float).3; - speex_preprocess_ctl(chan->speex_pp, SPEEX_PREPROCESS_SET_DEREVERB_LEVEL, &f); - -#endif -} - -static void channel_uninit(Channel *chan){ - ms_bufferizer_uninit(&chan->buff); - chan->is_speaking=0; - chan->energy=0; - chan->average_psd=0; -#ifndef DISABLE_SPEEX - if (chan->speex_pp!=NULL) - speex_preprocess_state_destroy(chan->speex_pp); - chan->speex_pp=NULL; -#endif -} - -static void conf_init(MSFilter *f){ - ConfState *s=(ConfState *)ms_new0(ConfState,1); - int i; - s->samplerate=8000; - s->conf_gran=((16 * s->samplerate) / 800) *2; - s->conf_nsamples=s->conf_gran/2; - for (i=0;ichannels[i], i); - s->enable_directmode=FALSE; - s->enable_vad=TRUE; - s->agc_level=0; - s->max_gain=30; - s->mix_mode=TRUE; - s->adaptative_msconf_buf=2; - f->data=s; -} - -static void conf_uninit(MSFilter *f){ - ConfState *s=(ConfState*)f->data; - int i; - for (i=0;ichannels[i]); - ms_free(f->data); -} - -static void conf_preprocess(MSFilter *f){ - ConfState *s=(ConfState*)f->data; - int i; - for (i=0;ichannels[i].is_used=FALSE; - s->channels[i].missed=0; - s->channels[i].stat_discarded=0; - s->channels[i].stat_missed=0; - s->channels[i].stat_processed=0; - } -} - -static bool_t should_process(MSFilter *f, ConfState *s){ - Channel *chan; - int active_channel=0; - int i; - - if (ms_bufferizer_get_avail(&(&s->channels[0])->buff)>s->conf_gran - && s->channels[0].is_used==FALSE) - { - /* soundread has just started */ - s->channels[0].is_used=TRUE; - } - else if (s->channels[0].is_used==FALSE) - { - return FALSE; - } - - /* count active channel */ - for (i=1;ichannels[i]; - if (chan->is_used == TRUE) - { - active_channel++; - } - } - - if (active_channel<=1) /* disable mix mode when it's not needed */ - s->mix_mode = FALSE; - else - s->mix_mode = TRUE; - - if (s->enable_directmode==FALSE) - { - s->mix_mode = TRUE; - } - - if (s->mix_mode == FALSE) - return FALSE; - - if (ms_bufferizer_get_avail(&(&s->channels[0])->buff)>=s->conf_gran) - { - return TRUE; - } - return FALSE; -} - -#ifndef DISABLE_SPEEX -static double powerspectrum_stat_beyond8K(struct Channel *chan){ - spx_int32_t ps_size = 0; - spx_int32_t *ps = NULL; - double mystat = 0; - float fftmul = 1.0 / (32768.0); - int i; - - speex_preprocess_ctl(chan->speex_pp, SPEEX_PREPROCESS_GET_PSD_SIZE, &ps_size); - ps = (spx_int32_t*)ortp_malloc(sizeof(spx_int32_t)*ps_size); - speex_preprocess_ctl(chan->speex_pp, SPEEX_PREPROCESS_GET_PSD, ps); - - mystat = 0; - for (i=ps_size/2;i < ps_size; i++) { - double yp; -#if defined(__cplusplus) - yp = sqrtf(sqrtf(static_cast(ps[i]))) - 1.0f; -#else - yp = sqrtf(sqrtf((float)(ps[i]))) - 1.0f; -#endif - yp = yp * fftmul; - yp = MIN(yp * 3000.0, 1.0); - yp = (1 - yp) * (100 - 1.0f); - mystat = yp + mystat; - } - - mystat = (mystat*2)/ps_size; - - ortp_free(ps); - - /* values: - Maximum: 108,064 low volume on high frequency. - Decrease when volume increase. */ - - /* return value between 0 and 108,064? */ - mystat = 108.064-mystat; - - chan->average_psd=(mystat*mystat*coef) + (1.0-coef)*chan->average_psd; - //ms_message("average power spectrum on half highest values ONLY: stat=%.3lf", chan->average_psd); - - return mystat; -} -#endif - -static void conf_sum(MSFilter *f, ConfState *s){ - int i,j; - Channel *chan; - memset(s->sum,0,s->conf_nsamples*sizeof(int)); - - chan=&s->channels[0]; - if (s->adaptative_msconf_buf*s->conf_granbuff)) - { - i = ms_bufferizer_get_avail(&chan->buff)/s->conf_gran; - if (i>5) - ms_message("Increasing buffer because sound card is late. (nb_buf=%i /old=%i)", i, s->adaptative_msconf_buf); - s->adaptative_msconf_buf=i; - if (s->adaptative_msconf_buf>10) - { - while (ms_bufferizer_get_avail(&chan->buff)> s->conf_gran*6) - { - ms_bufferizer_read(&chan->buff,(uint8_t*)chan->input,s->conf_gran); - ms_message("Deleting extra sound card data %i", ms_bufferizer_get_avail(&chan->buff)); - } - } - } - else if (s->adaptative_msconf_buf*s->conf_gran>ms_bufferizer_get_avail(&chan->buff)) - { - if (s->adaptative_msconf_buf>3) - { - s->adaptative_msconf_buf--; - s->adaptative_msconf_buf=ms_bufferizer_get_avail(&chan->buff)/s->conf_gran; - //ms_message("decreasing buffer because sound card is in advance. (nb_buf=%i)", s->adaptative_msconf_buf); - } - } - - if (s->adaptative_msconf_buf>6) - s->adaptative_msconf_buf=6; - - for (i=0;ichannels[i]; - - /* skip soundread and short buffer entry */ - if (i>0 - && ms_bufferizer_get_avail(&chan->buff)> s->conf_gran - && ms_bufferizer_get_avail(&chan->buff)> (ms_bufferizer_get_avail(&s->channels[0].buff)+s->conf_gran*6) ) - { -#if 0 - int loudness; -#endif - while (ms_bufferizer_get_avail(&chan->buff)> s->conf_gran - && ms_bufferizer_get_avail(&chan->buff)> (ms_bufferizer_get_avail(&s->channels[0].buff)) ) - { - ms_bufferizer_read(&chan->buff,(uint8_t*)chan->input,s->conf_gran); -#if 0 - speex_preprocess_ctl(chan->speex_pp, SPEEX_PREPROCESS_GET_AGC_LOUDNESS, &loudness); -#endif - /* we want to remove 4 packets (40ms) in a near future: */ -#ifndef DISABLE_SPEEX - if (chan->speex_pp!=NULL && s->enable_vad==TRUE) - { - int vad=0; - vad = speex_preprocess(chan->speex_pp, (short*)chan->input, NULL); - if (vad==1) - break; /* voice detected: process as usual */ - if (ms_bufferizer_get_avail(&chan->buff)conf_gran) - break; /* no more data to remove */ - ms_message("No voice detected: discarding sample. (idx=%i - bufsize=%i sncardbufsize=%i)", - i, ms_bufferizer_get_avail(&chan->buff), ms_bufferizer_get_avail(&s->channels[0].buff)); - } - if (ms_bufferizer_get_avail(&chan->buff) == (ms_bufferizer_get_avail(&s->channels[0].buff))) - ms_message("same data in soundcard and incoming rtp. (idx=%i - bufsize=%i sncardbufsize=%i)", - i, ms_bufferizer_get_avail(&chan->buff), ms_bufferizer_get_avail(&s->channels[0].buff)); -#endif - chan->stat_discarded++; - } - - for(j=0;jconf_nsamples;++j){ - s->sum[j]+=chan->input[j]; - } - chan->has_contributed=TRUE; - - chan->stat_processed++; - } - else if (ms_bufferizer_get_avail(&chan->buff)>=s->conf_gran) - { - struct channel_volume { - float energy; - int channel; - }; - struct channel_volume vol; - float en; - - ms_bufferizer_read(&chan->buff,(uint8_t*)chan->input,s->conf_gran); - - en=chan->energy; - for(j=0;jconf_nsamples;++j){ - float s=chan->input[j]; - en=(s*s*coef) + ((float)1.0-coef)*en; - } - chan->energy=en; - vol.energy = chan->energy; //10*log10f(chan->energy/max_e); - vol.channel = i; - ms_filter_notify(f, MS_CONF_CHANNEL_VOLUME, (void*)&vol); - - if (i>0) /* not for MIC */ - { - if (chan->energy>65) - chan->count_speaking++; - else - chan->count_speaking=0; - } - -#ifndef DISABLE_SPEEX - if (chan->speex_pp!=NULL && s->enable_vad==TRUE && i==0) - { - int vad; - vad = speex_preprocess(chan->speex_pp, (short*)chan->input, NULL); - ms_filter_notify(f, MS_CONF_SPEEX_PREPROCESS_MIC, (void*)chan->speex_pp); - - if (s->enable_halfduplex>0) - { - powerspectrum_stat_beyond8K(chan); - if (chan->average_psd>s->vad_prob_start) - { - if (s->channels[0].is_speaking<0) - ms_message("MIC is turned on"); - //ms_message("is_speaking (chan=%i) -> on/stat=%.3lf", i, chan->average_psd); - s->channels[0].is_speaking=20; /* keep RTP unmuted for the next few ms */ - } - else if (chan->average_psdvad_prob_continue) - { - if (s->channels[0].is_speaking==0) - { - ms_message("MIC is turned off"); - s->channels[0].count_speaking=0; - } - s->channels[0].is_speaking--; - } - if (s->channels[0].is_speaking>0) - { - s->channels[0].count_speaking++; - } - } - } - else if (chan->speex_pp!=NULL && s->enable_vad==TRUE) - { - int vad; - - if (s->enable_halfduplex>0) - { - vad = speex_preprocess(chan->speex_pp, (short*)chan->input, NULL); - } - else - { - vad = speex_preprocess(chan->speex_pp, (short*)chan->input, NULL); - //speex_preprocess_estimate_update(chan->speex_pp, (short*)chan->input); - } - } -#endif - - for(j=0;jconf_nsamples;++j){ - s->sum[j]+=chan->input[j]; - } - chan->has_contributed=TRUE; - - chan->stat_processed++; - } else { - chan->stat_missed++; - if (i>0 && chan->is_used == TRUE) - { - chan->missed++; - /* delete stream if data is missing since a long time */ - if (chan->missed>15) - { - chan->is_used=FALSE; - ms_message("msconf: deleted contributing stream (pin=%i)", i); - } - /* couldn't we add confort noise for those outputs? */ - } - chan->has_contributed=FALSE; - } - } - return; -} - -static inline int16_t saturate(int sample){ - if (sample>32000) - sample=32000; - else if (sample<-32000) - sample=-32000; - return (int16_t)sample; -} - -static mblk_t * conf_output(ConfState *s, Channel *chan, int16_t attenuation){ - mblk_t *m=allocb(s->conf_gran,0); - int i; - int tmp; - if (chan->has_contributed==TRUE){ - for (i=0;iconf_nsamples;++i){ - tmp=s->sum[i]-(int)chan->input[i]; - *((int16_t*)m->b_wptr)=saturate(tmp)/attenuation; - m->b_wptr+=2; - } - }else{ - for (i=0;iconf_nsamples;++i){ - tmp=s->sum[i]; - *((int16_t*)m->b_wptr)=saturate(tmp)/attenuation; - m->b_wptr+=2; - } - } - return m; -} - -static void conf_dispatch(MSFilter *f, ConfState *s){ - int i; - Channel *chan; - mblk_t *m; - - for (i=0;ioutputs[i]!=NULL){ - chan=&s->channels[i]; - if (s->channels[0].is_speaking>0 // if MIC is speaking - && s->channels[0].count_speaking<75 // if MIC was silence a few time ago - && chan->count_speaking>0 // if RTP has started to talk - && chan->count_speaking<75 // if RTP was silence a few ms ago - && i%2==1) // false detection of MIC speaking - { - ms_message("false detection of MIC speaking: turned off"); - m=conf_output(s,chan, 32000); - } - else if (s->channels[0].is_speaking<0 && i%2==1) // MIC is NOT speaking -> send silence on RTP - m=conf_output(s,chan, 32000); - else - m=conf_output(s,chan, 1); - ms_queue_put(f->outputs[i],m); - } - } -} - -static void conf_process(MSFilter *f){ - int i; - ConfState *s=(ConfState*)f->data; - Channel *chan; - Channel *chan0; - /*read from all inputs and put into bufferizers*/ - for (i=0;iinputs[i]!=NULL){ - chan=&s->channels[i]; - ms_bufferizer_put_from_queue(&chan->buff,f->inputs[i]); - if (ms_bufferizer_get_avail(&chan->buff)>0) - { - chan->missed=0; /* reset counter of missed packet */ - if (i>0 && chan->is_used==FALSE) - { - chan->is_used=TRUE; - ms_message("msconf: new contributing stream (chan=%i) %i", ms_bufferizer_get_avail(&chan->buff), i); - } - } - } - } - - /*do the job */ - while(should_process(f,s)==TRUE){ - conf_sum(f, s); - conf_dispatch(f,s); - } - - /* mixer is disabled! -> copy A->B and B->A*/ - if (s->mix_mode == FALSE) - { - /* get the soundread data and copy it to pinX */ - for (i=1;iinputs[i]!=NULL){ - chan0=&s->channels[0]; - chan=&s->channels[i]; - if (chan->is_used==TRUE) - { - while (ms_bufferizer_read(&chan->buff,(uint8_t*)chan->input,s->conf_gran)==s->conf_gran) - { - if (f->outputs[0]!=NULL) - { - /* send in pin0 */ - mblk_t *m=allocb(s->conf_gran,0); - memcpy(m->b_wptr, chan->input, s->conf_gran); - m->b_wptr+=s->conf_gran; - ms_queue_put(f->outputs[0],m); - } - } - } - - if (chan0->is_used==TRUE) - { - while (ms_bufferizer_read(&chan0->buff,(uint8_t*)chan0->input,s->conf_gran)==s->conf_gran) - { - if (f->outputs[i]!=NULL) - { - /* send in pinI */ - mblk_t *m=allocb(s->conf_gran,0); - memcpy(m->b_wptr, chan0->input, s->conf_gran); - m->b_wptr+=s->conf_gran; - ms_queue_put(f->outputs[i],m); - } - } - } - break; - } - } - } - -} - -static void conf_postprocess(MSFilter *f){ - int i; - ConfState *s=(ConfState*)f->data; - for (i=0;ichannels[i]); - for (i=0;ichannels[i], i); -} - -static int msconf_set_sr(MSFilter *f, void *arg){ - ConfState *s=(ConfState*)f->data; - int i; - - s->samplerate = *(int*)arg; - s->conf_gran = ((16 * s->samplerate) / 800) *2; - s->conf_nsamples=s->conf_gran/2; - for (i=0;ichannels[i]); - for (i=0;ichannels[i], i); - return 0; -} - -static int msconf_enable_directmode(MSFilter *f, void *arg){ - ConfState *s=(ConfState*)f->data; - s->enable_directmode = *(int*)arg; - return 0; -} - -static int msconf_enable_agc(MSFilter *f, void *arg){ - ConfState *s=(ConfState*)f->data; - int i; - s->agc_level = *(int*)arg; - - for (i=0;ichannels[i]); - for (i=0;ichannels[i], i); - return 0; -} - -static int msconf_set_max_gain(MSFilter *f, void *arg){ - ConfState *s=(ConfState*)f->data; - int i; - s->max_gain = *(int*)arg; - - for (i=0;ichannels[i]); - for (i=0;ichannels[i], i); - return 0; -} - - -static int msconf_enable_halfduplex(MSFilter *f, void *arg){ - ConfState *s=(ConfState*)f->data; - int i; - s->enable_halfduplex = *(int*)arg; - - for (i=0;ichannels[i]); - for (i=0;ichannels[i], i); - return 0; -} - -static int msconf_set_vad_prob_start(MSFilter *f, void *arg){ - ConfState *s=(ConfState*)f->data; - int i; - s->vad_prob_start = *(int*)arg; - - for (i=0;ichannels[i]); - for (i=0;ichannels[i], i); - return 0; -} - -static int msconf_set_vad_prob_continue(MSFilter *f, void *arg){ - ConfState *s=(ConfState*)f->data; - int i; - s->vad_prob_continue = *(int*)arg; - - for (i=0;ichannels[i]); - for (i=0;ichannels[i], i); - return 0; -} - -static int msconf_enable_vad(MSFilter *f, void *arg){ - ConfState *s=(ConfState*)f->data; - int i; - s->enable_vad = *(int*)arg; - - for (i=0;ichannels[i]); - for (i=0;ichannels[i], i); - return 0; -} - -static int msconf_get_stat_discarded(MSFilter *f, void *arg){ - ConfState *s=(ConfState*)f->data; - Channel *chan; - int i; - i = *(int*)arg; - /*read from all inputs and put into bufferizers*/ - if (i<0 || i>CONF_MAX_PINS) - return -1; - - if (f->inputs[i]!=NULL){ - chan=&s->channels[i]; - return chan->stat_discarded; - } - return -1; -} - -static int msconf_get_stat_missed(MSFilter *f, void *arg){ - ConfState *s=(ConfState*)f->data; - Channel *chan; - int i; - i = *(int*)arg; - /*read from all inputs and put into bufferizers*/ - if (i<0 || i>CONF_MAX_PINS) - return -1; - - if (f->inputs[i]!=NULL){ - chan=&s->channels[i]; - return chan->stat_missed; - } - return -1; -} - -static int msconf_get_stat_processed(MSFilter *f, void *arg){ - ConfState *s=(ConfState*)f->data; - Channel *chan; - int i; - i = *(int*)arg; - /*read from all inputs and put into bufferizers*/ - if (i<0 || i>CONF_MAX_PINS) - return -1; - - if (f->inputs[i]!=NULL){ - chan=&s->channels[i]; - return chan->stat_processed; - } - return -1; -} - -static MSFilterMethod msconf_methods[]={ - { MS_FILTER_SET_SAMPLE_RATE, msconf_set_sr }, - { MS_FILTER_ENABLE_DIRECTMODE, msconf_enable_directmode }, - { MS_FILTER_ENABLE_VAD, msconf_enable_vad }, - { MS_FILTER_ENABLE_AGC, msconf_enable_agc }, - { MS_FILTER_SET_MAX_GAIN, msconf_set_max_gain }, - - { MS_FILTER_GET_STAT_DISCARDED, msconf_get_stat_discarded }, - { MS_FILTER_GET_STAT_MISSED, msconf_get_stat_missed }, - { MS_FILTER_GET_STAT_OUTPUT, msconf_get_stat_processed }, - - { MS_FILTER_ENABLE_HALFDUPLEX, msconf_enable_halfduplex }, - { MS_FILTER_SET_VAD_PROB_START, msconf_set_vad_prob_start }, - { MS_FILTER_SET_VAD_PROB_CONTINUE, msconf_set_vad_prob_continue }, - { 0 , NULL} -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_conf_desc={ - MS_CONF_ID, - "MSConf", - N_("A filter to make conferencing"), - MS_FILTER_OTHER, - NULL, - CONF_MAX_PINS, - CONF_MAX_PINS, - conf_init, - conf_preprocess, - conf_process, - conf_postprocess, - conf_uninit, - msconf_methods -}; - -#else - -MSFilterDesc ms_conf_desc={ - .id=MS_CONF_ID, - .name="MSConf", - .text=N_("A filter to make conferencing"), - .category=MS_FILTER_OTHER, - .ninputs=CONF_MAX_PINS, - .noutputs=CONF_MAX_PINS, - .init=conf_init, - .preprocess=conf_preprocess, - .process=conf_process, - .postprocess=conf_postprocess, - .uninit=conf_uninit, - .methods=msconf_methods -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_conf_desc) - diff --git a/linphone/mediastreamer2/src/msdscap-mingw.cc b/linphone/mediastreamer2/src/msdscap-mingw.cc deleted file mode 100755 index 67449097b..000000000 --- a/linphone/mediastreamer2/src/msdscap-mingw.cc +++ /dev/null @@ -1,1071 +0,0 @@ -/* msdscap-mingw - mediastreamer2 plugin for video capture using directshow - Unlike winvideods.c filter, the following source code compiles with mingw. - winvideods.c requires visual studio to build. - - Copyright (C) 2009 Simon Morlat - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -/* -This plugin has been written by Simon Morlat based on the work made by -Jan Wedekind, posted on mingw tracker here: -http://sourceforge.net/tracker/index.php?func=detail&aid=1819367&group_id=2435&atid=302435 -He wrote all the declarations missing to get directshow capture working -with mingw, and provided a demo code that worked great with minimal code. -*/ - - -#include -#include -#include -#include -#include - - -#include -#include -#include -#include - -template -class ComPtr{ - private: - _ComT *mPtr; - public: - int coCreateInstance(REFCLSID clsid, REFIID iid){ - HRESULT res; - res=::CoCreateInstance(clsid,NULL,CLSCTX_INPROC,iid, - (void**)&mPtr); - return (res==S_OK) ? 0 : -1; - } - ComPtr() : mPtr(0){ - } - ~ComPtr(){ - reset(); - } - ComPtr(const ComPtr<_ComT>& other) : mPtr(other.mPtr){ - if (mPtr) mPtr->AddRef(); - } - ComPtr<_ComT> & operator=(const ComPtr<_ComT> &other){ - if (other.mPtr) - other.mPtr->AddRef(); - if (mPtr) - mPtr->Release(); - mPtr=other.mPtr; - return *this; - } - bool operator==(const ComPtr<_ComT> &other){ - return other.mPtr==mPtr; - } - bool operator!=(const ComPtr<_ComT> &other){ - return other.mPtr!=mPtr; - } - _ComT *get(){ - return mPtr; - } - _ComT **operator&(){ - return &mPtr; - } - _ComT * operator->(){ - return mPtr; - } - void reset(){ - if (mPtr){ - mPtr->Release(); - mPtr=0; - } - } -}; - - -DEFINE_GUID( CLSID_VideoInputDeviceCategory, 0x860BB310, 0x5D01, - 0x11d0, 0xBD, 0x3B, 0x00, 0xA0, 0xC9, 0x11, 0xCE, 0x86); -DEFINE_GUID( CLSID_SystemDeviceEnum, 0x62BE5D10, 0x60EB, 0x11d0, - 0xBD, 0x3B, 0x00, 0xA0, 0xC9, 0x11, 0xCE, 0x86 ); -DEFINE_GUID( CLSID_FilterGraph, 0xe436ebb3, 0x524f, 0x11ce, - 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70); -DEFINE_GUID( CLSID_SampleGrabber, 0xc1f400a0, 0x3f08, 0x11d3, - 0x9f, 0x0b, 0x00, 0x60, 0x08, 0x03, 0x9e, 0x37 ); -DEFINE_GUID( CLSID_NullRenderer,0xc1f400a4, 0x3f08, 0x11d3, - 0x9f, 0x0b, 0x00, 0x60, 0x08, 0x03, 0x9e, 0x37 ); -DEFINE_GUID( CLSID_VfwCapture, 0x1b544c22, 0xfd0b, 0x11ce, - 0x8c, 0x63, 0x0, 0xaa, 0x00, 0x44, 0xb5, 0x1e); -DEFINE_GUID( IID_IGraphBuilder, 0x56a868a9, 0x0ad4, 0x11ce, - 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70); -DEFINE_GUID( IID_IBaseFilter, 0x56a86895, 0x0ad4, 0x11ce, - 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); -DEFINE_GUID( IID_ICreateDevEnum, 0x29840822, 0x5b84, 0x11d0, - 0xbd, 0x3b, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86 ); -DEFINE_GUID( IID_IEnumFilters, 0x56a86893, 0xad4, 0x11ce, - 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); -DEFINE_GUID( IID_IEnumPins, 0x56a86892, 0x0ad4, 0x11ce, - 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); -DEFINE_GUID( IID_IMediaSample, 0x56a8689a, 0x0ad4, 0x11ce, - 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); -DEFINE_GUID( IID_IMediaFilter, 0x56a86899, 0x0ad4, 0x11ce, - 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); -DEFINE_GUID( IID_IPin, 0x56a86891, 0x0ad4, 0x11ce, - 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); -DEFINE_GUID( IID_ISampleGrabber, 0x6b652fff, 0x11fe, 0x4fce, - 0x92, 0xad, 0x02, 0x66, 0xb5, 0xd7, 0xc7, 0x8f ); -DEFINE_GUID( IID_ISampleGrabberCB, 0x0579154a, 0x2b53, 0x4994, - 0xb0, 0xd0, 0xe7, 0x73, 0x14, 0x8e, 0xff, 0x85 ); -DEFINE_GUID( IID_IMediaEvent, 0x56a868b6, 0x0ad4, 0x11ce, - 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); -DEFINE_GUID( IID_IMediaControl, 0x56a868b1, 0x0ad4, 0x11ce, - 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); -DEFINE_GUID( IID_IMemInputPin, 0x56a8689d, 0x0ad4, 0x11ce, - 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); -DEFINE_GUID( IID_IAMStreamConfig, 0xc6e13340, 0x30ac, 0x11d0, - 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56 ); -DEFINE_GUID( IID_IVideoProcAmp, 0x4050560e, 0x42a7, 0x413a, - 0x85, 0xc2, 0x09, 0x26, 0x9a, 0x2d, 0x0f, 0x44 ); -DEFINE_GUID( MEDIATYPE_Video, 0x73646976, 0x0000, 0x0010, - 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); -DEFINE_GUID( MEDIASUBTYPE_I420, 0x30323449, 0x0000, 0x0010, - 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); -DEFINE_GUID( MEDIASUBTYPE_YV12, 0x32315659, 0x0000, 0x0010, - 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); -DEFINE_GUID( MEDIASUBTYPE_IYUV, 0x56555949, 0x0000, 0x0010, - 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); -DEFINE_GUID( MEDIASUBTYPE_YUYV, 0x56595559, 0x0000, 0x0010, - 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); -DEFINE_GUID( MEDIASUBTYPE_YUY2, 0x32595559, 0x0000, 0x0010, - 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); -DEFINE_GUID( MEDIASUBTYPE_UYVY, 0x59565955, 0x0000, 0x0010, - 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); -DEFINE_GUID( MEDIASUBTYPE_RGB24, 0xe436eb7d, 0x524f, 0x11ce, - 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70 ); - -using namespace std; - -typedef LONGLONG REFERENCE_TIME; - -typedef struct tagVIDEOINFOHEADER { - RECT rcSource; - RECT rcTarget; - DWORD dwBitRate; - DWORD dwBitErrorRate; - REFERENCE_TIME AvgTimePerFrame; - BITMAPINFOHEADER bmiHeader; -} VIDEOINFOHEADER; - -typedef struct _AMMediaType { - GUID majortype; - GUID subtype; - BOOL bFixedSizeSamples; - BOOL bTemporalCompression; - ULONG lSampleSize; - GUID formattype; - IUnknown *pUnk; - ULONG cbFormat; - BYTE *pbFormat; -} AM_MEDIA_TYPE; - -DECLARE_ENUMERATOR_(IEnumMediaTypes,AM_MEDIA_TYPE*); - -typedef struct _VIDEO_STREAM_CONFIG_CAPS -{ - GUID guid; - ULONG VideoStandard; - SIZE InputSize; - SIZE MinCroppingSize; - SIZE MaxCroppingSize; - int CropGranularityX; - int CropGranularityY; - int CropAlignX; - int CropAlignY; - SIZE MinOutputSize; - SIZE MaxOutputSize; - int OutputGranularityX; - int OutputGranularityY; - int StretchTapsX; - int StretchTapsY; - int ShrinkTapsX; - int ShrinkTapsY; - LONGLONG MinFrameInterval; - LONGLONG MaxFrameInterval; - LONG MinBitsPerSecond; - LONG MaxBitsPerSecond; -} VIDEO_STREAM_CONFIG_CAPS; - -typedef LONGLONG REFERENCE_TIME; - -typedef interface IBaseFilter IBaseFilter; -typedef interface IReferenceClock IReferenceClock; -typedef interface IFilterGraph IFilterGraph; - -typedef enum _FilterState { - State_Stopped, - State_Paused, - State_Running -} FILTER_STATE; - -#define MAX_FILTER_NAME 128 -typedef struct _FilterInfo { - WCHAR achName[MAX_FILTER_NAME]; - IFilterGraph *pGraph; -} FILTER_INFO; - -typedef enum _PinDirection { - PINDIR_INPUT, - PINDIR_OUTPUT -} PIN_DIRECTION; - -#define MAX_PIN_NAME 128 -typedef struct _PinInfo { - IBaseFilter *pFilter; - PIN_DIRECTION dir; - WCHAR achName[MAX_PIN_NAME]; -} PIN_INFO; - -#define INTERFACE IPin -DECLARE_INTERFACE_(IPin,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(Connect)(THIS_ IPin*,const AM_MEDIA_TYPE*) PURE; - STDMETHOD(ReceiveConnection)(THIS_ IPin*,const AM_MEDIA_TYPE*) PURE; - STDMETHOD(Disconnect)(THIS) PURE; - STDMETHOD(ConnectedTo)(THIS_ IPin**) PURE; - STDMETHOD(ConnectionMediaType)(THIS_ AM_MEDIA_TYPE*) PURE; - STDMETHOD(QueryPinInfo)(THIS_ PIN_INFO*) PURE; - STDMETHOD(QueryDirection)(THIS_ PIN_DIRECTION*) PURE; -}; -#undef INTERFACE - -DECLARE_ENUMERATOR_(IEnumPins,IPin*); - -typedef struct _AllocatorProperties { - long cBuffers; - long cbBuffer; - long cbAlign; - long cbPrefix; -} ALLOCATOR_PROPERTIES; - -typedef LONG_PTR OAEVENT; - -#define INTERFACE IMediaEvent -DECLARE_INTERFACE_(IMediaEvent,IDispatch) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(GetEventHandle)(THIS_ OAEVENT*) PURE; - STDMETHOD(GetEvent)(THIS_ long*,LONG_PTR,LONG_PTR,long) PURE; - STDMETHOD(WaitForCompletion)(THIS_ long,long*) PURE; - STDMETHOD(CancelDefaultHandling)(THIS_ long) PURE; - STDMETHOD(RestoreDefaultHandling)(THIS_ long) PURE; - STDMETHOD(FreeEventParams)(THIS_ long,LONG_PTR,LONG_PTR) PURE; -}; -#undef INTERFACE - -typedef long OAFilterState; - -#define INTERFACE IMediaControl -DECLARE_INTERFACE_(IMediaControl,IDispatch) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(Run)(THIS) PURE; - STDMETHOD(Pause)(THIS) PURE; - STDMETHOD(Stop)(THIS) PURE; - STDMETHOD(GetState)(THIS_ LONG,OAFilterState*) PURE; - STDMETHOD(RenderFile)(THIS_ BSTR) PURE; - STDMETHOD(AddSourceFilter)(THIS_ BSTR,IDispatch**) PURE; - STDMETHOD(get_FilterCollection)(THIS_ IDispatch**) PURE; - STDMETHOD(get_RegFilterCollection)(THIS_ IDispatch**) PURE; - STDMETHOD(StopWhenReady)(THIS) PURE; -}; -#undef INTERFACE - -#define INTERFACE IVideoProcAmp -DECLARE_INTERFACE_(IVideoProcAmp,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; -}; -#undef INTERFACE - -#define INTERFACE IAMStreamConfig -DECLARE_INTERFACE_(IAMStreamConfig,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(SetFormat)(THIS_ AM_MEDIA_TYPE*) PURE; - STDMETHOD(GetFormat)(THIS_ AM_MEDIA_TYPE**) PURE; - STDMETHOD(GetNumberOfCapabilities)(THIS_ int*,int*) PURE; - STDMETHOD(GetStreamCaps)(THIS_ int,AM_MEDIA_TYPE**,BYTE*) PURE; -}; -#undef INTERFACE - -#define INTERFACE IMediaFilter -DECLARE_INTERFACE_(IMediaFilter,IPersist) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(Stop)(THIS) PURE; - STDMETHOD(Pause)(THIS) PURE; - STDMETHOD(Run)(THIS_ REFERENCE_TIME) PURE; - STDMETHOD(GetState)(THIS_ DWORD,FILTER_STATE*) PURE; - STDMETHOD(SetSyncSource)(THIS_ IReferenceClock*) PURE; - STDMETHOD(GetSyncSource)(THIS_ IReferenceClock**) PURE; -}; -#undef INTERFACE - -#define INTERFACE IBaseFilter -DECLARE_INTERFACE_(IBaseFilter,IMediaFilter) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(EnumPins)(THIS_ IEnumPins**) PURE; - STDMETHOD(FindPin)(THIS_ LPCWSTR,IPin**) PURE; - STDMETHOD(QueryFilterInfo)(THIS_ FILTER_INFO*) PURE; - STDMETHOD(JoinFilterGraph)(THIS_ IFilterGraph*,LPCWSTR) PURE; - STDMETHOD(QueryVendorInfo)(THIS_ LPWSTR*) PURE; -}; -#undef INTERFACE - -DECLARE_ENUMERATOR_(IEnumFilters,IBaseFilter*); - -// #define INTERFACE IEnumFilters -// DECLARE_INTERFACE_(IEnumFilters,IUnknown) -// { -// STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; -// STDMETHOD_(ULONG,AddRef)(THIS) PURE; -// STDMETHOD_(ULONG,Release)(THIS) PURE; -// STDMETHOD(Next)(THIS_ ULONG,IBaseFilter**,ULONG*) PURE; -// STDMETHOD(Skip)(THIS_ ULONG) PURE; -// STDMETHOD(Reset)(THIS) PURE; -// STDMETHOD(Clone)(THIS_ IEnumFilters**) PURE; -// }; -// #undef INTERFACE - -#define INTERFACE IFilterGraph -DECLARE_INTERFACE_(IFilterGraph,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(AddFilter)(THIS_ IBaseFilter*,LPCWSTR) PURE; - STDMETHOD(RemoveFilter)(THIS_ IBaseFilter*) PURE; - STDMETHOD(EnumFilters)(THIS_ IEnumFilters**) PURE; - STDMETHOD(FindFilterByName)(THIS_ LPCWSTR,IBaseFilter**) PURE; - STDMETHOD(ConnectDirect)(THIS_ IPin*,IPin*,const AM_MEDIA_TYPE*) PURE; - STDMETHOD(Reconnect)(THIS_ IPin*) PURE; - STDMETHOD(Disconnect)(THIS_ IPin*) PURE; - STDMETHOD(SetDefaultSyncSource)(THIS) PURE; -}; -#undef INTERFACE - -#define INTERFACE IGraphBuilder -DECLARE_INTERFACE_(IGraphBuilder,IFilterGraph) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(Connect)(THIS_ IPin*,IPin*) PURE; - STDMETHOD(Render)(THIS_ IPin*) PURE; - STDMETHOD(RenderFile)(THIS_ LPCWSTR,LPCWSTR) PURE; - STDMETHOD(AddSourceFilter)(THIS_ LPCWSTR,LPCWSTR,IBaseFilter**) PURE; - STDMETHOD(SetLogFile)(THIS_ DWORD_PTR) PURE; - STDMETHOD(Abort)(THIS) PURE; - STDMETHOD(ShouldOperationContinue)(THIS) PURE; -}; -#undef INTERFACE - -#define INTERFACE ICreateDevEnum -DECLARE_INTERFACE_(ICreateDevEnum,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(CreateClassEnumerator)(THIS_ REFIID,IEnumMoniker**,DWORD) PURE; -}; -#undef INTERFACE - -#define INTERFACE IMediaSample -DECLARE_INTERFACE_(IMediaSample,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(GetPointer)(THIS_ BYTE **) PURE; - STDMETHOD_(long, GetSize)(THIS) PURE; -}; -/* -#define INTERFACE IMediaSample -DECLARE_INTERFACE_(IMediaSample, IUnknown) -{ - STDMETHOD(GetPointer)(THIS_ BYTE **) PURE; - STDMETHOD_(long, GetSize)(THIS) PURE; - STDMETHOD(GetTime)(THIS_ REFERENCE_TIME *, REFERENCE_TIME *) PURE; - STDMETHOD(SetTime)(THIS_ REFERENCE_TIME *, REFERENCE_TIME *) PURE; - STDMETHOD(IsSyncPoint)(THIS) PURE; - STDMETHOD(SetSyncPoint)(THIS_ BOOL) PURE; - STDMETHOD(IsPreroll)(THIS) PURE; - STDMETHOD(SetPreroll)(THIS_ BOOL) PURE; - STDMETHOD_(long, GetActualDataLength)(THIS) PURE; - STDMETHOD(SetActualDataLength)(THIS_ long) PURE; - STDMETHOD(GetMediaType)(THIS_ AM_MEDIA_TYPE **) PURE; - STDMETHOD(SetMediaType)(THIS_ AM_MEDIA_TYPE *) PURE; - STDMETHOD(IsDiscontinuity)(THIS) PURE; - STDMETHOD(SetDiscontinuity)(THIS_ BOOL) PURE; - STDMETHOD(GetMediaTime)(THIS_ LONGLONG *, LONGLONG *) PURE; - STDMETHOD(SetMediaTime)(THIS_ LONGLONG *, LONGLONG *) PURE; -}; -*/ - - -#undef INTERFACE - -#define INTERFACE IMemAllocator -DECLARE_INTERFACE_(IMemAllocator,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(SetProperties)(THIS_ ALLOCATOR_PROPERTIES*,ALLOCATOR_PROPERTIES*) PURE; - STDMETHOD(GetProperties)(THIS_ ALLOCATOR_PROPERTIES*) PURE; - STDMETHOD(Commit)(THIS) PURE; - STDMETHOD(Decommit)(THIS) PURE; - STDMETHOD(GetBuffer)(THIS_ IMediaSample **,REFERENCE_TIME*,REFERENCE_TIME*,DWORD) PURE; - STDMETHOD(ReleaseBuffer)(THIS_ IMediaSample*) PURE; -}; -#undef INTERFACE - -#define INTERFACE IMemInputPin -DECLARE_INTERFACE_(IMemInputPin,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(GetAllocator)(THIS_ IMemAllocator**) PURE; - STDMETHOD(NotifyAllocator)(THIS_ IMemAllocator*,BOOL) PURE; - STDMETHOD(GetAllocatorRequirements)(THIS_ ALLOCATOR_PROPERTIES*) PURE; - STDMETHOD(Receive)(THIS_ IMediaSample*) PURE; - STDMETHOD(ReceiveMultiple)(THIS_ IMediaSample**,LONG,LONG*) PURE; - STDMETHOD(ReceiveCanBlock)(THIS) PURE; -}; -#undef INTERFACE - -#define INTERFACE ISampleGrabberCB -DECLARE_INTERFACE_(ISampleGrabberCB,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(SampleCB)(THIS_ double,IMediaSample*) PURE; - STDMETHOD(BufferCB)(THIS_ double,BYTE*,long) PURE; -}; -#undef INTERFACE - -#define INTERFACE ISampleGrabber -DECLARE_INTERFACE_(ISampleGrabber,IUnknown) -{ - STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - STDMETHOD(SetOneShot)(THIS_ BOOL) PURE; - STDMETHOD(SetMediaType)(THIS_ const AM_MEDIA_TYPE*) PURE; - STDMETHOD(GetConnectedMediaType)(THIS_ AM_MEDIA_TYPE*) PURE; - STDMETHOD(SetBufferSamples)(THIS_ BOOL) PURE; - STDMETHOD(GetCurrentBuffer)(THIS_ long*,long*) PURE; - STDMETHOD(GetCurrentSample)(THIS_ IMediaSample**) PURE; - STDMETHOD(SetCallBack)(THIS_ ISampleGrabberCB *,long) PURE; -}; -#undef INTERFACE - -ComPtr< IPin > getPin( IBaseFilter *filter, PIN_DIRECTION direction, int num ) -{ - ComPtr< IPin > retVal; - ComPtr< IEnumPins > enumPins; - if (filter->EnumPins( &enumPins )!=S_OK){ - ms_error("Error getting pin enumerator" ); - return retVal; - } - ULONG found; - ComPtr< IPin > pin; - while ( enumPins->Next( 1, &pin, &found ) == S_OK ) { - PIN_DIRECTION pinDirection = (PIN_DIRECTION)( -1 ); - pin->QueryDirection( &pinDirection ); - if ( pinDirection == direction ) { - if ( num == 0 ) { - retVal = pin; - break; - }; - num--; - }; - }; - return retVal; -} - - - -class DSCapture : public ISampleGrabberCB{ -public: - DSCapture(){ - qinit(&_rq); - ms_mutex_init(&_mutex,NULL); - _vsize=MS_VIDEO_SIZE_CIF; - _fps=15; - _start_time=0; - _frame_count=0; - _pixfmt=MS_YUV420P; - _ready=false; - m_refCount=1; - } - virtual ~DSCapture(){ - if (_ready) stopAndClean(); - flushq(&_rq,0); - ms_mutex_destroy(&_mutex); - } - STDMETHODIMP QueryInterface( REFIID riid, void **ppv ); - STDMETHODIMP_(ULONG) AddRef(void); - STDMETHODIMP_(ULONG) Release(void); - STDMETHODIMP SampleCB(double,IMediaSample*); - STDMETHODIMP BufferCB(double,BYTE*,long); - int startDshowGraph(); - void stopAndClean(); - mblk_t *readFrame(){ - mblk_t *ret=NULL; - ms_mutex_lock(&_mutex); - ret=getq(&_rq); - ms_mutex_unlock(&_mutex); - return ret; - } - bool isTimeToSend(uint64_t ticker_time); - MSVideoSize getVSize()const{ - return _vsize; - } - void setVSize(MSVideoSize vsize){ - _vsize=vsize; - } - void setFps(float fps){ - _fps=fps; - } - MSPixFmt getPixFmt(){ - if (!_ready) createDshowGraph(); /* so that _pixfmt is updated*/ - return _pixfmt; - } - void setDeviceIndex(int index){ - _devid=index; - } -protected: - long m_refCount; -private: - int createDshowGraph(); - int selectBestFormat(ComPtr streamConfig, int count); - int _devid; - MSVideoSize _vsize; - queue_t _rq; - ms_mutex_t _mutex; - float _fps; - float _start_time; - int _frame_count; - MSPixFmt _pixfmt; - ComPtr< IGraphBuilder > _graphBuilder; - ComPtr< IBaseFilter > _source; - ComPtr< IBaseFilter > _nullRenderer; - ComPtr< IBaseFilter > _grabberBase; - ComPtr< IMediaControl > _mediaControl; - ComPtr< IMediaEvent > _mediaEvent; - bool _ready; -}; - - -STDMETHODIMP DSCapture::QueryInterface(REFIID riid, void **ppv) -{ - HRESULT retval; - if ( ppv == NULL ) return E_POINTER; - /* - if ( riid == IID_IUnknown ) { - *ppv = static_cast< IUnknown * >( this ); - AddRef(); - retval = S_OK; - } else if ( riid == IID_ISampleGrabberCB ) { - *ppv = static_cast< ISampleGrabberCB * >( this ); - AddRef(); - retval = S_OK; - } else */ { - retval = E_NOINTERFACE; - }; - return retval; -}; - -STDMETHODIMP_(ULONG) DSCapture::AddRef(){ - m_refCount++; - return m_refCount; -} - -STDMETHODIMP_(ULONG) DSCapture::Release() -{ - ms_message("DSCapture::Release"); - if ( !InterlockedDecrement( &m_refCount ) ) { - int refcnt=m_refCount; - delete this; - return refcnt; - } - return m_refCount; -} - -static void dummy(void*p){ -} - -STDMETHODIMP DSCapture::SampleCB( double par1 , IMediaSample * sample) -{ - uint8_t *p; - unsigned int size; - if (sample->GetPointer(&p)!=S_OK){ - ms_error("error in GetPointer()"); - return S_OK; - } - size=sample->GetSize(); - //ms_message( "DSCapture::SampleCB pointer=%p, size=%i",p,size); - mblk_t *m=esballoc(p,size,0,dummy); - m->b_wptr+=size; - ms_mutex_lock(&_mutex); - putq(&_rq,m); - ms_mutex_unlock(&_mutex); - return S_OK; -} - - - -STDMETHODIMP DSCapture::BufferCB( double, BYTE *b, long len) -{ - ms_message("DSCapture::BufferCB"); - return S_OK; -} - -static void dscap_init(MSFilter *f){ - DSCapture *s=new DSCapture(); - f->data=s; -} - - - -static void dscap_uninit(MSFilter *f){ - DSCapture *s=(DSCapture*)f->data; - s->Release(); -} - -static char * fourcc_to_char(char *str, uint32_t fcc){ - memcpy(str,&fcc,4); - str[4]='\0'; - return str; -} - -static int find_best_format(ComPtr streamConfig, int count, MSVideoSize *requested_size, MSPixFmt requested_fmt ){ - int i; - MSVideoSize best_found=(MSVideoSize){32768,32768}; - int best_index=-1; - char fccstr[5]; - char selected_fcc[5]; - for (i=0; iGetStreamCaps( i, &mediaType, - (BYTE *)&videoConfig )!=S_OK){ - ms_error( "Error getting stream capabilities"); - return -1; - } - if ( mediaType->majortype == MEDIATYPE_Video && - mediaType->cbFormat != 0 ) { - VIDEOINFOHEADER *infoHeader = (VIDEOINFOHEADER*)mediaType->pbFormat; - ms_message("Seeing format %ix%i %s",infoHeader->bmiHeader.biWidth,infoHeader->bmiHeader.biHeight, - fourcc_to_char(fccstr,infoHeader->bmiHeader.biCompression)); - if (ms_fourcc_to_pix_fmt(infoHeader->bmiHeader.biCompression)==requested_fmt){ - MSVideoSize cur; - cur.width=infoHeader->bmiHeader.biWidth; - cur.height=infoHeader->bmiHeader.biHeight; - if (ms_video_size_greater_than(cur,*requested_size)){ - if (ms_video_size_greater_than(best_found,cur)){ - best_found=cur; - best_index=i; - fourcc_to_char(selected_fcc,infoHeader->bmiHeader.biCompression); - } - } - } - }; - if ( mediaType->cbFormat != 0 ) - CoTaskMemFree( (PVOID)mediaType->pbFormat ); - if ( mediaType->pUnk != NULL ) mediaType->pUnk->Release(); - CoTaskMemFree( (PVOID)mediaType ); - } - if (best_index!=-1) { - *requested_size=best_found; - ms_message("Best camera format is %s %ix%i",selected_fcc,best_found.width,best_found.height); - } - return best_index; -} - -int DSCapture::selectBestFormat(ComPtr streamConfig, int count){ - int index; - _pixfmt=MS_YUV420P; - index=find_best_format(streamConfig, count, &_vsize, _pixfmt); - if (index!=-1) goto success; - _pixfmt=MS_YUY2; - index=find_best_format(streamConfig, count, &_vsize,_pixfmt); - if (index!=-1) goto success; - _pixfmt=MS_YUYV; - index=find_best_format(streamConfig, count, &_vsize, _pixfmt); - if (index!=-1) goto success; - _pixfmt=MS_RGB24; - index=find_best_format(streamConfig, count, &_vsize, _pixfmt); - if (index!=-1) { - _pixfmt=MS_RGB24_REV; - goto success; - } - ms_error("This camera does not support any of our pixel formats."); - return -1; - - success: - VIDEO_STREAM_CONFIG_CAPS videoConfig; - AM_MEDIA_TYPE *mediaType; - if (streamConfig->GetStreamCaps( index, &mediaType, - (BYTE *)&videoConfig )!=S_OK){ - ms_error( "Error getting stream capabilities" ); - } - streamConfig->SetFormat( mediaType ); - return 0; -} - -int DSCapture::createDshowGraph(){ - ComPtr< ICreateDevEnum > createDevEnum; - - CoInitialize(NULL); - if (createDevEnum.coCreateInstance( CLSID_SystemDeviceEnum, - IID_ICreateDevEnum )==-1){ - ms_error("Could not create device enumerator"); - return -1; - } - ComPtr< IEnumMoniker > enumMoniker; - if (createDevEnum->CreateClassEnumerator( CLSID_VideoInputDeviceCategory, &enumMoniker, 0 )!=S_OK){ - ms_error("Fail to create class enumerator."); - return -1; - } - createDevEnum.reset(); - enumMoniker->Reset(); - - ULONG fetched = 0; - if (_graphBuilder.coCreateInstance( CLSID_FilterGraph, IID_IGraphBuilder )!=0){ - ms_error("Could not create graph builder."); - return -1; - } - ComPtr< IMoniker > moniker; - for ( int i=0;enumMoniker->Next( 1, &moniker, &fetched )==S_OK;++i ) { - if (i==_devid){ - if (moniker->BindToObject( 0, 0, IID_IBaseFilter, (void **)&_source )!=S_OK){ - ms_error("Error binding moniker to base filter" ); - return -1; - } - } - } - if (_source.get()==0){ - ms_error("Could not interface with webcam devid=%i",_devid); - return -1; - } - moniker.reset(); - enumMoniker.reset(); - if (_graphBuilder->AddFilter( _source.get(), L"Source" )!=S_OK){ - ms_error("Error adding camera source to filter graph" ); - return -1; - } - ComPtr< IPin > sourceOut = getPin( _source.get(), PINDIR_OUTPUT, 0 ); - if (sourceOut.get()==NULL){ - ms_error("Error getting output pin of camera source" ); - return -1; - } - ComPtr< IAMStreamConfig > streamConfig; - if (sourceOut->QueryInterface( IID_IAMStreamConfig, - (void **)&streamConfig )!=S_OK){ - ms_error("Error requesting stream configuration API" ); - return -1; - } - int count, size; - if (streamConfig->GetNumberOfCapabilities( &count, &size )!=S_OK){ - ms_error("Error getting number of capabilities" ); - return -1; - } - if (selectBestFormat(streamConfig,count)!=0){ - return -1; - } - streamConfig.reset(); - - if (CoCreateInstance( CLSID_SampleGrabber, NULL, - CLSCTX_INPROC, IID_IBaseFilter, - (void **)&_grabberBase )!=S_OK){ - ms_error("Error creating sample grabber" ); - return -1; - } - if (_graphBuilder->AddFilter( _grabberBase.get(), L"Grabber" )!=S_OK){ - ms_error("Error adding sample grabber to filter graph"); - return -1; - } - ComPtr< ISampleGrabber > sampleGrabber; - if (_grabberBase->QueryInterface( IID_ISampleGrabber, - (void **)&sampleGrabber )!=S_OK){ - ms_error("Error requesting sample grabber interface"); - return -1; - } - if (sampleGrabber->SetOneShot( FALSE )!=S_OK){ - ms_error("Error disabling one-shot mode" ); - return -1; - } - if (sampleGrabber->SetBufferSamples( TRUE )!=S_OK){ - ms_error("Error enabling buffer sampling" ); - return -1; - } - if (sampleGrabber->SetCallBack(this, 0 )!=S_OK){ - ms_error("Error setting callback interface for grabbing" ); - return -1; - } - ComPtr< IPin > grabberIn = getPin( _grabberBase.get(), PINDIR_INPUT, 0 ); - if (grabberIn.get() == NULL){ - ms_error("Error getting input of sample grabber"); - return -1; - } - ComPtr< IPin > grabberOut = getPin( _grabberBase.get(), PINDIR_OUTPUT, 0 ); - if (grabberOut.get()==NULL){ - ms_error("Error getting output of sample grabber" ); - return -1; - } - if (CoCreateInstance( CLSID_NullRenderer, NULL, - CLSCTX_INPROC, IID_IBaseFilter, - (void **)&_nullRenderer )!=S_OK){ - ms_error("Error creating Null Renderer" ); - return -1; - } - if (_graphBuilder->AddFilter( _nullRenderer.get(), L"Sink" )!=S_OK){ - ms_error("Error adding null renderer to filter graph" ); - return -1; - } - ComPtr< IPin > nullIn = getPin( _nullRenderer.get(), PINDIR_INPUT, 0 ); - if (_graphBuilder->Connect( sourceOut.get(), grabberIn.get() )!=S_OK){ - ms_error("Error connecting source to sample grabber" ); - return -1; - } - if (_graphBuilder->Connect( grabberOut.get(), nullIn.get() )!=S_OK){ - ms_error("Error connecting sample grabber to sink" ); - return -1; - } - ms_message("Directshow graph is now ready to run."); - - if (_graphBuilder->QueryInterface( IID_IMediaControl, - (void **)&_mediaControl )!=S_OK){ - ms_error("Error requesting media control interface" ); - return -1; - } - if (_graphBuilder->QueryInterface( IID_IMediaEvent, - (void **)&_mediaEvent )!=S_OK){ - ms_error("Error requesting event interface" ); - return -1; - } - _ready=true; - return 0; -} - -int DSCapture::startDshowGraph(){ - if (!_ready) { - if (createDshowGraph()!=0) return -1; - } - HRESULT r=_mediaControl->Run(); - if (r!=S_OK && r!=S_FALSE){ - ms_error("Error starting graph (%i)",r); - return -1; - } - ms_message("Graph started"); - return 0; -} - -void DSCapture::stopAndClean(){ - if (_mediaControl.get()!=NULL){ - HRESULT r; - r=_mediaControl->Stop(); - if (r!=S_OK){ - ms_error("msdscap: Could not stop graph !"); - fflush(NULL); - } - _graphBuilder->RemoveFilter(_source.get()); - _graphBuilder->RemoveFilter(_grabberBase.get()); - _graphBuilder->RemoveFilter(_nullRenderer.get()); - } - _source.reset(); - _grabberBase.reset(); - _nullRenderer.reset(); - _mediaControl.reset(); - _mediaEvent.reset(); - _graphBuilder.reset(); - CoUninitialize(); - ms_mutex_lock(&_mutex); - flushq(&_rq,0); - ms_mutex_unlock(&_mutex); - _ready=false; -} - -bool DSCapture::isTimeToSend(uint64_t ticker_time){ - if (_frame_count==-1){ - _start_time=(float)ticker_time; - _frame_count=0; - } - int cur_frame=(int)(((float)ticker_time-_start_time)*_fps/1000.0); - if (cur_frame>_frame_count){ - _frame_count++; - return true; - } - return false; -} - -static void dscap_preprocess(MSFilter * obj){ - DSCapture *s=(DSCapture*)obj->data; - s->startDshowGraph(); -} - -static void dscap_postprocess(MSFilter * obj){ - DSCapture *s=(DSCapture*)obj->data; - s->stopAndClean(); -} - -static void dscap_process(MSFilter * obj){ - DSCapture *s=(DSCapture*)obj->data; - mblk_t *m; - uint32_t timestamp; - - if (s->isTimeToSend(obj->ticker->time)){ - mblk_t *om=NULL; - /*keep the most recent frame if several frames have been captured */ - while((m=s->readFrame())!=NULL){ - if (om!=NULL) freemsg(om); - om=m; - } - if (om!=NULL){ - timestamp=(uint32_t)(obj->ticker->time*90);/* rtp uses a 90000 Hz clockrate for video*/ - mblk_set_timestamp_info(om,timestamp); - ms_queue_put(obj->outputs[0],om); - } - } -} - -static int dscap_set_fps(MSFilter *f, void *arg){ - DSCapture *s=(DSCapture*)f->data; - s->setFps(*(float*)arg); - return 0; -} - -static int dscap_get_pix_fmt(MSFilter *f,void *arg){ - DSCapture *s=(DSCapture*)f->data; - *((MSPixFmt*)arg)=s->getPixFmt(); - return 0; -} - -static int dscap_set_vsize(MSFilter *f, void *arg){ - DSCapture *s=(DSCapture*)f->data; - s->setVSize(*((MSVideoSize*)arg)); - return 0; -} - -static int dscap_get_vsize(MSFilter *f, void *arg){ - DSCapture *s=(DSCapture*)f->data; - MSVideoSize *vs=(MSVideoSize*)arg; - *vs=s->getVSize(); - return 0; -} - -static MSFilterMethod methods[]={ - { MS_FILTER_SET_FPS , dscap_set_fps }, - { MS_FILTER_GET_PIX_FMT , dscap_get_pix_fmt }, - { MS_FILTER_SET_VIDEO_SIZE, dscap_set_vsize }, - { MS_FILTER_GET_VIDEO_SIZE, dscap_get_vsize }, - { 0 , NULL } -}; - -MSFilterDesc ms_dscap_desc={ - MS_DSCAP_ID, - "MSDsCap", - N_("A webcam grabber based on directshow."), - MS_FILTER_OTHER, - NULL, - 0, - 1, - dscap_init, - dscap_preprocess, - dscap_process, - dscap_postprocess, - dscap_uninit, - methods -}; - - -static void ms_dshow_detect(MSWebCamManager *obj); -static MSFilter * ms_dshow_create_reader(MSWebCam *obj){ - MSFilter *f=ms_filter_new_from_desc(&ms_dscap_desc); - DSCapture *s=(DSCapture*)f->data; - s->setDeviceIndex((int)obj->data); - return f; -} - -MSWebCamDesc ms_dshow_cam_desc={ - "Directshow capture", - &ms_dshow_detect, - NULL, - &ms_dshow_create_reader, - NULL -}; - -static void ms_dshow_detect(MSWebCamManager *obj){ - ComPtr pBag; - - CoInitialize(NULL); - - ComPtr< ICreateDevEnum > createDevEnum; - if (createDevEnum.coCreateInstance( CLSID_SystemDeviceEnum, - IID_ICreateDevEnum)!=0){ - ms_error( "Could not create device enumerator" ); - return ; - } - ComPtr< IEnumMoniker > enumMoniker; - if (createDevEnum->CreateClassEnumerator( CLSID_VideoInputDeviceCategory, &enumMoniker, 0 )!=S_OK){ - ms_error("Fail to create class enumerator."); - return; - } - createDevEnum.reset(); - enumMoniker->Reset(); - - ULONG fetched = 0; - ComPtr< IMoniker > moniker; - for ( int i=0;enumMoniker->Next( 1, &moniker, &fetched )==S_OK;++i ) { - VARIANT var; - if (moniker->BindToStorage( 0, 0, IID_IPropertyBag, (void**) &pBag )!=S_OK) - continue; - VariantInit(&var); - if (pBag->Read( L"FriendlyName", &var, NULL )!=S_OK) - continue; - char szName[256]; - WideCharToMultiByte(CP_ACP,0,var.bstrVal,-1,szName,256,0,0); - MSWebCam *cam=ms_web_cam_new(&ms_dshow_cam_desc); - cam->name=ms_strdup(szName); - cam->data=(void*)i; - ms_web_cam_manager_prepend_cam(obj,cam); - VariantClear(&var); - } - enumMoniker.reset(); -} - diff --git a/linphone/mediastreamer2/src/msfileplayer.c b/linphone/mediastreamer2/src/msfileplayer.c deleted file mode 100644 index 3ae467617..000000000 --- a/linphone/mediastreamer2/src/msfileplayer.c +++ /dev/null @@ -1,325 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/msfileplayer.h" -#include "mediastreamer2/waveheader.h" -#include "mediastreamer2/msticker.h" - - -static int player_close(MSFilter *f, void *arg); - -typedef enum { - CLOSED, - STARTED, - STOPPED -} PlayerState; - -struct _PlayerData{ - int fd; - PlayerState state; - int rate; - int nchannels; - int hsize; - int loop_after; - int pause_time; - int count; - bool_t swap; -}; - -typedef struct _PlayerData PlayerData; - -static void player_init(MSFilter *f){ - PlayerData *d=ms_new(PlayerData,1); - d->fd=-1; - d->state=CLOSED; - d->swap=FALSE; - d->rate=8000; - d->nchannels=1; - d->hsize=0; - d->loop_after=-1; /*by default, don't loop*/ - d->pause_time=0; - d->count=0; - f->data=d; -} - -static int read_wav_header(PlayerData *d){ - char header1[sizeof(riff_t)]; - char header2[sizeof(format_t)]; - char header3[sizeof(data_t)]; - int count; - - riff_t *riff_chunk=(riff_t*)header1; - format_t *format_chunk=(format_t*)header2; - data_t *data_chunk=(data_t*)header3; - - unsigned long len=0; - - len = read(d->fd, header1, sizeof(header1)) ; - if (len != sizeof(header1)){ - goto not_a_wav; - } - - if (0!=strncmp(riff_chunk->riff, "RIFF", 4) || 0!=strncmp(riff_chunk->wave, "WAVE", 4)){ - goto not_a_wav; - } - - len = read(d->fd, header2, sizeof(header2)) ; - if (len != sizeof(header2)){ - ms_warning("Wrong wav header: cannot read file"); - goto not_a_wav; - } - - d->rate=le_uint32(format_chunk->rate); - d->nchannels=le_uint16(format_chunk->channel); - - if (format_chunk->len-0x10>0) - { - lseek(d->fd,(format_chunk->len-0x10),SEEK_CUR); - } - - d->hsize=sizeof(wave_header_t)-0x10+format_chunk->len; - - len = read(d->fd, header3, sizeof(header3)) ; - if (len != sizeof(header3)){ - ms_warning("Wrong wav header: cannot read file"); - goto not_a_wav; - } - count=0; - while (strncmp(data_chunk->data, "data", 4)!=0 && count<30) - { - ms_warning("skipping chunk=%s len=%i", data_chunk->data, data_chunk->len); - lseek(d->fd,data_chunk->len,SEEK_CUR); - count++; - d->hsize=d->hsize+len+data_chunk->len; - - len = read(d->fd, header3, sizeof(header3)) ; - if (len != sizeof(header3)){ - ms_warning("Wrong wav header: cannot read file"); - goto not_a_wav; - } - } - #ifdef WORDS_BIGENDIAN - if (le_uint16(format_chunk->blockalign)==le_uint16(format_chunk->channel) * 2) - d->swap=TRUE; - #endif - return 0; - - not_a_wav: - /*rewind*/ - lseek(d->fd,0,SEEK_SET); - d->hsize=0; - return -1; -} - -static int player_open(MSFilter *f, void *arg){ - PlayerData *d=(PlayerData*)f->data; - int fd; - const char *file=(const char*)arg; - - if (d->fd>=0){ - player_close(f,NULL); - } - if ((fd=open(file,O_RDONLY))==-1){ - ms_warning("Failed to open %s",file); - return -1; - } - d->state=STOPPED; - d->fd=fd; - if (read_wav_header(d)!=0 && strstr(file,".wav")){ - ms_warning("File %s has .wav extension but wav header could be found.",file); - } - ms_message("%s opened: rate=%i,channel=%i",file,d->rate,d->nchannels); - return 0; -} - -static int player_start(MSFilter *f, void *arg){ - PlayerData *d=(PlayerData*)f->data; - if (d->state==STOPPED) - d->state=STARTED; - return 0; -} - -static int player_stop(MSFilter *f, void *arg){ - PlayerData *d=(PlayerData*)f->data; - ms_filter_lock(f); - if (d->state==STARTED){ - d->state=STOPPED; - lseek(d->fd,d->hsize,SEEK_SET); - } - ms_filter_unlock(f); - return 0; -} - -static int player_close(MSFilter *f, void *arg){ - PlayerData *d=(PlayerData*)f->data; - player_stop(f,NULL); - if (d->fd>=0) close(d->fd); - d->fd=-1; - d->state=CLOSED; - return 0; -} - -static void player_uninit(MSFilter *f){ - PlayerData *d=(PlayerData*)f->data; - if (d->fd>=0) player_close(f,NULL); - ms_free(d); -} - -static void swap_bytes(unsigned char *bytes, int len){ - int i; - unsigned char tmp; - for(i=0;idata; - int nsamples=(f->ticker->interval*d->rate*d->nchannels)/1000; - int bytes; - /*send an even number of samples each tick. At 22050Hz the number of samples per 10 ms chunk is odd. - Odd size buffer of samples cause troubles to alsa. Fixing in alsa is difficult, so workaround here. - */ - if (nsamples & 0x1 ) { //odd number of samples - if (d->count & 0x1 ) - nsamples++; - else - nsamples--; - } - bytes=2*nsamples; - d->count++; - ms_filter_lock(f); - if (d->state==STARTED){ - int err; - mblk_t *om=allocb(bytes,0); - if (d->pause_time>0){ - err=bytes; - memset(om->b_wptr,0,bytes); - d->pause_time-=f->ticker->interval; - }else{ - err=read(d->fd,om->b_wptr,bytes); - if (d->swap) swap_bytes(om->b_wptr,bytes); - } - if (err>=0){ - if (err!=0){ - if (errb_wptr+err,0,bytes-err); - om->b_wptr+=bytes; - ms_queue_put(f->outputs[0],om); - }else freemsg(om); - if (errfd,d->hsize,SEEK_SET); - - /* special value for playing file only once */ - if (d->loop_after==-2) - { - d->state=STOPPED; - ms_filter_unlock(f); - return; - } - - if (d->loop_after>=0){ - d->pause_time=d->loop_after; - } - } - }else{ - ms_warning("Fail to read %i bytes: %s",bytes,strerror(errno)); - } - } - ms_filter_unlock(f); -} - -static int player_get_sr(MSFilter *f, void*arg){ - PlayerData *d=(PlayerData*)f->data; - *((int*)arg)=d->rate; - return 0; -} - -static int player_loop(MSFilter *f, void *arg){ - PlayerData *d=(PlayerData*)f->data; - d->loop_after=*((int*)arg); - return 0; -} - -static int player_eof(MSFilter *f, void *arg){ - PlayerData *d=(PlayerData*)f->data; - if (d->fd<0 && d->state==CLOSED) - *((int*)arg) = TRUE; /* 1 */ - else - *((int*)arg) = FALSE; /* 0 */ - return 0; -} - -static int player_get_nch(MSFilter *f, void *arg){ - PlayerData *d=(PlayerData*)f->data; - *((int*)arg)=d->nchannels; - return 0; -} - -static MSFilterMethod player_methods[]={ - { MS_FILE_PLAYER_OPEN, player_open }, - { MS_FILE_PLAYER_START, player_start }, - { MS_FILE_PLAYER_STOP, player_stop }, - { MS_FILE_PLAYER_CLOSE, player_close }, - { MS_FILTER_GET_SAMPLE_RATE, player_get_sr}, - { MS_FILTER_GET_NCHANNELS, player_get_nch }, - { MS_FILE_PLAYER_LOOP, player_loop }, - { MS_FILE_PLAYER_DONE, player_eof }, - { 0, NULL } -}; - -#ifdef WIN32 - -MSFilterDesc ms_file_player_desc={ - MS_FILE_PLAYER_ID, - "MSFilePlayer", - N_("Raw files and wav reader"), - MS_FILTER_OTHER, - NULL, - 0, - 1, - player_init, - NULL, - player_process, - NULL, - player_uninit, - player_methods -}; - -#else - -MSFilterDesc ms_file_player_desc={ - .id=MS_FILE_PLAYER_ID, - .name="MSFilePlayer", - .text=N_("Raw files and wav reader"), - .category=MS_FILTER_OTHER, - .ninputs=0, - .noutputs=1, - .init=player_init, - .process=player_process, - .uninit=player_uninit, - .methods=player_methods -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_file_player_desc) diff --git a/linphone/mediastreamer2/src/msfileplayer_win.c b/linphone/mediastreamer2/src/msfileplayer_win.c deleted file mode 100644 index 0007b7a2a..000000000 --- a/linphone/mediastreamer2/src/msfileplayer_win.c +++ /dev/null @@ -1,369 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#define UNICODE - -#include "mediastreamer2/msfileplayer.h" -#include "mediastreamer2/waveheader.h" -#include "mediastreamer2/msticker.h" - -typedef enum { - CLOSED, - STARTED, - STOPPED -} PlayerState; - -struct _PlayerData{ - HANDLE fd; - PlayerState state; - int rate; - int nchannels; - int hsize; - int loop_after; - int pause_time; - bool_t swap; - - int stat; - int big_buffer; /* ouput less & bigger buffer. (default => no change) */ -}; - -typedef struct _PlayerData PlayerData; - -static void player_init(MSFilter *f){ - PlayerData *d=(PlayerData *)ms_new(PlayerData,1); - d->fd=INVALID_HANDLE_VALUE; - d->state=CLOSED; - d->swap=FALSE; - d->rate=8000; - d->nchannels=1; - d->hsize=0; - d->loop_after=-1; - d->pause_time=0; - d->stat=-1; - d->big_buffer=1; - f->data=d; -} - -static int read_wav_header(PlayerData *d){ - - char header1[sizeof(riff_t)]; - char header2[sizeof(format_t)]; - char header3[sizeof(data_t)]; - int count; - - riff_t *riff_chunk=(riff_t*)header1; - format_t *format_chunk=(format_t*)header2; - data_t *data_chunk=(data_t*)header3; - - unsigned long len=0; - BOOL res; - - res = ReadFile(d->fd, header1, sizeof(header1), &len, NULL) ; - if (!res || len != sizeof(header1)){ - ms_warning("Wrong wav header: cannot read file"); - return -1; - } - - if (0!=strncmp(riff_chunk->riff, "RIFF", 4) || 0!=strncmp(riff_chunk->wave, "WAVE", 4)){ - ms_warning("Wrong wav header (not RIFF/WAV)"); - return -1; - } - - res = ReadFile(d->fd, header2, sizeof(header2), &len, NULL) ; - if (!res || len != sizeof(header2)){ - ms_warning("Wrong wav header: cannot read file"); - return -1; - } - - d->rate=le_uint32(format_chunk->rate); - d->nchannels=le_uint16(format_chunk->channel); - - if (format_chunk->len-0x10>0) - { - SetFilePointer(d->fd, (format_chunk->len-0x10), NULL, FILE_CURRENT); - } - - d->hsize=sizeof(wave_header_t)-0x10+format_chunk->len; - - res = ReadFile(d->fd, header3, sizeof(header3), &len, NULL) ; - if (!res || len != sizeof(header3)){ - ms_warning("Wrong wav header: cannot read file"); - return -1; - } - count=0; - while (strncmp(data_chunk->data, "data", 4)!=0 && count<30) - { - SetFilePointer(d->fd, data_chunk->len, NULL, FILE_CURRENT); - count++; - d->hsize=d->hsize+len+data_chunk->len; - - res = ReadFile(d->fd, header3, sizeof(header3), &len, NULL) ; - if (!res || len != sizeof(header3)){ - ms_warning("Wrong wav header: cannot read file"); - return -1; - } - } -#ifdef WORDS_BIGENDIAN - d->swap=TRUE; -#endif - return 0; -} - -static int player_open(MSFilter *f, void *arg){ - PlayerData *d=(PlayerData*)f->data; - HANDLE fd; - const char *file=(const char*)arg; - WCHAR wUnicode[1024]; - MultiByteToWideChar(CP_UTF8, 0, file, -1, wUnicode, 1024); - fd = CreateFile(wUnicode, GENERIC_READ, FILE_SHARE_READ, NULL, - OPEN_EXISTING, 0, NULL); - if (fd==INVALID_HANDLE_VALUE){ - ms_warning("Failed to open %s",file); - return -1; - } - d->state=STOPPED; - d->fd=fd; - if (strstr(file,".wav")!=NULL) read_wav_header(d); - return 0; -} - -static int player_close(MSFilter *f, void *arg){ - PlayerData *d=(PlayerData*)f->data; - if (d->fd!=INVALID_HANDLE_VALUE) CloseHandle(d->fd); - d->fd=NULL; - d->state=CLOSED; - d->stat=-1; - return 0; -} - -static int player_start(MSFilter *f, void *arg){ - PlayerData *d=(PlayerData*)f->data; - if (d->state==STOPPED) - d->state=STARTED; - return 0; -} - -static int player_stop(MSFilter *f, void *arg){ - PlayerData *d=(PlayerData*)f->data; - if (d->state==STARTED){ - d->state=STOPPED; - d->stat=-1; - SetFilePointer(d->fd, d->hsize, NULL, FILE_BEGIN); - //read_wav_header(d); - } - return 0; -} - -static void player_uninit(MSFilter *f){ - PlayerData *d=(PlayerData*)f->data; - if (d->fd!=INVALID_HANDLE_VALUE) player_close(f,NULL); - ms_free(d); -} - -static void player_process(MSFilter *f){ - PlayerData *d=(PlayerData*)f->data; - int bytes =d->big_buffer * 2*(f->ticker->interval*d->rate*d->nchannels)/1000; - - if (d->big_buffer>1) - { - /* when starting reading a file: prepare more data - so that sound card buffer will never remain empty. - */ - d->stat++; - if (d->stat>3) - { - if (d->stat%(d->big_buffer)!=0) - return; - } - } - - if (d->state==STARTED){ - unsigned long err; - mblk_t *om=allocb(bytes,0); - if (d->pause_time>0){ - err=bytes; - memset(om->b_wptr,0,bytes); - d->pause_time-=f->ticker->interval; - }else{ - BOOL res; - err=0; - res = ReadFile(d->fd, om->b_wptr, bytes, &err, NULL) ; - } - if (err>=0){ - if (err==bytes){ - om->b_wptr+=err; - ms_queue_put(f->outputs[0],om); - } - else if (err>0){ - BOOL res; - - om->b_wptr+=err; - - ms_filter_notify_no_arg(f,MS_FILE_PLAYER_EOF); - SetFilePointer(d->fd, d->hsize, NULL, FILE_BEGIN); - //read_wav_header(d); - - /* special value for playing file only once */ - if (d->loop_after==-2) - { - freemsg(om); - player_close(f,NULL); - return; - } - - if (d->loop_after>0) - { - d->stat=-1; - d->pause_time=d->loop_after; - } - else - { - bytes=bytes-err; - err=0; - res = ReadFile(d->fd, om->b_wptr, bytes, &err, NULL); - if (err>0){ - om->b_wptr+=err; - } - } - - ms_queue_put(f->outputs[0],om); - } - else if (err==0){ - BOOL res; - ms_filter_notify_no_arg(f,MS_FILE_PLAYER_EOF); - SetFilePointer(d->fd, d->hsize, NULL, FILE_BEGIN); - - if (d->loop_after==-2) - { - freemsg(om); - player_close(f,NULL); - return; - } - - if (d->loop_after>0) - { - d->stat=-1; - d->pause_time=d->loop_after; - } - else - { - bytes=bytes-err; - err=0; - res = ReadFile(d->fd, om->b_wptr, bytes, &err, NULL); - if (err>0){ - om->b_wptr+=err; - ms_queue_put(f->outputs[0],om); - return; - } - } - freemsg(om); - - }else freemsg(om); - }else{ -#if !defined(_WIN32_WCE) - ms_warning("Fail to read %i bytes: %s",bytes,strerror(errno)); -#else - ms_warning("Fail to read %i bytes: %i",bytes,WSAGetLastError()); -#endif - } - } -} - -static int player_get_sr(MSFilter *f, void*arg){ - PlayerData *d=(PlayerData*)f->data; - *((int*)arg)=d->rate; - return 0; -} - -static int player_loop(MSFilter *f, void *arg){ - PlayerData *d=(PlayerData*)f->data; - d->loop_after=*((int*)arg); - return 0; -} - -static int player_set_big_buffer(MSFilter *f, void *arg){ - PlayerData *d=(PlayerData*)f->data; - d->big_buffer=*((int*)arg); - return 0; -} - -static int player_eof(MSFilter *f, void *arg){ - PlayerData *d=(PlayerData*)f->data; - if (d->fd==NULL && d->state==CLOSED) - *((int*)arg) = TRUE; /* 1 */ - else - *((int*)arg) = FALSE; /* 0 */ - return 0; -} - -static int player_get_nch(MSFilter *f, void *arg){ - PlayerData *d=(PlayerData*)f->data; - *((int*)arg)=d->nchannels; - return 0; -} - -static MSFilterMethod player_methods[]={ - { MS_FILE_PLAYER_OPEN, player_open }, - { MS_FILE_PLAYER_START, player_start }, - { MS_FILE_PLAYER_STOP, player_stop }, - { MS_FILE_PLAYER_CLOSE, player_close }, - { MS_FILTER_GET_SAMPLE_RATE, player_get_sr}, - { MS_FILTER_GET_NCHANNELS, player_get_nch }, - { MS_FILE_PLAYER_LOOP, player_loop }, - { MS_FILE_PLAYER_DONE, player_eof }, - { MS_FILE_PLAYER_BIG_BUFFER, player_set_big_buffer }, - { 0, NULL } -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_file_player_desc={ - MS_FILE_PLAYER_ID, - "MSFilePlayer", - "Raw files and wav reader", - MS_FILTER_OTHER, - NULL, - 0, - 1, - player_init, - NULL, - player_process, - NULL, - player_uninit, - player_methods -}; - -#else - -MSFilterDesc ms_file_player_desc={ - .id=MS_FILE_PLAYER_ID, - .name="MSFilePlayer", - .text="Raw files and wav reader", - .category=MS_FILTER_OTHER, - .ninputs=0, - .noutputs=1, - .init=player_init, - .process=player_process, - .uninit=player_uninit, - .methods=player_methods -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_file_player_desc) diff --git a/linphone/mediastreamer2/src/msfilerec.c b/linphone/mediastreamer2/src/msfilerec.c deleted file mode 100644 index 78035492b..000000000 --- a/linphone/mediastreamer2/src/msfilerec.c +++ /dev/null @@ -1,200 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/msfilerec.h" -#include "mediastreamer2/waveheader.h" - -#include -#include -#include - -static int rec_close(MSFilter *f, void *arg); - -typedef enum{ - Closed, - Stopped, - Started -} State; - -typedef struct RecState{ - int fd; - int rate; - int size; - State state; -} RecState; - -static void rec_init(MSFilter *f){ - RecState *s=ms_new(RecState,1); - s->fd=-1; - s->rate=8000; - s->size=0; - s->state=Closed; - f->data=s; -} - -static void rec_process(MSFilter *f){ - RecState *s=(RecState*)f->data; - mblk_t *m; - int err; - while((m=ms_queue_get(f->inputs[0]))!=NULL){ - mblk_t *it=m; - ms_mutex_lock(&f->lock); - if (s->state==Started){ - while(it!=NULL){ - int len=it->b_wptr-it->b_rptr; - if ((err=write(s->fd,it->b_rptr,len))!=len){ - if (err<0) - ms_warning("MSFileRec: fail to write %i bytes: %s",len,strerror(errno)); - } - it=it->b_cont; - s->size+=len; - } - } - ms_mutex_unlock(&f->lock); - freemsg(m); - } -} - -static int rec_open(MSFilter *f, void *arg){ - RecState *s=(RecState*)f->data; - const char *filename=(const char*)arg; - if (s->fd>=0) rec_close(f,NULL); - ms_mutex_lock(&f->lock); - s->fd=open(filename,O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR); - if (s->fd<0){ - ms_warning("Cannot open %s: %s",filename,strerror(errno)); - ms_mutex_unlock(&f->lock); - return -1; - } - s->state=Stopped; - ms_mutex_unlock(&f->lock); - return 0; -} - -static int rec_start(MSFilter *f, void *arg){ - RecState *s=(RecState*)f->data; - ms_mutex_lock(&f->lock); - s->state=Started; - ms_mutex_unlock(&f->lock); - return 0; -} - -static int rec_stop(MSFilter *f, void *arg){ - RecState *s=(RecState*)f->data; - ms_mutex_lock(&f->lock); - s->state=Stopped; - ms_mutex_unlock(&f->lock); - return 0; -} - -static void write_wav_header(int fd, int rate,int size){ - wave_header_t header; - memcpy(&header.riff_chunk.riff,"RIFF",4); - header.riff_chunk.len=le_uint32(size+32); - memcpy(&header.riff_chunk.wave,"WAVE",4); - - memcpy(&header.format_chunk.fmt,"fmt ",4); - header.format_chunk.len=le_uint32(0x10); - header.format_chunk.type=le_uint16(0x1); - header.format_chunk.channel=le_uint16(0x1); - header.format_chunk.rate=le_uint32(rate); - header.format_chunk.bps=le_uint32(rate*2); - header.format_chunk.blockalign=le_uint16(2); - header.format_chunk.bitpspl=le_uint16(16); - - memcpy(&header.data_chunk.data,"data",4); - header.data_chunk.len=le_uint32(size); - lseek(fd,0,SEEK_SET); - if (write(fd,&header,sizeof(header))!=sizeof(header)){ - ms_warning("Fail to write wav header."); - } -} - -static int rec_close(MSFilter *f, void *arg){ - RecState *s=(RecState*)f->data; - ms_mutex_lock(&f->lock); - s->state=Closed; - if (s->fd>=0) { - write_wav_header(s->fd,s->rate, s->size); - close(s->fd); - s->fd=-1; - } - ms_mutex_unlock(&f->lock); - return 0; -} - -static int rec_set_sr(MSFilter *f, void *arg){ - RecState *s=(RecState*)f->data; - ms_mutex_lock(&f->lock); - s->rate=*((int*)arg); - ms_mutex_unlock(&f->lock); - return 0; -} - -static void rec_uninit(MSFilter *f){ - RecState *s=(RecState*)f->data; - if (s->fd>=0) rec_close(f,NULL); - ms_free(s); -} - -static MSFilterMethod rec_methods[]={ - { MS_FILTER_SET_SAMPLE_RATE, rec_set_sr }, - { MS_FILE_REC_OPEN , rec_open }, - { MS_FILE_REC_START , rec_start }, - { MS_FILE_REC_STOP , rec_stop }, - { MS_FILE_REC_CLOSE , rec_close }, - { 0 , NULL } -}; - -#ifdef WIN32 - -MSFilterDesc ms_file_rec_desc={ - MS_FILE_REC_ID, - "MSFileRec", - N_("Wav file recorder"), - MS_FILTER_OTHER, - NULL, - 1, - 0, - rec_init, - NULL, - rec_process, - NULL, - rec_uninit, - rec_methods -}; - -#else - -MSFilterDesc ms_file_rec_desc={ - .id=MS_FILE_REC_ID, - .name="MSFileRec", - .text=N_("Wav file recorder"), - .category=MS_FILTER_OTHER, - .ninputs=1, - .noutputs=0, - .init=rec_init, - .process=rec_process, - .uninit=rec_uninit, - .methods=rec_methods -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_file_rec_desc) diff --git a/linphone/mediastreamer2/src/msfilerec_win.c b/linphone/mediastreamer2/src/msfilerec_win.c deleted file mode 100644 index b485d451b..000000000 --- a/linphone/mediastreamer2/src/msfilerec_win.c +++ /dev/null @@ -1,246 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#define UNICODE - -#include "mediastreamer2/msfilerec.h" -#include "mediastreamer2/waveheader.h" - -#if !defined(_WIN32_WCE) -#include -#include -#include -#endif - - -typedef enum{ - Closed, - Stopped, - Started -} State; - -typedef struct RecState{ - HANDLE fd; - int rate; - int size; - State state; - char filename[256]; -} RecState; - -static void rec_init(MSFilter *f){ - RecState *s=(RecState *)ms_new(RecState,1); - s->fd=INVALID_HANDLE_VALUE; - s->rate=8000; - s->size=0; - s->state=Closed; - f->data=s; -} - -static void rec_process(MSFilter *f){ - RecState *s=(RecState*)f->data; - mblk_t *m; - int err; - while((m=ms_queue_get(f->inputs[0]))!=NULL){ - mblk_t *it=m; - ms_mutex_lock(&f->lock); - if (s->state==Started){ - while(it!=NULL){ - int len=it->b_wptr-it->b_rptr; - DWORD byte_written=0; - if ((err=WriteFile(s->fd,it->b_rptr,len, &byte_written, NULL))!=len){ - if (err<0) - { -#if !defined(_WIN32_WCE) - ms_warning("MSFileRec: fail to write %i bytes: %s",len,strerror(errno)); -#else - ms_warning("MSFileRec: fail to write %i bytes: %i",len,WSAGetLastError()); -#endif - } - } - it=it->b_cont; - s->size+=len; - } - } - ms_mutex_unlock(&f->lock); - freemsg(m); - } -} - -static void write_wav_header(int rate,int size, char *filename){ - wave_header_t header; - DWORD bytes_written=0; - HANDLE fd; - WCHAR wUnicode[1024]; - MultiByteToWideChar(CP_UTF8, 0, filename, -1, wUnicode, 1024); - - memcpy(&header.riff_chunk.riff,"RIFF",4); - header.riff_chunk.len=le_uint32(size+32); - memcpy(&header.riff_chunk.wave,"WAVE",4); - - memcpy(&header.format_chunk.fmt,"fmt ",4); - header.format_chunk.len=le_uint32(0x10); - header.format_chunk.type=le_uint16(0x1); - header.format_chunk.channel=le_uint16(0x1); - header.format_chunk.rate=le_uint32(rate); - header.format_chunk.bps=le_uint32(rate*2); - header.format_chunk.blockalign=le_uint16(2); - header.format_chunk.bitpspl=le_uint16(16); - - memcpy(&header.data_chunk.data,"data",4); - header.data_chunk.len=le_uint32(size); - - /* TODO: replace with "lseek" equivalent for windows */ - fd=CreateFile(wUnicode, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); - if (fd==INVALID_HANDLE_VALUE){ -#if !defined(_WIN32_WCE) - ms_warning("Cannot open %s: %s",filename,strerror(errno)); -#else - ms_warning("Cannot open %s: %i",filename,WSAGetLastError()); -#endif - return; - } - WriteFile(fd,&header,sizeof(header), &bytes_written, NULL); - if (bytes_written!=sizeof(header)){ - ms_warning("Fail to write wav header."); - } - CloseHandle(fd); -} - -static int rec_open(MSFilter *f, void *arg){ - wave_header_t header; - DWORD bytes_written=0; - - RecState *s=(RecState*)f->data; - const char *filename=(const char*)arg; - WCHAR wUnicode[1024]; - MultiByteToWideChar(CP_UTF8, 0, filename, -1, wUnicode, 1024); - - ms_mutex_lock(&f->lock); - snprintf(s->filename, sizeof(s->filename), "%s", filename); - s->fd=CreateFile(wUnicode, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); - if (s->fd==INVALID_HANDLE_VALUE){ -#if !defined(_WIN32_WCE) - ms_warning("Cannot open %s: %s",filename,strerror(errno)); -#else - ms_warning("Cannot open %s: %i",filename,WSAGetLastError()); -#endif - ms_mutex_unlock(&f->lock); - return -1; - } - - memset(&header ,0,sizeof(header)); - WriteFile(s->fd,&header,sizeof(header), &bytes_written, NULL); - if (bytes_written!=sizeof(header)){ - ms_warning("Fail to write wav header."); - } - - s->state=Stopped; - ms_mutex_unlock(&f->lock); - return 0; -} - -static int rec_start(MSFilter *f, void *arg){ - RecState *s=(RecState*)f->data; - ms_mutex_lock(&f->lock); - s->state=Started; - ms_mutex_unlock(&f->lock); - return 0; -} - -static int rec_stop(MSFilter *f, void *arg){ - RecState *s=(RecState*)f->data; - ms_mutex_lock(&f->lock); - s->state=Stopped; - ms_mutex_unlock(&f->lock); - return 0; -} - -static int rec_close(MSFilter *f, void *arg){ - RecState *s=(RecState*)f->data; - ms_mutex_lock(&f->lock); - s->state=Closed; - if (s->fd!=INVALID_HANDLE_VALUE) { - CloseHandle(s->fd); - write_wav_header(s->rate, s->size, s->filename); - s->fd=INVALID_HANDLE_VALUE; - s->size=0; - } - ms_mutex_unlock(&f->lock); - return 0; -} - -static int rec_set_sr(MSFilter *f, void *arg){ - RecState *s=(RecState*)f->data; - ms_mutex_lock(&f->lock); - s->rate=*((int*)arg); - ms_mutex_unlock(&f->lock); - return 0; -} - -static void rec_uninit(MSFilter *f){ - RecState *s=(RecState*)f->data; - if (s->fd!=INVALID_HANDLE_VALUE) rec_close(f,NULL); - ms_free(s); -} - -static MSFilterMethod rec_methods[]={ - { MS_FILTER_SET_SAMPLE_RATE, rec_set_sr }, - { MS_FILE_REC_OPEN , rec_open }, - { MS_FILE_REC_START , rec_start }, - { MS_FILE_REC_STOP , rec_stop }, - { MS_FILE_REC_CLOSE , rec_close }, - { 0 , NULL } -}; - -#ifdef WIN32 - -MSFilterDesc ms_file_rec_desc={ - MS_FILE_REC_ID, - "MSFileRec", - N_("Wav file recorder"), - MS_FILTER_OTHER, - NULL, - 1, - 0, - rec_init, - NULL, - rec_process, - NULL, - rec_uninit, - rec_methods -}; - -#else - -MSFilterDesc ms_file_rec_desc={ - .id=MS_FILE_REC_ID, - .name="MSFileRec", - .text=N_("Wav file recorder"), - .category=MS_FILTER_OTHER, - .ninputs=1, - .noutputs=0, - .init=rec_init, - .process=rec_process, - .uninit=rec_uninit, - .methods=rec_methods -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_file_rec_desc) diff --git a/linphone/mediastreamer2/src/msfilter.c b/linphone/mediastreamer2/src/msfilter.c deleted file mode 100644 index 4bbfaa5f0..000000000 --- a/linphone/mediastreamer2/src/msfilter.c +++ /dev/null @@ -1,309 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/msfilter.h" -#include "mediastreamer2/mscommon.h" - -static MSList *desc_list=NULL; - -void ms_filter_register(MSFilterDesc *desc){ - if (desc->id==MS_FILTER_NOT_SET_ID){ - ms_fatal("MSFilterId for %s not set !",desc->name); - } - /*lastly registered encoder/decoders may replace older ones*/ - desc_list=ms_list_prepend(desc_list,desc); -} - -void ms_filter_unregister_all(){ - if (desc_list!=NULL) ms_list_free(desc_list); -} - -bool_t ms_filter_codec_supported(const char *mime){ - if (ms_filter_get_encoder(mime)!=NULL - && ms_filter_get_decoder(mime)!=NULL) return TRUE; - return FALSE; -} - -MSFilterDesc * ms_filter_get_encoder(const char *mime){ - MSList *elem; - for (elem=desc_list;elem!=NULL;elem=ms_list_next(elem)){ - MSFilterDesc *desc=(MSFilterDesc*)elem->data; - if (desc->category==MS_FILTER_ENCODER && - strcasecmp(desc->enc_fmt,mime)==0){ - return desc; - } - } - return NULL; -} - -MSFilterDesc * ms_filter_get_decoder(const char *mime){ - MSList *elem; - for (elem=desc_list;elem!=NULL;elem=ms_list_next(elem)){ - MSFilterDesc *desc=(MSFilterDesc*)elem->data; - if (desc->category==MS_FILTER_DECODER && - strcasecmp(desc->enc_fmt,mime)==0){ - return desc; - } - } - return NULL; -} - -MSFilter * ms_filter_create_encoder(const char *mime){ - MSFilterDesc *desc=ms_filter_get_encoder(mime); - if (desc!=NULL) return ms_filter_new_from_desc(desc); - return NULL; -} - -MSFilter * ms_filter_create_decoder(const char *mime){ - MSFilterDesc *desc=ms_filter_get_decoder(mime); - if (desc!=NULL) return ms_filter_new_from_desc(desc); - return NULL; -} - -MSFilter *ms_filter_new_from_desc(MSFilterDesc *desc){ - MSFilter *obj; - obj=(MSFilter *)ms_new0(MSFilter,1); - ms_mutex_init(&obj->lock,NULL); - obj->desc=desc; - if (desc->ninputs>0) obj->inputs=(MSQueue**)ms_new0(MSQueue*,desc->ninputs); - if (desc->noutputs>0) obj->outputs=(MSQueue**)ms_new0(MSQueue*,desc->noutputs); - if (obj->desc->init!=NULL) - obj->desc->init(obj); - return obj; -} - -MSFilter *ms_filter_new(MSFilterId id){ - MSList *elem; - if (id==MS_FILTER_PLUGIN_ID){ - ms_warning("cannot create plugin filters with ms_filter_new_from_id()"); - return NULL; - } - for (elem=desc_list;elem!=NULL;elem=ms_list_next(elem)){ - MSFilterDesc *desc=(MSFilterDesc*)elem->data; - if (desc->id==id){ - return ms_filter_new_from_desc(desc); - } - } - ms_error("No such filter with id %i",id); - return NULL; -} - -MSFilter *ms_filter_new_from_name(const char *filter_name){ - MSList *elem; - for (elem=desc_list;elem!=NULL;elem=ms_list_next(elem)){ - MSFilterDesc *desc=(MSFilterDesc*)elem->data; - if (strcmp(desc->name,filter_name)==0){ - return ms_filter_new_from_desc(desc); - } - } - ms_error("No such filter with name %s",filter_name); - return NULL; -} - - -MSFilterId ms_filter_get_id(MSFilter *f){ - return f->desc->id; -} - -int ms_filter_link(MSFilter *f1, int pin1, MSFilter *f2, int pin2){ - MSQueue *q; - ms_return_val_if_fail(pin1desc->noutputs, -1); - ms_return_val_if_fail(pin2desc->ninputs, -1); - ms_return_val_if_fail(f1->outputs[pin1]==NULL,-1); - ms_return_val_if_fail(f2->inputs[pin2]==NULL,-1); - q=ms_queue_new(f1,pin1,f2,pin2); - f1->outputs[pin1]=q; - f2->inputs[pin2]=q; - ms_message("ms_filter_link: %s:%p,%i-->%s:%p,%i",f1->desc->name,f1,pin1,f2->desc->name,f2,pin2); - return 0; -} - -int ms_filter_unlink(MSFilter *f1, int pin1, MSFilter *f2, int pin2){ - MSQueue *q; - ms_return_val_if_fail(f1, -1); - ms_return_val_if_fail(f2, -1); - ms_return_val_if_fail(pin1desc->noutputs, -1); - ms_return_val_if_fail(pin2desc->ninputs, -1); - ms_return_val_if_fail(f1->outputs[pin1]!=NULL,-1); - ms_return_val_if_fail(f2->inputs[pin2]!=NULL,-1); - ms_return_val_if_fail(f1->outputs[pin1]==f2->inputs[pin2],-1); - q=f1->outputs[pin1]; - f1->outputs[pin1]=f2->inputs[pin2]=0; - ms_queue_destroy(q); - ms_message("ms_filter_unlink: %s:%p,%i-->%s:%p,%i",f1->desc->name,f1,pin1,f2->desc->name,f2,pin2); - return 0; -} - -#define MS_FILTER_METHOD_GET_FID(id) (((id)>>16) & 0xFFFF) - -int ms_filter_call_method(MSFilter *f, unsigned int id, void *arg){ - MSFilterMethod *methods=f->desc->methods; - int i; - unsigned int magic=MS_FILTER_METHOD_GET_FID(id); - if (magic!=MS_FILTER_BASE_ID && magic!=f->desc->id) { - ms_fatal("Method type checking failed when calling %u on filter %s",id,f->desc->name); - return -1; - } - for(i=0;methods!=NULL && methods[i].method!=NULL; i++){ - unsigned int mm=MS_FILTER_METHOD_GET_FID(methods[i].id); - if (mm!=f->desc->id && mm!=MS_FILTER_BASE_ID) { - ms_fatal("Bad method definition on filter %s. fid=%u , mm=%u",f->desc->name,f->desc->id,mm); - return -1; - } - if (methods[i].id==id){ - return methods[i].method(f,arg); - } - } - if (magic!=MS_FILTER_BASE_ID) ms_error("no such method on filter %s",f->desc->name); - return -1; -} - -int ms_filter_call_method_noarg(MSFilter *f, unsigned int id){ - return ms_filter_call_method(f,id,NULL); -} - -void ms_filter_set_notify_callback(MSFilter *f, MSFilterNotifyFunc fn, void *ud){ - f->notify=fn; - f->notify_ud=ud; -} - -void ms_filter_destroy(MSFilter *f){ - if (f->desc->uninit!=NULL) - f->desc->uninit(f); - if (f->inputs!=NULL) ms_free(f->inputs); - if (f->outputs!=NULL) ms_free(f->outputs); - ms_mutex_destroy(&f->lock); - ms_free(f); -} - - -void ms_filter_process(MSFilter *f){ - ms_debug("Executing process of filter %s:%p",f->desc->name,f); - f->desc->process(f); -} - -void ms_filter_preprocess(MSFilter *f, struct _MSTicker *t){ - f->last_tick=0; - f->ticker=t; - if (f->desc->preprocess!=NULL) - f->desc->preprocess(f); -} - -void ms_filter_postprocess(MSFilter *f){ - if (f->desc->postprocess!=NULL) - f->desc->postprocess(f); - f->ticker=NULL; -} - -bool_t ms_filter_inputs_have_data(MSFilter *f){ - int i; - for(i=0;idesc->ninputs;i++){ - MSQueue *q=f->inputs[i]; - if (q!=NULL && q->q.q_mcount>0) return TRUE; - } - return FALSE; -} - -void ms_filter_notify(MSFilter *f, unsigned int id, void *arg){ - if (f->notify!=NULL) - f->notify(f->notify_ud,id,arg); -} - -void ms_filter_notify_no_arg(MSFilter *f, unsigned int id){ - if (f->notify!=NULL) - f->notify(f->notify_ud,id,NULL); -} - - -static void find_filters(MSList **filters, MSFilter *f ){ - int i,found; - MSQueue *link; - if (f==NULL) ms_fatal("Bad graph."); - /*ms_message("seeing %s, seen=%i",f->desc->name,f->seen);*/ - if (f->seen){ - return; - } - f->seen=TRUE; - *filters=ms_list_append(*filters,f); - /* go upstream */ - for(i=0;idesc->ninputs;i++){ - link=f->inputs[i]; - if (link!=NULL) find_filters(filters,link->prev.filter); - } - /* go downstream */ - for(i=0,found=0;idesc->noutputs;i++){ - link=f->outputs[i]; - if (link!=NULL) { - found++; - find_filters(filters,link->next.filter); - } - } - if (f->desc->noutputs>=1 && found==0){ - ms_fatal("Bad graph: filter %s has %i outputs, none is connected.",f->desc->name,f->desc->noutputs); - } -} - -MSList * ms_filter_find_neighbours(MSFilter *me){ - MSList *l=NULL; - MSList *it; - find_filters(&l,me); - /*reset seen boolean for further lookups to succeed !*/ - for(it=l;it!=NULL;it=it->next){ - MSFilter *f=(MSFilter*)it->data; - f->seen=FALSE; - } - return l; -} - -void ms_connection_helper_start(MSConnectionHelper *h){ - h->last.filter=0; - h->last.pin=-1; -} - -int ms_connection_helper_link(MSConnectionHelper *h, MSFilter *f, int inpin, int outpin){ - int err=0; - if (h->last.filter==NULL){ - h->last.filter=f; - h->last.pin=outpin; - }else{ - err=ms_filter_link(h->last.filter,h->last.pin,f,inpin); - if (err==0){ - h->last.filter=f; - h->last.pin=outpin; - } - } - return err; -} - -int ms_connection_helper_unlink(MSConnectionHelper *h, MSFilter *f, int inpin, int outpin){ - int err=0; - if (h->last.filter==NULL){ - h->last.filter=f; - h->last.pin=outpin; - }else{ - err=ms_filter_unlink(h->last.filter,h->last.pin,f,inpin); - if (err==0){ - h->last.filter=f; - h->last.pin=outpin; - } - } - return err; -} - - diff --git a/linphone/mediastreamer2/src/msjoin.c b/linphone/mediastreamer2/src/msjoin.c deleted file mode 100644 index 9d04b0c1b..000000000 --- a/linphone/mediastreamer2/src/msjoin.c +++ /dev/null @@ -1,72 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/msfilter.h" - -static void join_process(MSFilter *f){ - mblk_t *im; - if (f->inputs[0]!=NULL) - { - while((im=ms_queue_get(f->inputs[0]))!=NULL){ - ms_queue_put(f->outputs[0],im); - } - } - if (f->inputs[1]!=NULL) - { - while((im=ms_queue_get(f->inputs[1]))!=NULL){ - int payload; - payload=mblk_set_payload_type(im, 123); - ms_queue_put(f->outputs[0],im); - } - } -} - -#ifdef _MSC_VER - -MSFilterDesc ms_join_desc={ - MS_JOIN_ID, - "MSJoin", - N_("A filter that send several inputs to one output."), - MS_FILTER_OTHER, - NULL, - 2, - 1, - NULL, - NULL, - join_process, - NULL, - NULL, - NULL -}; - -#else - -MSFilterDesc ms_join_desc={ - .id=MS_JOIN_ID, - .name="MSJoin", - .text=N_("A filter that send several inputs to one output."), - .category=MS_FILTER_OTHER, - .ninputs=2, - .noutputs=1, - .process=join_process -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_join_desc) diff --git a/linphone/mediastreamer2/src/msqueue.c b/linphone/mediastreamer2/src/msqueue.c deleted file mode 100644 index 66172a517..000000000 --- a/linphone/mediastreamer2/src/msqueue.c +++ /dev/null @@ -1,117 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/msqueue.h" -#include "mediastreamer2/mscommon.h" -#include "mediastreamer2/msvideo.h" -#include - -MSQueue * ms_queue_new(struct _MSFilter *f1, int pin1, struct _MSFilter *f2, int pin2 ){ - MSQueue *q=(MSQueue*)ms_new(MSQueue,1); - qinit(&q->q); - q->prev.filter=f1; - q->prev.pin=pin1; - q->next.filter=f2; - q->next.pin=pin2; - return q; -} - -void ms_queue_init(MSQueue *q){ - q->prev.filter=0; - q->prev.pin=0; - q->next.filter=0; - q->next.pin=0; - qinit(&q->q); -} - -void ms_queue_destroy(MSQueue *q){ - flushq(&q->q,0); - ms_free(q); -} - -void ms_queue_flush(MSQueue *q){ - flushq(&q->q,0); -} - - -void ms_bufferizer_init(MSBufferizer *obj){ - qinit(&obj->q); - obj->size=0; -} - -MSBufferizer * ms_bufferizer_new(){ - MSBufferizer *obj=(MSBufferizer *)ms_new(MSBufferizer,1); - ms_bufferizer_init(obj); - return obj; -} - -void ms_bufferizer_put(MSBufferizer *obj, mblk_t *m){ - obj->size+=msgdsize(m); - putq(&obj->q,m); -} - -void ms_bufferizer_put_from_queue(MSBufferizer *obj, MSQueue *q){ - mblk_t *m; - while((m=ms_queue_get(q))!=NULL){ - ms_bufferizer_put(obj,m); - } -} - -int ms_bufferizer_read(MSBufferizer *obj, uint8_t *data, int datalen){ - if (obj->size>=datalen){ - int sz=0; - int cplen; - mblk_t *m=peekq(&obj->q); - /*we can return something */ - while(szb_wptr-m->b_rptr,datalen-sz); - memcpy(data+sz,m->b_rptr,cplen); - sz+=cplen; - m->b_rptr+=cplen; - if (m->b_rptr==m->b_wptr){ - /* check cont */ - if (m->b_cont!=NULL) { - m=m->b_cont; - } - else{ - mblk_t *remove=getq(&obj->q); - freemsg(remove); - m=peekq(&obj->q); - } - } - } - obj->size-=datalen; - return datalen; - } - return 0; -} - -void ms_bufferizer_flush(MSBufferizer *obj){ - obj->size=0; - flushq(&obj->q,0); -} - -void ms_bufferizer_uninit(MSBufferizer *obj){ - flushq(&obj->q,0); -} - -void ms_bufferizer_destroy(MSBufferizer *obj){ - ms_bufferizer_uninit(obj); - ms_free(obj); -} diff --git a/linphone/mediastreamer2/src/msresample.c b/linphone/mediastreamer2/src/msresample.c deleted file mode 100644 index 6347faa31..000000000 --- a/linphone/mediastreamer2/src/msresample.c +++ /dev/null @@ -1,252 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/msfilter.h" - -#ifdef _MSC_VER -#include -#endif - -#include -#include - -typedef struct _ResampleData{ - MSBufferizer *bz; - uint32_t ts; - uint32_t input_rate; - uint32_t output_rate; - - SpeexResamplerState *handle; - int nb_unprocessed; -} ResampleData; - -static ResampleData * resample_data_new(){ - ResampleData *obj=(ResampleData *)ms_new(ResampleData,1); - obj->bz=ms_bufferizer_new(); - obj->ts=0; - obj->input_rate=8000; - obj->output_rate=16000; - obj->handle=NULL; - - obj->nb_unprocessed=0; - return obj; -} - -static void resample_data_destroy(ResampleData *obj){ - if (obj->handle!=NULL) - speex_resampler_destroy(obj->handle); - ms_bufferizer_destroy(obj->bz); - ms_free(obj); -} - -static void resample_init(MSFilter *obj){ - obj->data=resample_data_new(); -} - -static void resample_uninit(MSFilter *obj){ - resample_data_destroy((ResampleData*)obj->data); - -} - -#if 0 -static void resample_process_ms2(MSFilter *obj){ - ResampleData *dt=(ResampleData*)obj->data; - MSBufferizer *bz=dt->bz; - uint8_t buffer[2240]; - int size_of_input; - int size_of_output; - - mblk_t *m; - - if (dt->output_rate==dt->input_rate) - { - while((m=ms_queue_get(obj->inputs[0]))!=NULL){ - ms_queue_put(obj->outputs[0],m); - } - return; - } - if (dt->handle!=NULL){ - unsigned int inrate=0, outrate=0; - speex_resampler_get_rate(dt->handle,&inrate,&outrate); - if (inrate!=dt->input_rate || outrate!=dt->output_rate){ - speex_resampler_destroy(dt->handle); - dt->handle=0; - } - } - if (dt->handle==NULL){ - int err=0; - dt->handle=speex_resampler_init(1, dt->input_rate, dt->output_rate, SPEEX_RESAMPLER_QUALITY_VOIP, &err); - } - - - if (dt->input_rateoutput_rate) - size_of_input=320*dt->input_rate/8000; - else - size_of_input=320*dt->input_rate/8000; - size_of_output = (size_of_input * dt->output_rate)/dt->input_rate; - - while((m=ms_queue_get(obj->inputs[0]))!=NULL){ - ms_bufferizer_put(bz,m); - } - while (ms_bufferizer_read(bz,buffer,size_of_input)==size_of_input){ - mblk_t *obl=allocb(size_of_output,0); - - float *in; - float *out; - spx_uint32_t in_len; - spx_uint32_t out_len; - int err; - - short *data = (short*)buffer; - short *data_out = (short*)obl->b_wptr; - - int i; - spx_uint32_t idx; - - in = (float*) alloca((size_of_input/2)*sizeof(float)); - out = (float*) alloca((size_of_output/2)*sizeof(float)); - - /* Convert the samples to floats */ - for (i = 0; i < size_of_input/2; i++) - in[i] = (float) data[i]; - - in_len = size_of_input/2; - out_len = size_of_output/2; - err = speex_resampler_process_float(dt->handle, 0, in, &in_len, out, &out_len); - - /* ms_message("resampling info: err=%i in_len=%i, out_len=%i", err, in_len, out_len); */ - - for (idx=0;idxb_wptr=obl->b_wptr+(out_len*2); /* size_of_output; */ - - mblk_set_timestamp_info(obl,dt->ts); - dt->ts+=160; - ms_queue_put(obj->outputs[0],obl); - } -} - -#else -static void resample_process_ms2(MSFilter *obj){ - ResampleData *dt=(ResampleData*)obj->data; - mblk_t *m; - - if (dt->output_rate==dt->input_rate){ - while((m=ms_queue_get(obj->inputs[0]))!=NULL){ - ms_queue_put(obj->outputs[0],m); - } - return; - } - - if (dt->handle!=NULL){ - unsigned int inrate=0, outrate=0; - speex_resampler_get_rate(dt->handle,&inrate,&outrate); - if (inrate!=dt->input_rate || outrate!=dt->output_rate){ - speex_resampler_destroy(dt->handle); - dt->handle=0; - } - } - if (dt->handle==NULL){ - int err=0; - dt->handle=speex_resampler_init(1, dt->input_rate, dt->output_rate, SPEEX_RESAMPLER_QUALITY_VOIP, &err); - } - - - while((m=ms_queue_get(obj->inputs[0]))!=NULL){ - unsigned int inlen=(m->b_wptr-m->b_rptr)/2; - unsigned int outlen=((inlen*dt->output_rate)/dt->input_rate)+1; - unsigned int inlen_orig=inlen; - mblk_t *om=allocb(outlen*2,0); - speex_resampler_process_int(dt->handle, - 0, - (int16_t*)m->b_rptr, - &inlen, - (int16_t*)om->b_wptr, - &outlen); - if (inlen_orig!=inlen){ - ms_error("Bug in resampler ! only %u samples consumed instead of %u, out=%u", - inlen,inlen_orig,outlen); - } - om->b_wptr+=outlen*2; - mblk_set_timestamp_info(om,dt->ts); - dt->ts+=outlen; - ms_queue_put(obj->outputs[0],om); - freemsg(m); - } -} - -#endif - - - -int ms_resample_set_sr(MSFilter *obj, void *arg){ - ResampleData *dt=(ResampleData*)obj->data; - dt->input_rate=((int*)arg)[0]; - return 0; -} - -int ms_resample_set_output_sr(MSFilter *obj, void *arg){ - ResampleData *dt=(ResampleData*)obj->data; - dt->output_rate=((int*)arg)[0]; - return 0; -} - -static MSFilterMethod enc_methods[]={ - { MS_FILTER_SET_SAMPLE_RATE , ms_resample_set_sr }, - { MS_FILTER_SET_OUTPUT_SAMPLE_RATE , ms_resample_set_output_sr }, - { 0 , NULL } -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_resample_desc={ - MS_RESAMPLE_ID, - "MSResample", - N_("frequency resampler"), - MS_FILTER_OTHER, - NULL, - 1, - 1, - resample_init, - NULL, - resample_process_ms2, - NULL, - resample_uninit, - enc_methods -}; - -#else - -MSFilterDesc ms_resample_desc={ - .id=MS_RESAMPLE_ID, - .name="MSResample", - .text=N_("frequency resampler"), - .category=MS_FILTER_OTHER, - .ninputs=1, - .noutputs=1, - .init=resample_init, - .process=resample_process_ms2, - .uninit=resample_uninit, - .methods=enc_methods -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_resample_desc) - diff --git a/linphone/mediastreamer2/src/msrtp.c b/linphone/mediastreamer2/src/msrtp.c deleted file mode 100644 index 79a4a3fad..000000000 --- a/linphone/mediastreamer2/src/msrtp.c +++ /dev/null @@ -1,525 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/msrtp.h" -#include "mediastreamer2/msticker.h" - -#include "ortp/telephonyevents.h" -#if defined(__cplusplus) -#define B64_NO_NAMESPACE -#endif -#include "ortp/b64.h" - - -struct SenderData { - RtpSession *session; - uint32_t tsoff; - uint32_t skip_until; - int rate; - char dtmf; - bool_t dtmf_start; - int dtmf_duration; - char relay_session_id[64]; - int relay_session_id_size; - uint64_t last_rsi_time; - bool_t skip; - bool_t mute_mic; -}; - -typedef struct SenderData SenderData; - -static void sender_init(MSFilter * f) -{ - SenderData *d = (SenderData *)ms_new(SenderData, 1); - - d->session = NULL; - d->tsoff = 0; - d->skip_until = 0; - d->skip = FALSE; - d->rate = 8000; - d->dtmf = 0; - d->dtmf_start = FALSE; - d->dtmf_duration = 800; - d->mute_mic=FALSE; - d->relay_session_id_size=0; - d->last_rsi_time=0; - f->data = d; -} - -static void sender_uninit(MSFilter * f) -{ - SenderData *d = (SenderData *) f->data; - - ms_free(d); -} - -static int sender_send_dtmf(MSFilter * f, void *arg) -{ - const char *dtmf = (const char *) arg; - SenderData *d = (SenderData *) f->data; - - ms_filter_lock(f); - if (d->skip==TRUE) - { - ms_filter_unlock(f); - return -1; - } - d->dtmf = dtmf[0]; - ms_filter_unlock(f); - return 0; -} - -static int sender_set_dtmf_duration(MSFilter * f, void *arg) -{ - SenderData *d = (SenderData *) f->data; - d->dtmf_duration = *((int*)arg); - return 0; -} - -static int sender_set_session(MSFilter * f, void *arg) -{ - SenderData *d = (SenderData *) f->data; - RtpSession *s = (RtpSession *) arg; - PayloadType *pt = - rtp_profile_get_payload(rtp_session_get_profile(s), - rtp_session_get_send_payload_type(s)); - if (pt != NULL) { - if (strcasecmp("g722", pt->mime_type)==0 ) - d->rate=8000; - else d->rate = pt->clock_rate; - } else { - ms_warning("Sending undefined payload type ?"); - } - d->session = s; - return 0; -} - -static int sender_mute_mic(MSFilter * f, void *arg) -{ - SenderData *d = (SenderData *) f->data; - ms_filter_lock(f); - d->mute_mic=TRUE; - ms_filter_unlock(f); - return 0; -} - -static int sender_unmute_mic(MSFilter * f, void *arg) -{ - SenderData *d = (SenderData *) f->data; - ms_filter_lock(f); - d->mute_mic=FALSE; - ms_filter_unlock(f); - return 0; -} - -static int sender_set_relay_session_id(MSFilter *f, void*arg){ - SenderData *d = (SenderData *) f->data; - const char *tmp=(const char *)arg; - d->relay_session_id_size=b64_decode(tmp, strlen(tmp), (void*)d->relay_session_id, (unsigned int)sizeof(d->relay_session_id)); - return 0; -} - -static int sender_get_sr(MSFilter *f, void *arg){ - SenderData *d = (SenderData *) f->data; - *(int*)arg=d->rate; - return 0; -} - -/* the goal of that function is to return a absolute timestamp closest to real time, with respect of given packet_ts, which is a relative to an undefined origin*/ -static uint32_t get_cur_timestamp(MSFilter * f, uint32_t packet_ts) -{ - SenderData *d = (SenderData *) f->data; - uint32_t curts = (uint32_t)( (f->ticker->time*(uint64_t)d->rate)/(uint64_t)1000) ; - int diff; - int delta = d->rate / 50; /*20 ms at 8000Hz */ - uint32_t netts; - - netts = packet_ts + d->tsoff; - diff = curts - netts; - -#ifdef AMD_HACK - if (diff > delta) { - d->tsoff = curts - packet_ts; - netts = packet_ts + d->tsoff; - ms_message("synchronizing timestamp, diff=%i", diff); - } - else if (diff < -delta) { - /* d->tsoff = curts - packet_ts; */ - /* hardware clock is going slower than sound card on my PDA... */ - } -#else - if ((diff > delta) || (diff < -(delta * 5))) { - d->tsoff = curts - packet_ts; - netts = packet_ts + d->tsoff; - ms_message("synchronizing timestamp, diff=%i", diff); - } -#endif - - /*ms_message("returned ts=%u, orig_ts=%u",netts,packet_ts); */ - return netts; -} - -static int send_dtmf(MSFilter * f, uint32_t timestamp_start, uint32_t current_timestamp) -{ - SenderData *d = (SenderData *) f->data; - mblk_t *m1; - int tev_type; - - /* create the first telephony event packet */ - switch (d->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: - ms_warning("Bad dtmf: %c.",d->dtmf); - return -1; - } - - - if (d->dtmf_start == TRUE) - m1=rtp_session_create_telephone_event_packet(d->session,1); - else - m1=rtp_session_create_telephone_event_packet(d->session,0); - if (m1==NULL) return -1; - - - if (RTP_TIMESTAMP_IS_NEWER_THAN(current_timestamp, d->skip_until)) { - //retransmit end of rtp dtmf event - mblk_t *tmp; - rtp_session_add_telephone_event(d->session,m1,tev_type,1,10, (current_timestamp-timestamp_start)); - tmp=copymsg(m1); - rtp_session_sendm_with_ts(d->session,tmp,timestamp_start); - d->session->rtp.snd_seq--; - tmp=copymsg(m1); - rtp_session_sendm_with_ts(d->session,tmp,timestamp_start); - d->session->rtp.snd_seq--; - rtp_session_sendm_with_ts(d->session,m1,timestamp_start); - } - else { - rtp_session_add_telephone_event(d->session,m1,tev_type,0,10, (current_timestamp-timestamp_start)); - rtp_session_sendm_with_ts(d->session,m1,timestamp_start); - } - return 0; -} - -static void sender_process(MSFilter * f) -{ - SenderData *d = (SenderData *) f->data; - RtpSession *s = d->session; - - mblk_t *im; - uint32_t timestamp; - - if (s == NULL){ - ms_queue_flush(f->inputs[0]); - return; - } - - if (d->relay_session_id_size>0 && - ( (f->ticker->time-d->last_rsi_time)>5000 || d->last_rsi_time==0) ) { - ms_message("relay session id sent in RTCP APP"); - rtp_session_send_rtcp_APP(s,0,"RSID",(const uint8_t *)d->relay_session_id,d->relay_session_id_size); - d->last_rsi_time=f->ticker->time; - } - - while ((im = ms_queue_get(f->inputs[0])) != NULL) { - mblk_t *header; - - timestamp = get_cur_timestamp(f, mblk_get_timestamp_info(im)); - ms_filter_lock(f); - if (d->skip) { - ms_debug("skipping.."); - send_dtmf(f, d->skip_until-d->dtmf_duration, timestamp); - d->dtmf_start = FALSE; - if (!RTP_TIMESTAMP_IS_NEWER_THAN(timestamp, d->skip_until)) { - freemsg(im); - ms_filter_unlock(f); - continue; - } - d->skip = FALSE; - d->dtmf = 0; - } - - if (d->skip == FALSE && d->mute_mic==FALSE){ - int pt = mblk_get_payload_type(im); - header = rtp_session_create_packet(s, 12, NULL, 0); - if (pt>0) - rtp_set_payload_type(header, pt); - rtp_set_markbit(header, mblk_get_marker_info(im)); - header->b_cont = im; - rtp_session_sendm_with_ts(s, header, timestamp); - } - else{ - freemsg(im); - } - - if (d->dtmf != 0) { - ms_debug("prepare to send RFC2833 dtmf."); - d->skip_until = timestamp + d->dtmf_duration; - d->skip = TRUE; - d->dtmf_start = TRUE; - } - ms_filter_unlock(f); - } -} - -static MSFilterMethod sender_methods[] = { - {MS_RTP_SEND_MUTE_MIC, sender_mute_mic}, - {MS_RTP_SEND_UNMUTE_MIC, sender_unmute_mic}, - {MS_RTP_SEND_SET_SESSION, sender_set_session}, - {MS_RTP_SEND_SEND_DTMF, sender_send_dtmf}, - {MS_RTP_SEND_SET_RELAY_SESSION_ID, sender_set_relay_session_id}, - {MS_FILTER_GET_SAMPLE_RATE, sender_get_sr }, - {MS_RTP_SEND_SET_DTMF_DURATION, sender_set_dtmf_duration }, - {0, NULL} -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_rtp_send_desc = { - MS_RTP_SEND_ID, - "MSRtpSend", - N_("RTP output filter"), - MS_FILTER_OTHER, - NULL, - 1, - 0, - sender_init, - NULL, - sender_process, - NULL, - sender_uninit, - sender_methods -}; - -#else - -MSFilterDesc ms_rtp_send_desc = { - .id = MS_RTP_SEND_ID, - .name = "MSRtpSend", - .text = N_("RTP output filter"), - .category = MS_FILTER_OTHER, - .ninputs = 1, - .noutputs = 0, - .init = sender_init, - .process = sender_process, - .uninit = sender_uninit, - .methods = sender_methods -}; - -#endif - -struct ReceiverData { - RtpSession *session; - int rate; -}; - -typedef struct ReceiverData ReceiverData; - -static void receiver_init(MSFilter * f) -{ - ReceiverData *d = (ReceiverData *)ms_new(ReceiverData, 1); - d->session = NULL; - d->rate = 8000; - f->data = d; -} - -static void receiver_postprocess(MSFilter * f){ - /*ReceiverData *d = (ReceiverData *) f->data;*/ -} - -static void receiver_uninit(MSFilter * f){ - ReceiverData *d = (ReceiverData *) f->data; - ms_free(d); -} - -static int receiver_set_session(MSFilter * f, void *arg) -{ - ReceiverData *d = (ReceiverData *) f->data; - RtpSession *s = (RtpSession *) arg; - PayloadType *pt = rtp_profile_get_payload(rtp_session_get_profile(s), - rtp_session_get_recv_payload_type - (s)); - if (pt != NULL) { - if (strcasecmp("g722", pt->mime_type)==0 ) - d->rate=8000; - else d->rate = pt->clock_rate; - } else { - ms_warning("Receiving undefined payload type ?"); - } - d->session = s; - - return 0; -} - -static int receiver_get_sr(MSFilter *f, void *arg){ - ReceiverData *d = (ReceiverData *) f->data; - PayloadType *pt; - if (d->session==NULL) { - ms_warning("Could not obtain sample rate, session is not set."); - return -1; - } - pt=rtp_profile_get_payload(rtp_session_get_profile(d->session), - rtp_session_get_recv_payload_type(d->session)); - if (pt != NULL) { - *(int*)arg=pt->clock_rate; - }else{ - ms_warning("Could not obtain sample rate, payload type is unknown."); - return -1; - } - return 0; -} - -static void receiver_preprocess(MSFilter * f){ - ReceiverData *d = (ReceiverData *) f->data; - if (d->session){ - PayloadType *pt=rtp_profile_get_payload( - rtp_session_get_profile(d->session), - rtp_session_get_recv_payload_type(d->session)); - if (pt){ - if (pt->type!=PAYLOAD_VIDEO) - rtp_session_flush_sockets(d->session); - } - } -} - -static void receiver_process(MSFilter * f) -{ - ReceiverData *d = (ReceiverData *) f->data; - mblk_t *m; - uint32_t timestamp; - - if (d->session == NULL) - return; - - timestamp = (uint32_t) (f->ticker->time * (d->rate/1000)); - while ((m = rtp_session_recvm_with_ts(d->session, timestamp)) != NULL) { - mblk_set_timestamp_info(m, rtp_get_timestamp(m)); - mblk_set_marker_info(m, rtp_get_markbit(m)); - mblk_set_payload_type(m, rtp_get_payload_type(m)); - rtp_get_payload(m,&m->b_rptr); - ms_queue_put(f->outputs[0], m); - } -} - -static MSFilterMethod receiver_methods[] = { - { MS_RTP_RECV_SET_SESSION , receiver_set_session }, - { MS_FILTER_GET_SAMPLE_RATE , receiver_get_sr }, - { 0, NULL} -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_rtp_recv_desc = { - MS_RTP_RECV_ID, - "MSRtpRecv", - N_("RTP input filter"), - MS_FILTER_OTHER, - NULL, - 0, - 1, - receiver_init, - receiver_preprocess, - receiver_process, - receiver_postprocess, - receiver_uninit, - receiver_methods -}; - -#else - -MSFilterDesc ms_rtp_recv_desc = { - .id = MS_RTP_RECV_ID, - .name = "MSRtpRecv", - .text = N_("RTP input filter"), - .category = MS_FILTER_OTHER, - .ninputs = 0, - .noutputs = 1, - .init = receiver_init, - .preprocess = receiver_preprocess, - .process = receiver_process, - .postprocess=receiver_postprocess, - .uninit = receiver_uninit, - .methods = receiver_methods -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_rtp_send_desc) -MS_FILTER_DESC_EXPORT(ms_rtp_recv_desc) diff --git a/linphone/mediastreamer2/src/mssndcard.c b/linphone/mediastreamer2/src/mssndcard.c deleted file mode 100644 index 593e3ec8f..000000000 --- a/linphone/mediastreamer2/src/mssndcard.c +++ /dev/null @@ -1,231 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/mssndcard.h" -#ifdef HAVE_CONFIG_H -#include "mediastreamer-config.h" -#endif - -static MSSndCardManager *scm=NULL; - -static MSSndCardManager * create_manager(){ - MSSndCardManager *obj=(MSSndCardManager *)ms_new(MSSndCardManager,1); - obj->cards=NULL; - obj->descs=NULL; - return obj; -} - -void ms_snd_card_manager_destroy(void){ - if (scm!=NULL){ - MSList *elem; - for(elem=scm->descs;elem!=NULL;elem=elem->next){ - MSSndCardDesc *desc = (MSSndCardDesc*)elem->data; - if (desc->unload!=NULL) - desc->unload(scm); - } - ms_list_for_each(scm->cards,(void (*)(void*))ms_snd_card_destroy); - ms_list_free(scm->cards); - ms_list_free(scm->descs); - } - ms_free(scm); - scm=NULL; -} - -MSSndCardManager * ms_snd_card_manager_get(void){ - if (scm==NULL) scm=create_manager(); - return scm; -} - -MSSndCard * ms_snd_card_manager_get_card(MSSndCardManager *m, const char *id){ - MSList *elem; - for (elem=m->cards;elem!=NULL;elem=elem->next){ - MSSndCard *card=(MSSndCard*)elem->data; - if (id==NULL) return card; - if (strcmp(ms_snd_card_get_string_id(card),id)==0) return card; - } - if (id!=NULL) ms_warning("no card with id %s",id); - return NULL; -} - -MSSndCard * ms_snd_card_manager_get_default_card(MSSndCardManager *m){ - /*return the first card that has the capture+playback capability */ - MSList *elem; - for (elem=m->cards;elem!=NULL;elem=elem->next){ - MSSndCard *card=(MSSndCard*)elem->data; - if ((card->capabilities & MS_SND_CARD_CAP_CAPTURE ) - && (card->capabilities & MS_SND_CARD_CAP_PLAYBACK)) - return card; - } - return NULL; -} - -MSSndCard * ms_snd_card_manager_get_default_capture_card(MSSndCardManager *m){ - MSList *elem; - for (elem=m->cards;elem!=NULL;elem=elem->next){ - MSSndCard *card=(MSSndCard*)elem->data; - if (card->capabilities & MS_SND_CARD_CAP_CAPTURE) - return card; - } - return NULL; -} - -MSSndCard * ms_snd_card_manager_get_default_playback_card(MSSndCardManager *m){ - MSList *elem; - for (elem=m->cards;elem!=NULL;elem=elem->next){ - MSSndCard *card=(MSSndCard*)elem->data; - if (card->capabilities & MS_SND_CARD_CAP_PLAYBACK) - return card; - } - return NULL; -} - -const MSList * ms_snd_card_manager_get_list(MSSndCardManager *m){ - return m->cards; -} - -void ms_snd_card_manager_add_card(MSSndCardManager *m, MSSndCard *c){ - ms_message("Card %s added",ms_snd_card_get_string_id(c)); - m->cards=ms_list_append(m->cards,c); -} - -static void card_detect(MSSndCardManager *m, MSSndCardDesc *desc){ - if (desc->detect!=NULL) - desc->detect(m); -} - -void ms_snd_card_manager_register_desc(MSSndCardManager *m, MSSndCardDesc *desc){ - m->descs=ms_list_append(m->descs,desc); - card_detect(m,desc); -} - -void ms_snd_card_manager_reload(MSSndCardManager *m){ - MSList *elem; - ms_list_for_each(m->cards,(void (*)(void*))ms_snd_card_destroy); - ms_list_free(m->cards); - m->cards=NULL; - for(elem=m->descs;elem!=NULL;elem=elem->next) - card_detect(m,(MSSndCardDesc*)elem->data); -} - -MSSndCard * ms_snd_card_dup(MSSndCard *card){ - MSSndCard *obj=NULL; - if (card->desc->duplicate!=NULL) - obj=card->desc->duplicate(card); - return obj; -} - -MSSndCard * ms_snd_card_new(MSSndCardDesc *desc){ - MSSndCard *obj=(MSSndCard *)ms_new(MSSndCard,1); - obj->desc=desc; - obj->name=NULL; - obj->data=NULL; - obj->id=NULL; - obj->capabilities=MS_SND_CARD_CAP_CAPTURE|MS_SND_CARD_CAP_PLAYBACK; - if (desc->init!=NULL) - desc->init(obj); - return obj; -} - -const char *ms_snd_card_get_driver_type(const MSSndCard *obj){ - return obj->desc->driver_type; -} - -const char *ms_snd_card_get_name(const MSSndCard *obj){ - return obj->name; -} - -unsigned int ms_snd_card_get_capabilities(const MSSndCard *obj){ - return obj->capabilities; -} - -const char *ms_snd_card_get_string_id(MSSndCard *obj){ - if (obj->id==NULL) obj->id=ms_strdup_printf("%s: %s",obj->desc->driver_type,obj->name); - return obj->id; -} - -void ms_snd_card_set_level(MSSndCard *obj, MSSndCardMixerElem e, int percent){ - if (obj->desc->set_level!=NULL) - obj->desc->set_level(obj,e,percent); - else ms_warning("ms_snd_card_set_level: unimplemented by %s wrapper",obj->desc->driver_type); -} - -int ms_snd_card_get_level(MSSndCard *obj, MSSndCardMixerElem e){ - if (obj->desc->get_level!=NULL) - return obj->desc->get_level(obj,e); - else { - ms_warning("ms_snd_card_get_level: unimplemented by %s wrapper",obj->desc->driver_type); - return -1; - } -} - -void ms_snd_card_set_capture(MSSndCard *obj, MSSndCardCapture c){ - if (obj->desc->set_capture!=NULL) - obj->desc->set_capture(obj,c); - else ms_warning("ms_snd_card_set_capture: unimplemented by %s wrapper",obj->desc->driver_type); -} - -int ms_snd_card_set_control(MSSndCard *obj, MSSndCardControlElem e, int val) -{ - if (obj->desc->set_control!=NULL) - return obj->desc->set_control(obj,e,val); - else { - ms_warning("ms_snd_card_set_control: unimplemented by %s wrapper",obj->desc->driver_type); - return -1; - } -} - -int ms_snd_card_get_control(MSSndCard *obj, MSSndCardControlElem e) -{ - if (obj->desc->get_control!=NULL) - return obj->desc->get_control(obj,e); - else { - ms_warning("ms_snd_card_get_control: unimplemented by %s wrapper",obj->desc->driver_type); - return -1; - } -} - -struct _MSFilter * ms_snd_card_create_reader(MSSndCard *obj){ - if (obj->desc->create_reader!=NULL) - return obj->desc->create_reader(obj); - else ms_warning("ms_snd_card_create_reader: unimplemented by %s wrapper",obj->desc->driver_type); - return NULL; -} - -struct _MSFilter * ms_snd_card_create_writer(MSSndCard *obj){ - if (obj->desc->create_writer!=NULL) - return obj->desc->create_writer(obj); - else ms_warning("ms_snd_card_create_writer: unimplemented by %s wrapper",obj->desc->driver_type); - return NULL; -} - -void ms_snd_card_destroy(MSSndCard *obj){ - if (obj->desc->uninit!=NULL) obj->desc->uninit(obj); - if (obj->name!=NULL) ms_free(obj->name); - if (obj->id!=NULL) ms_free(obj->id); - ms_free(obj); -} - -#ifdef __linux -#ifndef __ALSA_ENABLED__ -MSSndCard * ms_alsa_card_new_custom(const char *pcmdev, const char *mixdev){ - ms_warning("Alsa support not available in this build of mediastreamer2"); - return NULL; -} -#endif -#endif diff --git a/linphone/mediastreamer2/src/msspeex.c b/linphone/mediastreamer2/src/msspeex.c deleted file mode 100644 index 871db5409..000000000 --- a/linphone/mediastreamer2/src/msspeex.c +++ /dev/null @@ -1,538 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/msfilter.h" - -#include - -#ifdef WIN32 -#include /* for alloca */ -#endif - -typedef struct SpeexEncState{ - int rate; - int bitrate; - int maxbitrate; - int ptime; - int vbr; - int cng; - int mode; - int frame_size; - void *state; - uint32_t ts; - MSBufferizer *bufferizer; -} SpeexEncState; - -static void enc_init(MSFilter *f){ - SpeexEncState *s=(SpeexEncState *)ms_new(SpeexEncState,1); - s->rate=8000; - s->bitrate=-1; - s->maxbitrate=-1; - s->ptime=0; - s->mode=-1; - s->vbr=0; - s->cng=0; - s->frame_size=0; - s->state=0; - s->ts=0; - s->bufferizer=ms_bufferizer_new(); - f->data=s; -} - -static void enc_uninit(MSFilter *f){ - SpeexEncState *s=(SpeexEncState*)f->data; - if (s==NULL) - return; - ms_bufferizer_destroy(s->bufferizer); - if (s->state!=NULL) - speex_encoder_destroy(s->state); - ms_free(s); -} - -static void enc_preprocess(MSFilter *f){ - SpeexEncState *s=(SpeexEncState*)f->data; - const SpeexMode *mode=NULL; - int _mode=0; - - switch(s->rate){ - case 8000: - _mode = SPEEX_MODEID_NB; /* rate = 8000Hz */ - break; - case 16000: - _mode = SPEEX_MODEID_WB; /* rate = 16000Hz */ - break; - /* should be supported in the future */ - case 32000: - _mode = SPEEX_MODEID_UWB; /* rate = 32000Hz */ - break; - default: - ms_error("Unsupported rate for speex encoder (back to default rate=8000)."); - s->rate=8000; - } - /* warning: speex_lib_get_mode() is not available on speex<1.1.12 */ - mode = speex_lib_get_mode(_mode); - - if (mode==NULL) - return; - s->state=speex_encoder_init(mode); - - if (s->vbr==1) - { - if (speex_encoder_ctl(s->state,SPEEX_SET_VBR,&s->vbr)!=0){ - ms_error("Could not set vbr mode to speex encoder."); - } - /* implicit VAD */ - speex_encoder_ctl (s->state, SPEEX_SET_DTX, &s->vbr); - } - else if (s->vbr==2) - { - int vad=1; - /* VAD */ - speex_encoder_ctl (s->state, SPEEX_SET_VAD, &vad); - speex_encoder_ctl (s->state, SPEEX_SET_DTX, &vad); - } - else if (s->cng==1) - { - speex_encoder_ctl (s->state, SPEEX_SET_VAD, &s->cng); - } - - if (s->rate==8000){ - //+------+---------------+-------------+ - //| mode | Speex quality | bit-rate | - //+------+---------------+-------------+ - //| 1 | 0 | 2.15 kbit/s | - //| 2 | 2 | 5.95 kbit/s | - //| 3 | 3 or 4 | 8.00 kbit/s | - //| 4 | 5 or 6 | 11.0 kbit/s | - //| 5 | 7 or 8 | 15.0 kbit/s | - //| 6 | 9 | 18.2 kbit/s | - //| 7 | 10 | 24.6 kbit/s | - //| 8 | 1 | 3.95 kbit/s | - //+------+---------------+-------------+ - if (s->mode<=0 || s->mode>8) - s->mode = 3; /* default mode */ - - if (s->mode==1) - s->bitrate = 2150; - else if (s->mode==2) - s->bitrate = 5950; - else if (s->mode==3) - s->bitrate = 8000; - else if (s->mode==4) - s->bitrate = 11000; - else if (s->mode==5) - s->bitrate = 15000; - else if (s->mode==6) - s->bitrate = 18200; - else if (s->mode==7) - s->bitrate = 24600; - else if (s->mode==8) - s->bitrate = 3950; - - if (s->bitrate!=-1){ - if (speex_encoder_ctl(s->state,SPEEX_SET_BITRATE,&s->bitrate)!=0){ - ms_error("Could not set bitrate %i to speex encoder.",s->bitrate); - } - } - } - else if (s->rate==16000 || s->rate==32000){ - //+------+---------------+-------------------+------------------------+ - //| mode | Speex quality | wideband bit-rate | ultra wideband | - //| | | | bit-rate | - //+------+---------------+-------------------+------------------------+ - //| 0 | 0 | 3.95 kbit/s | 5.75 kbit/s | - //| 1 | 1 | 5.75 kbit/s | 7.55 kbit/s | - //| 2 | 2 | 7.75 kbit/s | 9.55 kbit/s | - //| 3 | 3 | 9.80 kbit/s | 11.6 kbit/s | - //| 4 | 4 | 12.8 kbit/s | 14.6 kbit/s | - //| 5 | 5 | 16.8 kbit/s | 18.6 kbit/s | - //| 6 | 6 | 20.6 kbit/s | 22.4 kbit/s | - //| 7 | 7 | 23.8 kbit/s | 25.6 kbit/s | - //| 8 | 8 | 27.8 kbit/s | 29.6 kbit/s | - //| 9 | 9 | 34.2 kbit/s | 36.0 kbit/s | - //| 10 | 10 | 42.2 kbit/s | 44.0 kbit/s | - //+------+---------------+-------------------+------------------------+ - int q=0; - if (s->mode<0 || s->mode>10) - s->mode = 8; /* default mode */ - q=s->mode; - if (speex_encoder_ctl(s->state,SPEEX_SET_QUALITY,&q)!=0){ - ms_error("Could not set quality %i to speex encoder.",q); - } - } - - if (s->maxbitrate>0){ - /* convert from network bitrate to codec bitrate:*/ - /* ((nbr/(50*8)) -20-12-8)*50*8*/ - int cbr=(int)( ((((float)s->maxbitrate)/(50.0*8))-20-12-8)*50*8); - ms_message("Setting maxbitrate=%i to speex encoder.",cbr); - if (speex_encoder_ctl(s->state,SPEEX_SET_BITRATE,&cbr)!=0){ - ms_error("Could not set maxbitrate %i to speex encoder.",s->bitrate); - } - } - if (speex_encoder_ctl(s->state,SPEEX_GET_BITRATE,&s->bitrate)!=0){ - ms_error("Could not get bitrate %i to speex encoder.",s->bitrate); - } - else ms_message("Using bitrate %i for speex encoder.",s->bitrate); - - speex_mode_query(mode,SPEEX_MODE_FRAME_SIZE,&s->frame_size); -} - -static void enc_process(MSFilter *f){ - SpeexEncState *s=(SpeexEncState*)f->data; - mblk_t *im; - int nbytes; - uint8_t *buf; - int frame_per_packet=1; - - if (s->frame_size<=0) - return; - - if (s->ptime>=20) - { - frame_per_packet = s->ptime/20; - } - - if (frame_per_packet<=0) - frame_per_packet=1; - if (frame_per_packet>7) /* 7*20 == 140 ms max */ - frame_per_packet=7; - - nbytes=s->frame_size*2; - buf=(uint8_t*)alloca(nbytes*frame_per_packet); - - while((im=ms_queue_get(f->inputs[0]))!=NULL){ - ms_bufferizer_put(s->bufferizer,im); - } - while(ms_bufferizer_read(s->bufferizer,buf,nbytes*frame_per_packet)==nbytes*frame_per_packet){ - mblk_t *om=allocb(nbytes*frame_per_packet,0);//too large... - int k; - SpeexBits bits; - speex_bits_init(&bits); - for (k=0;kstate,(int16_t*)(buf + (k*s->frame_size*2)),&bits); - s->ts+=s->frame_size; - } - speex_bits_insert_terminator(&bits); - k=speex_bits_write(&bits, (char*)om->b_wptr, nbytes*frame_per_packet); - om->b_wptr+=k; - - mblk_set_timestamp_info(om,s->ts-s->frame_size); - ms_queue_put(f->outputs[0],om); - speex_bits_destroy(&bits); - } -} - -static void enc_postprocess(MSFilter *f){ - SpeexEncState *s=(SpeexEncState*)f->data; - speex_encoder_destroy(s->state); - s->state=NULL; -} - -static int enc_set_sr(MSFilter *f, void *arg){ - SpeexEncState *s=(SpeexEncState*)f->data; - /* TODO: should be done with fmtp parameter */ - s->rate=((int*)arg)[0]; - return 0; -} - -static int enc_set_br(MSFilter *f, void *arg){ - SpeexEncState *s=(SpeexEncState*)f->data; - s->maxbitrate=((int*)arg)[0]; - return 0; -} - -static int enc_add_fmtp(MSFilter *f, void *arg){ - char buf[64]; - const char *fmtp=(const char *)arg; - SpeexEncState *s=(SpeexEncState*)f->data; - - memset(buf, '\0', sizeof(buf)); - fmtp_get_value(fmtp, "vbr", buf, sizeof(buf)); - if (buf[0]=='\0'){ - } - else if (strstr(buf,"off")!=NULL){ - s->vbr=0; - } - else if (strstr(buf,"on")!=NULL){ - s->vbr=1; - } - else if (strstr(buf,"vad")!=NULL){ - s->vbr=2; - } - - memset(buf, '\0', sizeof(buf)); - fmtp_get_value(fmtp, "cng", buf, sizeof(buf)); - if (buf[0]=='\0'){ - } - else if (strstr(buf,"off")!=NULL){ - s->cng=0; - } - else if (strstr(buf,"on")!=NULL){ - s->cng=1; - } - - memset(buf, '\0', sizeof(buf)); - fmtp_get_value(fmtp, "mode", buf, sizeof(buf)); - if (buf[0]=='\0' || buf[1]=='\0'){ - } - else if (buf[0]=='0' || (buf[0]=='"' && buf[1]=='0')){ - s->mode=0; - } - else if (buf[0]=='"' && atoi(buf+1)>=0){ - s->mode=atoi(buf+1); - } - else if (buf[0]!='"' && atoi(buf)>=0){ - s->mode=atoi(buf); - } - else { - s->mode = -1; /* deault mode */ - } - return 0; -} - -static int enc_add_attr(MSFilter *f, void *arg){ - const char *fmtp=(const char *)arg; - SpeexEncState *s=(SpeexEncState*)f->data; - if (strstr(fmtp,"ptime:10")!=NULL){ - s->ptime=20; - }else if (strstr(fmtp,"ptime:20")!=NULL){ - s->ptime=20; - }else if (strstr(fmtp,"ptime:30")!=NULL){ - s->ptime=40; - }else if (strstr(fmtp,"ptime:40")!=NULL){ - s->ptime=40; - }else if (strstr(fmtp,"ptime:50")!=NULL){ - s->ptime=60; - }else if (strstr(fmtp,"ptime:60")!=NULL){ - s->ptime=60; - }else if (strstr(fmtp,"ptime:70")!=NULL){ - s->ptime=80; - }else if (strstr(fmtp,"ptime:80")!=NULL){ - s->ptime=80; - }else if (strstr(fmtp,"ptime:90")!=NULL){ - s->ptime=100; /* not allowed */ - }else if (strstr(fmtp,"ptime:100")!=NULL){ - s->ptime=100; - }else if (strstr(fmtp,"ptime:110")!=NULL){ - s->ptime=120; - }else if (strstr(fmtp,"ptime:120")!=NULL){ - s->ptime=120; - }else if (strstr(fmtp,"ptime:130")!=NULL){ - s->ptime=140; - }else if (strstr(fmtp,"ptime:140")!=NULL){ - s->ptime=140; - } - return 0; -} - -static MSFilterMethod enc_methods[]={ - { MS_FILTER_SET_SAMPLE_RATE , enc_set_sr }, - { MS_FILTER_SET_BITRATE , enc_set_br }, - { MS_FILTER_ADD_FMTP , enc_add_fmtp }, - { MS_FILTER_ADD_ATTR , enc_add_attr}, - { 0 , NULL } -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_speex_enc_desc={ - MS_SPEEX_ENC_ID, - "MSSpeexEnc", - N_("The free and wonderful speex codec"), - MS_FILTER_ENCODER, - "speex", - 1, - 1, - enc_init, - enc_preprocess, - enc_process, - enc_postprocess, - enc_uninit, - enc_methods -}; - -#else - -MSFilterDesc ms_speex_enc_desc={ - .id=MS_SPEEX_ENC_ID, - .name="MSSpeexEnc", - .text=N_("The free and wonderful speex codec"), - .category=MS_FILTER_ENCODER, - .enc_fmt="speex", - .ninputs=1, - .noutputs=1, - .init=enc_init, - .preprocess=enc_preprocess, - .postprocess=enc_postprocess, - .process=enc_process, - .uninit=enc_uninit, - .methods=enc_methods -}; - -#endif - -typedef struct DecState{ - int rate; - int penh; - int frsz; - void *state; -} DecState; - -static void dec_init(MSFilter *f){ - DecState *s=(DecState *)ms_new(DecState,1); - s->rate=8000; - s->frsz=0; - s->state=NULL; - s->penh=1; - f->data=s; -} - -static void dec_uninit(MSFilter *f){ - DecState *s=(DecState*)f->data; - if (s==NULL) - return; - if (s->state!=NULL) - speex_decoder_destroy(s->state); - ms_free(s); -} - -static void dec_preprocess(MSFilter *f){ - DecState *s=(DecState*)f->data; - const SpeexMode *mode=NULL; - int modeid; - switch(s->rate){ - case 8000: - modeid = SPEEX_MODEID_NB; /* rate = 8000Hz */ - break; - case 16000: - modeid = SPEEX_MODEID_WB; /* rate = 16000Hz */ - break; - /* should be supported in the future */ - case 32000: - modeid = SPEEX_MODEID_UWB; /* rate = 32000Hz */ - break; - default: - ms_error("Unsupported rate for speex decoder (back to default rate=8000)."); - modeid=SPEEX_MODEID_NB; - } - /* warning: speex_lib_get_mode() is not available on speex<1.1.12 */ - mode = speex_lib_get_mode(modeid); - s->state=speex_decoder_init(mode); - speex_mode_query(mode,SPEEX_MODE_FRAME_SIZE,&s->frsz); - if (s->penh==1) - speex_decoder_ctl (s->state, SPEEX_SET_ENH, &s->penh); -} - -static void dec_postprocess(MSFilter *f){ - DecState *s=(DecState*)f->data; - speex_decoder_destroy(s->state); - s->state=NULL; -} - -static int dec_set_sr(MSFilter *f, void *arg){ - DecState *s=(DecState*)f->data; - s->rate=((int*)arg)[0]; - return 0; -} - -static void dec_process(MSFilter *f){ - DecState *s=(DecState*)f->data; - mblk_t *im; - mblk_t *om; - int err; - int frame_per_packet; - SpeexBits bits; - int bytes=s->frsz*2; - speex_bits_init(&bits); - while((im=ms_queue_get(f->inputs[0]))!=NULL){ - speex_bits_reset(&bits); - speex_bits_read_from(&bits,(char*)im->b_rptr,im->b_wptr-im->b_rptr); - om=allocb(bytes*7,0); - /* support for multiple frame (max=7 frames???) in one RTP packet */ - for (frame_per_packet=0;frame_per_packet<7;frame_per_packet++) - { - int i; - err=speex_decode_int(s->state,&bits,(int16_t*)(om->b_wptr+(frame_per_packet*320))); - - i = speex_bits_remaining(&bits); - if (i<10) /* this seems to work: don't know why. */ - break; - } - if (err==0){ - om->b_wptr+=bytes*(frame_per_packet+1); - ms_queue_put(f->outputs[0],om); - }else { - if (err==-1) - ms_warning("speex end of stream"); - else if (err==-2) - ms_warning("speex corrupted stream"); - freemsg(om); - } - freemsg(im); - } - speex_bits_destroy(&bits); -} - -static MSFilterMethod dec_methods[]={ - { MS_FILTER_SET_SAMPLE_RATE , dec_set_sr }, - { 0 , NULL } -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_speex_dec_desc={ - MS_SPEEX_DEC_ID, - "MSSpeexDec", - N_("The free and wonderful speex codec"), - MS_FILTER_DECODER, - "speex", - 1, - 1, - dec_init, - dec_preprocess, - dec_process, - dec_postprocess, - dec_uninit, - dec_methods -}; - -#else - -MSFilterDesc ms_speex_dec_desc={ - .id=MS_SPEEX_DEC_ID, - .name="MSSpeexDec", - .text=N_("The free and wonderful speex codec"), - .category=MS_FILTER_DECODER, - .enc_fmt="speex", - .ninputs=1, - .noutputs=1, - .init=dec_init, - .preprocess=dec_preprocess, - .postprocess=dec_postprocess, - .process=dec_process, - .uninit=dec_uninit, - .methods=dec_methods -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_speex_dec_desc) -MS_FILTER_DESC_EXPORT(ms_speex_enc_desc) diff --git a/linphone/mediastreamer2/src/msticker.c b/linphone/mediastreamer2/src/msticker.c deleted file mode 100644 index 6e52656d0..000000000 --- a/linphone/mediastreamer2/src/msticker.c +++ /dev/null @@ -1,468 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - - -#include "mediastreamer2/msticker.h" - - -void * ms_ticker_run(void *s); -static uint64_t get_cur_time(void *); - -void ms_ticker_start(MSTicker *s){ - s->run=TRUE; - ms_thread_create(&s->thread,NULL,ms_ticker_run,s); -} - - -void ms_ticker_init(MSTicker *ticker) -{ - ms_mutex_init(&ticker->lock,NULL); - ticker->execution_list=NULL; - ticker->ticks=1; - ticker->time=0; - ticker->interval=10; - ticker->run=FALSE; - ticker->exec_id=0; - ticker->get_cur_time_ptr=&get_cur_time; - ticker->get_cur_time_data=NULL; -#ifdef WIN32_TIMERS - ticker->TimeEvent=NULL; -#endif - ticker->name=ms_strdup("MSTicker"); - ms_ticker_start(ticker); -} - -MSTicker *ms_ticker_new(){ - MSTicker *obj=(MSTicker *)ms_new(MSTicker,1); - ms_ticker_init(obj); - return obj; -} - -void ms_ticker_stop(MSTicker *s){ - ms_mutex_lock(&s->lock); - s->run=FALSE; - ms_mutex_unlock(&s->lock); - ms_thread_join(s->thread,NULL); -} - -void ms_ticker_set_name(MSTicker *s, const char *name){ - if (s->name) ms_free(s->name); - s->name=ms_strdup(name); -} - -void ms_ticker_uninit(MSTicker *ticker) -{ - ms_ticker_stop(ticker); - ms_free(ticker->name); - ms_mutex_destroy(&ticker->lock); -} - -void ms_ticker_destroy(MSTicker *ticker){ - ms_ticker_uninit(ticker); - ms_free(ticker); -} - - -static MSList *get_sources(MSList *filters){ - MSList *sources=NULL; - MSFilter *f; - for(;filters!=NULL;filters=filters->next){ - f=(MSFilter*)filters->data; - if (f->desc->ninputs==0){ - sources=ms_list_append(sources,f); - } - } - return sources; -} - -int ms_ticker_attach(MSTicker *ticker,MSFilter *f) -{ - MSList *sources=NULL; - MSList *filters=NULL; - MSList *it; - - if (f->ticker!=NULL) { - ms_message("Filter %s is already being scheduled; nothing to do.",f->desc->name); - return 0; - } - - filters=ms_filter_find_neighbours(f); - sources=get_sources(filters); - if (sources==NULL){ - ms_fatal("No sources found around filter %s",f->desc->name); - ms_list_free(filters); - return -1; - } - /*run preprocess on each filter: */ - for(it=filters;it!=NULL;it=it->next) - ms_filter_preprocess((MSFilter*)it->data,ticker); - ms_mutex_lock(&ticker->lock); - ticker->execution_list=ms_list_concat(ticker->execution_list,sources); - ms_mutex_unlock(&ticker->lock); - ms_list_free(filters); - return 0; -} - - - -int ms_ticker_detach(MSTicker *ticker,MSFilter *f){ - MSList *sources=NULL; - MSList *filters=NULL; - MSList *it; - - if (f->ticker==NULL) { - ms_message("Filter %s is not scheduled; nothing to do.",f->desc->name); - return 0; - } - - ms_mutex_lock(&ticker->lock); - - filters=ms_filter_find_neighbours(f); - sources=get_sources(filters); - if (sources==NULL){ - ms_fatal("No sources found around filter %s",f->desc->name); - ms_list_free(filters); - ms_mutex_unlock(&ticker->lock); - return -1; - } - - for(it=sources;it!=NULL;it=ms_list_next(it)){ - ticker->execution_list=ms_list_remove(ticker->execution_list,it->data); - } - ms_mutex_unlock(&ticker->lock); - ms_list_for_each(filters,(void (*)(void*))ms_filter_postprocess); - ms_list_free(filters); - ms_list_free(sources); - return 0; -} - - -static bool_t filter_can_process(MSFilter *f, int tick){ - /* look if filters before this one have run */ - int i; - MSQueue *l; - for(i=0;idesc->ninputs;i++){ - l=f->inputs[i]; - if (l!=NULL){ - if (l->prev.filter->last_tick!=tick) return FALSE; - } - } - return TRUE; -} - -static void call_process(MSFilter *f){ - bool_t process_done=FALSE; - if (f->desc->ninputs==0 || f->desc->flags & MS_FILTER_IS_PUMP){ - ms_filter_process(f); - }else{ - while (ms_filter_inputs_have_data(f)) { - if (process_done){ - ms_warning("Re-scheduling filter %s: all data should be consumed in one process call, so fix it.",f->desc->name); - } - ms_filter_process(f); - process_done=TRUE; - } - } -} - -static void run_graph(MSFilter *f, MSTicker *s, MSList **unschedulable, bool_t force_schedule){ - int i; - MSQueue *l; - if (f->last_tick!=s->ticks ){ - if (filter_can_process(f,s->ticks) || force_schedule) { - /* this is a candidate */ - f->last_tick=s->ticks; - call_process(f); - /* now recurse to next filters */ - for(i=0;idesc->noutputs;i++){ - l=f->outputs[i]; - if (l!=NULL){ - run_graph(l->next.filter,s,unschedulable, force_schedule); - } - } - }else{ - /* this filter has not all inputs that have been filled by filters before it. */ - *unschedulable=ms_list_prepend(*unschedulable,f); - } - } -} - -static void run_graphs(MSTicker *s, MSList *execution_list, bool_t force_schedule){ - MSList *it; - MSList *unschedulable=NULL; - for(it=execution_list;it!=NULL;it=it->next){ - run_graph((MSFilter*)it->data,s,&unschedulable,force_schedule); - } - /* filters that are part of a loop haven't been called in process() because one of their input refers to a filter that could not be scheduled (because they could not be scheduled themselves)... Do you understand ?*/ - /* we resolve this by simply assuming that they must be called anyway - for the loop to run correctly*/ - /* we just recall run_graphs on them, as if they were source filters */ - if (unschedulable!=NULL) { - run_graphs(s,unschedulable,TRUE); - ms_list_free(unschedulable); - } -} - -#ifdef __MACH__ -#include -#include -#endif - -static uint64_t get_cur_time(void *unused){ -#if defined(_WIN32_WCE) - DWORD timemillis = GetTickCount(); - return timemillis; -#elif defined(WIN32) - return timeGetTime() ; -#elif defined(__MACH__) && defined(__GNUC__) && (__GNUC__ >= 3) - struct timeval tv; - gettimeofday(&tv, NULL); - return (tv.tv_sec*1000LL) + (tv.tv_usec/1000LL); -#elif defined(__MACH__) - struct timespec ts; - struct timeb time_val; - - ftime (&time_val); - ts.tv_sec = time_val.time; - ts.tv_nsec = time_val.millitm * 1000000; - return (ts.tv_sec*1000LL) + (ts.tv_nsec/1000000LL); -#else - struct timespec ts; - if (clock_gettime(CLOCK_MONOTONIC,&ts)<0){ - ms_fatal("clock_gettime() doesn't work: %s",strerror(errno)); - } - return (ts.tv_sec*1000LL) + (ts.tv_nsec/1000000LL); -#endif -} - -static void sleepMs(int ms){ -#ifdef WIN32 - Sleep(ms); -#else - struct timespec ts; - ts.tv_sec=0; - ts.tv_nsec=ms*1000000LL; - nanosleep(&ts,NULL); -#endif -} - -static int set_high_prio(void){ - int precision=2; - int result=0; -#ifdef WIN32 - MMRESULT mm; - TIMECAPS ptc; - mm=timeGetDevCaps(&ptc,sizeof(ptc)); - if (mm==0){ - if (ptc.wPeriodMin<(UINT)precision) - ptc.wPeriodMin=precision; - else - precision = ptc.wPeriodMin; - mm=timeBeginPeriod(ptc.wPeriodMin); - if (mm!=TIMERR_NOERROR){ - ms_warning("timeBeginPeriod failed."); - } - ms_message("win32 timer resolution set to %i ms",ptc.wPeriodMin); - }else{ - ms_warning("timeGetDevCaps failed."); - } - - if(!SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST)){ - ms_warning("SetThreadPriority() failed (%d)\n", GetLastError()); - } -#else - struct sched_param param; - memset(¶m,0,sizeof(param)); -#ifdef TARGET_OS_MAC - int policy=SCHED_RR; -#else - int policy=SCHED_OTHER; -#endif - param.sched_priority=sched_get_priority_max(policy); - if((result=pthread_setschedparam(pthread_self(),policy, ¶m))) { - ms_warning("Set sched param failed with error code(%i)\n",result); - } else { - ms_message("MS ticker priority set to max"); - } -#endif - return precision; -} - -static void unset_high_prio(int precision){ -#ifdef WIN32 - MMRESULT mm; - - if(!SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL)){ - ms_warning("SetThreadPriority() failed (%d)\n", GetLastError()); - } - - mm=timeEndPeriod(precision); -#endif -} - -#ifndef WIN32_TIMERS - -void * ms_ticker_run(void *arg) -{ - uint64_t realtime; - int64_t diff; - MSTicker *s=(MSTicker*)arg; - int lastlate=0; - int precision=2; - int late; - - precision = set_high_prio(); - - - s->ticks=1; - ms_mutex_lock(&s->lock); - s->orig=s->get_cur_time_ptr(s->get_cur_time_data); - - while(s->run){ - s->ticks++; - run_graphs(s,s->execution_list,FALSE); - s->time+=s->interval; - while(1){ - realtime=s->get_cur_time_ptr(s->get_cur_time_data)-s->orig; - ms_mutex_unlock(&s->lock); - diff=s->time-realtime; - if (diff>0){ - /* sleep until next tick */ - sleepMs((int)diff); - }else{ - late=(int)-diff; - if (late>s->interval*5 && late>lastlate){ - ms_warning("%s: We are late of %d miliseconds.",s->name,late); - } - lastlate=late; - break; /*exit the while loop */ - } - ms_mutex_lock(&s->lock); - } - ms_mutex_lock(&s->lock); - } - ms_mutex_unlock(&s->lock); - unset_high_prio(precision); - ms_message("%s thread exiting",s->name); - - ms_thread_exit(NULL); - return NULL; -} - -#else - -void * ms_ticker_run(void *arg) -{ - MSTicker *s=(MSTicker*)arg; - uint64_t realtime; - int precision=2; - UINT timerId; - - precision = set_high_prio(); - - s->TimeEvent = CreateEvent (NULL, FALSE, FALSE, NULL); - - s->ticks=1; - ms_mutex_lock(&s->lock); - s->orig=s->get_cur_time_ptr(s->get_cur_time_data); - - timerId = timeSetEvent (s->interval, precision, (LPTIMECALLBACK)s->TimeEvent, 0, - TIME_PERIODIC | TIME_CALLBACK_EVENT_SET); - while(s->run){ - DWORD err; - - s->ticks++; - run_graphs(s,s->execution_list,FALSE); - - /* elapsed time since origin */ - s->time = s->get_cur_time_ptr(s->get_cur_time_data)- s->orig; - - ms_mutex_unlock(&s->lock); - err = WaitForSingleObject (s->TimeEvent, s->interval*1000 ); /* wake up each diff */ - if (err==WAIT_FAILED) - ms_message("WaitForSingleObject is failing"); - - ms_mutex_lock(&s->lock); - } - ms_mutex_unlock(&s->lock); - timeKillEvent (timerId); - CloseHandle (s->TimeEvent); - s->TimeEvent=NULL; - unset_high_prio(precision); - ms_message("MSTicker thread exiting"); - ms_thread_exit(NULL); - return NULL; -} - -#endif - -void ms_ticker_set_time_func(MSTicker *ticker, MSTickerTimeFunc func, void *user_data){ - if (func==NULL) func=get_cur_time; - /*ms_mutex_lock(&ticker->lock);*/ - ticker->get_cur_time_ptr=func; - ticker->get_cur_time_data=user_data; - /*re-set the origin to take in account that previous function ptr and the - new one may return different times*/ - ticker->orig=func(user_data)-ticker->time; - /*ms_mutex_unlock(&ticker->lock);*/ - ms_message("ms_ticker_set_time_func: ticker updated."); -} - -static void print_graph(MSFilter *f, MSTicker *s, MSList **unschedulable, bool_t force_schedule){ - int i; - MSQueue *l; - if (f->last_tick!=s->ticks ){ - if (filter_can_process(f,s->ticks) || force_schedule) { - /* this is a candidate */ - f->last_tick=s->ticks; - ms_message("print_graphs: %s", f->desc->name); - /* now recurse to next filters */ - for(i=0;idesc->noutputs;i++){ - l=f->outputs[i]; - if (l!=NULL){ - print_graph(l->next.filter,s,unschedulable, force_schedule); - } - } - }else{ - /* this filter has not all inputs that have been filled by filters before it. */ - *unschedulable=ms_list_prepend(*unschedulable,f); - } - } -} - -static void print_graphs(MSTicker *s, MSList *execution_list, bool_t force_schedule){ - MSList *it; - MSList *unschedulable=NULL; - for(it=execution_list;it!=NULL;it=it->next){ - print_graph((MSFilter*)it->data,s,&unschedulable,force_schedule); - } - /* filters that are part of a loop haven't been called in process() because one of their input refers to a filter that could not be scheduled (because they could not be scheduled themselves)... Do you understand ?*/ - /* we resolve this by simply assuming that they must be called anyway - for the loop to run correctly*/ - /* we just recall run_graphs on them, as if they were source filters */ - if (unschedulable!=NULL) { - print_graphs(s,unschedulable,TRUE); - ms_list_free(unschedulable); - } -} - -void ms_ticker_print_graphs(MSTicker *ticker){ - print_graphs(ticker,ticker->execution_list,FALSE); -} diff --git a/linphone/mediastreamer2/src/msv4l.c b/linphone/mediastreamer2/src/msv4l.c deleted file mode 100644 index 635f789b5..000000000 --- a/linphone/mediastreamer2/src/msv4l.c +++ /dev/null @@ -1,1072 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifdef __linux - -#include "mediastreamer-config.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#ifdef HAVE_LINUX_VIDEODEV2_H -#include -#endif - -#include "mediastreamer2/msvideo.h" -#include "mediastreamer2/msticker.h" -#include "mediastreamer2/msv4l.h" -#include "mediastreamer2/mswebcam.h" -#include "nowebcam.h" - -/* From: Logitech QuickCam USB driver */ -#define QC_IOCTLBASE 220 -/* Get enable workaround for bugs, bitfield */ -#define VIDIOCQCGCOMPATIBLE _IOR ('v',QC_IOCTLBASE+10,int) -/* Set enable workaround for bugs, bitfield */ -#define VIDIOCQCSCOMPATIBLE _IOWR('v',QC_IOCTLBASE+10,int) - -#ifndef VIDIOSFPS -#define VIDIOSFPS _IOW('v',BASE_VIDIOCPRIVATE+20, int) -#endif - -typedef struct V4lState{ - int fd; - ms_thread_t thread; - char *dev; - char *mmapdbuf; - int msize;/*mmapped size*/ - MSVideoSize vsize; - MSVideoSize got_vsize; - int pix_fmt; - int int_pix_fmt; /*internal pixel format */ - mblk_t *frames[VIDEO_MAX_FRAME]; - mblk_t *mire; - queue_t rq; - ms_mutex_t mutex; - int frame_ind; - int frame_max; - float fps; - float start_time; - int frame_count; - int queued; - bool_t run; - bool_t usemire; - bool_t v4lv2; /*we interface with a V4Lv2 driver */ - bool_t force_v1; - bool_t auto_started; -}V4lState; - -static void *v4l_thread(void *s); -static int v4l_configure(V4lState *s); - -#ifdef HAVE_LINUX_VIDEODEV2_H - -static bool_t v4lv2_try_format(V4lState *s, int fmtid){ - struct v4l2_format fmt; - - memset(&fmt,0,sizeof(fmt)); - - fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - fmt.fmt.pix.width = s->vsize.width; - fmt.fmt.pix.height = s->vsize.height; - fmt.fmt.pix.pixelformat = fmtid; - fmt.fmt.pix.field = V4L2_FIELD_ANY; - - if (ioctl (s->fd, VIDIOC_S_FMT, &fmt)<0){ - return FALSE; - } - s->got_vsize.width=s->vsize.width; - s->got_vsize.height=s->vsize.height; - return TRUE; -} - -static int v4lv2_configure(V4lState *s) -{ - struct v4l2_capability cap; - - if (ioctl (s->fd, VIDIOC_QUERYCAP, &cap)<0) { - ms_message("Not a v4lv2 driver."); - return -1; - } - - if (!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) { - ms_error("%s is not a video capture device\n",s->dev); - return -1; - } - - if (!(cap.capabilities & V4L2_CAP_STREAMING)) { - ms_error("%s does not support streaming i/o\n",s->dev); - return -1; - } - - if (v4lv2_try_format(s,V4L2_PIX_FMT_YUV420)){ - s->pix_fmt=MS_YUV420P; - s->int_pix_fmt=V4L2_PIX_FMT_YUV420; - ms_message("v4lv2: YUV420P choosen"); - }else if (v4lv2_try_format(s,V4L2_PIX_FMT_NV12)){ - s->pix_fmt=MS_YUV420P; - s->int_pix_fmt=V4L2_PIX_FMT_NV12; - ms_message("v4lv2: V4L2_PIX_FMT_NV12 choosen"); - }else if (v4lv2_try_format(s,V4L2_PIX_FMT_MJPEG)){ - s->pix_fmt=MS_MJPEG; - s->int_pix_fmt=V4L2_PIX_FMT_MJPEG; - ms_message("v4lv2: MJPEG choosen"); - }else if (v4lv2_try_format(s,V4L2_PIX_FMT_YUYV)){ - s->pix_fmt=MS_YUYV; - s->int_pix_fmt=V4L2_PIX_FMT_YUYV; - ms_message("v4lv2: V4L2_PIX_FMT_YUYV choosen"); - }else if (v4lv2_try_format(s,V4L2_PIX_FMT_RGB24)){ - s->pix_fmt=MS_RGB24; - s->int_pix_fmt=V4L2_PIX_FMT_RGB24; - ms_message("v4lv2: RGB24 choosen"); - }else{ - ms_error("Could not find supported pixel format."); - return -1; - } - return 0; -} - -static int v4lv2_do_mmap(V4lState *s){ - struct v4l2_requestbuffers req; - int i; - enum v4l2_buf_type type; - - memset(&req,0,sizeof(req)); - - req.count = 4; - req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - req.memory = V4L2_MEMORY_MMAP; - - if (ioctl (s->fd, VIDIOC_REQBUFS, &req)<0) { - ms_error("Error requesting info on mmap'd buffers: %s",strerror(errno)); - return -1; - } - - for (i=0; ifd, VIDIOC_QUERYBUF, &buf)<0){ - ms_error("Could not VIDIOC_QUERYBUF : %s",strerror(errno)); - return -1; - } - - start=mmap (NULL /* start anywhere */, - buf.length, - PROT_READ | PROT_WRITE /* required */, - MAP_SHARED /* recommended */, - s->fd, buf.m.offset); - - if (start==NULL){ - ms_error("Could not mmap: %s",strerror(errno)); - } - msg=esballoc(start,buf.length,0,NULL); - /* adjust to real size of picture*/ - if (s->pix_fmt==MS_RGB24) - msg->b_wptr+=s->vsize.width*s->vsize.height*3; - else - msg->b_wptr+=(s->vsize.width*s->vsize.height*3)/2; - - s->frames[i]=msg; - } - s->frame_max=req.count; - /* - for (i = 0; i < s->frame_max; ++i) { - struct v4l2_buffer buf; - - memset(&buf,0,sizeof(buf)); - buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - buf.memory = V4L2_MEMORY_MMAP; - buf.index = i; - if (-1==ioctl (s->fd, VIDIOC_QBUF, &buf)){ - ms_error("VIDIOC_QBUF failed: %s",strerror(errno)); - } - } - */ - /*start capture immediately*/ - type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - if (-1 ==ioctl (s->fd, VIDIOC_STREAMON, &type)){ - ms_error("VIDIOC_STREAMON failed: %s",strerror(errno)); - return -1; - } - return 0; -} - -static mblk_t * v4lv2_grab_image(V4lState *s){ - struct v4l2_buffer buf; - unsigned int k; - memset(&buf,0,sizeof(buf)); - mblk_t *ret=NULL; - - buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - buf.memory = V4L2_MEMORY_MMAP; - if (s->queued){ - if (ioctl(s->fd, VIDIOC_DQBUF, &buf)<0) { - switch (errno) { - case EAGAIN: - case EIO: - /* Could ignore EIO, see spec. */ - break; - default: - ms_warning("VIDIOC_DQBUF failed: %s",strerror(errno)); - } - }else{ - if (buf.index >= s->frame_max){ - ms_error("buf.index>=s->max_frames !"); - return NULL; - } - s->queued--; - /*decrement ref count of dequeued buffer */ - ret=s->frames[buf.index]; - ret->b_datap->db_ref--; - if (buf.bytesused<=30){ - ms_warning("Ignoring empty buffer..."); - return NULL; - } - } - } - - /*queue buffers whose ref count has dropped to 1, because they are not - still used anywhere in the filter chain */ - for(k=0;kframe_max;++k){ - if (s->frames[k]->b_datap->db_ref==1){ - buf.index=k; - if (-1==ioctl (s->fd, VIDIOC_QBUF, &buf)) - ms_warning("VIDIOC_QBUF %i failed: %s",k, strerror(errno)); - else { - /*increment ref count of queued buffer*/ - s->frames[k]->b_datap->db_ref++; - s->queued++; - } - } - } - return ret; -} - -#endif - -static void v4l_init(MSFilter *f){ - V4lState *s=ms_new0(V4lState,1); - s->fd=-1; - s->run=FALSE; - s->v4lv2=FALSE; - s->mmapdbuf=NULL; - s->vsize.width=MS_VIDEO_SIZE_CIF_W; - s->vsize.height=MS_VIDEO_SIZE_CIF_H; - s->pix_fmt=MS_RGB24; - s->dev=ms_strdup("/dev/video0"); - qinit(&s->rq); - s->mire=NULL; - ms_mutex_init(&s->mutex,NULL); - s->start_time=0; - s->frame_count=-1; - s->fps=15; - s->usemire=(getenv("DEBUG")!=NULL); - s->queued=0; - s->force_v1=FALSE; - s->auto_started=FALSE; - f->data=s; -} - -/* we try not to close the /dev/videoX device to workaround a bug of linux kernel. -The bug is this one: -One thread opens /dev/videoX, and mmap()s some pages to get data from the camera. -Then several threads are created (using clone) and automatically get a reference to the mmap'd page, thus a reference to the file_struct of the opened file descriptor. -Then when the first thread closes and unmap() the file descriptor, the .release method of the driver is not called because there are still some threads owning the reference to the mmap'd pages. -As far as I understand. -If all threads are correctly pthread_join()ed, then the file descriptor is closed correctly. -But unfortunately when using alsa dmix/asym plugins, some threads are started by those plugins and are kept alive (or zombie) for some time after the mmap()/close(). -*/ - -static int v4l_fd=-1; -static bool_t reuse_fd=FALSE; -static char *v4l_devname=NULL; - -static int v4l_start(MSFilter *f, void *arg) -{ - V4lState *s=(V4lState*)f->data; - int err=0; - if (v4l_fd>=0 && reuse_fd){ - if (strcmp(v4l_devname,s->dev)==0 ){ - /*use this one!*/ - ms_message("v4l_start: reusing previous file descriptor."); - s->fd=v4l_fd; - }else{ - ms_message("closing cached fd"); - close(v4l_fd); - v4l_fd=-1; - ms_free(v4l_devname); - v4l_devname=NULL; - } - } - if (s->fd==-1){ - s->fd=open(s->dev,O_RDWR); - ms_message("v4l_start: open, fd=%i",s->fd); - if (s->fd>=0){ - v4l_fd=s->fd; - v4l_devname=ms_strdup(s->dev); - } - } - if (s->fd<0){ - ms_error("MSV4l: cannot open video device (%s): %s.",s->dev,strerror(errno)); - if (!s->usemire){ - s->pix_fmt=MS_YUV420P; - s->fps=1; - } - return -1; - }else{ -#ifdef HAVE_LINUX_VIDEODEV2_H - if (s->force_v1 || v4lv2_configure(s)<0) {/*might not be V4LV2 */ -#else - if (1){ -#endif - struct video_capability vidcap; - err=v4l_configure(s); - if (err<0) - { - ms_error("MSV4l: could not get configuration of video device"); - close(s->fd); - s->fd=-1; - return -1; - } - if (!s->force_v1) reuse_fd=TRUE; - - err=ioctl(s->fd, VIDIOCGCAP, &vidcap); - if (err==0) - { - ms_message("MSV4l: Webcam is %s.", vidcap.name); - if (strcasecmp(vidcap.name, "Logitech QuickCam USB")==0) - { - int comp_arg=0; - err=ioctl(s->fd, VIDIOCQCSCOMPATIBLE, &comp_arg); - if (err==0) - { - ms_message("MSV4l: compatibility mode disabled for %s.", vidcap.name); - } - } - } - }else{ - ms_message("Device is a video4linux V2 one."); - s->v4lv2=TRUE; - reuse_fd=FALSE; - } - } - return 0; -} - -static void v4l_start_capture(V4lState *s){ - if (s->fd>=0){ - s->run=TRUE; - ms_thread_create(&s->thread,NULL,v4l_thread,s); - } -} - -static int v4l_stop(MSFilter *f, void *arg){ - V4lState *s=(V4lState*)f->data; - if (s->fd>=0){ - if (!reuse_fd){ - if (close(s->fd)<0){ - ms_warning("MSV4l: Could not close(): %s",strerror(errno)); - } - ms_message("v4l fd %i closed",s->fd); - } - s->fd=-1; - s->frame_count=-1; - } - return 0; -} - -static void v4l_stop_capture(V4lState *s){ - if (s->run){ - s->run=FALSE; - ms_thread_join(s->thread,NULL); - ms_message("v4l thread has joined."); - flushq(&s->rq,0); - } -} - - -static void v4l_uninit(MSFilter *f){ - V4lState *s=(V4lState*)f->data; - if (s->fd>=0) v4l_stop(f,NULL); - ms_free(s->dev); - flushq(&s->rq,0); - ms_mutex_destroy(&s->mutex); - freemsg(s->mire); - ms_free(s); -} - -static bool_t try_format(int fd, struct video_picture *pict, int palette, int depth){ - int err; - pict->palette=palette; - pict->depth=depth; - err=ioctl(fd,VIDIOCSPICT,pict); - if (err<0){ - ms_warning("Could not set picture properties: %s",strerror(errno)); - return FALSE; - } - return TRUE; -} - -static int v4l_do_mmap(V4lState *s){ - struct video_mbuf vmbuf; - int err,i; - memset(&vmbuf,0,sizeof(vmbuf)); - /* try to get mmap properties */ - err=ioctl(s->fd,VIDIOCGMBUF,&vmbuf); - if (err<0){ - ms_error("Could not get mmap properties: %s",strerror(errno)); - return -1; - }else { - if (vmbuf.size>0){ - /* do the mmap */ - s->msize=vmbuf.size; - s->frame_max=vmbuf.frames; - } else { - ms_error("This device cannot support mmap."); - return -1; - } - } - s->mmapdbuf=mmap(NULL,s->msize,PROT_READ,MAP_SHARED,s->fd,0); - if (s->mmapdbuf==(void*)-1) { - /* for non-mmu arch */ - s->mmapdbuf=mmap(NULL,s->msize,PROT_READ,MAP_PRIVATE,s->fd,0); - if (s->mmapdbuf==(void*)-1) { - ms_error("Could not mmap: %s",strerror(errno)); - s->mmapdbuf=NULL; - return -1; - } - } - /* initialize the mediastreamer buffers */ - ms_message("Using %i-frames mmap'd buffer at %p, len %i", - s->frame_max, s->mmapdbuf,s->msize); - for(i=0;iframe_max;i++){ - mblk_t *buf=esballoc((uint8_t*)s->mmapdbuf+vmbuf.offsets[i],vmbuf.offsets[1],0,NULL); - /* adjust to real size of picture*/ - if (s->pix_fmt==MS_RGB24) - buf->b_wptr+=s->vsize.width*s->vsize.height*3; - else - buf->b_wptr+=(s->vsize.width*s->vsize.height*3)/2; - s->frames[i]=buf; - } - s->frame_ind=0; - return 0; -} - -static bool_t try_size(V4lState *s, MSVideoSize vsize){ - struct video_window win; - int err; - memset(&win,0,sizeof(win)); - /*set picture size */ - win.x=win.y=0; - win.width=vsize.width; - win.height=vsize.height; - win.flags=0; - win.clips=NULL; - win.clipcount=0; - - ms_message("Trying to set capture size to %ix%i", vsize.width,vsize.height); - err=ioctl(s->fd,VIDIOCSWIN,&win); - if (err<0){ - ms_warning("Could not set window size: %s",strerror(errno)); - return FALSE; - } - - err=ioctl(s->fd, VIDIOCGWIN, &win); - if (err<0){ - ms_warning("Could not get window size: %s",strerror(errno)); - return FALSE; - } - s->vsize.width=vsize.width; - s->vsize.height=vsize.height; - - if (s->vsize.width!=win.width || s->vsize.height!=win.height){ - ms_warning("Capture size is not what we expected: asked for %ix%i and get %ix%i",s->vsize.width,s->vsize.height, win.width, win.height); - } - s->got_vsize.width=win.width; - s->got_vsize.height=win.height; - ms_message("Capture size set to %ix%i", s->got_vsize.width,s->got_vsize.height); - return TRUE; -} - -static int v4l_configure(V4lState *s) -{ - struct video_channel chan; - struct video_picture pict; - struct video_capability cap; - int err; - int i; - int fps = 0; - int found=0; - - memset(&chan,0,sizeof(chan)); - memset(&pict,0,sizeof(pict)); - memset(&cap,0,sizeof(cap)); - - err=ioctl(s->fd,VIDIOCGCAP,&cap); - if (err!=0) - { - ms_warning("MSV4l: cannot get device capabilities: %s.",strerror(errno)); - return -1; - } - - ms_message("Found %s device. (maxsize=%ix%i, minsize=%ix%i)",cap.name, cap.maxwidth, cap.maxheight, - cap.minwidth, cap.minheight); - for (i=0;ifd,VIDIOCGCHAN,&chan); - if (err==0) - { - ms_message("Getting video channel %s",chan.name); - switch(chan.type){ - case VIDEO_TYPE_TV: - ms_message("Channel is a TV."); - break; - case VIDEO_TYPE_CAMERA: - ms_message("Channel is a camera"); - break; - default: - ms_warning("unknown video channel type."); - } - found=1; - break; /* find the first channel */ - } - } - if (found) ms_message("A valid video channel was found."); - /* select this channel */ - ioctl(s->fd,VIDIOCSCHAN,&chan); - - /* get picture properties */ - err=ioctl(s->fd,VIDIOCGPICT,&pict); - if (err<0){ - ms_warning("Could not get picture properties: %s",strerror(errno)); - return -1; - } - ms_message("Default picture properties: brightness=%i,hue=%i,colour=%i,contrast=%i,depth=%i, palette=%i.", - pict.brightness,pict.hue,pict.colour, pict.contrast,pict.depth, pict.palette); - - /* trying color format */ - if (try_format(s->fd,&pict,VIDEO_PALETTE_YUV420P,16)){ - ms_message("Driver supports YUV420P, using that format."); - s->pix_fmt=MS_YUV420P; - }else if (try_format(s->fd, &pict,VIDEO_PALETTE_RGB24,24)){ - ms_message("Driver supports RGB24, using that format."); - s->pix_fmt=MS_RGB24; - }else if (try_format(s->fd, &pict,VIDEO_PALETTE_YUV422, 16)){ - ms_message("Driver supports YUV422, using that format."); - s->pix_fmt=MS_YUYV; - }else if (try_format(s->fd, &pict,VIDEO_PALETTE_UYVY, 16)){ - ms_message("Driver supports UYVY, using that format."); - s->pix_fmt=MS_UYVY; - }else{ - s->vsize.width=MS_VIDEO_SIZE_CIF_W; - s->vsize.height=MS_VIDEO_SIZE_CIF_H; - s->pix_fmt=MS_YUV420P; - ms_fatal("Unsupported video pixel format."); - return -1; - } - - if (!try_size(s,s->vsize)) { - if (!try_size(s,MS_VIDEO_SIZE_NS1)){ - if (!try_size(s,MS_VIDEO_SIZE_VGA)){ - if (!try_size(s,MS_VIDEO_SIZE_CIF)) { - if (!try_size(s,MS_VIDEO_SIZE_QCIF)) { - if (!try_size(s,MS_VIDEO_SIZE_QVGA)) { - if (!try_size(s,MS_VIDEO_SIZE_4CIF)) { - if (!try_size(s,MS_VIDEO_SIZE_1024)) { - return -1; - } - } - } - } - } - } - } - } - - /* Try HW frame rate control */ - fps = s->fps; - if (ioctl(s->fd, VIDIOSFPS, &fps) < 0 ) - ms_message("v4l_configure: cannot set HW frame rate control"); - else - ms_message("v4l_configure: set HW fps to be : %d", fps); - - return 0; -} - - -int ms_to_v4l_pix_fmt(MSPixFmt p){ - switch(p){ - case MS_YUV420P: - return VIDEO_PALETTE_YUV420P; - case MS_RGB24: - return VIDEO_PALETTE_RGB24; - case MS_YUYV: - return VIDEO_PALETTE_YUV422; - case MS_UYVY: - return VIDEO_PALETTE_UYVY; - default: - ms_fatal("unsupported pix fmt"); - return -1; - } -} - -static void plane_copy(uint8_t *dest, int dw, int dh, uint8_t *src, int sw, int sh, int bpp){ - int diffw=dw-sw; - int diffh=dh-sh; - int dlsize=dw*bpp; - int slsize=sw*bpp; - int i; - int dstartx=(diffw>0) ? diffw/2 : 0; - int dstarty=(diffh>0) ? diffh/2 : 0; - int sstartx=(diffw<0) ? diffw/2 : 0; - int sstarty=(diffh<0) ? diffh/2 : 0; - uint8_t *tmp1=dest; - uint8_t *tmp2=src; - - /* copy orig into dest */ - tmp2+=sstarty*slsize; - tmp1+=dstarty*dlsize; - for(i=dstarty;ivsize.width*s->vsize.height; - mblk_t *newpic; - if (s->pix_fmt==MS_YUV420P) size=size*3/2; - else if (s->pix_fmt==MS_YUYV) size=size*2; - else if (s->pix_fmt==MS_UYVY) size=size*2; - else if (s->pix_fmt==MS_RGB24) size=size*3; - else ms_fatal("crop_or_pad: unsupported pixel format."); - newpic=allocb(size,0); - memset(newpic->b_wptr,0,size); - pic_copy(newpic->b_wptr, s->vsize.width, s->vsize.height, - pic->b_rptr,s->got_vsize.width,s->got_vsize.height,s->pix_fmt); - newpic->b_wptr+=size; - return newpic; -} - -static mblk_t * v4l_grab_image_mmap(V4lState *s){ - struct video_mmap vmap; - int err; - int syncframe; - int jitter=s->frame_max-1; - int query_frame; - mblk_t *ret; - vmap.width=s->got_vsize.width; - vmap.height=s->got_vsize.height; - vmap.format=ms_to_v4l_pix_fmt(s->pix_fmt); - - query_frame=(s->frame_ind) % s->frame_max; - /*ms_message("v4l_mmap_process: query_frame=%i", - obj->query_frame);*/ - vmap.frame=query_frame; - err=ioctl(s->fd,VIDIOCMCAPTURE,&vmap); - if (err<0) { - ms_warning("v4l_grab_image_mmap: error in VIDIOCMCAPTURE: %s.",strerror(errno)); - usleep(10000); - return NULL; - } - /*g_message("v4l_mmap_process: query_frame=%i done", - obj->query_frame);*/ - syncframe=(s->frame_ind-jitter); - s->frame_ind++; - if (syncframe>=0){ - syncframe=syncframe%s->frame_max; - /*ms_message("Syncing on frame %i",syncframe);*/ - err=ioctl(s->fd,VIDIOCSYNC,&syncframe); - if (err<0) { - ms_warning("v4l_grab_image_mmap: error in VIDIOCSYNC: %s.",strerror(errno)); - return NULL; - } - /*g_message("got frame %i",syncframe);*/ - }else { - return NULL; - } - ret=s->frames[syncframe]; - /* crop or pad picture if obtained size is not what we want */ - if (s->vsize.width!=s->got_vsize.width){ - ret=crop_or_pad(s,ret); - } - return ret; -} - -static mblk_t * v4l_make_mire(V4lState *s){ - unsigned char *data; - int i,j,line,pos; - int patternw=s->vsize.width/6; - int patternh=s->vsize.height/6; - int red,green=0,blue=0; - if (s->mire==NULL){ - s->mire=allocb(s->vsize.width*s->vsize.height*3,0); - s->mire->b_wptr=s->mire->b_datap->db_lim; - } - data=s->mire->b_rptr; - for (i=0;ivsize.height;++i){ - line=i*s->vsize.width*3; - if ( ((i+s->frame_ind)/patternh) & 0x1) red=255; - else red= 0; - for (j=0;jvsize.width;++j){ - pos=line+(j*3); - - if ( ((j+s->frame_ind)/patternw) & 0x1) blue=255; - else blue= 0; - - data[pos]=red; - data[pos+1]=green; - data[pos+2]=blue; - } - } - s->frame_ind++; - return s->mire; -} - -static mblk_t * v4l_make_nowebcam(V4lState *s){ - if (s->mire==NULL && s->frame_ind==0){ - s->mire=ms_load_nowebcam(&s->vsize, -1); - } - s->frame_ind++; - return s->mire; -} - -static void v4l_purge(V4lState *s){ - int i; - int err; - int jitter=s->frame_max-1; - for (i=s->frame_ind-jitter;iframe_ind;++i){ - int syncframe=i%s->frame_max; - ms_message("syncing last frame"); - err=ioctl(s->fd,VIDIOCSYNC,&syncframe); - if (err<0) { - ms_warning("v4l_mmap_process: error in VIDIOCSYNC: %s.",strerror(errno)); - } - } -} - -#ifdef HAVE_LINUX_VIDEODEV2_H -static void v4lv2_purge(V4lState *s){ - struct v4l2_buffer buf; - memset(&buf,0,sizeof(buf)); - - buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - buf.memory = V4L2_MEMORY_MMAP; - - for(;s->queued>0;s->queued--){ - if (ioctl(s->fd, VIDIOC_DQBUF, &buf)==-1){ - ms_warning("v4lv2_purge: Could not DQ buffer: %s",strerror(errno)); - } - } -} -#endif - -static void v4l_do_munmap(V4lState *s){ - int i; -#ifdef HAVE_LINUX_VIDEODEV2_H - enum v4l2_buf_type type; - if (s->v4lv2){ - v4lv2_purge(s); - /*stop capture immediately*/ - type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - if (-1 ==ioctl (s->fd, VIDIOC_STREAMOFF, &type)){ - ms_error("VIDIOC_STREAMOFF failed: %s",strerror(errno)); - } - } -#endif - if (!s->v4lv2){ - v4l_purge(s); - } - if (s->mmapdbuf!=NULL){ - if (munmap(s->mmapdbuf,s->msize)<0){ - ms_warning("MSV4l: Fail to unmap: %s",strerror(errno)); - } - ms_message("munmap() done (%p,%i)",s->mmapdbuf,s->msize); - s->mmapdbuf=NULL; - } - s->msize=0; - for(i=0;iframe_max;++i){ - if (s->v4lv2){ - mblk_t *msg=s->frames[i]; - int len=msg->b_datap->db_lim-msg->b_datap->db_base; - if (munmap(msg->b_datap->db_base,len)<0){ - ms_warning("MSV4l: Fail to unmap: %s",strerror(errno)); - } - } - freemsg(s->frames[i]); - s->frames[i]=NULL; - } -} - - -static void *v4l_thread(void *ptr){ - V4lState *s=(V4lState*)ptr; - int err=-1; - ms_message("v4l_thread starting"); - if (s->v4lv2){ -#ifdef HAVE_LINUX_VIDEODEV2_H - err=v4lv2_do_mmap(s); -#endif - }else{ - err=v4l_do_mmap(s); - } - if (err<0){ - ms_thread_exit(NULL); - } - while(s->run){ - mblk_t *m; -#ifdef HAVE_LINUX_VIDEODEV2_H - if (s->v4lv2) - m=v4lv2_grab_image(s); - else -#endif - m=v4l_grab_image_mmap(s); - - if (s->vsize.width!=s->got_vsize.width){ - if (m){ - /* mblock was allocated by crop or pad! */ - ms_mutex_lock(&s->mutex); - putq(&s->rq,m); - ms_mutex_unlock(&s->mutex); - }else{ - ms_error("grabbing failed !"); - } - } else if (m!=NULL) { - mblk_t *dm=dupmsg(m); - ms_mutex_lock(&s->mutex); - putq(&s->rq,dm); - ms_mutex_unlock(&s->mutex); - } - } - v4l_do_munmap(s); - ms_message("v4l_thread exited."); - ms_thread_exit(NULL); -} - - -static void v4l_process(MSFilter * obj){ - V4lState *s=(V4lState*)obj->data; - uint32_t timestamp; - int cur_frame; - if (s->frame_count==-1){ - s->start_time=obj->ticker->time; - s->frame_count=0; - } - cur_frame=((obj->ticker->time-s->start_time)*s->fps/1000.0); - if (cur_frame>=s->frame_count){ - mblk_t *om=NULL; - ms_mutex_lock(&s->mutex); - /*keep the most recent frame if several frames have been captured */ - if (s->fd!=-1){ - om=getq(&s->rq); - }else{ - if (s->usemire){ - om=dupmsg(v4l_make_mire(s)); - }else { - mblk_t *tmpm=v4l_make_nowebcam(s); - if (tmpm) { - om=dupmsg(tmpm); - mblk_set_precious_flag(om,1); - } - } - } - ms_mutex_unlock(&s->mutex); - if (om!=NULL){ - timestamp=obj->ticker->time*90;/* rtp uses a 90000 Hz clockrate for video*/ - mblk_set_timestamp_info(om,timestamp); - mblk_set_marker_info(om,TRUE); - ms_queue_put(obj->outputs[0],om); - /*ms_message("picture sent");*/ - s->frame_count++; - } - }else flushq(&s->rq,0); -} - -static void v4l_preprocess(MSFilter *f){ - V4lState *s=(V4lState*)f->data; - if (s->fd==-1){ - s->auto_started=TRUE; - v4l_start(f,NULL); - v4l_start_capture(s); - } - else - { - v4l_start_capture(s); - } -} - -static void v4l_postprocess(MSFilter *f){ - V4lState *s=(V4lState*)f->data; - if (s->auto_started){ - v4l_stop_capture(s); - v4l_stop(f,NULL); - } - else - { - v4l_stop_capture(s); - } -} - -static int v4l_set_fps(MSFilter *f, void *arg){ - V4lState *s=(V4lState*)f->data; - s->fps=*((float*)arg); - s->frame_count=-1; - return 0; -} - -static int v4l_get_pix_fmt(MSFilter *f,void *arg){ - V4lState *s=(V4lState*)f->data; - MSPixFmt res; - if (s->fd==-1){ - v4l_start(f,NULL); - res=s->pix_fmt; - v4l_stop(f,NULL); - }else res=s->pix_fmt; - *((MSPixFmt*)arg)=res; - return 0; -} - -static int v4l_set_vsize(MSFilter *f, void *arg){ - V4lState *s=(V4lState*)f->data; - s->vsize=*((MSVideoSize*)arg); - return 0; -} - -static int v4l_get_vsize(MSFilter *f, void *arg){ - V4lState *s=(V4lState*)f->data; - *(MSVideoSize*)arg=s->vsize; - return 0; -} - -static MSFilterMethod methods[]={ - { MS_FILTER_SET_FPS , v4l_set_fps }, - { MS_FILTER_GET_PIX_FMT , v4l_get_pix_fmt }, - { MS_FILTER_SET_VIDEO_SIZE, v4l_set_vsize }, - { MS_V4L_START , v4l_start }, - { MS_V4L_STOP , v4l_stop }, - { MS_FILTER_GET_VIDEO_SIZE, v4l_get_vsize }, - { 0 , NULL } -}; - -static int v4l_set_devfile(MSFilter *f, void *arg){ - V4lState *s=(V4lState*)f->data; - if (s->dev) ms_free(s->dev); - s->dev=ms_strdup((char*)arg); - return 0; -} - -MSFilterDesc ms_v4l_desc={ - .id=MS_V4L_ID, - .name="MSV4l", - .text=N_("A video4linux compatible source filter to stream pictures."), - .ninputs=0, - .noutputs=1, - .category=MS_FILTER_OTHER, - .init=v4l_init, - .preprocess=v4l_preprocess, - .process=v4l_process, - .postprocess=v4l_postprocess, - .uninit=v4l_uninit, - .methods=methods -}; - -MS_FILTER_DESC_EXPORT(ms_v4l_desc) - -static MSFilter *v4l_create_reader(MSWebCam *obj){ - MSFilter *f=ms_filter_new_from_desc(&ms_v4l_desc); - V4lState *s=(V4lState*)f->data; - v4l_set_devfile(f,obj->name); - s->force_v1=TRUE; - return f; -} - -static void v4l_detect(MSWebCamManager *obj); - -static void v4l_cam_init(MSWebCam *cam){ - -} - -MSWebCamDesc v4l_desc={ - "V4L", - &v4l_detect, - &v4l_cam_init, - &v4l_create_reader, - NULL -}; - -static void v4l_detect(MSWebCamManager *obj){ - struct video_capability cap; - const char *devname="/dev/video0"; - int fd=open(devname,O_RDWR); - if (fd!=-1){ - if (ioctl (fd, VIDIOCGCAP, &cap)==0) { - /* is a V4Lv1 */ - MSWebCam *cam=ms_web_cam_new(&v4l_desc); - cam->name=ms_strdup(devname); - ms_web_cam_manager_add_cam(obj,cam); - } - close(fd); - } - devname="/dev/video1"; - fd=open(devname,O_RDWR); - if (fd!=-1){ - if (ioctl (fd, VIDIOCGCAP, &cap)==0) { - /* is a V4Lv1 */ - MSWebCam *cam=ms_web_cam_new(&v4l_desc); - cam->name=ms_strdup(devname); - ms_web_cam_manager_add_cam(obj,cam); - } - close(fd); - } -} - - -#endif diff --git a/linphone/mediastreamer2/src/msv4l2.c b/linphone/mediastreamer2/src/msv4l2.c deleted file mode 100644 index 377131926..000000000 --- a/linphone/mediastreamer2/src/msv4l2.c +++ /dev/null @@ -1,524 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifdef HAVE_CONFIG_H -#include "mediastreamer-config.h" -#endif - -#ifdef HAVE_LINUX_VIDEODEV2_H - - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "mediastreamer2/msvideo.h" -#include "mediastreamer2/msticker.h" -#include "mediastreamer2/mswebcam.h" - -#ifdef HAVE_LIBV4L2 -#include -#else - -#define v4l2_open open -#define v4l2_close close -#define v4l2_mmap mmap -#define v4l2_munmap munmap -#define v4l2_ioctl ioctl - -#endif - -typedef struct V4l2State{ - int fd; - char *dev; - char *mmapdbuf; - int msize;/*mmapped size*/ - MSVideoSize vsize; - MSVideoSize got_vsize; - int pix_fmt; - int int_pix_fmt; /*internal pixel format */ - int picture_size; - mblk_t *frames[VIDEO_MAX_FRAME]; - int frame_ind; - int frame_max; - float fps; - float start_time; - int frame_count; - int queued; - bool_t configured; -}V4l2State; - -static int msv4l2_open(V4l2State *s){ - int fd=v4l2_open(s->dev,O_RDWR|O_NONBLOCK); - if (fd==-1){ - ms_error("Could not open %s: %s",s->dev,strerror(errno)); - return -1; - } - s->fd=fd; - return 0; -} - -static int msv4l2_close(V4l2State *s){ - if (s->fd!=-1){ - v4l2_close(s->fd); - s->fd=-1; - s->configured=FALSE; - } - return 0; -} - -static bool_t v4lv2_try_format( V4l2State *s, struct v4l2_format *fmt, int fmtid){ - - fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - fmt->fmt.pix.pixelformat = fmtid; - fmt->fmt.pix.field = V4L2_FIELD_ANY; - - if (v4l2_ioctl (s->fd, VIDIOC_TRY_FMT, fmt)<0){ - ms_message("VIDIOC_TRY_FMT: %s",strerror(errno)); - return FALSE; - } - if (v4l2_ioctl (s->fd, VIDIOC_S_FMT, fmt)<0){ - ms_message("VIDIOC_S_FMT: %s",strerror(errno)); - return FALSE; - } - return TRUE; -} - -static int get_picture_buffer_size(MSPixFmt pix_fmt, int w, int h){ - switch(pix_fmt){ - case MS_YUV420P: - return (w*h*3)/2; - break; - case MS_RGB24: - return w*h*3; - break; - case MS_YUYV: - return w*h*2; - break; - default: - return 0; - } - return 0; -} - -static int msv4l2_configure(V4l2State *s){ - struct v4l2_capability cap; - struct v4l2_format fmt; - MSVideoSize vsize; - - if (v4l2_ioctl (s->fd, VIDIOC_QUERYCAP, &cap)<0) { - ms_message("Not a v4lv2 driver."); - return -1; - } - - if (!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) { - ms_error("%s is not a video capture device\n",s->dev); - return -1; - } - - if (!(cap.capabilities & V4L2_CAP_STREAMING)) { - ms_error("%s does not support streaming i/o\n",s->dev); - return -1; - } - - ms_message("Driver is %s",cap.driver); - memset(&fmt,0,sizeof(fmt)); - - fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - if (v4l2_ioctl (s->fd, VIDIOC_G_FMT, &fmt)<0){ - ms_error("VIDIOC_G_FMT failed: %s",strerror(errno)); - } - vsize=s->vsize; - do{ - fmt.fmt.pix.width = s->vsize.width; - fmt.fmt.pix.height = s->vsize.height; - if (v4lv2_try_format(s,&fmt,V4L2_PIX_FMT_YUV420)){ - s->pix_fmt=MS_YUV420P; - s->int_pix_fmt=V4L2_PIX_FMT_YUV420; - ms_message("v4lv2: YUV420P choosen"); - break; - }else if (v4lv2_try_format(s,&fmt,V4L2_PIX_FMT_MJPEG)){ - s->pix_fmt=MS_MJPEG; - s->int_pix_fmt=V4L2_PIX_FMT_MJPEG; - ms_message("v4lv2: MJPEG choosen"); - break; - }else if (v4lv2_try_format(s,&fmt,V4L2_PIX_FMT_YUYV)){ - s->pix_fmt=MS_YUYV; - s->int_pix_fmt=V4L2_PIX_FMT_YUYV; - ms_message("v4lv2: V4L2_PIX_FMT_YUYV choosen"); - break; - }else if (v4lv2_try_format(s,&fmt,V4L2_PIX_FMT_RGB24)){ - s->pix_fmt=MS_RGB24; - s->int_pix_fmt=V4L2_PIX_FMT_RGB24; - ms_message("v4lv2: RGB24 choosen"); - break; - }else{ - ms_error("Could not find supported pixel format for %ix%i", s->vsize.width, s->vsize.height); - } - s->vsize=ms_video_size_get_just_lower_than(s->vsize); - }while(s->vsize.width!=0); - if (s->vsize.width==0){ - ms_message("Could not find any combination of resolution/pixel-format that works !"); - s->vsize=vsize; - return -1; - } - memset(&fmt,0,sizeof(fmt)); - - fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - - if (v4l2_ioctl (s->fd, VIDIOC_G_FMT, &fmt)<0){ - ms_error("VIDIOC_G_FMT failed: %s",strerror(errno)); - }else{ - ms_message("Size of webcam delivered pictures is %ix%i",fmt.fmt.pix.width,fmt.fmt.pix.height); - s->vsize.width=fmt.fmt.pix.width; - s->vsize.height=fmt.fmt.pix.height; - } - s->picture_size=get_picture_buffer_size(s->pix_fmt,s->vsize.width,s->vsize.height); - s->configured=TRUE; - return 0; -} - -static int msv4l2_do_mmap(V4l2State *s){ - struct v4l2_requestbuffers req; - int i; - enum v4l2_buf_type type; - - memset(&req,0,sizeof(req)); - - req.count = 4; - req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - req.memory = V4L2_MEMORY_MMAP; - - if (v4l2_ioctl (s->fd, VIDIOC_REQBUFS, &req)<0) { - ms_error("Error requesting info on mmap'd buffers: %s",strerror(errno)); - return -1; - } - - for (i=0; ifd, VIDIOC_QUERYBUF, &buf)<0){ - ms_error("Could not VIDIOC_QUERYBUF : %s",strerror(errno)); - return -1; - } - - start=v4l2_mmap (NULL /* start anywhere */, - buf.length, - PROT_READ | PROT_WRITE /* required */, - MAP_SHARED /* recommended */, - s->fd, buf.m.offset); - - if (start==NULL){ - ms_error("Could not v4l2_mmap: %s",strerror(errno)); - } - msg=esballoc(start,buf.length,0,NULL); - msg->b_wptr+=buf.length; - s->frames[i]=msg; - } - s->frame_max=req.count; - for (i = 0; i < s->frame_max; ++i) { - struct v4l2_buffer buf; - - memset(&buf,0,sizeof(buf)); - buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - buf.memory = V4L2_MEMORY_MMAP; - buf.index = i; - if (-1==v4l2_ioctl (s->fd, VIDIOC_QBUF, &buf)){ - ms_error("VIDIOC_QBUF failed: %s",strerror(errno)); - }else { - s->frames[i]->b_datap->db_ref++; - s->queued++; - } - } - /*start capture immediately*/ - type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - if (-1 ==v4l2_ioctl (s->fd, VIDIOC_STREAMON, &type)){ - ms_error("VIDIOC_STREAMON failed: %s",strerror(errno)); - return -1; - } - return 0; -} - -static mblk_t * v4lv2_grab_image(V4l2State *s){ - struct v4l2_buffer buf; - unsigned int k; - memset(&buf,0,sizeof(buf)); - mblk_t *ret=NULL; - - buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - buf.memory = V4L2_MEMORY_MMAP; - - /*queue buffers whose ref count is 1, because they are not - still used anywhere in the filter chain */ - for(k=0;kframe_max;++k){ - if (s->frames[k]->b_datap->db_ref==1){ - buf.index=k; - if (-1==v4l2_ioctl (s->fd, VIDIOC_QBUF, &buf)) - ms_warning("VIDIOC_QBUF %i failed: %s",k, strerror(errno)); - else { - ms_debug("v4l2: queue buf %i",k); - /*increment ref count of queued buffer*/ - s->frames[k]->b_datap->db_ref++; - s->queued++; - } - } - } - - if (s->queued){ - struct pollfd fds; - memset(&fds,0,sizeof(fds)); - fds.events=POLLIN; - fds.fd=s->fd; - /*check with poll if there is something to read */ - if (poll(&fds,1,0)==1 && fds.revents==POLLIN){ - if (v4l2_ioctl(s->fd, VIDIOC_DQBUF, &buf)<0) { - switch (errno) { - case EAGAIN: - case EIO: - /* Could ignore EIO, see spec. */ - break; - default: - ms_warning("VIDIOC_DQBUF failed: %s",strerror(errno)); - } - }else{ - s->queued--; - ms_debug("v4l2: de-queue buf %i",buf.index); - /*decrement ref count of dequeued buffer */ - ret=s->frames[buf.index]; - ret->b_datap->db_ref--; - if (buf.index >= s->frame_max){ - ms_error("buf.index>=s->max_frames !"); - return NULL; - } - if (buf.bytesused<=30){ - ms_warning("Ignoring empty buffer..."); - return NULL; - } - /*normally buf.bytesused should contain the right buffer size; however we have found a buggy - driver that puts a random value inside */ - if (s->picture_size!=0) - ret->b_wptr=ret->b_rptr+s->picture_size; - else ret->b_wptr=ret->b_rptr+buf.bytesused; - } - } - } - return ret; -} - -static void msv4l2_do_munmap(V4l2State *s){ - int i; - enum v4l2_buf_type type; - /*stop capture immediately*/ - type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - if (-1 ==v4l2_ioctl (s->fd, VIDIOC_STREAMOFF, &type)){ - ms_error("VIDIOC_STREAMOFF failed: %s",strerror(errno)); - } - - for(i=0;iframe_max;++i){ - mblk_t *msg=s->frames[i]; - int len=msg->b_datap->db_lim-msg->b_datap->db_base; - if (v4l2_munmap(msg->b_datap->db_base,len)<0){ - ms_warning("MSV4l2: Fail to unmap: %s",strerror(errno)); - } - freemsg(s->frames[i]); - s->frames[i]=NULL; - } -} - - - -static void msv4l2_init(MSFilter *f){ - V4l2State *s=ms_new0(V4l2State,1); - s->dev=ms_strdup("/dev/video0"); - s->fd=-1; - s->vsize=MS_VIDEO_SIZE_CIF; - s->fps=15; - s->configured=FALSE; - f->data=s; -} - -static void msv4l2_uninit(MSFilter *f){ - V4l2State *s=(V4l2State*)f->data; - ms_free(s->dev); - ms_free(s); -} - -static void msv4l2_preprocess(MSFilter *f){ - V4l2State *s=(V4l2State*)f->data; - if (s->fd==-1 && msv4l2_open(s)!=0) { - return; - } - if (!s->configured && msv4l2_configure(s)!=0){ - return; - } - if (msv4l2_do_mmap(s)==0){ - ms_message("V4L2 video capture started."); - }else{ - msv4l2_close(s); - } - s->start_time=f->ticker->time; -} - -static void msv4l2_process(MSFilter *f){ - V4l2State *s=(V4l2State*)f->data; - uint32_t elapsed; - - if (s->fd!=-1){ - /*see it is necessary to output a frame:*/ - elapsed=f->ticker->time-s->start_time; - if (((float)elapsed*s->fps/1000.0)>s->frame_count){ - mblk_t *m; - m=v4lv2_grab_image(s); - if (m){ - mblk_t *om=dupb(m); - mblk_set_marker_info(om,(s->pix_fmt==MS_MJPEG)); - ms_queue_put(f->outputs[0],om); - s->frame_count++; - } - } - } -} - -static void msv4l2_postprocess(MSFilter *f){ - V4l2State *s=(V4l2State*)f->data; - if (s->fd!=-1){ - msv4l2_do_munmap(s); - msv4l2_close(s); - } -} - -static int msv4l2_set_fps(MSFilter *f, void *arg){ - V4l2State *s=(V4l2State*)f->data; - s->fps=*(float*)arg; - return 0; -} - -static int msv4l2_set_vsize(MSFilter *f, void *arg){ - V4l2State *s=(V4l2State*)f->data; - s->vsize=*(MSVideoSize*)arg; - return 0; -} - -static int msv4l2_get_vsize(MSFilter *f, void *arg){ - V4l2State *s=(V4l2State*)f->data; - *(MSVideoSize*)arg=s->vsize; - return 0; -} - -static int msv4l2_get_pixfmt(MSFilter *f, void *arg){ - V4l2State *s=(V4l2State*)f->data; - if (s->fd==-1){ - if (msv4l2_open(s)==0){ - msv4l2_configure(s); - *(MSPixFmt*)arg=s->pix_fmt; - return 0; - }else return -1; - } - *(MSPixFmt*)arg=s->pix_fmt; - return 0; -} - -static int msv4l2_set_devfile(MSFilter *f, void *arg){ - V4l2State *s=(V4l2State*)f->data; - if (s->dev) ms_free(s->dev); - s->dev=ms_strdup((char*)arg); - return 0; -} - -static MSFilterMethod msv4l2_methods[]={ - { MS_FILTER_SET_FPS , msv4l2_set_fps }, - { MS_FILTER_SET_VIDEO_SIZE, msv4l2_set_vsize }, - { MS_FILTER_GET_VIDEO_SIZE, msv4l2_get_vsize }, - { MS_FILTER_GET_PIX_FMT , msv4l2_get_pixfmt }, - { 0 , NULL } -}; - -MSFilterDesc ms_v4l2_desc={ - .id=MS_V4L2_CAPTURE_ID, - .name="MSV4L2Capture", - .text=N_("A filter to grab pictures from Video4Linux2-powered cameras"), - .category=MS_FILTER_OTHER, - .ninputs=0, - .noutputs=1, - .init=msv4l2_init, - .preprocess=msv4l2_preprocess, - .process=msv4l2_process, - .postprocess=msv4l2_postprocess, - .uninit=msv4l2_uninit, - .methods=msv4l2_methods -}; - -MS_FILTER_DESC_EXPORT(ms_v4l2_desc) - -static MSFilter *msv4l2_create_reader(MSWebCam *obj){ - MSFilter *f=ms_filter_new(MS_V4L2_CAPTURE_ID); - msv4l2_set_devfile(f,obj->name); - return f; -} - -static void msv4l2_detect(MSWebCamManager *obj); - -static void msv4l2_cam_init(MSWebCam *cam){ -} - -MSWebCamDesc v4l2_card_desc={ - "V4L2", - &msv4l2_detect, - &msv4l2_cam_init, - &msv4l2_create_reader, - NULL -}; - -static void msv4l2_detect(MSWebCamManager *obj){ - struct v4l2_capability cap; - char devname[32]; - int i; - for(i=0;i<10;++i){ - int fd; - snprintf(devname,sizeof(devname),"/dev/video%i",i); - fd=open(devname,O_RDWR); - if (fd!=-1){ - if (v4l2_ioctl (fd, VIDIOC_QUERYCAP, &cap)==0) { - /* is a V4LV2 */ - MSWebCam *cam=ms_web_cam_new(&v4l2_card_desc); - cam->name=ms_strdup(devname); - ms_web_cam_manager_add_cam(obj,cam); - } - close(fd); - } - } -} - - -#endif diff --git a/linphone/mediastreamer2/src/msv4m.m b/linphone/mediastreamer2/src/msv4m.m deleted file mode 100644 index de52a465f..000000000 --- a/linphone/mediastreamer2/src/msv4m.m +++ /dev/null @@ -1,706 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifdef __APPLE__ - -#include "mediastreamer-config.h" - -#include -#include -#include -#include -#include -#include -#include - -#include "mediastreamer2/msvideo.h" -#include "mediastreamer2/msticker.h" -#include "mediastreamer2/msv4l.h" -#include "nowebcam.h" -#include "mediastreamer2/mswebcam.h" - -// build for carbon -#define TARGET_API_MAC_CARBON 1 - -#if __APPLE_CC__ - #include - #include - #include -#else - #include - #include - #include - #include - #include -#endif - -typedef struct v4mState{ - char * name; - char * id; - SeqGrabComponent seqgrab; - SGChannel sgchanvideo; - GWorldPtr pgworld; - ImageSequence decomseq; - - char *mmapdbuf; - int msize;/*mmapped size*/ - MSVideoSize vsize; - MSVideoSize got_vsize; - int pix_fmt; - int int_pix_fmt; /*internal pixel format */ - mblk_t *mire; - queue_t rq; - ms_mutex_t mutex; - int frame_ind; - int frame_max; - float fps; - float start_time; - int frame_count; - int queued; - bool_t run; - bool_t usemire; -}v4mState; - -static void v4m_init(MSFilter *f){ - v4mState *s=ms_new0(v4mState,1); - s->seqgrab=NULL; - s->sgchanvideo=NULL; - s->pgworld=NULL; - s->decomseq=0; - - s->run=FALSE; - s->mmapdbuf=NULL; - s->vsize.width=MS_VIDEO_SIZE_CIF_W; - s->vsize.height=MS_VIDEO_SIZE_CIF_H; - s->pix_fmt=MS_RGB24; - qinit(&s->rq); - s->mire=NULL; - ms_mutex_init(&s->mutex,NULL); - s->start_time=0; - s->frame_count=-1; - s->fps=15; - s->usemire=(getenv("DEBUG")!=NULL); - s->queued=0; - f->data=s; -} - - -#define BailErr(x) {err = x; if(err != noErr) goto bail;} - -pascal OSErr sgdata_callback(SGChannel c, Ptr p, long len, long *offset, long chRefCon, TimeValue time, short writeType, long refCon); -pascal OSErr sgdata_callback(SGChannel c, Ptr p, long len, long *offset, long chRefCon, TimeValue time, short writeType, long refCon) -{ -#pragma unused(offset,chRefCon,time,writeType) - - CodecFlags ignore; - v4mState *s=(v4mState *)refCon; - ComponentResult err = noErr; - - if (!s) goto bail; - - Rect boundsRect = {0, 0, s->vsize.height, s->vsize.width}; /* 240 , 320*/ - if (s->pgworld) { - - if (s->decomseq == 0) { - Rect sourceRect = { 0, 0 }; - MatrixRecord scaleMatrix; - ImageDescriptionHandle imageDesc = (ImageDescriptionHandle)NewHandle(0); - - err = SGGetChannelSampleDescription(c,(Handle)imageDesc); - BailErr(err); - - // make a scaling matrix for the sequence - sourceRect.right = (**imageDesc).width; - sourceRect.bottom = (**imageDesc).height; - RectMatrix(&scaleMatrix, &sourceRect, &boundsRect); - - err = DecompressSequenceBegin(&s->decomseq, // pointer to field to receive unique ID for sequence - imageDesc, // handle to image description structure - s->pgworld, // port for the DESTINATION image - NULL, // graphics device handle, if port is set, set to NULL - NULL, // source rectangle defining the portion of the image to decompress - &scaleMatrix, // transformation matrix - srcCopy, // transfer mode specifier - NULL, // clipping region in dest. coordinate system to use as a mask - 0, // flags - codecNormalQuality, // accuracy in decompression - bestSpeedCodec); // compressor identifier or special identifiers ie. bestSpeedCodec - BailErr(err); - - DisposeHandle((Handle)imageDesc); - imageDesc = NULL; - } - - // decompress a frame into the GWorld - can queue a frame for async decompression when passed in a completion proc - // once the image is in the GWorld it can be manipulated at will - err = DecompressSequenceFrameS(s->decomseq, // sequence ID returned by DecompressSequenceBegin - p, // pointer to compressed image data - len, // size of the buffer - 0, // in flags - &ignore, // out flags - NULL); // async completion proc - BailErr(err); - - { - unsigned line; - mblk_t *buf; - int size = s->vsize.width * s->vsize.height * 3; - buf=allocb(size,0); - - PixMap * pixmap = *GetGWorldPixMap(s->pgworld); - uint8_t * data; - unsigned rowBytes = pixmap->rowBytes & (((unsigned short) 0xFFFF) >> 2); - unsigned pixelSize = pixmap->pixelSize / 8; // Pixel size in bytes - unsigned lineOffset = rowBytes - s->vsize.width * pixelSize; - - data = (uint8_t *) GetPixBaseAddr(GetGWorldPixMap(s->pgworld)); - - for (line = 0 ; line < s->vsize.height ; line++) { - unsigned offset = line * (s->vsize.width * pixelSize + lineOffset); - memcpy(buf->b_wptr + ((line * s->vsize.width) * pixelSize), data + offset, (rowBytes - lineOffset)); - } - - if (s->pix_fmt==MS_RGB24) - { - /* Conversion from top down bottom up (BGR to RGB and flip) */ - unsigned long Index,nPixels; - unsigned char *blue; - unsigned char tmp; - short iPixelSize; - - blue=buf->b_wptr; - - nPixels=s->vsize.width*s->vsize.height; - iPixelSize=24/8; - - for(Index=0;Index!=nPixels;Index++) // For each pixel - { - tmp=*blue; - *blue=*(blue+2); - *(blue+2)=tmp; - blue+=iPixelSize; - } - } - - buf->b_wptr+=size; - //ms_mutex_lock(&s->mutex); /* called during SGIdle? */ - putq(&s->rq, buf); - //ms_mutex_unlock(&s->mutex); - } - } - -bail: - return err; -} - -static int v4m_close(v4mState *s) -{ - if(s->seqgrab) - CloseComponent(s->seqgrab); - s->seqgrab=NULL; - if (s->decomseq) - CDSequenceEnd(s->decomseq); - s->decomseq=0; - if (s->pgworld!=NULL) - DisposeGWorld(s->pgworld); - s->pgworld=NULL; - return 0; -} -unsigned char *stdToPascalString(char *buffer, char * str) { - if (strlen(str) <= 255) { - buffer[0] = strlen(str); - - memcpy(buffer + 1, str, strlen(str)); - - return (unsigned char*)buffer; - } else { - return NULL; - } -} - -static int sequence_grabber_start(v4mState *s) -{ - OSErr err = noErr; - char *camName; - - ms_warning("Opening component"); - s->seqgrab = OpenDefaultComponent(SeqGrabComponentType, 0); - if (s->seqgrab == NULL) { - ms_warning("can't get default sequence grabber component"); - return -1; - } - - ms_warning("Initializing component"); - err = SGInitialize(s->seqgrab); - if (err != noErr) { - ms_warning("can't initialize sequence grabber component"); - return -1; - } - - ms_warning("SetDataRef"); - err = SGSetDataRef(s->seqgrab, 0, 0, seqGrabDontMakeMovie); - if (err != noErr) { - ms_warning("can't set the destination data reference"); - return -1; - } - - ms_warning("Creating new channel"); - err = SGNewChannel(s->seqgrab, VideoMediaType, &s->sgchanvideo); - if (err != noErr) { - ms_warning("can't create a video channel"); - return -1; - } - - - camName = alloca(strlen(s->name) + 1); - - err = SGSetChannelDevice(s->sgchanvideo, stdToPascalString(camName, s->name)); - if (err != noErr) { - ms_warning("can't set channel device"); - return -1; - } - - short input = atoi(s->id); - - err = SGSetChannelDeviceInput(s->sgchanvideo,input); - if (err != noErr) { - ms_warning("can't set channel device input"); - return -1; - } - - ms_warning("createGWorld"); - Rect theRect = {0, 0, s->vsize.height, s->vsize.width}; - - err = QTNewGWorld(&(s->pgworld), // returned GWorld - k24BGRPixelFormat, - &theRect, // bounding rectangle - 0, // color table - NULL, // graphic device handle - 0); // flags - if (err!=noErr) - { - return -1; - } - - if(!LockPixels(GetPortPixMap(s->pgworld))) - { - v4m_close(s); - return -1; - } - - err = SGSetGWorld(s->seqgrab, s->pgworld, GetMainDevice()); - if (err != noErr) { - ms_warning("can't set GWorld"); - return -1; - } - - ms_warning("SGSetDataProc"); - err = SGSetDataProc(s->seqgrab,NewSGDataUPP(sgdata_callback),(long)s); - if (err != noErr) { - ms_warning("can't set data proc"); - return -1; - } - - ms_warning("SGSetChannelUsage"); - err = SGSetChannelUsage(s->sgchanvideo, seqGrabRecord); - if (err != noErr) { - ms_warning("can't set channel usage"); - return -1; - } - - ms_warning("SGPrepare"); - err = SGPrepare(s->seqgrab, false, true); - if (err != noErr) { - ms_warning("can't prepare sequence grabber component"); - return -1; - } - - err = SGSetChannelBounds(s->sgchanvideo, &theRect); - if (err!=noErr) - { - v4m_close(s); - return -1; - } - - err = SGStartRecord(s->seqgrab); - if (err!=noErr) - { - v4m_close(s); - return -1; - } - - return 0; -} - -static int v4m_start(MSFilter *f, void *arg) -{ - v4mState *s=(v4mState*)f->data; - int err=0; - - err = sequence_grabber_start(s); - - if (err!=0) - { - s->pix_fmt=MS_YUV420P; - s->vsize.width=MS_VIDEO_SIZE_CIF_W; - s->vsize.height=MS_VIDEO_SIZE_CIF_H; - return 0; - } - - ms_message("v4m video device opened."); - s->pix_fmt=MS_RGB24; - - return 0; -} - -static void v4m_start_capture(v4mState *s){ - if (s->seqgrab!=NULL){ - s->run=TRUE; - } -} - -static int v4m_stop(MSFilter *f, void *arg){ - v4mState *s=(v4mState*)f->data; - if (s->seqgrab!=NULL){ - ms_mutex_lock(&s->mutex); - SGStop(s->seqgrab); - v4m_close(s); - flushq(&s->rq,0); - ms_mutex_unlock(&s->mutex); - } - return 0; -} - -static void v4m_stop_capture(v4mState *s){ - if (s->run){ - s->run=FALSE; - ms_message("v4m capture stopped."); - } -} - - -static void v4m_uninit(MSFilter *f){ - v4mState *s=(v4mState*)f->data; - if (s->seqgrab!=NULL) v4m_stop(f,NULL); - //ms_free(s->dev); - flushq(&s->rq,0); - ms_mutex_destroy(&s->mutex); - freemsg(s->mire); - ms_free(s); -} - -static mblk_t * v4m_make_mire(v4mState *s){ - unsigned char *data; - int i,j,line,pos; - int patternw=s->vsize.width/6; - int patternh=s->vsize.height/6; - int red,green=0,blue=0; - if (s->mire==NULL){ - s->mire=allocb(s->vsize.width*s->vsize.height*3,0); - s->mire->b_wptr=s->mire->b_datap->db_lim; - } - data=s->mire->b_rptr; - for (i=0;ivsize.height;++i){ - line=i*s->vsize.width*3; - if ( ((i+s->frame_ind)/patternh) & 0x1) red=255; - else red= 0; - for (j=0;jvsize.width;++j){ - pos=line+(j*3); - - if ( ((j+s->frame_ind)/patternw) & 0x1) blue=255; - else blue= 0; - - data[pos]=red; - data[pos+1]=green; - data[pos+2]=blue; - } - } - s->frame_ind++; - return s->mire; -} - -static mblk_t * v4m_make_nowebcam(v4mState *s){ - if (s->mire==NULL && s->frame_ind==0){ - s->mire=ms_load_nowebcam(&s->vsize, -1); - } - s->frame_ind++; - return s->mire; -} - -static void v4m_process(MSFilter * obj){ - v4mState *s=(v4mState*)obj->data; - uint32_t timestamp; - int cur_frame; - if (s->frame_count==-1){ - s->start_time=obj->ticker->time; - s->frame_count=0; - } - - ms_mutex_lock(&s->mutex); - - if (s->seqgrab!=NULL) - { - SGIdle(s->seqgrab); - } - - cur_frame=((obj->ticker->time-s->start_time)*s->fps/1000.0); - if (cur_frame>=s->frame_count){ - mblk_t *om=NULL; - /*keep the most recent frame if several frames have been captured */ - if (s->seqgrab!=NULL){ - om=getq(&s->rq); - }else{ - if (s->pix_fmt==MS_YUV420P - && s->vsize.width==MS_VIDEO_SIZE_CIF_W - && s->vsize.height==MS_VIDEO_SIZE_CIF_H) - { - if (s->usemire){ - om=dupmsg(v4m_make_mire(s)); - }else { - mblk_t *tmpm=v4m_make_nowebcam(s); - if (tmpm) om=dupmsg(tmpm); - } - } - } - if (om!=NULL){ - timestamp=obj->ticker->time*90;/* rtp uses a 90000 Hz clockrate for video*/ - mblk_set_timestamp_info(om,timestamp); - mblk_set_marker_info(om,TRUE); - ms_queue_put(obj->outputs[0],om); - /*ms_message("picture sent");*/ - s->frame_count++; - } - }else flushq(&s->rq,0); - - ms_mutex_unlock(&s->mutex); -} - -static void v4m_preprocess(MSFilter *f){ - v4mState *s=(v4mState*)f->data; - - if(s->seqgrab == NULL) - v4m_start(f,NULL); - - v4m_start_capture(s); -} - -static void v4m_postprocess(MSFilter *f){ - v4mState *s=(v4mState*)f->data; - v4m_stop_capture(s); -} - -static int v4m_set_fps(MSFilter *f, void *arg){ - v4mState *s=(v4mState*)f->data; - s->fps=*((float*)arg); - s->frame_count=-1; - return 0; -} - -static int v4m_get_pix_fmt(MSFilter *f,void *arg){ - v4mState *s=(v4mState*)f->data; - *((MSPixFmt*)arg) = s->pix_fmt; - return 0; -} - -static int v4m_set_vsize(MSFilter *f, void *arg){ - v4mState *s=(v4mState*)f->data; - s->vsize=*((MSVideoSize*)arg); - return 0; -} - -static int v4m_get_vsize(MSFilter *f, void *arg){ - v4mState *s=(v4mState*)f->data; - *(MSVideoSize*)arg=s->vsize; - return 0; -} - -static MSFilterMethod methods[]={ - { MS_FILTER_SET_FPS , v4m_set_fps }, - { MS_FILTER_GET_PIX_FMT , v4m_get_pix_fmt }, - { MS_FILTER_SET_VIDEO_SIZE, v4m_set_vsize }, - { MS_V4L_START , v4m_start }, - { MS_V4L_STOP , v4m_stop }, - { MS_FILTER_GET_VIDEO_SIZE, v4m_get_vsize }, - { 0 , NULL } -}; - -MSFilterDesc ms_v4m_desc={ - .id=MS_V4L_ID, - .name="MSV4m", - .text="A video for macosx compatible source filter to stream pictures.", - .ninputs=0, - .noutputs=1, - .category=MS_FILTER_OTHER, - .init=v4m_init, - .preprocess=v4m_preprocess, - .process=v4m_process, - .postprocess=v4m_postprocess, - .uninit=v4m_uninit, - .methods=methods -}; - -MS_FILTER_DESC_EXPORT(ms_v4m_desc) - -static void ms_v4m_detect(MSWebCamManager *obj); - -static void ms_v4m_cam_init(MSWebCam *cam) -{ - -} - -static int v4m_set_device(MSFilter *f, void *arg){ - v4mState *s=(v4mState*)f->data; - - s->id = (char*) malloc(sizeof(char)*strlen((char*)arg)); - strcpy(s->id,(char*)arg); - - return 0; -} - -static int v4m_set_name(MSFilter *f, void *arg){ - v4mState *s=(v4mState*)f->data; - - s->name = (char*) malloc(sizeof(char)*strlen((char*)arg)); - strcpy(s->name,(char*)arg); - - return 0; -} - -static MSFilter *ms_v4m_create_reader(MSWebCam *obj) -{ - MSFilter *f= ms_filter_new_from_desc(&ms_v4m_desc); - - v4m_set_device(f,obj->id); - v4m_set_name(f,obj->data); - - return f; -} - -MSWebCamDesc ms_v4m_cam_desc={ - "VideoForMac grabber", - &ms_v4m_detect, - &ms_v4m_cam_init, - &ms_v4m_create_reader, - NULL -}; - -char * genDeviceName(unsigned char * device,short inputIndex, unsigned char * input) -{ - static char buffer[32]; - snprintf(buffer,sizeof(buffer), "%s:%d:%s", device,inputIndex,input); - return buffer; -} - -/* - * convert pascal string to c string - */ -static char* pas2cstr(const char *pstr) -{ - char *cstr = ms_malloc(pstr[0] + 1); - memcpy(cstr, pstr+1, pstr[0]); - cstr[(int)pstr[0]] = 0; - - return cstr; - -} - -static void ms_v4m_detect(MSWebCamManager *obj){ - - - SGDeviceList sgDeviceList; - OSErr err = noErr; - SGChannel _SGChanVideo; - - SeqGrabComponent _seqGrab; - NSApplicationLoad(); - - if (_SGChanVideo) { - SGDisposeChannel(_seqGrab, _SGChanVideo); - } - - if (_seqGrab) { - CloseComponent(_seqGrab); - } - - _seqGrab = OpenDefaultComponent(SeqGrabComponentType, 0); - if (_seqGrab == NULL) { - ms_warning("can't get default sequence grabber component"); - return; - } - - err = SGInitialize(_seqGrab); - if (err != noErr) { - ms_warning("can't initialize sequence grabber component"); - return; - } - - err = SGSetDataRef(_seqGrab, 0, 0, seqGrabDontMakeMovie); - if (err != noErr) { - ms_warning("can't set the destination data reference"); - return; - } - - err = SGNewChannel(_seqGrab, VideoMediaType, &_SGChanVideo); - if (err != noErr) { - ms_warning("can't create a video channel"); - return; - } - - err = SGGetChannelDeviceList(_SGChanVideo, sgDeviceListIncludeInputs, &sgDeviceList); - if (err != noErr) - ms_warning("can't get device list"); - - register short i = 0; - for (; i < (*sgDeviceList)->count ; i++) - { - if (!((*sgDeviceList)->entry[i].flags & sgDeviceNameFlagDeviceUnavailable)) - { - SGDeviceInputList inputs = (*sgDeviceList)->entry[i].inputs; - - register short j = 0; - for (; j < (*inputs)->count ; j++) - { - if (!((*inputs)->entry[j].flags & sgDeviceInputNameFlagInputUnavailable)) - { - MSWebCam *cam=ms_web_cam_new(&ms_v4m_cam_desc); - char * buffer = (char*)malloc(sizeof(char)*32); - sprintf(buffer,"%d",(*inputs)->selectedIndex); - cam->name=pas2cstr((*inputs)->entry[j].name); - cam->id = buffer; - cam->data = pas2cstr((*sgDeviceList)->entry[i].name); - ms_web_cam_manager_add_cam(obj,cam); - ms_warning("web cam found : %s:%s:%s",cam->name,cam->id,cam->data); - } - } - } - } - - SGDisposeDeviceList(_seqGrab, sgDeviceList); - - - if (_SGChanVideo) { - SGDisposeChannel(_seqGrab, _SGChanVideo); - } - - if (_seqGrab) { - CloseComponent(_seqGrab); - } -} - -#endif diff --git a/linphone/mediastreamer2/src/msvideo.c b/linphone/mediastreamer2/src/msvideo.c deleted file mode 100644 index 7c1abeb25..000000000 --- a/linphone/mediastreamer2/src/msvideo.c +++ /dev/null @@ -1,252 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/msvideo.h" - -static void yuv_buf_init(YuvBuf *buf, int w, int h, uint8_t *ptr){ - int ysize,usize; - ysize=w*h; - usize=ysize/4; - buf->w=w; - buf->h=h; - buf->planes[0]=ptr; - buf->planes[1]=buf->planes[0]+ysize; - buf->planes[2]=buf->planes[1]+usize; - buf->planes[3]=0; - buf->strides[0]=w; - buf->strides[1]=w/2; - buf->strides[2]=buf->strides[1]; - buf->strides[3]=0; -} - -int yuv_buf_init_from_mblk(YuvBuf *buf, mblk_t *m){ - int size=m->b_wptr-m->b_rptr; - int w,h; - if (size==(MS_VIDEO_SIZE_QCIF_W*MS_VIDEO_SIZE_QCIF_H*3)/2){ - w=MS_VIDEO_SIZE_QCIF_W; - h=MS_VIDEO_SIZE_QCIF_H; - }else if (size==(MS_VIDEO_SIZE_CIF_W*MS_VIDEO_SIZE_CIF_H*3)/2){ - w=MS_VIDEO_SIZE_CIF_W; - h=MS_VIDEO_SIZE_CIF_H; - }else if (size==(MS_VIDEO_SIZE_QVGA_W*MS_VIDEO_SIZE_QVGA_H*3)/2){ - w=MS_VIDEO_SIZE_QVGA_W; - h=MS_VIDEO_SIZE_QVGA_H; - }else if (size==(MS_VIDEO_SIZE_VGA_W*MS_VIDEO_SIZE_VGA_H*3)/2){ - w=MS_VIDEO_SIZE_VGA_W; - h=MS_VIDEO_SIZE_VGA_H; - }else if (size==(MS_VIDEO_SIZE_4CIF_W*MS_VIDEO_SIZE_4CIF_H*3)/2){ - w=MS_VIDEO_SIZE_4CIF_W; - h=MS_VIDEO_SIZE_4CIF_H; - }else if (size==(MS_VIDEO_SIZE_SVGA_W*MS_VIDEO_SIZE_SVGA_H*3)/2){ - w=MS_VIDEO_SIZE_SVGA_W; - h=MS_VIDEO_SIZE_SVGA_H; - }else if (size==(MS_VIDEO_SIZE_SQCIF_W*MS_VIDEO_SIZE_SQCIF_H*3)/2){ - w=MS_VIDEO_SIZE_SQCIF_W; - h=MS_VIDEO_SIZE_SQCIF_H; - }else if (size==(MS_VIDEO_SIZE_QQVGA_W*MS_VIDEO_SIZE_QQVGA_H*3)/2){ - w=MS_VIDEO_SIZE_QQVGA_W; - h=MS_VIDEO_SIZE_QQVGA_H; - }else if (size==(MS_VIDEO_SIZE_NS1_W*MS_VIDEO_SIZE_NS1_H*3)/2){ - w=MS_VIDEO_SIZE_NS1_W; - h=MS_VIDEO_SIZE_NS1_H; - }else if (size==(MS_VIDEO_SIZE_QSIF_W*MS_VIDEO_SIZE_QSIF_H*3)/2){ - w=MS_VIDEO_SIZE_QSIF_W; - h=MS_VIDEO_SIZE_QSIF_H; - }else if (size==(MS_VIDEO_SIZE_SIF_W*MS_VIDEO_SIZE_SIF_H*3)/2){ - w=MS_VIDEO_SIZE_SIF_W; - h=MS_VIDEO_SIZE_SIF_H; - }else if (size==(MS_VIDEO_SIZE_4SIF_W*MS_VIDEO_SIZE_4SIF_H*3)/2){ - w=MS_VIDEO_SIZE_4SIF_W; - h=MS_VIDEO_SIZE_4SIF_H; - }else if (size==(MS_VIDEO_SIZE_288P_W*MS_VIDEO_SIZE_288P_H*3)/2){ - w=MS_VIDEO_SIZE_288P_W; - h=MS_VIDEO_SIZE_288P_H; - }else if (size==(MS_VIDEO_SIZE_448P_W*MS_VIDEO_SIZE_448P_H*3)/2){ - w=MS_VIDEO_SIZE_448P_W; - h=MS_VIDEO_SIZE_448P_H; - }else if (size==(MS_VIDEO_SIZE_576P_W*MS_VIDEO_SIZE_576P_H*3)/2){ - w=MS_VIDEO_SIZE_576P_W; - h=MS_VIDEO_SIZE_576P_H; - }else if (size==(MS_VIDEO_SIZE_720P_W*MS_VIDEO_SIZE_720P_H*3)/2){ - w=MS_VIDEO_SIZE_720P_W; - h=MS_VIDEO_SIZE_720P_H; - }else if (size==(MS_VIDEO_SIZE_1080P_W*MS_VIDEO_SIZE_1080P_H*3)/2){ - w=MS_VIDEO_SIZE_1080P_W; - h=MS_VIDEO_SIZE_1080P_H; - }else if (size==(MS_VIDEO_SIZE_SDTV_W*MS_VIDEO_SIZE_SDTV_H*3)/2){ - w=MS_VIDEO_SIZE_SDTV_W; - h=MS_VIDEO_SIZE_SDTV_H; - }else if (size==(MS_VIDEO_SIZE_HDTVP_W*MS_VIDEO_SIZE_HDTVP_H*3)/2){ - w=MS_VIDEO_SIZE_HDTVP_W; - h=MS_VIDEO_SIZE_HDTVP_H; - }else if (size==(MS_VIDEO_SIZE_XGA_W*MS_VIDEO_SIZE_XGA_H*3)/2){ - w=MS_VIDEO_SIZE_XGA_W; - h=MS_VIDEO_SIZE_XGA_H; - }else if (size==(MS_VIDEO_SIZE_WXGA_W*MS_VIDEO_SIZE_WXGA_H*3)/2){ - w=MS_VIDEO_SIZE_WXGA_W; - h=MS_VIDEO_SIZE_WXGA_H; - }else if (size==(160*112*3)/2){/*format used by econf*/ - w=160; - h=112; - }else if (size==(320*200*3)/2){/*format used by gTalk */ - w=320; - h=200; - }else { - ms_error("Unsupported image size: size=%i (bug somewhere !)",size); - return -1; - } - yuv_buf_init(buf,w,h,m->b_rptr); - return 0; -} - -void yuv_buf_init_from_mblk_with_size(YuvBuf *buf, mblk_t *m, int w, int h){ - yuv_buf_init(buf,w,h,m->b_rptr); -} - -mblk_t * yuv_buf_alloc(YuvBuf *buf, int w, int h){ - int size=(w*h*3)/2; - mblk_t *msg=allocb(size,0); - yuv_buf_init(buf,w,h,msg->b_wptr); - msg->b_wptr+=size; - return msg; -} - -static void plane_copy(const uint8_t *src_plane, int src_stride, - uint8_t *dst_plane, int dst_stride, MSVideoSize roi){ - int i; - for(i=0;iplanes[0],buf->strides[0],buf->w,buf->h); - plane_mirror(buf->planes[1],buf->strides[1],buf->w/2,buf->h/2); - plane_mirror(buf->planes[2],buf->strides[2],buf->w/2,buf->h/2); -} - -#ifndef MAKEFOURCC -#define MAKEFOURCC(a,b,c,d) ((d)<<24 | (c)<<16 | (b)<<8 | (a)) -#endif - -MSPixFmt ms_fourcc_to_pix_fmt(uint32_t fourcc){ - MSPixFmt ret; - switch (fourcc){ - case MAKEFOURCC('I','4','2','0'): - ret=MS_YUV420P; - break; - case MAKEFOURCC('Y','U','Y','2'): - ret=MS_YUY2; - break; - case MAKEFOURCC('Y','U','Y','V'): - ret=MS_YUYV; - break; - case MAKEFOURCC('U','Y','V','Y'): - ret=MS_UYVY; - break; - case 0: /*BI_RGB on windows*/ - ret=MS_RGB24; - break; - default: - ret=MS_PIX_FMT_UNKNOWN; - } - return ret; -} - -void rgb24_revert(uint8_t *buf, int w, int h, int linesize){ - uint8_t *p,*pe; - int i,j; - uint8_t *end=buf+((h-1)*linesize); - uint8_t exch; - p=buf; - pe=end-1; - for(i=0;iwidth!=0;++p){ - if (ms_video_size_greater_than(vs,*p) && !ms_video_size_equal(vs,*p)){ - ret=*p; - }else return ret; - } - return ret; -}; diff --git a/linphone/mediastreamer2/src/msvolume.c b/linphone/mediastreamer2/src/msvolume.c deleted file mode 100644 index 8d1df08d6..000000000 --- a/linphone/mediastreamer2/src/msvolume.c +++ /dev/null @@ -1,431 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifdef HAVE_CONFIG_H -#include "mediastreamer-config.h" -#endif - -#include "mediastreamer2/msvolume.h" -#include "mediastreamer2/msticker.h" -#include - -#ifdef HAVE_SPEEXDSP -#include -#endif - -static const float max_e=32767*32767; -static const float coef=0.1; -static const float gain_k=0.02; -static const float en_weight=4.0; -static const float noise_thres=0.1; - - -typedef struct Volume{ - float energy; - float norm_en; - float gain; /*the one really applied, smoothed by noise gate and echo limiter*/ - float static_gain; /*the one fixed by the user*/ - float gain_k; - float thres; - float force; - float target_gain; /*the target gain choosed by echo limiter and noise gate*/ - float last_peer_en; - int sustain_time; /* time in ms for which echo limiter remains active after resuming from speech to silence.*/ - uint64_t sustain_start; - MSFilter *peer; -#ifdef HAVE_SPEEXDSP - SpeexPreprocessState *speex_pp; -#endif - int sample_rate; - int nsamples; - int ng_cut_time; /*noise gate cut time, after last speech detected*/ - int ng_noise_dur; - float ng_threshold; - float ng_floorgain; - MSBufferizer *buffer; - bool_t ea_active; - bool_t agc_enabled; - bool_t noise_gate_enabled; -}Volume; - -static void volume_init(MSFilter *f){ - Volume *v=(Volume*)ms_new(Volume,1); - v->energy=0; - v->norm_en=0; - v->static_gain=v->gain=1; - v->ea_active=FALSE; - v->gain_k=gain_k; - v->thres=noise_thres; - v->force=en_weight; - v->peer=NULL; - v->last_peer_en=0; - v->sustain_time=200; - v->sustain_start=0; - v->agc_enabled=FALSE; - v->buffer=ms_bufferizer_new(); - v->sample_rate=8000; - v->nsamples=80; - v->noise_gate_enabled=FALSE; - v->ng_cut_time=100;/*milliseconds*/ - v->ng_noise_dur=0; - v->ng_threshold=noise_thres; - v->ng_floorgain=0; -#ifdef HAVE_SPEEXDSP - v->speex_pp=NULL; -#endif - f->data=v; -} - -static void volume_uninit(MSFilter *f){ - Volume *v=(Volume*)f->data; -#ifdef HAVE_SPEEXDSP - if (v->speex_pp) - speex_preprocess_state_destroy(v->speex_pp); -#endif - ms_bufferizer_destroy(v->buffer); - ms_free(f->data); -} - -static int volume_get(MSFilter *f, void *arg){ - float *farg=(float*)arg; - Volume *v=(Volume*)f->data; - *farg=10*ortp_log10f((v->energy+1)/max_e); - - return 0; -} - -static int volume_set_sample_rate(MSFilter *f, void *arg){ - Volume *v=(Volume*)f->data; - v->sample_rate=*(int*)arg; - return 0; -} - -static int volume_get_linear(MSFilter *f, void *arg){ - float *farg=(float*)arg; - Volume *v=(Volume*)f->data; - *farg=(v->energy+1)/max_e; - return 0; -} -#ifdef HAVE_SPEEXDSP -static void volume_agc_process(Volume *v, mblk_t *om){ - speex_preprocess_run(v->speex_pp,(int16_t*)om->b_rptr); -} -#else - -static void volume_agc_process(Volume *v, mblk_t *om){ -} - -#endif - - -static inline float compute_gain(float static_gain, float energy, float weight){ - float ret=static_gain*(1 - (energy*weight)); - if (ret<0) ret=0; - return ret; -} - -/* -The principle of this algorithm is that we apply a gain to the input signal which is opposite to the -energy measured by the peer MSVolume. -For example if some noise is played by the speaker, then the signal captured by the microphone will be lowered. -The gain changes smoothly when the peer energy is decreasing, but is immediately changed when the peer energy is -increasing. -*/ - -static void volume_echo_avoider_process(Volume *v, uint64_t curtime){ - float peer_e; - float gain; - ms_filter_call_method(v->peer,MS_VOLUME_GET_LINEAR,&peer_e); - peer_e=sqrt(peer_e); - if (v->ea_active){ - if (peer_e>v->thres){ - /*lower our output*/ - gain=compute_gain(v->static_gain,peer_e,v->force); - if (peer_e>v->last_peer_en) - v->gain=gain; - }else { - v->sustain_start=curtime; - v->ea_active=FALSE; - gain=v->gain; - } - }else{ - int peer_active=FALSE; - ms_filter_call_method(v->peer,MS_VOLUME_GET_EA_STATE,&peer_active); - if (peer_e>v->thres && ! peer_active){ - /*lower our output*/ - gain=compute_gain(v->static_gain,peer_e,v->force); - v->ea_active=TRUE; - v->gain=gain; - }else { - if (curtime!=0 && (curtime-v->sustain_start)sustain_time){ - gain=v->gain; - }else{/*restore normal gain*/ - gain=v->static_gain; - v->sustain_start=0; - } - } - } - v->last_peer_en=peer_e; - v->target_gain=gain; - ms_message("ea_active=%i, peer_e=%f gain=%f gain_k=%f force=%f",v->ea_active,peer_e,v->gain, v->gain_k,v->force); -} - -static void volume_noise_gate_process(Volume *v , float energy, mblk_t *om){ - int nsamples=((om->b_wptr-om->b_rptr)/2); - if ((energy/max_e)ng_threshold){ - v->ng_noise_dur+=(nsamples*1000)/v->sample_rate; - if (v->ng_noise_dur>v->ng_cut_time){ - v->target_gain=v->ng_floorgain; - } - }else{ - v->ng_noise_dur=0; - /*let the target gain unchanged, ie let the echo-limiter choose the gain*/ - } -} - -static int volume_set_gain(MSFilter *f, void *arg){ - float *farg=(float*)arg; - Volume *v=(Volume*)f->data; - v->gain=v->static_gain=v->target_gain=*farg; - return 0; -} - - -static int volume_get_ea_state(MSFilter *f, void *arg){ - int *barg=(int*)arg; - Volume *v=(Volume*)f->data; - *barg=v->ea_active; - return 0; -} - -static int volume_set_peer(MSFilter *f, void *arg){ - MSFilter *p=(MSFilter*)arg; - Volume *v=(Volume*)f->data; - v->peer=p; - return 0; -} - -static int volume_set_agc(MSFilter *f, void *arg){ - Volume *v=(Volume*)f->data; - v->agc_enabled=*(int*)arg; - return 0; -} - -static int volume_set_ea_threshold(MSFilter *f, void*arg){ - Volume *v=(Volume*)f->data; - float val=*(float*)arg; - if (val<0 || val>1) { - ms_error("Error: threshold must be in range [0..1]"); - return -1; - } - v->thres=val; - return 0; -} - -static int volume_set_ea_speed(MSFilter *f, void*arg){ - Volume *v=(Volume*)f->data; - float val=*(float*)arg; - if (val<0 || val>1) { - ms_error("Error: speed must be in range [0..1]"); - return -1; - } - v->gain_k=val; - return 0; -} - -static int volume_set_ea_force(MSFilter *f, void*arg){ - Volume *v=(Volume*)f->data; - float val=*(float*)arg; - v->force=val; - return 0; -} - -static int volume_set_ea_sustain(MSFilter *f, void *arg){ - Volume *v=(Volume*)f->data; - v->sustain_time=*(int*)arg; - return 0; -} - -static int volume_enable_noise_gate(MSFilter *f, void *arg){ - Volume *v=(Volume*)f->data; - v->noise_gate_enabled=*(int*)arg; - return 0; -} - -static int volume_set_noise_gate_threshold(MSFilter *f, void *arg){ - Volume *v=(Volume*)f->data; - v->ng_threshold=*(float*)arg; - return 0; -} - -static int volume_set_noise_gate_floorgain(MSFilter *f, void *arg){ - Volume *v=(Volume*)f->data; - v->ng_floorgain=*(float*)arg; - return 0; -} - -static inline int16_t saturate(float val){ - return (val>32767) ? 32767 : ( (val<-32767) ? -32767 : val); -} - -static float update_energy(int16_t *signal, int numsamples, float last_energy_value){ - int i; - float en=last_energy_value; - for (i=0;itarget_gain; - - if (gain==1 && v->gain==1) return; - v->gain=(v->gain*(1-v->gain_k)) + (v->gain_k*gain); - for ( sample=(int16_t*)m->b_rptr; - sample<(int16_t*)m->b_wptr; - ++sample){ - float s=*sample; - *sample=saturate(s*v->gain); - } -} - -static void volume_preprocess(MSFilter *f){ - Volume *v=(Volume*)f->data; - /*process agc by chunks of 10 ms*/ - v->nsamples=(int)(0.01*(float)v->sample_rate); - if (v->agc_enabled){ - ms_message("AGC is enabled."); -#ifdef HAVE_SPEEXDSP - if (v->speex_pp==NULL){ - int tmp=1; - v->speex_pp=speex_preprocess_state_init(v->nsamples,v->sample_rate); - if (speex_preprocess_ctl(v->speex_pp,SPEEX_PREPROCESS_SET_AGC,&tmp)==-1){ - ms_warning("Speex AGC is not available."); - } - tmp=0; - speex_preprocess_ctl(v->speex_pp,SPEEX_PREPROCESS_SET_VAD,&tmp); - speex_preprocess_ctl(v->speex_pp,SPEEX_PREPROCESS_SET_DENOISE,&tmp); - speex_preprocess_ctl(v->speex_pp,SPEEX_PREPROCESS_SET_DEREVERB,&tmp); - } -#else - ms_error("No AGC possible, mediastreamer2 was compiled without libspeexdsp."); -#endif - } -} - - - -static void volume_process(MSFilter *f){ - mblk_t *m; - Volume *v=(Volume*)f->data; - float en=v->energy; - - if (v->agc_enabled){ - mblk_t *om; - int nbytes=v->nsamples*2; - ms_bufferizer_put_from_queue(v->buffer,f->inputs[0]); - while(ms_bufferizer_get_avail(v->buffer)>=nbytes){ - om=allocb(nbytes,0); - ms_bufferizer_read(v->buffer,om->b_wptr,nbytes); - om->b_wptr+=nbytes; - en=update_energy((int16_t*)om->b_rptr,v->nsamples,en); - volume_agc_process(v,om); - - if (v->peer){ - volume_echo_avoider_process(v,f->ticker->time); - }else v->target_gain=v->static_gain; - - if (v->noise_gate_enabled) - volume_noise_gate_process(v,en,om); - apply_gain(v,om); - ms_queue_put(f->outputs[0],om); - } - }else{ - /*light processing: no agc. Work in place in the input buffer*/ - while((m=ms_queue_get(f->inputs[0]))!=NULL){ - en=update_energy((int16_t*)m->b_rptr,(m->b_wptr-m->b_rptr)/2,en); - if (v->peer){ - volume_echo_avoider_process(v,f->ticker->time); - }else v->target_gain=v->static_gain; - - if (v->noise_gate_enabled) - volume_noise_gate_process(v,en,m); - apply_gain(v,m); - ms_queue_put(f->outputs[0],m); - } - } - v->energy=en; -} - -static MSFilterMethod methods[]={ - { MS_VOLUME_GET , volume_get }, - { MS_VOLUME_GET_LINEAR , volume_get_linear }, - { MS_VOLUME_SET_GAIN , volume_set_gain }, - { MS_VOLUME_GET_EA_STATE , volume_get_ea_state }, - { MS_VOLUME_SET_PEER , volume_set_peer }, - { MS_VOLUME_SET_EA_THRESHOLD , volume_set_ea_threshold }, - { MS_VOLUME_SET_EA_SPEED , volume_set_ea_speed }, - { MS_VOLUME_SET_EA_FORCE , volume_set_ea_force }, - { MS_VOLUME_SET_EA_SUSTAIN, volume_set_ea_sustain }, - { MS_FILTER_SET_SAMPLE_RATE, volume_set_sample_rate }, - { MS_VOLUME_ENABLE_AGC , volume_set_agc }, - { MS_VOLUME_ENABLE_NOISE_GATE, volume_enable_noise_gate}, - { MS_VOLUME_SET_NOISE_GATE_THRESHOLD, volume_set_noise_gate_threshold}, - { MS_VOLUME_SET_NOISE_GATE_FLOORGAIN, volume_set_noise_gate_floorgain}, - { 0 , NULL } -}; - -#ifndef _MSC_VER -MSFilterDesc ms_volume_desc={ - .name="MSVolume", - .text=N_("A filter that controls and measure sound volume"), - .id=MS_VOLUME_ID, - .category=MS_FILTER_OTHER, - .ninputs=1, - .noutputs=1, - .init=volume_init, - .uninit=volume_uninit, - .preprocess=volume_preprocess, - .process=volume_process, - .methods=methods -}; -#else -MSFilterDesc ms_volume_desc={ - MS_VOLUME_ID, - "MSVolume", - N_("A filter that controls and measure sound volume"), - MS_FILTER_OTHER, - NULL, - 1, - 1, - volume_init, - volume_preprocess, - volume_process, - NULL, - volume_uninit, - methods -}; -#endif - -MS_FILTER_DESC_EXPORT(ms_volume_desc) - - diff --git a/linphone/mediastreamer2/src/mswebcam.c b/linphone/mediastreamer2/src/mswebcam.c deleted file mode 100644 index fa360ec4e..000000000 --- a/linphone/mediastreamer2/src/mswebcam.c +++ /dev/null @@ -1,137 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/mswebcam.h" -#ifdef HAVE_CONFIG_H -#include "mediastreamer-config.h" -#endif - -#include "mediastreamer2/msfilter.h" - -static MSWebCamManager *scm=NULL; - -static MSWebCamManager * create_manager(){ - MSWebCamManager *obj=(MSWebCamManager *)ms_new(MSWebCamManager,1); - obj->cams=NULL; - obj->descs=NULL; - return obj; -} - -void ms_web_cam_manager_destroy(void){ - if (scm!=NULL){ - ms_list_for_each(scm->cams,(void (*)(void*))ms_web_cam_destroy); - ms_list_free(scm->cams); - ms_list_free(scm->descs); - } - ms_free(scm); - scm=NULL; -} - -MSWebCamManager * ms_web_cam_manager_get(void){ - if (scm==NULL) scm=create_manager(); - return scm; -} - -MSWebCam * ms_web_cam_manager_get_cam(MSWebCamManager *m, const char *id){ - MSList *elem; - for (elem=m->cams;elem!=NULL;elem=elem->next){ - MSWebCam *cam=(MSWebCam*)elem->data; - if (id==NULL) return cam; - if (strcmp(ms_web_cam_get_string_id(cam),id)==0) return cam; - } - if (id!=NULL) ms_warning("no camera with id %s",id); - return NULL; -} - -MSWebCam * ms_web_cam_manager_get_default_cam(MSWebCamManager *m){ - if (m->cams!=NULL) - return (MSWebCam*)m->cams->data; - return NULL; -} - -const MSList * ms_web_cam_manager_get_list(MSWebCamManager *m){ - return m->cams; -} - -void ms_web_cam_manager_add_cam(MSWebCamManager *m, MSWebCam *c){ - ms_message("Webcam %s added",ms_web_cam_get_string_id(c)); - m->cams=ms_list_append(m->cams,c); -} - -void ms_web_cam_manager_prepend_cam(MSWebCamManager *m, MSWebCam *c){ - ms_message("Webcam %s prepended",ms_web_cam_get_string_id(c)); - m->cams=ms_list_prepend(m->cams,c); -} - -static void cam_detect(MSWebCamManager *m, MSWebCamDesc *desc){ - if (desc->detect!=NULL) - desc->detect(m); -} - -void ms_web_cam_manager_register_desc(MSWebCamManager *m, MSWebCamDesc *desc){ - m->descs=ms_list_append(m->descs,desc); - cam_detect(m,desc); -} - -void ms_web_cam_manager_reload(MSWebCamManager *m){ - MSList *elem; - ms_list_for_each(m->cams,(void (*)(void*))ms_web_cam_destroy); - ms_list_free(m->cams); - m->cams=NULL; - for(elem=m->descs;elem!=NULL;elem=elem->next) - cam_detect(m,(MSWebCamDesc*)elem->data); -} - -MSWebCam * ms_web_cam_new(MSWebCamDesc *desc){ - MSWebCam *obj=(MSWebCam *)ms_new(MSWebCam,1); - obj->desc=desc; - obj->name=NULL; - obj->data=NULL; - obj->id=NULL; - if (desc->init!=NULL) - desc->init(obj); - return obj; -} - -const char *ms_web_cam_get_driver_type(const MSWebCam *obj){ - return obj->desc->driver_type; -} - -const char *ms_web_cam_get_name(const MSWebCam *obj){ - return obj->name; -} - -const char *ms_web_cam_get_string_id(MSWebCam *obj){ - if (obj->id==NULL) obj->id=ms_strdup_printf("%s: %s",obj->desc->driver_type,obj->name); - return obj->id; -} - -struct _MSFilter * ms_web_cam_create_reader(MSWebCam *obj){ - if (obj->desc->create_reader!=NULL) - return obj->desc->create_reader(obj); - else ms_warning("ms_web_cam_create_reader: unimplemented by %s wrapper",obj->desc->driver_type); - return NULL; -} - -void ms_web_cam_destroy(MSWebCam *obj){ - if (obj->desc->uninit!=NULL) obj->desc->uninit(obj); - if (obj->name!=NULL) ms_free(obj->name); - if (obj->id!=NULL) ms_free(obj->id); - ms_free(obj); -} diff --git a/linphone/mediastreamer2/src/mtu.c b/linphone/mediastreamer2/src/mtu.c deleted file mode 100644 index baf242cfa..000000000 --- a/linphone/mediastreamer2/src/mtu.c +++ /dev/null @@ -1,249 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -/* mtu.c : discover the mtu automatically */ - -#include "mediastreamer2/mscommon.h" - - -#if defined(WIN32) && !defined(_WIN32_WCE) - -HINSTANCE m_IcmpInst = NULL; - -typedef struct ip_option_information { - UCHAR Ttl; - UCHAR Tos; - UCHAR Flags; - UCHAR OptionsSize; - PUCHAR OptionsData; -} IP_OPTION_INFORMATION, * PIP_OPTION_INFORMATION; - -typedef BOOL (WINAPI *ICMPCLOSEHANDLE)(HANDLE IcmpHandle); -typedef HANDLE (WINAPI *ICMPCREATEFILE)(VOID); -typedef DWORD (WINAPI *ICMPSENDECHO)(HANDLE IcmpHandle,ULONG DestinationAddress, LPVOID RequestData, WORD RequestSize, PIP_OPTION_INFORMATION RequestOptions, LPVOID ReplyBuffer, DWORD ReplySize, DWORD Timeout); - -ICMPCLOSEHANDLE pIcmpCloseHandle = NULL; -ICMPCREATEFILE pIcmpCreateFile = NULL; -ICMPSENDECHO pIcmpSendEcho = NULL; - -#define IP_FLAG_DF 0x2 // Don't fragment this packet. -#define IP_OPT_ROUTER_ALERT 0x94 // Router Alert Option - -#define IP_STATUS_BASE 11000 -#define IP_PACKET_TOO_BIG (IP_STATUS_BASE + 9) -#define IP_REQ_TIMED_OUT (IP_STATUS_BASE + 10) - -static int mtus[] = { - 1500, // Ethernet, Point-to-Point (default) - 1492, // IEEE 802.3 - 1006, // SLIP, ARPANET - 576, // X.25 Networks - 544, // DEC IP Portal - 512, // NETBIOS - 508, // IEEE 802/Source-Rt Bridge, ARCNET - 296, // Point-to-Point (low delay) - 68, // Official minimum - 0 -}; - -int ms_discover_mtu(const char *host) -{ - int i; - - struct addrinfo hints,*ai=NULL; - char port[10]; - char ipaddr[INET6_ADDRSTRLEN]; - int err; - - HANDLE hIcmp; - unsigned long target_addr; - - struct ip_option_information ip_opts; - unsigned char reply_buffer[10000]; - - if (!m_IcmpInst) - { - m_IcmpInst = LoadLibrary("icmp.dll"); - if (m_IcmpInst) - { - pIcmpCloseHandle = (ICMPCLOSEHANDLE)GetProcAddress(m_IcmpInst, "IcmpCloseHandle"); - pIcmpCreateFile = (ICMPCREATEFILE) GetProcAddress(m_IcmpInst, "IcmpCreateFile"); - pIcmpSendEcho = (ICMPSENDECHO) GetProcAddress(m_IcmpInst, "IcmpSendEcho"); - } - } - - hIcmp = pIcmpCreateFile(); - - memset(&hints,0,sizeof(hints)); - hints.ai_family = PF_INET; - hints.ai_socktype = SOCK_DGRAM; - - snprintf(port,sizeof(port),"0"); - err=getaddrinfo(host,port,&hints,&ai); - if (err!=0){ - pIcmpCloseHandle( hIcmp ); - ms_error("getaddrinfo(): error\n"); - return -1; - } - getnameinfo (ai->ai_addr, ai->ai_addrlen, ipaddr, sizeof (ipaddr), port, - sizeof (port), NI_NUMERICHOST | NI_NUMERICSERV); - freeaddrinfo(ai); - - target_addr=inet_addr(ipaddr); - - - /* Prepare the IP options */ - memset(&ip_opts,0,sizeof(ip_opts)); - ip_opts.Ttl=30; - ip_opts.Flags = IP_FLAG_DF | IP_OPT_ROUTER_ALERT; - - - // ignore icmpbuff data contents - for (i=0;mtus[i]!=0;i++) - { - char icmpbuff[2048]; - char *icmp_data = icmpbuff; - - int status = -1; - if (pIcmpSendEcho) - status=pIcmpSendEcho(hIcmp, - target_addr, - (LPVOID)icmp_data, - mtus[i]-60, /* icmp_data_size */ - &ip_opts, - reply_buffer, - sizeof(reply_buffer), - 3000L); // 3 seconds - if (status || GetLastError() == IP_REQ_TIMED_OUT) - { - pIcmpCloseHandle( hIcmp ); - return mtus[i]; - } - } - - pIcmpCloseHandle( hIcmp ); - - return -1; -} - -#elif defined(__linux) - -#include -#include -#include -#include -#include -#include -#include - -#ifndef IP_MTU -#define IP_MTU 14 -#endif - -int ms_discover_mtu(const char *host){ - int sock; - int err,mtu=0,new_mtu; - socklen_t optlen; - char buf[1500-28]={0}; - char port[10]; - struct addrinfo hints,*ai=NULL; - int rand_port; - int retry=0; - struct timeval tv; - - memset(&hints,0,sizeof(hints)); - hints.ai_family = PF_INET; - hints.ai_socktype = SOCK_DGRAM; - - gettimeofday(&tv,NULL); - srandom(tv.tv_usec); - rand_port=random() & 0xFFFF; - if (rand_port<1000) rand_port+=1000; - snprintf(port,sizeof(port),"%i",rand_port); - err=getaddrinfo(host,port,&hints,&ai); - if (err!=0){ - ms_error("getaddrinfo(): %s\n",gai_strerror(err)); - return -1; - } - sock=socket(PF_INET,SOCK_DGRAM,0); - - mtu=IP_PMTUDISC_DO; - optlen=sizeof(mtu); - err=setsockopt(sock,IPPROTO_IP,IP_MTU_DISCOVER,&mtu,optlen); - if (err!=0){ - ms_error("setsockopt(): %s",strerror(errno)); - err = close(sock); - if (err!=0) - ms_error("close(): %s", strerror(errno)); - return -1; - } - err=connect(sock,ai->ai_addr,ai->ai_addrlen); - freeaddrinfo(ai); - if (err!=0){ - ms_error("connect(): %s",strerror(errno)); - err = close(sock); - if (err !=0) - ms_error("close(): %s", strerror(errno)); - return -1; - } - mtu=sizeof(buf); - do{ - send(sock,buf,mtu,0); - usleep(500000);/*wait for an icmp message come back */ - err=getsockopt(sock,IPPROTO_IP,IP_MTU,&new_mtu,&optlen); - if (err!=0){ - ms_error("getsockopt(): %s",strerror(errno)); - err = close(sock); - if (err!=0) - ms_error("close(): %s", strerror(errno)); - return -1; - }else{ - ms_message("Partial MTU discovered : %i",new_mtu); - if (new_mtu==mtu) break; - else mtu=new_mtu; - } - retry++; - }while(retry<10); - - ms_message("mtu to %s is %i",host,mtu); - - err = close(sock); - if (err!=0) - ms_error("close() %s", strerror(errno)); - return mtu; -} - -#else - -int ms_discover_mtu(const char*host){ - ms_warning("mtu discovery not implemented."); - return -1; -} - -#endif - - -void ms_set_mtu(int mtu){ - /*60= IPv6+UDP+RTP overhead */ - if (mtu>60){ - if (mtu>1500) mtu=1500;/*limit to 1500, the mediastreamer2 buffer are not large enough anyway*/ - ms_set_payload_max_size(mtu-60); - }else ms_set_payload_max_size(0); -} diff --git a/linphone/mediastreamer2/src/nowebcam.c b/linphone/mediastreamer2/src/nowebcam.c deleted file mode 100644 index 4241dc1f9..000000000 --- a/linphone/mediastreamer2/src/nowebcam.c +++ /dev/null @@ -1,1827 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifdef HAVE_CONFIG_H -#include "mediastreamer-config.h" -#endif - -#include "mediastreamer2/mscommon.h" -#include "mediastreamer2/msvideo.h" -#include "mediastreamer2/msfilter.h" -#include "mediastreamer2/msticker.h" -#include "mediastreamer2/mswebcam.h" - -#include "ffmpeg-priv.h" - -#include - -#ifdef WIN32 -#include -#include -#include -#include -#include -#endif - -static mblk_t *jpeg2yuv(uint8_t *jpgbuf, int bufsize, MSVideoSize *reqsize){ - AVCodecContext av_context; - int got_picture=0; - AVFrame orig; - AVPicture dest; - mblk_t *ret; - struct SwsContext *sws_ctx; - AVPacket pkt; - - avcodec_get_context_defaults(&av_context); - if (avcodec_open(&av_context,avcodec_find_decoder(CODEC_ID_MJPEG))<0){ - ms_error("jpeg2yuv: avcodec_open failed"); - return NULL; - } - av_init_packet(&pkt); - pkt.data=jpgbuf; - pkt.size=bufsize; - if (avcodec_decode_video2(&av_context,&orig,&got_picture,&pkt)<0){ - ms_error("jpeg2yuv: avcodec_decode_video failed"); - avcodec_close(&av_context); - return NULL; - } - ret=allocb(avpicture_get_size(PIX_FMT_YUV420P,reqsize->width,reqsize->height),0); - ret->b_wptr=ret->b_datap->db_lim; - avpicture_fill(&dest,ret->b_rptr,PIX_FMT_YUV420P,reqsize->width,reqsize->height); - - sws_ctx=sws_getContext(av_context.width,av_context.height,av_context.pix_fmt, - reqsize->width,reqsize->height,PIX_FMT_YUV420P,SWS_FAST_BILINEAR, - NULL, NULL, NULL); - if (sws_ctx==NULL) { - ms_error("jpeg2yuv: sws_getContext() failed."); - avcodec_close(&av_context); - freemsg(ret); - return NULL; - } - if (sws_scale(sws_ctx,orig.data,orig.linesize,0,av_context.height,dest.data,dest.linesize)<0){ - ms_error("jpeg2yuv: sws_scale() failed."); - sws_freeContext(sws_ctx); - avcodec_close(&av_context); - freemsg(ret); - return NULL; - } - sws_freeContext(sws_ctx); - avcodec_close(&av_context); - return ret; -} - -#ifndef MS2_MINIMAL_SIZE -unsigned char def_mire[] = /* 22092 */ -{0xFF,0xD8,0xFF,0xE0,0x00,0x10,0x4A,0x46,0x49,0x46,0x00,0x01,0x01,0x01,0x00 -,0x59,0x00,0x59,0x00,0x00,0xFF,0xDB,0x00,0x43,0x00,0x05,0x03,0x04,0x04,0x04 -,0x03,0x05,0x04,0x04,0x04,0x05,0x05,0x05,0x06,0x07,0x0C,0x08,0x07,0x07,0x07 -,0x07,0x0F,0x0B,0x0B,0x09,0x0C,0x11,0x0F,0x12,0x12,0x11,0x0F,0x11,0x11,0x13 -,0x16,0x1C,0x17,0x13,0x14,0x1A,0x15,0x11,0x11,0x18,0x21,0x18,0x1A,0x1D,0x1D -,0x1F,0x1F,0x1F,0x13,0x17,0x22,0x24,0x22,0x1E,0x24,0x1C,0x1E,0x1F,0x1E,0xFF -,0xDB,0x00,0x43,0x01,0x05,0x05,0x05,0x07,0x06,0x07,0x0E,0x08,0x08,0x0E,0x1E -,0x14,0x11,0x14,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E -,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E -,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E -,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0xFF,0xC0,0x00,0x11,0x08,0x01,0x20 -,0x01,0x60,0x03,0x01,0x22,0x00,0x02,0x11,0x01,0x03,0x11,0x01,0xFF,0xC4,0x00 -,0x1D,0x00,0x01,0x00,0x02,0x03,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x06,0x07,0x04,0x05,0x08,0x03,0x02,0x01,0x09,0xFF,0xC4 -,0x00,0x4A,0x10,0x00,0x02,0x01,0x03,0x03,0x02,0x04,0x03,0x06,0x03,0x04,0x05 -,0x0A,0x06,0x03,0x00,0x01,0x02,0x03,0x04,0x05,0x11,0x00,0x06,0x12,0x21,0x31 -,0x07,0x13,0x22,0x41,0x14,0x51,0x61,0x08,0x23,0x32,0x52,0x71,0x81,0x15,0x42 -,0x91,0x16,0x33,0x62,0xA1,0x43,0x53,0x72,0x82,0xB1,0x24,0x34,0x44,0x63,0x73 -,0x83,0x92,0xA2,0xC1,0xC2,0x17,0x26,0x45,0xA3,0xD1,0xE1,0x54,0x93,0xA4,0xFF -,0xC4,0x00,0x19,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x03,0x04,0x05,0xFF,0xC4,0x00,0x22 -,0x11,0x01,0x00,0x03,0x00,0x02,0x01,0x04,0x03,0x01,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x01,0x02,0x11,0x21,0x31,0x03,0x04,0x05,0x12,0x41,0x13,0x51 -,0x71,0xA1,0xFF,0xDA,0x00,0x0C,0x03,0x01,0x00,0x02,0x11,0x03,0x11,0x00,0x3F -,0x00,0xE3,0x2D,0x34,0xD3,0x40,0xD3,0x4D,0x34,0x0D,0x34,0xD3,0x40,0xD3,0x4D -,0x34,0x0D,0x34,0xD3,0x40,0xD3,0x4D,0x34,0x0D,0x34,0xD3,0x40,0xD3,0x4D,0x34 -,0x0D,0x34,0xD3,0x40,0xD3,0x4D,0x34,0x0D,0x34,0xD3,0x40,0xD3,0x4D,0x34,0x0D -,0x34,0xD3,0x40,0xD3,0x4D,0x34,0x0D,0x34,0xD3,0x40,0xD3,0x4D,0x34,0x0D,0x34 -,0xD3,0x40,0xD3,0x4D,0x34,0x0D,0x34,0xD3,0x40,0xD3,0x4D,0x34,0x0D,0x34,0xD3 -,0x40,0xD3,0x4D,0x34,0x0D,0x34,0xD3,0x40,0xD3,0x4D,0x34,0x0D,0x34,0xD3,0x40 -,0xD3,0x4D,0x34,0x0D,0x34,0xD3,0x40,0xD3,0x4D,0x34,0x0D,0x34,0xD3,0x40,0xD3 -,0x4D,0x34,0x0D,0x34,0xD3,0x40,0xD3,0x4D,0x34,0x0D,0x34,0xD3,0x40,0xD3,0x4D -,0x34,0x0D,0x34,0xD3,0x40,0xD3,0x4D,0x4D,0x76,0xBF,0x87,0x17,0xDB,0xCC,0xC6 -,0x39,0x20,0xA9,0x86,0x40,0xE6,0x21,0x4B,0x0C,0x1E,0x75,0x49,0x93,0xD6,0x02 -,0x32,0x65,0x56,0x23,0xC9,0x14,0x15,0x95,0xD1,0x8A,0xB8,0x64,0x57,0xED,0xA0 -,0x85,0x69,0xAE,0xB3,0xD9,0x5F,0x65,0xBA,0xFB,0x95,0x3A,0xD6,0x6E,0x2A,0x2B -,0x3E,0xDA,0xB7,0x42,0xAE,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xE7,0xE1,0x2F,0xD9,0x89 -,0x6D,0x96,0x23,0x25,0xD6,0xAE,0x4A,0x3A,0xCA,0x88,0x84,0x72,0xAC,0x66,0x48 -,0x54,0xA9,0x09,0xC8,0x37,0x95,0x22,0xCB,0x20,0x62,0x8A,0xD8,0x79,0x15,0x03 -,0x03,0xF7,0x23,0x52,0x4B,0x67,0xD9,0x73,0x69,0xDB,0x9E,0xA6,0x58,0xAB,0x26 -,0x92,0x49,0xA4,0x67,0x0F,0x14,0x92,0xD3,0xCA,0x80,0x9C,0xF1,0x59,0x43,0xB9 -,0x50,0x3E,0x8B,0x9F,0x99,0xD0,0x7F,0x3A,0x34,0xD7,0x73,0x6F,0xCF,0xB2,0xD5 -,0x75,0xC9,0x6B,0x27,0xA7,0xBC,0xC9,0x53,0x51,0x53,0xC3,0x9B,0xD4,0xD3,0xA5 -,0x64,0x8C,0xA9,0xC7,0x88,0x6A,0x99,0x9C,0x4E,0x30,0x11,0x57,0xEE,0xF1,0xE9 -,0x18,0xED,0xD3,0x55,0x65,0xF7,0xEC,0xED,0x57,0x6F,0x90,0xCF,0x74,0xA3,0xB4 -,0x22,0x45,0x10,0x48,0xA9,0xE8,0x6E,0x73,0x5A,0xBE,0x24,0x82,0x49,0x66,0x92 -,0xE3,0x1B,0x0E,0x67,0x38,0xC2,0x12,0xB8,0x51,0xD3,0x39,0x24,0x39,0xB3,0x4D -,0x5A,0x97,0x3F,0x03,0x37,0xD5,0xB2,0xCA,0xF5,0x55,0x7B,0x63,0x74,0xBD,0x56 -,0x14,0xC5,0xF0,0x56,0xA4,0xAC,0xA4,0x61,0xC8,0x72,0x2D,0x3C,0x13,0x39,0x00 -,0x0C,0x9C,0x84,0x6C,0x90,0x07,0x4C,0xE4,0x44,0xF7,0xB6,0xC3,0xDC,0x7B,0x41 -,0x61,0x7B,0xC5,0x05,0x4C,0x29,0x22,0xA9,0xE5,0x2D,0x1D,0x45,0x3F,0x16,0x39 -,0xF4,0x71,0x9E,0x34,0x66,0x20,0x00,0x4B,0x28,0x65,0x1C,0xD7,0xD5,0x93,0x8D -,0x04,0x5F,0x4D,0x34,0xD0,0x34,0xD3,0x4D,0x03,0x4D,0x34,0xD0,0x34,0xD3,0x4D -,0x03,0x4D,0x34,0xD0,0x34,0xD3,0x4D,0x03,0x4D,0x34,0xD0,0x34,0xD3,0x4D,0x03 -,0x4D,0x34,0xD0,0x34,0xD3,0x4D,0x03,0x4D,0x34,0xD0,0x34,0xD3,0x4D,0x03,0x4D -,0x34,0xD0,0x34,0xD6,0xCE,0xC3,0x61,0xBB,0xDF,0x65,0x68,0xED,0x74,0x4F,0x38 -,0x56,0x0A,0xF2,0x33,0x2C,0x71,0xAB,0x15,0x66,0x55,0x2E,0xC4,0x28,0x66,0x08 -,0xC1,0x54,0x9C,0xB1,0x18,0x50,0x4F,0x4D,0x5C,0x3E,0x1D,0x7D,0x9E,0xF7,0x25 -,0xE2,0xE6,0x45,0x5D,0x11,0xA9,0x58,0x64,0x19,0x8C,0xAB,0xC5,0x1F,0x42,0x8D -,0xF7,0x81,0xB8,0x48,0x32,0x39,0x83,0x1B,0xF9,0x0D,0x8C,0x32,0x39,0xED,0xA0 -,0xA4,0x68,0xE9,0x2A,0xAB,0x6A,0x05,0x3D,0x1D,0x34,0xD5,0x33,0x15,0x66,0x11 -,0xC4,0x85,0xDB,0x8A,0xA9,0x66,0x38,0x1D,0x70,0x14,0x12,0x7E,0x40,0x13,0xAB -,0x1F,0x65,0xF8,0x39,0xB8,0xEF,0xF7,0x1A,0x58,0x63,0x8D,0x6A,0xD6,0x41,0xCA -,0x48,0xE8,0x9C,0xBE,0x00,0x93,0x8E,0x3C,0xD0,0xAC,0x85,0x59,0x41,0x22,0x58 -,0x84,0xCA,0xB9,0x5E,0x58,0xEB,0x8E,0xA3,0xA0,0xF0,0x87,0xC3,0x8F,0x0E,0xE8 -,0x21,0xB9,0xF8,0x87,0x79,0xB7,0xC4,0x59,0x63,0x48,0xE8,0xE0,0x41,0x1A,0xCC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x0C,0xA4,0x11,0x90,0xCA,0xCA,0x48,0x65,0x20,0x82,0x18,0x12,0x08,0x20 -,0x82,0x41,0x07,0x58,0xDA,0xEA,0xFF,0x00,0xB6,0xD7,0x86,0x62,0xC5,0x34,0x77 -,0xEA,0x4A,0x28,0x96,0x9A,0xB6,0x79,0x4A,0x4E,0x10,0x2F,0x09,0x95,0x5A,0x57 -,0x50,0x4B,0x80,0x16,0x54,0x2E,0xE4,0x10,0x4F,0x9B,0x03,0x94,0x55,0xF3,0xDB -,0x3C,0xA1,0xA0,0x69,0xA6,0x9A,0x06,0x9A,0x69,0xA0,0x69,0xA6,0x9A,0x06,0x9A -,0x69,0xA0,0x69,0xA6,0x9A,0x06,0x9A,0x69,0xA0,0x69,0xA6,0x9A,0x06,0x9A,0x69 -,0xA0,0x69,0xA6,0xBD,0xA8,0xE9,0xAA,0x6B,0x6B,0x21,0xA3,0xA3,0xA7,0x96,0xA6 -,0xA6,0x79,0x16,0x28,0x61,0x89,0x0B,0xBC,0x8E,0xC7,0x0A,0xAA,0xA3,0xA9,0x24 -,0x90,0x00,0x1D,0xF4,0x1E,0x3A,0x6A,0x6B,0xB3,0x3C,0x38,0xBE,0xEE,0x26,0x32 -,0x34,0x33,0x53,0x53,0x87,0x31,0x16,0x11,0x02,0xC2,0x4F,0x58,0x08,0x4B,0xB2 -,0x46,0x8D,0xC9,0x00,0x2A,0xEE,0xAF,0x86,0x05,0x55,0xFB,0x6B,0xA2,0x3C,0x2C -,0xFB,0x35,0x5D,0x12,0x68,0xEB,0xE7,0x0D,0x6B,0xF5,0x07,0x49,0xE4,0xCF,0x9F -,0x1F,0x54,0x60,0x51,0xDD,0x03,0xAB,0x2B,0xA6,0x41,0x58,0xA1,0x71,0x92,0x04 -,0xC4,0x1D,0x07,0x2F,0xED,0xFD,0xAD,0x72,0xBC,0x3C,0x25,0x4C,0x54,0x71,0x4E -,0x0F,0x91,0x24,0xE1,0xC9,0x9C,0xFA,0xF0,0x22,0x8D,0x15,0x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,0x3A,0xB0,0xEB,0x83 -,0x9F,0x46,0x08,0xC8,0xF7,0xD7,0xA2,0xC1,0x55,0x53,0x12,0xA3,0x93,0x43,0x4F -,0x80,0x04,0x30,0x91,0xE6,0x63,0x1D,0x8B,0x0E,0x8B,0xF2,0xC2,0xF5,0x18,0x04 -,0x36,0xB3,0x95,0x55,0x49,0x21,0x40,0x27,0xB9,0xC7,0x7D,0x7E,0xE8,0xAA,0xAB -,0xED,0x47,0x40,0x5F,0xC1,0x4B,0x9D,0x6D,0x28,0x3F,0x15,0x63,0x68,0x2E,0xD4 -,0x6E,0x49,0x66,0x49,0x29,0x64,0x59,0x32,0x09,0xEA,0x4F,0x05,0x90,0x67,0xEA -,0x75,0xFC,0xC7,0xBC,0xDB,0xAB,0x2C,0xF7,0x8A,0xDB,0x45,0xC6,0x11,0x0D,0x6D -,0x0D,0x44,0x94,0xD5,0x11,0x87,0x57,0xE1,0x22,0x31,0x56,0x1C,0x94,0x90,0x70 -,0x41,0xEA,0x09,0x07,0xDB,0x5F,0xD6,0x3F,0x16,0xA9,0x05,0x77,0x87,0x57,0xDA -,0x52,0x03,0x09,0xAD,0xF5,0x30,0xF1,0x23,0x21,0x8C,0x90,0x3C,0x60,0x7E,0xE5 -,0xC6,0xBF,0x94,0xDB,0xBE,0x7A,0xAA,0xCD,0xD1,0x71,0xB8,0x56,0x53,0xCD,0x04 -,0xB5,0xF5,0x0D,0x5A,0x16,0x54,0x2A,0xC5,0x66,0x3E,0x6A,0x36,0x0F,0xB3,0x2B -,0xAB,0x03,0xEE,0x08,0x23,0xBE,0x83,0x55,0xA6,0x9A,0x68,0x1A,0x69,0xA6,0x81 -,0xA6,0x9A,0x68,0x1A,0x69,0xA6,0x81,0xA6,0x9A,0x68,0x1A,0x69,0xA6,0x81,0xA6 -,0x9A,0xCD,0xB7,0x5A,0x6E,0x57,0x08,0x64,0x9E,0x92,0x8E,0x59,0x29,0xE2,0x92 -,0x38,0xA6,0xA8,0x23,0x8C,0x30,0x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B -,0x12,0x75,0xB1,0xD1,0x35,0xA5,0xDB,0xBB,0x56,0xC3,0x60,0x58,0xCD,0xBA,0x82 -,0x35,0x96,0x34,0xF2,0xD6,0x79,0x3D,0x72,0x2A,0x7E,0x55,0x63,0xF8,0x57,0xFC -,0x0B,0x85,0x1E,0xC0,0x6B,0x6F,0x3C,0x86,0x28,0x24,0x94,0x21,0x72,0x8A,0x5B -,0x88,0xEE,0x70,0x3B,0x6B,0xEF,0x4D,0x11,0xC1,0xD7,0xCB,0x9D,0xF3,0xC4,0x7B -,0xEA,0x6E,0xDD,0xCF,0x53,0x1C,0x15,0x15,0x9E,0x45,0x45,0x91,0x38,0x16,0x86 -,0x91,0x51,0xF9,0x88,0x11,0x4E,0x0B,0x13,0x85,0xE4,0xDE,0x90,0xC5,0xBA,0x13 -,0x81,0x8D,0xE4,0x3B,0x8E,0xA6,0x96,0x95,0x64,0xDC,0x36,0x3A,0xEB,0x6B,0x01 -,0xEA,0x92,0x25,0xF8,0xA8,0x7F,0xAC,0x79,0x60,0x3E,0xAC,0xA0,0x7D,0x4E,0xAD -,0x6D,0xE9,0xE0,0xC5,0xE6,0xD1,0x72,0xAD,0xB8,0xEC,0x58,0xA8,0xEE,0x36,0xEA -,0xB9,0x1A,0x57,0xB4,0x54,0xCD,0xE4,0xC9,0x01,0x63,0x96,0x58,0x24,0x20,0xA9 -,0x42,0x49,0x22,0x36,0xE2,0x14,0x93,0x86,0xC1,0xC0,0x83,0x5D,0x96,0xF1,0x67 -,0x59,0x05,0xDF,0x6A,0x6E,0x3A,0x13,0x1A,0x72,0x25,0xAD,0xD2,0x49,0x19,0x20 -,0x67,0x88,0x96,0x30,0xD1,0xE7,0xDB,0xF1,0x7E,0x99,0xD5,0x56,0x99,0x77,0x7E -,0xD3,0x9E,0x3E,0x9B,0x96,0xD4,0x80,0xF7,0xCD,0x62,0x21,0xFF,0x00,0x32,0x08 -,0xD6,0x9E,0xB0,0x78,0x57,0x52,0x59,0xEA,0x24,0xDA,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0x9D,0xBF,0x34,0x92,0x36,0x5E,0x46,0xFF,0x00,0x13,0x12,0x74 -,0x4D,0x71,0xBF,0x87,0x3F,0x65,0x1D,0xCB,0x71,0xA1,0x13,0x6E,0x4A,0x78,0x2D -,0x9E,0x7C,0x78,0x26,0xAA,0x52,0xF3,0x45,0x90,0x87,0x29,0x14,0x4E,0x15,0x58 -,0x10,0xE3,0x9B,0xC8,0xD9,0x56,0xEB,0x08,0x23,0x5D,0x11,0xB2,0x3C,0x09,0xDA -,0x1B,0x78,0xD3,0x4D,0x50,0x92,0xD7,0xD4,0xD3,0xF2,0x30,0xBC,0x84,0x0F,0x27 -,0x93,0x17,0x22,0x3E,0x20,0x08,0x47,0x22,0x4F,0xDC,0xAC,0x40,0xE4,0xE4,0x1C -,0xEA,0xD8,0xD3,0x41,0x8F,0x6E,0xA0,0xA2,0xB7,0x53,0x0A,0x6B,0x7D,0x24,0x14 -,0xB0,0x82,0x5B,0x84,0x31,0x84,0x5C,0x9E,0xE7,0x03,0xDC,0xFC,0xF5,0x91,0xA6 -,0xBC,0xEA,0x6A,0x20,0xA6,0x88,0xCB,0x51,0x2A,0x44,0x99,0x03,0x93,0x9C,0x0C -,0x93,0x80,0x3F,0x52,0x7A,0x63,0x44,0x7A,0x69,0xAC,0x44,0xB8,0x53,0x3C,0x51 -,0x38,0xF3,0x43,0xCC,0xA1,0xD2,0x16,0x89,0x84,0xA5,0x49,0xC0,0x25,0x08,0xE4 -,0xA3,0xA8,0xCE,0x40,0xC6,0x7A,0xE3,0x58,0x93,0xDC,0x1D,0x99,0x97,0xAA,0x70 -,0xEB,0x24,0x71,0x90,0x5A,0x31,0xE9,0x27,0xCC,0x73,0xE8,0x8F,0x00,0x9C,0x8C -,0x92,0x47,0x55,0x3A,0x0D,0xB6,0xB1,0xE5,0xAC,0x86,0x36,0x64,0x0C,0x64,0x74 -,0xFC,0x41,0x3A,0xF1,0xE9,0x9F,0x51,0xEC,0xBD,0x3A,0xF5,0x23,0x58,0xD4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x00,0x6E,0x83,0x87,0x74,0xD3,0x4D,0x03,0x4D,0x34,0xD0,0x34,0xD6 -,0x55,0xB6,0xDF,0x59,0x71,0xA8,0xF2,0x68,0xE1,0xE6,0x46,0x0B,0xB1,0x60,0xA9 -,0x12,0x96,0x0B,0xC9,0xDD,0x88,0x54,0x5C,0xB2,0x82,0xCC,0x40,0x19,0x19,0x23 -,0x57,0x27,0x87,0x9F,0x67,0x5D,0xD5,0xBA,0xA1,0xA5,0x9F,0x84,0xD1,0x45,0x30 -,0xE4,0xF2,0x4B,0x13,0x41,0x0A,0xA3,0x20,0xE2,0x55,0xDC,0x19,0x24,0x60,0xE4 -,0x83,0xC6,0x23,0x11,0x0B,0xD2,0x5F,0x56,0x40,0x52,0xB4,0xD0,0x4D,0x53,0x51 -,0x15,0x35,0x34,0x32,0x4D,0x3C,0xAE,0x12,0x38,0xE3,0x52,0xCC,0xEC,0x4E,0x02 -,0x80,0x3A,0x92,0x4F,0x4C,0x6A,0xC0,0xD8,0x9E,0x12,0x6E,0x2D,0xD9,0x01,0x7A -,0x44,0x94,0xBC,0x8A,0x44,0x0B,0x4F,0x10,0x95,0x79,0xF1,0x56,0x02,0x49,0x0B -,0x2C,0x6B,0xE9,0x2F,0x94,0x56,0x79,0x95,0x90,0x83,0x17,0x5C,0xEB,0xB3,0x7C -,0x3E,0xFB,0x3C,0x6D,0x9B,0x1D,0x0F,0x93,0x75,0xE3,0x59,0x13,0x90,0xEF,0x46 -,0x91,0x84,0xA6,0x62,0x18,0xB2,0xF3,0x8B,0x2D,0xE6,0xF1,0x2E,0xE0,0x79,0xED -,0x39,0x01,0xB0,0xA5,0x47,0x4D,0x5C,0x96,0xCB,0x65,0x05,0xB2,0x05,0x86,0x82 -,0x92,0x28,0x11,0x50,0x20,0xE2,0x3A,0xF1,0x1D,0x97,0x3D,0xF0,0x33,0xD0,0x7B -,0x7B,0x68,0x9A,0xE6,0xEF,0x0A,0x3E,0xCC,0xB1,0x59,0xCA,0x55,0xDD,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A,0x53,0xAF,0xDE,0x10,0x0F,0x42,0x58,0x20,0x1D,0xF3 -,0x8D,0x6B,0x9E,0xE1,0x7E,0xAD,0x32,0x16,0x63,0x68,0x82,0x3C,0x99,0x70,0xD1 -,0xCD,0x56,0x80,0x63,0x25,0xD8,0xFF,0x00,0xC9,0xE9,0xF0,0x08,0x24,0x7D,0xE1 -,0x2B,0xD4,0x60,0xE8,0xA9,0x45,0xC6,0xE5,0x05,0x0C,0xB1,0xAD,0x47,0xA1,0x64 -,0xCF,0x16,0x24,0x12,0xC7,0xF2,0xAA,0x8C,0xB3,0xB7,0xD0,0x0F,0xFF,0x00,0x1A -,0xD7,0xCB,0x78,0xAA,0x96,0x57,0x58,0x69,0xC5,0x3A,0x46,0x39,0x37,0x99,0x86 -,0x98,0x8C,0x13,0xD5,0x01,0x0B,0x18,0x23,0xA8,0x69,0x18,0x76,0xC1,0x5D,0x47 -,0xAD,0x6B,0x51,0x56,0x59,0xAC,0x54,0x6F,0x52,0x65,0x00,0x49,0x5C,0xF3,0xC8 -,0x90,0xB0,0xE8,0x7A,0xD4,0xB7,0xDF,0x54,0x00,0x7A,0xAF,0x96,0x16,0x32,0x09 -,0x52,0x46,0xB7,0x54,0x9B,0x4A,0x96,0x44,0x43,0x7C,0x98,0x5D,0x78,0x1E,0x49 -,0x4B,0xE5,0x08,0xA8,0xA3,0x39,0xCF,0xA6,0x01,0x95,0x3D,0x7A,0x83,0x21,0x76 -,0x07,0xB1,0x1A,0x0C,0x2A,0xDD,0xD8,0x27,0xA6,0x79,0xAD,0xC6,0x2A,0x8A,0x54 -,0xE8,0xD5,0x86,0x71,0x05,0x18,0xEA,0x40,0xCD,0x4B,0x0F,0x56,0x7B,0x62,0x15 -,0x62,0x18,0x63,0x23,0x58,0x30,0xD0,0xDE,0x6F,0xAA,0x43,0x45,0xE6,0xD3,0x31 -,0xCB,0x49,0x5B,0x03,0xD3,0xD1,0x9F,0x99,0x14,0xB9,0xF3,0x67,0x3D,0x3A,0xF9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,0xA2,0x79,0x03,0x4B,0x2F,0x22,0x0E -,0x79,0xC8,0x01,0x0B,0xD7,0xF9,0x23,0xFC,0x20,0x8E,0xE1,0x9B,0x93,0x0E,0xC7 -,0x3A,0xD9,0xE9,0xA0,0xC6,0xA6,0xA2,0x82,0x09,0x3C,0xEC,0x34,0xB3,0x91,0x83 -,0x34,0x87,0x93,0x90,0x71,0x90,0x0F,0xB0,0x24,0x67,0x88,0xC0,0xFA,0x6B,0x27 -,0x4D,0x34,0x0D,0x34,0xD3,0x40,0xD3,0x4D,0x34,0x0D,0x35,0xE5,0x53,0x51,0x05 -,0x34,0x62,0x4A,0x89,0x92,0x25,0x2C,0x15,0x4B,0x1C,0x72,0x63,0xD8,0x0F,0x99 -,0x3E,0xC0,0x75,0x3A,0xC6,0x15,0x35,0xB5,0x43,0xFE,0x49,0x4F,0xE4,0x21,0x19 -,0x13,0x55,0x29,0x07,0xB0,0x20,0x88,0xFA,0x37,0xD0,0x86,0x28,0x47,0xD7,0x41 -,0x9D,0xA6,0xB5,0xEF,0x34,0x14,0xB3,0x14,0x69,0x26,0xAD,0xAB,0xC6,0x44,0x6B -,0x86,0x71,0x9E,0x58,0xE8,0x30,0xA8,0x0F,0x51,0xC8,0xE0,0x1C,0x75,0x3A,0xFA -,0x61,0x57,0x22,0xB4,0x95,0x53,0x47,0x45,0x02,0xE4,0x95,0x8D,0xB2,0xD8,0x1F -,0x99,0xCF,0x40,0x31,0xDC,0x01,0xD3,0xD9,0xB4,0x1F,0x35,0x31,0x52,0x1A,0x94 -,0x5A,0xE9,0xFC,0xF9,0x1F,0xAC,0x74,0xED,0xD5,0x7A,0x15,0xEA,0x10,0x7E,0x20 -,0x0E,0x0E,0x4E,0x78,0xE7,0xB8,0xD6,0xC3,0x58,0x96,0xE8,0xA9,0x62,0x0F,0xF0 -,0xB0,0x14,0x0D,0x82,0xD2,0x90,0x73,0x29,0x1D,0x32,0x49,0xF5,0x31,0xC0,0x1E -,0xA3,0xDF,0xA7,0x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xDC,0x97,0x1B,0x1C,0xA9,0xB1,0xB6,0xEA,0xF2,0x90,0xD7,0xD6,0xAA,0x07 -,0x24,0x07,0x02,0xA2,0x77,0xC9,0x1E,0x66,0x03,0x15,0x45,0x21,0x10,0xA8,0x00 -,0x72,0x2D,0xAD,0xDF,0x8A,0xFB,0x9E,0xA7,0x7A,0x6E,0x6A,0x4F,0x0B,0xF6,0x9D -,0x7D,0x54,0x70,0x25,0x53,0xC3,0x5B,0x14,0x14,0x4F,0x47,0x46,0xF2,0x85,0xCB -,0xC7,0xF0,0xE9,0x99,0x24,0x8D,0x01,0xE7,0x28,0x93,0x93,0x33,0xF0,0x45,0x55 -,0xE4,0x4E,0xAF,0x1F,0x0B,0xFC,0x34,0x7D,0xB3,0xB6,0xE8,0x6D,0x14,0x86,0x60 -,0x94,0xCE,0xD3,0x1B,0x85,0xD1,0x52,0x5A,0x97,0x99,0x98,0xB3,0xCB,0x1D,0x3A -,0xFD,0xDC,0x4E,0x49,0x24,0x48,0xE5,0xDC,0x0F,0x4B,0x02,0x00,0xD1,0x5F,0xB5 -,0xBE,0x40,0xB5,0xD3,0x53,0xB8,0xA3,0x86,0xD0,0xB8,0x8A,0x96,0x29,0x29,0x5A -,0x9A,0xDA,0x7E,0x49,0x05,0x1A,0x7D,0xED,0x61,0xFF,0x00,0x0B,0x10,0x8D,0xD1 -,0x93,0xE5,0xAD,0xB5,0xB2,0xD9,0x5F,0x51,0x55,0x15,0x49,0x8E,0xA9,0x27,0x8D -,0x7E,0xEA,0xA2,0xB5,0x23,0x92,0xB1,0x57,0x07,0x1E,0x4C,0x03,0x10,0xD2,0x29 -,0x03,0x01,0x98,0x72,0x20,0x61,0x97,0x3D,0x75,0x26,0xA0,0xDB,0x54,0x94,0x75 -,0xAD,0x5A,0x92,0xCD,0x35,0x53,0xA7,0x19,0x2A,0x66,0x6E,0x55,0x12,0x83,0xDD -,0x4C,0x87,0x25,0x53,0x38,0x21,0x23,0xE0,0xA0,0xE7,0x03,0xAE,0x35,0xF5,0x74 -,0xA4,0x81,0x61,0xE1,0x55,0x34,0x6E,0xB2,0x72,0x09,0x4E,0x63,0x26,0x36,0x38 -,0x62,0x7E,0xE9,0x7D,0x52,0x92,0x0E,0x48,0x24,0xF6,0xC8,0x03,0x41,0xAE,0x88 -,0xD2,0xC5,0x4D,0x34,0xBF,0x15,0x98,0x87,0x49,0xEA,0x45,0x51,0x54,0xEE,0x47 -,0xAE,0xA9,0xBA,0x9E,0xA3,0xF0,0xC7,0x8E,0x27,0xA1,0xE9,0xAC,0xDA,0x39,0xA3 -,0xA7,0x82,0x38,0x69,0x69,0xE3,0xA5,0x85,0x99,0x8C,0x7C,0xA9,0xCC,0x41,0xDB -,0x24,0xB7,0x08,0x07,0xAD,0x8E,0x72,0x4F,0x2C,0x7E,0x61,0x91,0xAC,0x49,0x69 -,0xCF,0xC6,0x07,0x3E,0x7C,0x95,0xA8,0x09,0x8C,0xB0,0x49,0xAA,0x63,0x04,0x38 -,0x1C,0x17,0xFB,0x98,0x32,0x06,0x03,0x1F,0xC4,0x3A,0x37,0x5D,0x6C,0x28,0xED -,0x12,0x73,0x91,0xE6,0x7F,0x87,0x12,0x74,0x71,0x0C,0xAC,0xD2,0xC8,0x32,0xD8 -,0x0F,0x31,0xF5,0x63,0xD5,0x90,0x17,0x8F,0x13,0x90,0x09,0x1A,0x04,0xB3,0xD4 -,0x34,0xC6,0x14,0x69,0x16,0x50,0x3A,0x85,0xE3,0x24,0xE3,0x20,0xE3,0xA7,0xF7 -,0x71,0x76,0xE8,0x4E,0x43,0x76,0xC6,0x75,0x91,0x05,0xBD,0x89,0x66,0x95,0xCC -,0x41,0xBF,0x12,0xC5,0x23,0x17,0x6E,0xA7,0x1C,0xA4,0x3E,0xA2,0x3A,0xE4,0x01 -,0x8C,0x75,0x1D,0x46,0xB3,0xA9,0xE1,0x86,0x9E,0x21,0x14,0x11,0x24,0x48,0x09 -,0x3C,0x51,0x70,0x32,0x4E,0x49,0xFE,0xBA,0xF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0,0x07,0xCD,0x21,0x80,0x60,0x7C,0xB2 -,0x35,0xCE,0xDB,0xAF,0xC4,0x9D,0xC9,0xB8,0x2A,0x26,0x9A,0xA6,0xB2,0x67,0x9A -,0x50,0xC8,0x6A,0xAA,0x24,0xF3,0xAA,0x42,0x12,0x0F,0x15,0x72,0x00,0x84,0x74 -,0xC7,0xDC,0xAC,0x7C,0x95,0x88,0x6E,0x40,0xEA,0x19,0xA6,0xA2,0x9A,0xCC,0xB5 -,0xDD,0x2E,0x76,0xB7,0x99,0xED,0x97,0x1A,0xBA,0x16,0x9E,0x23,0x0C,0xCD,0x4F -,0x33,0x46,0x64,0x8C,0x90,0x4A,0x37,0x12,0x32,0xA4,0xA8,0x38,0x3D,0x3A,0x0F -,0x96,0xBE,0xAD,0x76,0xAA,0xEB,0x9F,0x33,0x4B,0x12,0xF9,0x51,0xF4,0x92,0x69 -,0xA5,0x58,0x61,0x8C,0xF1,0x66,0x01,0xA4,0x72,0x11,0x49,0x08,0xDC,0x41,0x39 -,0x62,0x30,0x32,0x7A,0x6A,0x43,0x41,0xB2,0xA5,0xA9,0xA7,0x9C,0x7C,0x45,0x64 -,0xD5,0x6B,0x49,0x15,0x54,0x69,0x4D,0x42,0x7C,0xA5,0x57,0x04,0x91,0x2C,0x93 -,0x34,0x5C,0x71,0x8C,0x02,0x82,0x45,0x6C,0x36,0x0E,0x00,0x24,0x3A,0x87,0xEC -,0x9D,0xB2,0xA8,0x77,0x33,0x4D,0x71,0xB8,0xD5,0x5D,0x68,0x1E,0xB6,0x29,0x67 -,0x41,0x68,0xB8,0x4D,0x6F,0x44,0x61,0x0D,0x0B,0x16,0x58,0xE0,0x64,0x40,0x0B -,0xCF,0x37,0xA7,0x8F,0x1F,0x90,0xC0,0x1A,0xF7,0xDF,0xDB,0xC3,0x7D,0xEC,0xDF -,0x15,0x2E,0xDB,0x73,0x6A,0x6F,0xCB,0x85,0x75,0x9E,0xD6,0x90,0x47,0x32,0x5E -,0xE9,0xA1,0xA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C,0xAA,0x91,0xC9,0x1B,0xD0 -,0x3D,0x5C,0x87,0x9A,0xC7,0x45,0x31,0x63,0x24,0x25,0x4A,0x48,0x54,0x73,0x6E -,0x62,0x48,0xD7,0x9A,0xF3,0x97,0x2B,0x2E,0x55,0x47,0x4C,0x78,0x55,0xE3,0xFD -,0x82,0xC3,0xB1,0x6D,0x96,0x7D,0xED,0x52,0xBF,0x1D,0x49,0x4E,0x91,0xC1,0x51 -,0x45,0x53,0x15,0x52,0xD4,0xC2,0x17,0xEE,0xD9,0xB8,0xBF,0x28,0xE4,0xE3,0x80 -,0xCB,0x20,0x52,0x08,0xEA,0x01,0x24,0x0E,0x31,0xD3,0x41,0xD6,0x3E,0x24,0x7D -,0xA6,0x65,0x9C,0xD4,0xD2,0x6D,0xC9,0x92,0xCF,0x4F,0x1F,0xA4,0x3A,0x2A,0x55 -,0xD6,0xCE,0x4C,0x65,0x94,0xA1,0x04,0xD3,0xC4,0x99,0xC2,0xB3,0x17,0x91,0xD4 -,0xB6,0x44,0x64,0x82,0x07,0x36,0xEE,0x6D,0xDD,0x7D,0xDC,0x15,0x33,0xCB,0x5D -,0x5F,0x50,0xE2,0xA0,0x71,0x98,0xBC,0xAC,0xEF,0x30,0xF4,0x1C,0x49,0x21,0xF5 -,0x38,0xE4,0x8A,0xC1,0x49,0xE2,0xAD,0x92,0xAA,0xA0,0xE3,0x5A,0x0D,0x34,0x0D -,0x34,0xD6,0x5D,0x9E,0x82,0x5B,0x9D,0xC1,0x28,0xE1,0x96,0x9E,0x16,0x65,0x77 -,0x32,0x4F,0x28,0x8D,0x11,0x51,0x4B,0x31,0x24,0xFC,0x95,0x4F,0x41,0x96,0x27 -,0x01,0x41,0x24,0x02,0x18,0x9A,0xDB,0xD1,0x53,0x53,0xC6,0x0D,0x33,0xDB,0xAA -,0x6B,0xEE,0x6E,0xE5,0x44,0x0A,0x4F,0x08,0x97,0x89,0x07,0x2A,0xBE,0xA6,0x93 -,0x24,0x10,0x32,0x02,0x94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4,0xBF,0x96 -,0xC5,0x26,0x9B,0x3D,0x88,0x53,0x98,0x62,0x1D,0x41,0x73,0x23,0xF6,0x8C,0x1D -,0x74,0xD5,0x8E,0xD5,0x6F,0xB1,0xD9,0xA8,0xEC,0xF6,0x9A,0x58,0xE9,0x28,0x28 -,0xA1,0x58,0x29,0xE1,0x8C,0x61,0x63,0x45,0x18,0x00,0x7E,0xDA,0xAE,0xBE,0xCD -,0x1E,0x16,0xC3,0xE1,0x6F,0x87,0x70,0x50,0x55,0x71,0x9A,0xFD,0x5C,0x12,0x7B -,0xAD,0x46,0x79,0x66,0x40,0xB8,0x58,0x81,0xFC,0x91,0x8F,0x48,0xF6,0xCF,0x23 -,0xFC,0xDA,0xB4,0x74,0x0D,0x34,0xD3,0x40,0xD3,0x4D,0x34,0x0D,0x34,0xD3,0x40 -,0xD6,0x0D,0xC6,0xE7,0x4F,0x47,0x4F,0x24,0xF2,0x4B,0x0A,0x43,0x17,0xF7,0xB3 -,0xCD,0x20,0x48,0xA3,0xEB,0x8E,0xAC,0x7D,0xF3,0xD3,0x03,0x3D,0x70,0x0E,0x33 -,0xA8,0xE5,0xE7,0x72,0xA1,0x79,0x16,0x92,0x48,0xEB,0x15,0x64,0x31,0x72,0x0E -,0x56,0x95,0x1F,0xF2,0xB3,0x80,0x5A,0x69,0x3D,0x2D,0xF7,0x51,0x83,0xD7,0xD2 -,0xC0,0x74,0x6D,0x51,0xFE,0x28,0x78,0xD9,0x41,0x64,0xAA,0x10,0x5A,0x02,0xEE -,0x3B,0xEC,0x78,0xE0,0xED,0x3C,0x70,0x52,0xD0,0x86,0x21,0x03,0xB3,0x96,0xF2 -,0xE9,0x53,0x93,0x05,0x0D,0x96,0x73,0xCB,0x89,0x91,0x08,0xC6,0x82,0xDD,0xDC -,0xDB,0xAD,0x28,0xA9,0x65,0xAF,0xA9,0xAB,0xFE,0x1F,0x4F,0x04,0x7E,0x6B,0xD6 -,0x55,0x2A,0xC7,0x22,0x2E,0x08,0xE5,0x1C,0x72,0x10,0x90,0x29,0xCB,0x62,0x49 -,0xCE,0x4E,0x0A,0x85,0x7C,0x8D,0x73,0xE6,0xEE,0xFB,0x44,0x5B,0x28,0x61,0xA8 -,0x7B,0x05,0x3B,0x1A,0x1A,0x86,0x92,0x35,0xBC,0x54,0xA4,0xAD,0x4F,0x51,0x32 -,0x29,0x24,0x20,0x60,0x26,0xAD,0x75,0x04,0x2F,0xDE,0x18,0xE2,0x05,0xE3,0x56 -,0x54,0x52,0x1B,0x5C,0xF1,0xE2,0x37,0x89,0x77,0x5D,0xC9,0x72,0xF3,0xAF,0x37 -,0x28,0x77,0x0B,0x28,0x12,0xC3,0x12,0xAC,0x91,0x5B,0xA9,0x64,0x74,0x6C,0x95 -,0x85,0x82,0xB4,0xB2,0x29,0x31,0xFD,0xE4,0xB9,0xC9,0x56,0x0C,0xB2,0xA9,0x0C -,0x6B,0xAA,0xAA,0x9A,0x8A,0xB9,0xBC,0xEA,0xAA,0x89,0x67,0x93,0x82,0xA7,0x39 -,0x1C,0xB3,0x71,0x55,0x0A,0xA3,0x27,0xD8,0x28,0x00,0x0F,0x60,0x00,0xD0,0x6E -,0x77,0x36,0xEC,0xBD,0x5F,0xCD,0x52,0x56,0xD6,0xCC,0xF4,0xF5,0x35,0xAD,0x5D -,0x2A,0xB9,0x52,0xF2,0xCC,0x57,0x88,0x79,0x1C,0x00,0x64,0x21,0x72,0x17,0x3D -,0x13,0x9B,0xF0,0x08,0x18,0x83,0xA1,0xD3,0x4D,0x03,0x4D,0x34,0xD0,0x34,0xD3 -,0x4D,0x03,0x57,0x4F,0x80,0xFB,0x3D,0x2B,0xAB,0x29,0xA5,0xAB,0x05,0x0D,0x35 -,0x55,0x0D,0x7D,0x64,0x6D,0x1E,0x0B,0x23,0xCE,0xAB,0x4D,0x11,0xE4,0x81,0x80 -,0x60,0x5E,0x66,0xC3,0x32,0x3A,0x9A,0x73,0xDD,0x75,0x52,0x58,0x28,0xE9,0xEE -,0x17,0xDB,0x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6A,0xB6,0xF1,0xD8,0x17,0x0B -,0x4D,0x33,0x79,0x57,0x14,0x02,0xAA,0xDB,0x30,0xE8,0x61,0xAA,0x88,0xF3,0x89 -,0x81,0xF6,0xF5,0x0C,0x1F,0xA1,0x3A,0xA1,0x77,0x55,0xC1,0x2E,0xB6,0xCD,0x9F -,0xE2,0x34,0x30,0x18,0x4D,0x5A,0x8B,0x65,0xCE,0x30,0x3A,0xC7,0xE6,0x36,0x00 -,0x3F,0xF6,0x75,0x0A,0x53,0xE9,0xCD,0xB5,0xCA,0xF1,0x92,0xD5,0x67,0x61,0x09 -,0xBD,0x51,0x43,0x60,0xBB,0x19,0x11,0x4A,0xD2,0x53,0x4A,0xD7,0x28,0x23,0x52 -,0x42,0xFC,0x3B,0x95,0x4A,0xD8,0x70,0x0F,0x55,0x19,0x8A,0x70,0xBD,0xBD,0x2F -,0xD3,0x59,0x95,0xD6,0x9A,0xEB,0x2F,0x88,0x1B,0x6E,0xEF,0xB5,0xEF,0xB5,0x36 -,0x17,0x89,0x65,0x4A,0x51,0x1E,0x64,0xA7,0x49,0x06,0x24,0xF2,0xC4,0x5C,0x82 -,0x84,0x75,0x12,0x16,0x51,0x80,0x78,0xF6,0xC9,0xD6,0xEB,0x7A,0xAC,0x31,0x5B -,0x62,0xBA,0x4F,0x17,0x9B,0x15,0xBE,0x61,0x34,0xE9,0xF9,0xE9,0xD8,0x18,0xEA -,0x17,0xF7,0x85,0xE4,0xFD,0xF1,0xAD,0x19,0x33,0xA6,0xC2,0x91,0x67,0x93,0xCD -,0xAF,0xDB,0x35,0x4C,0xB2,0x30,0xEA,0x58,0xD2,0xC9,0xD7,0xF7,0x78,0x87,0xEE -,0x1F,0x58,0x69,0x69,0xC5,0xE3,0x97,0x89,0x6D,0x74,0xA8,0xB1,0xFF,0x00,0x08 -,0xDA,0x5F,0x15,0x05,0x3C,0x73,0xFC,0x59,0x35,0x1C,0x5D,0x5C,0xBA,0x82,0x21 -,0x07,0x39,0x05,0x0E,0x47,0x3F,0x71,0xD7,0xAE,0xA3,0x3B,0x86,0x5D,0xCD,0xBC -,0x2A,0x52,0x7D,0xE7,0x7E,0x96,0xE5,0x14,0x6E,0x1E,0x2A,0x34,0x89,0x62,0xA5 -,0x8D,0x86,0x70,0x56,0x11,0x95,0x24,0x7E,0x69,0x0C,0x87,0xE5,0xC7,0x5A,0xBB -,0x99,0x58,0x37,0x8D,0x92,0xB9,0x08,0x29,0x57,0x0C,0xF4,0x44,0x8F,0xE6,0x25 -,0x44,0xC8,0x7F,0x61,0x13,0xFF,0x00,0xE2,0xD4,0x83,0x41,0xE5,0x4F,0x4F,0x0C -,0x0A,0x44,0x49,0x82,0xDF,0x89,0x89,0xCB,0x37,0xB7,0x52,0x7A,0x9F,0xDF,0x51 -,0x0A,0x08,0x04,0xBE,0x16,0x5D,0x2D,0x61,0xD4,0x0A,0x78,0x6B,0xA8,0x54,0xB1 -,0xE8,0xA2,0x37,0x92,0x35,0xCF,0xEC,0x17,0x52,0xDF,0x88,0xE6,0x40,0xA7,0x4F -,0x3B,0xAF,0x57,0x07,0x08,0x3F,0x7F,0x7F,0xDB,0x3F,0x5C,0x6A,0x23,0x4B,0x1C -,0x14,0xBB,0x43,0x74,0x55,0x54,0x81,0x32,0xAD,0x45,0xC2,0x47,0x5E,0xBC,0x7F -,0x9B,0x20,0x29,0x27,0xE4,0x7F,0xA9,0xD0,0x49,0xAD,0x75,0xCB,0x51,0x6B,0xA2 -,0xA8,0x2B,0x23,0x35,0x45,0x3A,0x49,0xE9,0x42,0x47,0x55,0x07,0xBE,0x30,0x3B -,0xEB,0x17,0x72,0x54,0xD4,0x41,0x45,0x4B,0x57,0x14,0x2F,0x1B,0x52,0xDC,0xA8 -,0x6A,0x39,0x12,0x32,0x38,0x55,0x44,0xD9,0x18,0xCF,0xCB,0x59,0x3B,0x66,0x9D -,0xE9,0x36,0xDD,0xB2,0x96,0x40,0x43,0xC3,0x47,0x14,0x6C,0x0F,0x7C,0x84,0x00 -,0xFF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FF,0x00,0x0A,0x8A,0x95,0x97,0xAC,0xB0,0x42 -,0x07,0xDD,0x44,0xC7,0xF3,0xE0,0xF3,0x7F,0x9B,0xBB,0x7C,0x86,0xAE,0x6D,0x34 -,0xD0,0x34,0xD7,0xCC,0xB2,0x24,0x51,0xB4,0x92,0x3A,0xA2,0x28,0xCB,0x33,0x1C -,0x00,0x3E,0xA7,0x51,0xFD,0xC5,0xB8,0x23,0xA2,0x89,0x50,0xCE,0x68,0xFC,0xD0 -,0xDE,0x59,0x31,0x17,0xA9,0x97,0x18,0xCF,0x95,0x0F,0x7E,0x99,0x39,0x77,0x1C -,0x57,0x00,0x90,0x54,0xE7,0x41,0xB8,0xAF,0xAF,0xA7,0xA3,0x28,0x92,0x33,0x3C -,0xD2,0x7F,0x75,0x0C,0x6B,0xCA,0x49,0x3A,0x81,0xD1,0x47,0xB0,0x24,0x64,0xF6 -,0x19,0xC9,0x20,0x75,0xD4,0x4B,0x73,0xEF,0x2A,0x3B,0x6A,0xB8,0xAD,0x96,0x33 -,0x2A,0xB8,0x43,0x47,0x14,0x84,0x84,0x7F,0xC4,0x12,0x57,0x50,0x4B,0x48,0x46 -,0x0F,0x93,0x18,0x66,0x39,0x3D,0x1D,0x7A,0x8A,0xE3,0x79,0xF8,0x8E,0xB4,0x94 -,0x52,0xCD,0x4B,0x50,0x96,0xEA,0x49,0xD8,0x2B,0x54,0x99,0x5A,0x49,0x6A,0x18 -,0xE4,0xAA,0xF9,0x88,0x79,0xCC,0x4F,0x2F,0x4C,0x70,0x10,0xB8,0x07,0x84,0xAF -,0x83,0x1E,0xB9,0x77,0xC4,0xDF,0x17,0x23,0xA8,0x89,0xA0,0xB4,0x55,0x65,0x5E -,0x36,0x8D,0x56,0x36,0x53,0x28,0x46,0x50,0xEB,0x96,0x41,0xE5,0x45,0x19,0x66 -,0x04,0xC7,0x1E,0x49,0x31,0x92,0x56,0x09,0x3A,0x90,0xBB,0xBC,0x4A,0xF1,0xB2 -,0x43,0x23,0xD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x17 -,0x6E,0x5C,0x77,0xFF,0x00,0x89,0x3B,0x8F,0xC7,0xFD,0xD3,0x4E,0xCA,0xD5,0xB5 -,0x12,0xC1,0x64,0x8E,0x4E,0xBC,0x17,0xF0,0x33,0x2F,0xD1,0x10,0x08,0x81,0xF7 -,0xF5,0xFC,0xB5,0xD4,0x75,0xB7,0x2A,0x2A,0x3A,0x88,0x69,0xA7,0xA8,0x51,0x51 -,0x36,0x7C,0xA8,0x17,0x2D,0x23,0x81,0xDC,0x85,0x1D,0x48,0x19,0xEA,0x71,0x81 -,0xEF,0xA0,0xCB,0xD7,0x85,0x7D,0x65,0x25,0x05,0x1C,0x95,0x95,0xD5,0x30,0xD2 -,0xD3,0x44,0x39,0x49,0x2C,0xAE,0x11,0x14,0x7C,0xC9,0x3D,0x06,0xA3,0xDB,0x87 -,0x79,0x51,0x50,0x72,0x82,0x80,0x2D,0x6D,0x48,0x63,0x1B,0x1E,0x47,0xCA,0x8D -,0xC7,0xE2,0x52,0xCA,0x09,0x77,0x00,0x1C,0xA4,0x61,0x98,0x7F,0x30,0x51,0xEA -,0xD5,0x0D,0xE2,0x67,0x8B,0x54,0x74,0x15,0x98,0x96,0xBC,0x5C,0xEE,0xC8,0x15 -,0xE3,0x45,0x95,0x23,0x8E,0x98,0x31,0x0A,0xAF,0xCB,0x98,0x8E,0x9D,0x09,0x70 -,0x3C,0xCF,0x33,0x91,0x0E,0x31,0x39,0xEB,0x1E,0x82,0xD4,0xDE,0x1E,0x20,0x14 -,0x2F,0x1D,0xBA,0x36,0xA4,0x58,0xC8,0xCD,0x45,0x44,0x7F,0x7C,0x32,0xA4,0x8E -,0x11,0x30,0xFB,0xAC,0x8C,0x90,0x64,0x1C,0xC8,0x07,0x84,0x52,0x8D,0x73,0xA7 -,0x88,0xFE,0x30,0xDA,0x2D,0xF4,0xF3,0x4D,0x1D,0x42,0x57,0x99,0x9E,0x31,0x24 -,0x8C,0xE2,0x65,0x98,0x17,0x60,0x1C,0x29,0x70,0xF5,0x61,0x4A,0xC9,0x86,0xE4 -,0xB1,0x29,0x51,0xC1,0xA0,0x7C,0x46,0x69,0x0D,0xFD,0xE2,0xD5,0xCE,0xFF,0x00 -,0xCE,0x34,0x72,0xDC,0x64,0x06,0x34,0xE2,0xBF,0x08,0x8A,0x24,0x66,0x60,0x62 -,0x65,0xFB,0xEE,0x5C,0x63,0x62,0x5C,0x2A,0x12,0x5F,0x31,0x16,0x21,0xF5,0x5A -,0x55,0xD4,0xD4,0xD6,0x54,0x35,0x45,0x5D,0x44,0xB5,0x13,0x36,0x39,0x49,0x2B -,0x96,0x63,0x81,0x81,0x92,0x7A,0xF6,0x00,0x68,0x25,0xDB,0xDB,0xC4,0x6D,0xC1 -,0xB9,0x2E,0x52,0xD5,0x0A,0xDA,0xCA,0x65,0x96,0x1F,0x2A,0x42,0xD3,0x86,0x95 -,0x83,0x23,0x2C,0xAB,0xCD,0x55,0x78,0xC6,0xFC,0xDF,0x31,0xA0,0x55,0x23,0x8F -,0x30,0xEC,0x0B,0x98,0x5E,0x9A,0x68,0x1A,0x69,0xA6,0x81,0xA6,0x9A,0x68,0x1A -,0x69,0xA6,0x81,0xA6,0x9A,0x68,0x1A,0x69,0xA6,0x81,0xA6,0x9A,0x68,0x1A,0x69 -,0xA6,0x81,0xAB,0x73,0xC0,0x9D,0xD1,0x2D,0xB1,0x25,0xA6,0x56,0xA8,0x75,0x0E -,0x94,0xF5,0x80,0xC8,0xEE,0xAB,0x4B,0x24,0xC8,0x23,0x70,0xB8,0xE3,0x1A,0xC7 -,0x3B,0x10,0x7D,0x5E,0xA3,0x59,0x90,0x3D,0x24,0x9A,0x8F,0x59,0x96,0x6B,0x8C -,0xD6,0xBB,0x82,0x56,0x41,0x1C,0x12,0x30,0x47,0x8D,0x92,0x68,0xC3,0xA3,0xA3 -,0xA1,0x47,0x52,0x3D,0xB2,0xAC,0x46,0x41,0x0C,0x33,0x95,0x20,0x80,0x40,0x5F -,0x77,0x4B,0x61,0xA1,0xBE,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0xAA,0xDD,0x74,0x34 -,0x6D,0x3D,0x0D,0x6A,0x88,0x77,0x96,0xDF,0x44,0x26,0x5A,0x69,0x80,0xE3,0xF1 -,0x51,0xA7,0xE2,0x2C,0x00,0xF5,0x01,0xD5,0x94,0x02,0x3D,0x69,0x83,0x7B,0xED -,0x2B,0xC4,0x55,0x50,0x53,0xD3,0x7F,0x10,0x8E,0xE1,0x14,0xD0,0xF9,0xF6,0xFA -,0xF4,0x70,0xCB,0x5B,0x07,0x4C,0x36,0x47,0x4E,0x6B,0x90,0x1B,0xE7,0x90,0xC3 -,0x19,0x2A,0xBD,0xE3,0x8E,0x1C,0xD9,0xD4,0xF0,0x3D,0x55,0x04,0xF6,0x8B,0xD2 -,0x25,0x50,0x28,0x63,0x77,0x65,0x1C,0x6A,0x63,0x3D,0x39,0x10,0x3A,0x03,0x8E -,0x8C,0x07,0xBF,0x51,0x80,0x46,0xBC,0x2C,0xB5,0x15,0x14,0x35,0x7F,0xC0,0xEE -,0x52,0xBC,0xB2,0x2A,0x96,0xA3,0xA9,0x73,0x93,0x53,0x10,0xF6,0x63,0xFE,0xB1 -,0x7A,0x03,0xF9,0x86,0x18,0x77,0x60,0xBB,0xAD,0x62,0x5D,0xA8,0x22,0xB8,0xD2 -,0x79,0x2E,0xEF,0x14,0x8A,0xC2,0x48,0x66,0x8F,0x1C,0xE1,0x90,0x76,0x75,0xCF -,0xB8,0xF9,0x1E,0x84,0x12,0x08,0x20,0x91,0xA6,0x0C,0xA6,0x50,0xCA,0x55,0x80 -,0x2A,0x46,0x08,0x23,0xA1,0xD5,0x2F,0x7E,0xB5,0x9B,0x47,0x8C,0xF6,0x2B,0x5D -,0x2C,0xB1,0x9B,0x75,0x36,0xDE,0xAE,0x7A,0x58,0x40,0x3C,0xE9,0xD1,0xAA,0x29 -,0x87,0x96,0x4F,0x62,0x80,0x8F,0x40,0xE9,0x80,0x08,0xEC,0x06,0xAD,0x6B,0x1D -,0xCA,0x4A,0x96,0x9A,0x82,0x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A,0xEE,0xED,0xCB,0x71,0xDC,0x97,0x6A -,0x3A,0x3A,0xA1,0x25,0x55,0x55,0x54,0xD2,0xA4,0x09,0xF0,0xF1,0x48,0x55,0x03 -,0xB1,0xFC,0xC7,0xD5,0x80,0x48,0x38,0xE9,0xAA,0x7B,0x72,0x6E,0xF1,0xB9,0xFC -,0x47,0xAC,0xAA,0xA0,0x72,0xD0,0xD1,0xCD,0x2C,0x16,0xC9,0x02,0xB3,0x21,0xE7 -,0x3C,0xAE,0x26,0x08,0x0E,0x64,0x90,0xF9,0x8C,0x16,0x30,0xAD,0x90,0x7D,0xBA -,0x91,0x8B,0x5B,0x5A,0x88,0xC6,0xD2,0xBA,0xB6,0x82,0xC9,0x6D,0xB7,0x5A,0x2B -,0x9C,0x4B,0x43,0x63,0x48,0x66,0xB8,0x41,0x14,0x65,0x05,0x54,0xEB,0x83,0x0C -,0x00,0xE0,0x06,0x32,0x3A,0xF2,0x6C,0x86,0xF4,0xAB,0x36,0x7E,0x7A,0xCD,0x8D -,0x4F,0x0E,0xF8,0xDF,0x16,0xC3,0xB9,0xEB,0xAB,0xED,0x16,0x45,0x4A,0x8B,0x9D -,0x55,0x74,0x14,0xB2,0xB4,0xB5,0x05,0xDF,0x8C,0xAD,0x94,0x0E,0xD1,0x42,0xCE -,0x4C,0x7E,0x6E,0x38,0x2F,0x5F,0xE6,0xC8,0xD4,0x4F,0x72,0x5F,0x29,0x62,0x85 -,0x9A,0x86,0x78,0xB9,0xB1,0x61,0x0C,0x00,0x89,0x24,0x06,0x40,0x1E,0x4A,0x99 -,0x9D,0x7E,0xEF,0x9C,0x9C,0x94,0x70,0x42,0x4A,0x84,0x28,0xC5,0x42,0x71,0x92 -,0x27,0x7A,0xBA,0x57,0x5E,0x6E,0x73,0x5C,0xAE,0x53,0x99,0xEA,0x66,0x23,0x93 -,0x71,0x0A,0xA0,0x00,0x15,0x55,0x55,0x40,0x54,0x45,0x50,0x15,0x55,0x40,0x55 -,0x50,0x00,0x00,0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A,0x66,0x47,0xA7,0x78,0xC0,0x0D -,0xE9,0x11,0xA9,0xCB,0x67,0x96,0x06,0x35,0x67,0xD5,0xFD,0xA4,0xA6,0x8B,0x6E -,0x51,0x45,0x47,0x67,0xB0,0x4F,0x74,0x1C,0x3E,0x26,0x41,0xB5,0x29,0xE9,0x5E -,0x2F,0x49,0xE4,0x63,0x9B,0xCF,0x95,0x0B,0x06,0xC0,0x04,0xD3,0x80,0x46,0x4E -,0x17,0x1C,0x4F,0x3A,0x69,0xA0,0x92,0x6E,0xDD,0xEB,0x7F,0xDC,0xF5,0x32,0x55 -,0x5C,0xEA,0xDD,0xAA,0x6A,0x23,0xE1,0x5B,0x32,0xCB,0x21,0x7A,0xD3,0xC8,0x36 -,0x65,0x2C,0xC7,0x20,0x15,0x4C,0x20,0xC2,0x2F,0x00,0x55,0x54,0xE4,0x98,0xDE -,0x9A,0x68,0x1A,0x69,0xA6,0x81,0xA6,0x9A,0x68,0x1A,0x69,0xA6,0x81,0xA6,0x9A -,0x68,0x1A,0x69,0xA6,0x81,0xA6,0x9A,0x68,0x1A,0x69,0xA6,0x81,0xA6,0x9A,0x68 -,0x1A,0x69,0xA6,0x81,0xA6,0x9A,0x68,0x1A,0x69,0xA6,0x81,0xA6,0x9A,0x68,0x1A -,0x69,0xA6,0x81,0xA6,0x9A,0x68,0x1A,0x69,0xA6,0x81,0xA6,0x9A,0x68,0x1A,0x69 -,0xA6,0x81,0xA6,0x9A,0x68,0x1A,0x69,0xA6,0x81,0xA6,0x9A,0x68,0x1A,0x69,0xA6 -,0x81,0xA6,0x9A,0x68,0x1A,0x69,0xA6,0x81,0xA6,0x9A,0x68,0x1A,0x69,0xA6,0x81 -,0xA6,0x9A,0x68,0x1A,0x69,0xA6,0x81,0xA6,0x9A,0x68,0x1A,0x69,0xA6,0x81,0xA6 -,0x9A,0x68,0x1A,0x69,0xA6,0x81,0xA6,0x9A,0x68,0x3F,0xFF,0xD9}; -/* end binary data. size = 22092 bytes */ -#endif - -mblk_t *ms_load_generate_yuv(MSVideoSize *reqsize) -{ - YuvBuf buf; - mblk_t *m=NULL; -#ifndef MS2_MINIMAL_SIZE - m=jpeg2yuv((uint8_t*)&def_mire,sizeof(def_mire),reqsize); - if (m!=NULL) - { - return m; - } -#endif - - m = yuv_buf_alloc(&buf, reqsize->width, reqsize->height); - int ysize=buf.strides[0]*buf.h; - memset(buf.planes[0],16,ysize); - memset(buf.planes[1],128,ysize/4); - memset(buf.planes[2],128,ysize/4); - buf.planes[3]=NULL; - return m; -} - -mblk_t *ms_load_jpeg_as_yuv(const char *jpgpath, MSVideoSize *reqsize){ - mblk_t *m=NULL; - struct stat statbuf; - uint8_t *jpgbuf; -#if !defined(_MSC_VER) - int fd=open(jpgpath,O_RDONLY); -#else - int fd=_open(jpgpath,O_RDONLY); -#endif - if (fd!=-1){ - fstat(fd,&statbuf); - if (statbuf.st_size<=0) - { -#if !defined(_MSC_VER) - close(fd); -#else - _close(fd); -#endif - ms_error("Cannot load %s",jpgpath); - m=ms_load_generate_yuv(reqsize); - return m; - } - jpgbuf=(uint8_t*)ms_malloc0(statbuf.st_size); - if (jpgbuf==NULL) - { -#if !defined(_MSC_VER) - close(fd); -#else - _close(fd); -#endif - ms_error("Cannot allocate buffer for %s",jpgpath); - m=ms_load_generate_yuv(reqsize); - return m; - } -#if !defined(_MSC_VER) - read(fd,jpgbuf,statbuf.st_size); -#else - _read(fd,jpgbuf,statbuf.st_size); -#endif - m=jpeg2yuv(jpgbuf,statbuf.st_size,reqsize); - ms_free(jpgbuf); - if (m==NULL) - { -#if !defined(_MSC_VER) - close(fd); -#else - _close(fd); -#endif - ms_error("Cannot load image from buffer for %s",jpgpath); - m=ms_load_generate_yuv(reqsize); - return m; - } - }else{ - m=ms_load_generate_yuv(reqsize); - ms_error("Cannot load %s",jpgpath); - return m; - } -#if !defined(_MSC_VER) - close(fd); -#else - _close(fd); -#endif - return m; -} - - - -#ifndef PACKAGE_DATA_DIR -#define PACKAGE_DATA_DIR "." -#endif - -#ifndef NOWEBCAM_JPG -#define NOWEBCAM_JPG "nowebcamCIF" -#endif - -static char *def_image=NULL; - -static const char *def_image_path=PACKAGE_DATA_DIR "/images/" NOWEBCAM_JPG ".jpg"; - - -mblk_t *ms_load_nowebcam(MSVideoSize *reqsize, int idx){ - char tmp[256]; - if (idx<0) - snprintf(tmp, sizeof(tmp), "%s/images/%s.jpg", PACKAGE_DATA_DIR, NOWEBCAM_JPG); - else - snprintf(tmp, sizeof(tmp), "%s/images/%s%i.jpg", PACKAGE_DATA_DIR, NOWEBCAM_JPG, idx); - return ms_load_jpeg_as_yuv(tmp,reqsize); -} - -typedef struct _SIData{ - MSVideoSize vsize; - char *nowebcamimage; - uint64_t lasttime; - mblk_t *pic; -}SIData; - -void static_image_init(MSFilter *f){ - SIData *d=(SIData*)ms_new(SIData,1); - d->vsize.width=MS_VIDEO_SIZE_CIF_W; - d->vsize.height=MS_VIDEO_SIZE_CIF_H; - - if (def_image==NULL) - def_image=ms_strdup(def_image_path); - - d->nowebcamimage=ms_strdup(def_image); - d->lasttime=0; - d->pic=NULL; - f->data=d; -} - -void static_image_uninit(MSFilter *f){ - SIData *d=(SIData*)f->data; - ms_free(d->nowebcamimage); - ms_free(d); -} - -void static_image_preprocess(MSFilter *f){ - SIData *d=(SIData*)f->data; - if (d->pic==NULL){ - d->pic=ms_load_jpeg_as_yuv(d->nowebcamimage,&d->vsize); - } -} - -void static_image_process(MSFilter *f){ - SIData *d=(SIData*)f->data; - /*output a frame every second*/ - if ((f->ticker->time - d->lasttime>1000) || d->lasttime==0){ - ms_mutex_lock(&f->lock); - if (d->pic) { - mblk_t *o=dupb(d->pic); - /*prevent mirroring at the output*/ - mblk_set_precious_flag(o,1); - ms_queue_put(f->outputs[0],o); - } - ms_mutex_unlock(&f->lock); - d->lasttime=f->ticker->time; - } -} - -void static_image_postprocess(MSFilter *f){ - SIData *d=(SIData*)f->data; - if (d->pic) { - freemsg(d->pic); - d->pic=NULL; - } -} - -int static_image_set_vsize(MSFilter *f, void* data){ - SIData *d=(SIData*)f->data; - d->vsize=*(MSVideoSize*)data; - return 0; -} - -int static_image_get_vsize(MSFilter *f, void* data){ - SIData *d=(SIData*)f->data; - *(MSVideoSize*)data=d->vsize; - return 0; -} - -int static_image_get_pix_fmt(MSFilter *f, void *data){ - *(MSPixFmt*)data=MS_YUV420P; - return 0; -} - -static int static_image_set_image(MSFilter *f, void *arg){ - SIData *d=(SIData*)f->data; - const char *image = (const char *)arg; - ms_filter_lock(f); - if (d->nowebcamimage) ms_free(d->nowebcamimage); - if (image!=NULL && image[0]!='\0') - d->nowebcamimage=ms_strdup(image); - else - d->nowebcamimage = ms_strdup(def_image); - - if (d->pic!=NULL){ - freemsg(d->pic); - d->pic=NULL; - } - - ms_filter_unlock(f); - return 0; -} - -MSFilterMethod static_image_methods[]={ - { MS_FILTER_SET_VIDEO_SIZE, static_image_set_vsize }, - { MS_FILTER_GET_VIDEO_SIZE, static_image_get_vsize }, - { MS_FILTER_GET_PIX_FMT, static_image_get_pix_fmt }, - { MS_FILTER_SET_IMAGE, static_image_set_image }, - { 0,0 } -}; - -MSFilterDesc ms_static_image_desc={ - MS_STATIC_IMAGE_ID, - "MSStaticImage", - N_("A filter that outputs a static image."), - MS_FILTER_OTHER, - NULL, - 0, - 1, - static_image_init, - static_image_preprocess, - static_image_process, - static_image_postprocess, - static_image_uninit, - static_image_methods -}; - -MS_FILTER_DESC_EXPORT(ms_static_image_desc) - -static void static_image_detect(MSWebCamManager *obj); - -static void static_image_cam_init(MSWebCam *cam){ - cam->name=ms_strdup("Static picture"); -} - - -static MSFilter *static_image_create_reader(MSWebCam *obj){ - return ms_filter_new_from_desc(&ms_static_image_desc); -} - -MSWebCamDesc static_image_desc={ - "StaticImage", - &static_image_detect, - &static_image_cam_init, - &static_image_create_reader, - NULL -}; - -static void static_image_detect(MSWebCamManager *obj){ - MSWebCam *cam=ms_web_cam_new(&static_image_desc); - ms_web_cam_manager_add_cam(obj,cam); -} - -void ms_static_image_set_default_image(const char *path){ - if (def_image!=NULL) - ms_free(def_image); - def_image=NULL; - if (path) - def_image=ms_strdup(path); -} diff --git a/linphone/mediastreamer2/src/nowebcam.h b/linphone/mediastreamer2/src/nowebcam.h deleted file mode 100644 index b77ec505d..000000000 --- a/linphone/mediastreamer2/src/nowebcam.h +++ /dev/null @@ -1,28 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -#ifndef nowebcam_h -#define nowebcam_h - -mblk_t *ms_load_jpeg_as_yuv(const char *path, MSVideoSize *reqsize); -mblk_t *ms_load_nowebcam(MSVideoSize *reqsize, int idx); - -#endif - diff --git a/linphone/mediastreamer2/src/nowebcamCIF.jpg b/linphone/mediastreamer2/src/nowebcamCIF.jpg deleted file mode 100644 index 2ab8bdc2ace897259946d67357523a6c9796cd3a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14247 zcmdtIWmua{v?v;!7H^@rQ(OwgElBYK#T`m1uutw z-?@9A{XBR7xcA3-o^vK6nXH-hu6MF#md)er<0=4OQC2|~fP{nukbn9B9@hY`WV~!F z0RUxX04o3hz2U!d4M0OdMMXtHd#cdT(9kikF)^MJ9v0R!Yy!L&F9`4m2wuLT zAbv?mMnphBLQ6tMNl8sj{gRlDfsTrSf{L2zFA}7usTk-OxR{u@RD=YCRR5pTV+Vi$ z6Nv`tBMK570GR*@g#hXC7l0A~KtcncApJ}2KQ-zTiI_;pD9@h2AMgQ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w;yYehyrMXc#v{BRZE)ikp&Bp5DFBmjZjyFs@?R1IT?g;zuE3kCqvLw?h_ zpCye8y$h6-*~Jru;56rohZ+4 zg;%Y)o`+Vz;{Eq0R`YZTu`{Yx(?-RR0*onmwn9oCD26 zMcc0j@a-Qwdt0A<%u8Ln5)hzvz@8xR1vdP#MCO?s7#cC=p3jCmY0e(bs<6EnLwR8NNB_Mf2B?vaR zQ3083Sa2I=sz*JKXeyXwCsg1Z1X*9FIy91?u2R3xW2`|GOwBXtIGrXn#2DCuOG`3U z=wqD}I%p*x;xG9^m6tg+OduC2yIXeBl%m0Tvlt2a5r49QXOf*FiMO;Eqlw)RvLoQ2 z9j%AZ^LSX-q86l}asOM410Uc4 zNPAB4gN0MFHd37MXmY$Ne+?lykLoB2;~3bKl_p@I*9ZqG+$eVSejncSf&jfT&q<^( zlwXVT-bO`uZ<#yQeB6=WhzOox^BOxfi8vkWnByx-4wD^~ECYmwpYP)83H34vIJ^T% z1&uAw>GvwZeQ`o4f&O_-3TW>k$#rLuDafNpY#dKltDi;mie#5PX_EhOGhKiSMPH@1!cg{&znvD7F;UD*gX?Aaa=P zs%!w?m7A1>@Rx-v!~NAyWrnb9>u0UXN+6!NAq^1GnucI6@0^B4J1=rSyiX)4R=+me zhA`2iMJKVw?*o=^KRourr%=%Fa0&ozr7As^1Is`)?f - -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_ALLOCA_H /*FreeBSD does not have alloca.h*/ -#include -#endif - -MSFilter *ms_oss_read_new(MSSndCard *card); -MSFilter *ms_oss_write_new(MSSndCard *card); - -static int oss_open(const char *devname, int bits,int stereo, int rate, int *minsz) -{ - int fd; - int p=0,cond=0; - int i=0; - int min_size=0,blocksize=512; - int err; - int frag; - audio_buf_info info; - - //g_message("opening sound device"); - fd=open(devname,O_RDWR|O_NONBLOCK); - if (fd<0) return -EWOULDBLOCK; - /* unset nonblocking mode */ - /* We wanted non blocking open but now put it back to normal ; thanks Xine !*/ - fcntl(fd, F_SETFL, fcntl(fd, F_GETFL)&~O_NONBLOCK); - - /* reset is maybe not needed but takes time*/ - /*ioctl(fd, SNDCTL_DSP_RESET, 0); */ - - /* This code is used to limit the internal buffer of the sound - card so that no internal delay can occur in the sound card */ - frag = ( ( 32767 << 16 ) | 7 ); - if( ioctl( fd, SNDCTL_DSP_SETFRAGMENT, &frag ) ) { - ms_warning("oss_open: can't set fragment size:%s.",strerror(errno)); - } - - p=AFMT_S16_NE; - - err=ioctl(fd,SNDCTL_DSP_SETFMT,&p); - if (err<0){ - ms_warning("oss_open: can't set sample format:%s.",strerror(errno)); - } - - - p = bits; /* 16 bits */ - err=ioctl(fd, SNDCTL_DSP_SAMPLESIZE, &p); - if (err<0){ - ms_warning("oss_open: can't set sample size to %i:%s.",bits,strerror(errno)); - } - - p = rate; /* rate in khz*/ - err=ioctl(fd, SNDCTL_DSP_SPEED, &p); - if (err<0){ - ms_warning("oss_open: can't set sample rate to %i:%s.",rate,strerror(errno)); - } - - p = stereo; /* stereo or not */ - err=ioctl(fd, SNDCTL_DSP_STEREO, &p); - if (err<0){ - ms_warning("oss_open: can't set mono/stereo mode:%s.",strerror(errno)); - } - - if (rate==16000) blocksize=4096; /* oss emulation is not very good at 16khz */ - else blocksize=blocksize*(rate/8000); - ioctl(fd, SNDCTL_DSP_GETBLKSIZE, &min_size); - - /* try to subdivide BLKSIZE to reach blocksize if necessary */ - if (min_size>blocksize) - { - cond=1; - p=min_size/blocksize; - while(cond) - { - i=ioctl(fd, SNDCTL_DSP_SUBDIVIDE, &p); - //printf("SUB_DIVIDE said error=%i,errno=%i\n",i,errno); - if ((i==0) || (p==1)) cond=0; - else p=p/2; - } - } - ioctl(fd, SNDCTL_DSP_GETBLKSIZE, &min_size); - if (min_size>blocksize) - { - ms_warning("dsp block size set to %i.",min_size); - }else{ - /* no need to access the card with less latency than needed*/ - min_size=blocksize; - } - - ms_message("/dev/dsp opened: rate=%i,bits=%i,stereo=%i blocksize=%i.", - rate,bits,stereo,min_size); - - if( ioctl( fd, SNDCTL_DSP_GETISPACE, &info ) == -1 ) { - ms_warning("oss_open: can't get ispace:%s.",strerror(errno)); - } - else{ - ms_warning("oss_open: audio buffer size: %i.", info.fragsize * sizeof( short )); - } - - - /* start recording !!! Alex */ - { - int fl,res; - - fl=PCM_ENABLE_OUTPUT|PCM_ENABLE_INPUT; - res=ioctl(fd, SNDCTL_DSP_SETTRIGGER, &fl); - if (res<0) ms_warning("OSS_TRIGGER: %s",strerror(errno)); - } - *minsz=min_size; - return fd; -} - -typedef struct OssData{ - char *pcmdev; - char *mixdev; - int pcmfd; - int rate; - int bits; - ms_thread_t thread; - ms_mutex_t mutex; - queue_t rq; - MSBufferizer * bufferizer; - bool_t read_started; - bool_t write_started; - bool_t stereo; -} OssData; - -static void oss_set_level(MSSndCard *card, MSSndCardMixerElem e, int percent) -{ - OssData *d=(OssData*)card->data; - int p,mix_fd; - int osscmd; - if (d->mixdev==NULL) return; - switch(e){ - case MS_SND_CARD_MASTER: - osscmd=SOUND_MIXER_VOLUME; - break; - case MS_SND_CARD_CAPTURE: - osscmd=SOUND_MIXER_IGAIN; - break; - case MS_SND_CARD_PLAYBACK: - osscmd=SOUND_MIXER_PCM; - break; - default: - ms_warning("oss_card_set_level: unsupported command."); - return; - } - p=(((int)percent)<<8 | (int)percent); - mix_fd = open(d->mixdev, O_WRONLY); - ioctl(mix_fd,MIXER_WRITE(osscmd), &p); - close(mix_fd); -} - -static int oss_get_level(MSSndCard *card, MSSndCardMixerElem e) -{ - OssData *d=(OssData*)card->data; - int p=0,mix_fd; - int osscmd; - if (d->mixdev==NULL) return -1; - switch(e){ - case MS_SND_CARD_MASTER: - osscmd=SOUND_MIXER_VOLUME; - break; - case MS_SND_CARD_CAPTURE: - osscmd=SOUND_MIXER_IGAIN; - break; - case MS_SND_CARD_PLAYBACK: - osscmd=SOUND_MIXER_PCM; - break; - default: - ms_warning("oss_card_get_level: unsupported command."); - return -1; - } - mix_fd = open(d->mixdev, O_RDONLY); - ioctl(mix_fd,MIXER_READ(osscmd), &p); - close(mix_fd); - return p>>8; -} - -static void oss_set_source(MSSndCard *card, MSSndCardCapture source) -{ - OssData *d=(OssData*)card->data; - int p=0; - int mix_fd; - if (d->mixdev==NULL) return; - - switch(source){ - case MS_SND_CARD_MIC: - p = 1 << SOUND_MIXER_MIC; - break; - case MS_SND_CARD_LINE: - p = 1 << SOUND_MIXER_LINE; - break; - } - - mix_fd = open(d->mixdev, O_WRONLY); - ioctl(mix_fd, SOUND_MIXER_WRITE_RECSRC, &p); - close(mix_fd); -} - -static void oss_init(MSSndCard *card){ - OssData *d=ms_new(OssData,1); - d->pcmdev=NULL; - d->mixdev=NULL; - d->pcmfd=-1; - d->read_started=FALSE; - d->write_started=FALSE; - d->bits=16; - d->rate=8000; - d->stereo=FALSE; - qinit(&d->rq); - d->bufferizer=ms_bufferizer_new(); - ms_mutex_init(&d->mutex,NULL); - card->data=d; -} - -static void oss_uninit(MSSndCard *card){ - OssData *d=(OssData*)card->data; - if (d->pcmdev!=NULL) ms_free(d->pcmdev); - if (d->mixdev!=NULL) ms_free(d->mixdev); - ms_bufferizer_destroy(d->bufferizer); - flushq(&d->rq,0); - ms_mutex_destroy(&d->mutex); - ms_free(d); -} - -#define DSP_NAME "/dev/dsp" -#define MIXER_NAME "/dev/mixer" - -static void oss_detect(MSSndCardManager *m); -static MSSndCard *oss_duplicate(MSSndCard *obj); - -MSSndCardDesc oss_card_desc={ - .driver_type="OSS", - .detect=oss_detect, - .init=oss_init, - .set_level=oss_set_level, - .get_level=oss_get_level, - .set_capture=oss_set_source, - .set_control=NULL, - .get_control=NULL, - .create_reader=ms_oss_read_new, - .create_writer=ms_oss_write_new, - .uninit=oss_uninit, - .duplicate=oss_duplicate -}; - -static MSSndCard *oss_duplicate(MSSndCard *obj){ - MSSndCard *card=ms_snd_card_new(&oss_card_desc); - OssData *dcard=(OssData*)card->data; - OssData *dobj=(OssData*)obj->data; - dcard->pcmdev=ms_strdup(dobj->pcmdev); - dcard->mixdev=ms_strdup(dobj->mixdev); - card->name=ms_strdup(obj->name); - return card; -} - -static MSSndCard *oss_card_new(const char *pcmdev, const char *mixdev){ - MSSndCard *card=ms_snd_card_new(&oss_card_desc); - OssData *d=(OssData*)card->data; - d->pcmdev=ms_strdup(pcmdev); - d->mixdev=ms_strdup(mixdev); - card->name=ms_strdup(pcmdev); - return card; -} - -static void oss_detect(MSSndCardManager *m){ - int i; - char pcmdev[sizeof(DSP_NAME)+3]; - char mixdev[sizeof(MIXER_NAME)+3]; - if (access(DSP_NAME,F_OK)==0){ - MSSndCard *card=oss_card_new(DSP_NAME,MIXER_NAME); - ms_snd_card_manager_add_card(m,card); - } - for(i=0;i<10;i++){ - snprintf(pcmdev,sizeof(pcmdev),"%s%i",DSP_NAME,i); - snprintf(mixdev,sizeof(mixdev),"%s%i",MIXER_NAME,i); - if (access(pcmdev,F_OK)==0){ - MSSndCard *card=oss_card_new(pcmdev,mixdev); - ms_snd_card_manager_add_card(m,card); - } - } -} - -static void * oss_thread(void *p){ - MSSndCard *card=(MSSndCard*)p; - OssData *d=(OssData*)card->data; - int bsize=0; - uint8_t *rtmpbuff=NULL; - uint8_t *wtmpbuff=NULL; - int err; - mblk_t *rm=NULL; - d->pcmfd=oss_open(d->pcmdev,d->bits,d->stereo,d->rate,&bsize); - if (d->pcmfd>=0){ - rtmpbuff=(uint8_t*)malloc(bsize); - wtmpbuff=(uint8_t*)malloc(bsize); - if(rtmpbuff == NULL || wtmpbuff == NULL) { - free(rtmpbuff); - free(wtmpbuff); - return NULL; - } - } - while(d->read_started || d->write_started){ - if (d->pcmfd>=0){ - if (d->read_started){ - struct timeval timeout; - fd_set read_fds; - audio_buf_info info; - if (rm==NULL) rm=allocb(bsize,0); - - timeout.tv_sec = 0; - timeout.tv_usec = 0; - FD_ZERO( &read_fds ); - FD_SET( d->pcmfd, &read_fds ); - if( select( d->pcmfd + 1, &read_fds, NULL, NULL, &timeout ) == -1 ) { - } - if (FD_ISSET( d->pcmfd, &read_fds ) && ioctl( d->pcmfd, SNDCTL_DSP_GETISPACE, &info ) != -1) - { - if (info.bytes>=bsize) - { - err=read(d->pcmfd,rm->b_wptr,bsize); - if (err<0){ - ms_warning("Fail to read %i bytes from soundcard: %s", - bsize,strerror(errno)); - }else{ - rm->b_wptr+=err; - ms_mutex_lock(&d->mutex); - putq(&d->rq,rm); - ms_mutex_unlock(&d->mutex); - rm=NULL; - } - } - else - { - timeout.tv_sec = 0; - timeout.tv_usec = 5000; - select(0, 0, NULL, NULL, &timeout ); - } - } - else - { - timeout.tv_sec = 0; - timeout.tv_usec = 5000; - select(0, 0, NULL, NULL, &timeout ); - } - }else { - int sz = read(d->pcmfd,rtmpbuff,bsize); - if( sz!=bsize) ms_warning("sound device read returned %i !",sz); - } - if (d->write_started){ - - audio_buf_info info; - if( ms_bufferizer_get_avail(d->bufferizer)>=bsize && ioctl( d->pcmfd, SNDCTL_DSP_GETOSPACE, &info ) == 0 ) { - if( info.fragstotal - info.fragments > 15 ) { - static int c=0; - /* drop the fragment if the buffer starts to fill up */ - /* we got too much data: I prefer to empty the incoming buffer */ - while (ms_bufferizer_get_avail(d->bufferizer)>bsize*4){ - ms_mutex_lock(&d->mutex); - err=ms_bufferizer_read(d->bufferizer,wtmpbuff,bsize); - err=ms_bufferizer_read(d->bufferizer,wtmpbuff,bsize); - err=ms_bufferizer_read(d->bufferizer,wtmpbuff,bsize); - err=ms_bufferizer_read(d->bufferizer,wtmpbuff,bsize); - ms_mutex_unlock(&d->mutex); - c=c+err*4; - ms_warning("drop fragment when buffer gets too much data (%i - discarded:%i)", info.fragstotal - info.fragments, c); - if (err==0) - break; - } - - }else { - ms_mutex_lock(&d->mutex); - err=ms_bufferizer_read(d->bufferizer,wtmpbuff,bsize); - ms_mutex_unlock(&d->mutex); - err=write(d->pcmfd,wtmpbuff,bsize); - if (err<0){ - ms_warning("Fail to write %i bytes from soundcard: %s", - bsize,strerror(errno)); - } - } - } - - }else { - int sz; - memset(wtmpbuff,0,bsize); - sz = write(d->pcmfd,wtmpbuff,bsize); - if( sz!=bsize) ms_warning("sound device write returned %i !",sz); - } - }else usleep(20000); - } - if (d->pcmfd>=0) { - close(d->pcmfd); - d->pcmfd=-1; - } - free(rtmpbuff); - free(wtmpbuff); - if (rm!=NULL) freemsg(rm); - /*reset to default parameters */ - //d->bits=16; - //d->rate=8000; - //d->stereo=FALSE; - return NULL; -} - -static void oss_start_r(MSSndCard *card){ - OssData *d=(OssData*)card->data; - ms_mutex_lock(&d->mutex); - if (d->read_started==FALSE && d->write_started==FALSE){ - d->read_started=TRUE; - ms_thread_create(&d->thread,NULL,oss_thread,card); - }else d->read_started=TRUE; - flushq(&d->rq,0); - ms_mutex_unlock(&d->mutex); -} - -static void oss_stop_r(MSSndCard *card){ - OssData *d=(OssData*)card->data; - d->read_started=FALSE; - if (d->write_started==FALSE){ - ms_thread_join(d->thread,NULL); - } -} - -static void _flush_buffer(MSBufferizer *obj){ - flushq(&obj->q,0); - obj->size=0; -} - -static void oss_start_w(MSSndCard *card){ - OssData *d=(OssData*)card->data; - ms_mutex_lock(&d->mutex); - if (d->read_started==FALSE && d->write_started==FALSE){ - d->write_started=TRUE; - ms_thread_create(&d->thread,NULL,oss_thread,card); - }else{ - d->write_started=TRUE; - } - _flush_buffer(d->bufferizer); - ms_mutex_unlock(&d->mutex); -} - -static void oss_stop_w(MSSndCard *card){ - OssData *d=(OssData*)card->data; - d->write_started=FALSE; - if (d->read_started==FALSE){ - ms_thread_join(d->thread,NULL); - } -} - -static mblk_t *oss_get(MSSndCard *card){ - OssData *d=(OssData*)card->data; - mblk_t *m; - ms_mutex_lock(&d->mutex); - m=getq(&d->rq); - ms_mutex_unlock(&d->mutex); - return m; -} - -static void oss_put(MSSndCard *card, mblk_t *m){ - OssData *d=(OssData*)card->data; - ms_mutex_lock(&d->mutex); - ms_bufferizer_put(d->bufferizer,m); - ms_mutex_unlock(&d->mutex); -} - - -static void oss_read_preprocess(MSFilter *f){ - MSSndCard *card=(MSSndCard*)f->data; - oss_start_r(card); -} - -static void oss_read_postprocess(MSFilter *f){ - MSSndCard *card=(MSSndCard*)f->data; - oss_stop_r(card); -} - -static void oss_read_process(MSFilter *f){ - MSSndCard *card=(MSSndCard*)f->data; - mblk_t *m; - while((m=oss_get(card))!=NULL){ - ms_queue_put(f->outputs[0],m); - } -} - -static void oss_write_preprocess(MSFilter *f){ - MSSndCard *card=(MSSndCard*)f->data; - oss_start_w(card); -} - -static void oss_write_postprocess(MSFilter *f){ - MSSndCard *card=(MSSndCard*)f->data; - oss_stop_w(card); -} - -static void oss_write_process(MSFilter *f){ - MSSndCard *card=(MSSndCard*)f->data; - mblk_t *m; - while((m=ms_queue_get(f->inputs[0]))!=NULL){ - oss_put(card,m); - } -} - -static int get_rate(MSFilter *f, void *arg){ - MSSndCard *card=(MSSndCard*)f->data; - OssData *d=(OssData*)card->data; - *((int*)arg)=d->rate; - return 0; -} - -static int set_rate(MSFilter *f, void *arg){ - MSSndCard *card=(MSSndCard*)f->data; - OssData *d=(OssData*)card->data; - d->rate=*((int*)arg); - return 0; -} - -static int set_nchannels(MSFilter *f, void *arg){ - MSSndCard *card=(MSSndCard*)f->data; - OssData *d=(OssData*)card->data; - d->stereo=(*((int*)arg)==2); - return 0; -} - -static MSFilterMethod oss_methods[]={ - { MS_FILTER_GET_SAMPLE_RATE , get_rate }, - { MS_FILTER_SET_SAMPLE_RATE , set_rate }, - { MS_FILTER_SET_NCHANNELS , set_nchannels }, - { 0 , NULL } -}; - -MSFilterDesc oss_read_desc={ - .id=MS_OSS_READ_ID, - .name="MSOssRead", - .text=N_("Sound capture filter for OSS drivers"), - .category=MS_FILTER_OTHER, - .ninputs=0, - .noutputs=1, - .preprocess=oss_read_preprocess, - .process=oss_read_process, - .postprocess=oss_read_postprocess, - .methods=oss_methods -}; - - -MSFilterDesc oss_write_desc={ - .id=MS_OSS_WRITE_ID, - .name="MSOssWrite", - .text=N_("Sound playback filter for OSS drivers"), - .category=MS_FILTER_OTHER, - .ninputs=1, - .noutputs=0, - .preprocess=oss_write_preprocess, - .process=oss_write_process, - .postprocess=oss_write_postprocess, - .methods=oss_methods -}; - -MSFilter *ms_oss_read_new(MSSndCard *card){ - MSFilter *f=ms_filter_new_from_desc(&oss_read_desc); - f->data=card; - return f; -} - - -MSFilter *ms_oss_write_new(MSSndCard *card){ - MSFilter *f=ms_filter_new_from_desc(&oss_write_desc); - f->data=card; - return f; -} - -MS_FILTER_DESC_EXPORT(oss_read_desc) -MS_FILTER_DESC_EXPORT(oss_write_desc) diff --git a/linphone/mediastreamer2/src/pasnd.c b/linphone/mediastreamer2/src/pasnd.c deleted file mode 100644 index abba82abc..000000000 --- a/linphone/mediastreamer2/src/pasnd.c +++ /dev/null @@ -1,597 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include - -#include "mediastreamer2/mssndcard.h" -#include "mediastreamer2/msfilter.h" - -#include "portaudio.h" - -MSFilter *ms_pasnd_read_new(MSSndCard *card); -MSFilter *ms_pasnd_write_new(MSSndCard *card); - -typedef struct PASndData{ - char *pcmdev; - char *mixdev; - int sound_err; - char waveoutbuffer[30][3200]; - PaStream *waveoutdev; - - PaStream *waveindev; - - int rate; - int bits; - ms_thread_t thread; - ms_mutex_t mutex; - queue_t rq; - MSBufferizer * bufferizer; - bool_t read_started; - bool_t write_started; - bool_t stereo; - - SpeexPreprocessState *pst; -} PASndData; - -int SpeakerCallback( const void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, - const PaStreamCallbackTimeInfo* timeInfo, - PaStreamCallbackFlags statusFlags, - void *userData ) -{ - PASndData *device = (PASndData*)userData; - uint8_t *wtmpbuff=NULL; - int err; - int ovfl = (device->rate/8000)*320*6; - - memset(outputBuffer,0, framesPerBuffer*2); - if (!device->read_started && !device->write_started) - { - return 0; - } - - wtmpbuff=(uint8_t*)alloca(framesPerBuffer*2); - - memset(outputBuffer,0, framesPerBuffer*2); - - ms_mutex_lock(&device->mutex); - - /* remove extra buffer when latency is increasing: - this often happen with USB device */ - if (device->bufferizer->size>=ovfl){ - ms_warning("Extra data for sound card (total:%i %ims)", - device->bufferizer->size, (device->bufferizer->size*20)/320); - err=ms_bufferizer_read(device->bufferizer,wtmpbuff, framesPerBuffer*2); - err=ms_bufferizer_read(device->bufferizer,wtmpbuff, framesPerBuffer*2); - err=ms_bufferizer_read(device->bufferizer,wtmpbuff, framesPerBuffer*2); - err=ms_bufferizer_read(device->bufferizer,wtmpbuff, framesPerBuffer*2); - err=ms_bufferizer_read(device->bufferizer,wtmpbuff, framesPerBuffer*2); - ms_warning("Extra data for sound card removed (total:%i %ims)", - device->bufferizer->size, (device->bufferizer->size*20)/320); - } - - err=ms_bufferizer_read(device->bufferizer,wtmpbuff,framesPerBuffer*2); - ms_mutex_unlock(&device->mutex); - if (err==framesPerBuffer*2) - { - memcpy (outputBuffer, wtmpbuff, framesPerBuffer*2); - } - - return 0; -} - -int WaveInCallback( const void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, - const PaStreamCallbackTimeInfo* timeInfo, - PaStreamCallbackFlags statusFlags, - void *userData ) -{ - PASndData *device = (PASndData*)userData; - - if (!device->read_started && !device->write_started) - { - return 0; - } - - ms_mutex_lock(&device->mutex); - if (device->read_started) - { - int vad; - mblk_t *rm=NULL; - if (rm==NULL) rm=allocb(framesPerBuffer*2,0); - memcpy(rm->b_wptr,inputBuffer, framesPerBuffer*2); - - if (device->pst!=NULL) - { - vad = speex_preprocess(device->pst, (spx_int16_t *)rm->b_wptr, NULL); -#if 0 - if (vad!=1) - ms_message("WaveInCallback : %d", vad); -#endif - } - - rm->b_wptr+=framesPerBuffer*2; - - putq(&device->rq,rm); - rm=NULL; - } - ms_mutex_unlock(&device->mutex); - - return 0; -} - -static int pasnd_open(PASndData *device, int devnumber, int bits,int stereo, int rate, int *minsz) -{ - PaStreamParameters outputParameters; - PaStreamParameters inputParameters; - PaError err; - - const PaHostApiInfo *pa_hai = Pa_GetHostApiInfo(Pa_GetDefaultHostApi()); - - ms_warning("pasnd_open : opening default input device: name=%s (%i)", - pa_hai->name, pa_hai->defaultInputDevice); - ms_warning("pasnd_open : opening default output device name=%s (%i)", - pa_hai->name, pa_hai->defaultOutputDevice); - - outputParameters.device = devnumber; /* default output device */ - outputParameters.device = pa_hai->defaultOutputDevice; - outputParameters.channelCount = 1; /* stereo output */ - outputParameters.sampleFormat = paInt16; /* 32 bit floating point output */ - outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency; - outputParameters.hostApiSpecificStreamInfo = NULL; - - err = Pa_OpenStream( - &device->waveoutdev, /* stream */ - NULL, /* no input */ - &outputParameters, // - rate, // double sampleRate - 160*(rate/8000), //unsigned long framesPerBuffer - paClipOff, - SpeakerCallback, //PortAudioCallback *callback - (void *) device); //void *userData - - if (err != paNoError) - { - ms_warning("Failed to open out device. (Pa_OpenDefaultStream:0x%i)", err); - return -1; - } - - inputParameters.device = devnumber; /* default input device */ - inputParameters.device = pa_hai->defaultInputDevice; - inputParameters.channelCount = 1; /* stereo input */ - inputParameters.sampleFormat = paInt16; /* 32 bit floating point input */ - inputParameters.suggestedLatency = Pa_GetDeviceInfo( inputParameters.device )->defaultLowInputLatency; - inputParameters.hostApiSpecificStreamInfo = NULL; - - err = Pa_OpenStream( - &device->waveindev, //PortAudioStream** stream - &inputParameters, /* input param*/ - NULL, /* output param */ - rate, // double sampleRate - 160*(rate/8000), //unsigned long framesPerBuffer - paClipOff, - WaveInCallback, //PortAudioCallback *callback - (void *) device); //void *userData - - - if (err != paNoError) - { - ms_warning("Failed to open in device. (Pa_OpenDefaultStream:0x%i)", err); - return -1; - } - - err = Pa_StartStream( device->waveoutdev ); - if( err != paNoError ) - { - ms_warning("Failed to start out device. (Pa_StartStream:0x%i)", err); - return -1; - } - - device->pst = speex_preprocess_state_init((device->rate/8000 * 320)/2, device->rate); - if (device->pst!=NULL) { - float f; - int i=1; - speex_preprocess_ctl(device->pst, SPEEX_PREPROCESS_SET_VAD, &i); - i=1; - speex_preprocess_ctl(device->pst, SPEEX_PREPROCESS_SET_DENOISE, &i); - i=0; - speex_preprocess_ctl(device->pst, SPEEX_PREPROCESS_SET_AGC, &i); - f=8000; - speex_preprocess_ctl(device->pst, SPEEX_PREPROCESS_SET_AGC_LEVEL, &f); - i=0; - speex_preprocess_ctl(device->pst, SPEEX_PREPROCESS_SET_DEREVERB, &i); - f=.4; - speex_preprocess_ctl(device->pst, SPEEX_PREPROCESS_SET_DEREVERB_DECAY, &f); - f=.3; - speex_preprocess_ctl(device->pst, SPEEX_PREPROCESS_SET_DEREVERB_LEVEL, &f); - } - - err = Pa_StartStream( device->waveindev ); - if( err != paNoError ) - { - ms_warning("Failed to start in device: trying default device. (Pa_StartStream:0x%i)", err); - return -1; - } - - *minsz=device->rate/8000 * 320; - return 0; -} - -static void pasnd_set_level(MSSndCard *card, MSSndCardMixerElem e, int percent) -{ - PASndData *d=(PASndData*)card->data; - - if (d->mixdev==NULL) return; - switch(e){ - case MS_SND_CARD_MASTER: - return; - break; - case MS_SND_CARD_CAPTURE: - break; - case MS_SND_CARD_PLAYBACK: - break; - default: - ms_warning("pasnd_card_set_level: unsupported command."); - return; - } -} - -static int pasnd_get_level(MSSndCard *card, MSSndCardMixerElem e) -{ - PASndData *d=(PASndData*)card->data; - - if (d->mixdev==NULL) return -1; - switch(e){ - case MS_SND_CARD_MASTER: - return 60; - break; - case MS_SND_CARD_CAPTURE: - break; - case MS_SND_CARD_PLAYBACK: - break; - default: - ms_warning("pasnd_card_get_level: unsupported command."); - return -1; - } - return -1; -} - -static void pasnd_set_source(MSSndCard *card, MSSndCardCapture source) -{ - PASndData *d=(PASndData*)card->data; - if (d->mixdev==NULL) return; - - switch(source){ - case MS_SND_CARD_MIC: - break; - case MS_SND_CARD_LINE: - break; - } -} - -static void pasnd_init(MSSndCard *card){ - PASndData *d=ms_new(PASndData,1); - memset(d, 0, sizeof(PASndData)); - d->pcmdev=NULL; - d->mixdev=NULL; - d->sound_err=-1; /* not opened */ - d->read_started=FALSE; - d->write_started=FALSE; - d->bits=16; - d->rate=8000; - d->stereo=FALSE; - qinit(&d->rq); - d->bufferizer=ms_bufferizer_new(); - ms_mutex_init(&d->mutex,NULL); - card->data=d; - d->pst=0; -} - -static void pasnd_uninit(MSSndCard *card){ - PASndData *d=(PASndData*)card->data; - if (d==NULL) - return; - if (d->pcmdev!=NULL) ms_free(d->pcmdev); - if (d->mixdev!=NULL) ms_free(d->mixdev); - ms_bufferizer_destroy(d->bufferizer); - flushq(&d->rq,0); - - ms_mutex_destroy(&d->mutex); - - if (d->pst!=NULL) - speex_preprocess_state_destroy(d->pst); - - ms_free(d); -} - -#define DSP_NAME "/dev/dsp" -#define MIXER_NAME "/dev/mixer" - -static void pasnd_detect(MSSndCardManager *m); -static MSSndCard *pasnd_duplicate(MSSndCard *obj); - -MSSndCardDesc pasnd_card_desc={ - "PASND", - pasnd_detect, - pasnd_init, - pasnd_set_level, - pasnd_get_level, - pasnd_set_source, - NULL, - NULL, - ms_pasnd_read_new, - ms_pasnd_write_new, - pasnd_uninit, - pasnd_duplicate -}; - -static MSSndCard *pasnd_duplicate(MSSndCard *obj){ - MSSndCard *card=ms_snd_card_new(&pasnd_card_desc); - PASndData *dcard=(PASndData*)card->data; - PASndData *dobj=(PASndData*)obj->data; - dcard->pcmdev=ms_strdup(dobj->pcmdev); - dcard->mixdev=ms_strdup(dobj->mixdev); - card->name=ms_strdup(obj->name); - return card; -} - -static MSSndCard *pasnd_card_new(const char *pcmdev, const char *mixdev){ - MSSndCard *card=ms_snd_card_new(&pasnd_card_desc); - PASndData *d=(PASndData*)card->data; - d->pcmdev=ms_strdup(pcmdev); - d->mixdev=ms_strdup(mixdev); - card->name=ms_strdup(pcmdev); - return card; -} - -static void pasnd_detect(MSSndCardManager *m){ - int err = 0; - unsigned int numDevices; - const PaDeviceInfo *pdi; - char pcmdev[1024]; - char mixdev[1024]; - int i; - - err = Pa_Initialize(); - if( err != paNoError ) - { - ms_warning("PortAudio error: %s\n", Pa_GetErrorText( err ) ); - return; - } - - numDevices = Pa_GetDeviceCount(); - - for( i=0; iname); - snprintf(mixdev,sizeof(mixdev),"%s",pdi->name); - if (i == 0) - { - card=pasnd_card_new(pcmdev,mixdev); - ms_snd_card_manager_add_card(m,card); - } - card=pasnd_card_new(pcmdev,mixdev); - ms_snd_card_manager_add_card(m,card); - } - } -} - -static void pasnd_closedriver(PASndData *d) -{ - if (d->sound_err==0) { - - int err = Pa_StopStream( d->waveindev ); - if( err != paNoError ) - { - ms_warning("Failed to stop device. (Pa_StopStream:0x%i)", err); - } - - err = Pa_CloseStream( d->waveindev); - if( err != paNoError ) - { - ms_warning("failed to close recording sound card (Pa_CloseStream:0x%i)", err); - } - else - { - ms_message("successfully closed recording sound card"); - } - - err = Pa_StopStream( d->waveoutdev ); - if( err != paNoError ) - { - ms_warning("Failed to stop device. (Pa_StopStream:0x%i)", err); - } - - err = Pa_CloseStream( d->waveoutdev ); - if( err != paNoError ) - { - ms_error("failed to stop recording sound card (Pa_CloseStream:0x%i)", err); - } - else - { - ms_message("successfully stopped recording sound card"); - } - - - d->sound_err=-1; - } -} - -static void pasnd_start_r(MSSndCard *card){ - PASndData *d=(PASndData*)card->data; - if (d->read_started==FALSE && d->write_started==FALSE){ - int bsize=0; - d->read_started=TRUE; - d->sound_err=pasnd_open(d, 0, d->bits,d->stereo,d->rate,&bsize); - }else d->read_started=TRUE; -} - -static void pasnd_stop_r(MSSndCard *card){ - PASndData *d=(PASndData*)card->data; - d->read_started=FALSE; - if (d->write_started==FALSE){ - /* ms_thread_join(d->thread,NULL); */ - pasnd_closedriver(d); - } -} - -static void pasnd_start_w(MSSndCard *card){ - PASndData *d=(PASndData*)card->data; - if (d->read_started==FALSE && d->write_started==FALSE){ - int bsize=0; - d->write_started=TRUE; - d->sound_err=pasnd_open(d, 0, d->bits,d->stereo,d->rate,&bsize); - }else{ - d->write_started=TRUE; - } -} - -static void pasnd_stop_w(MSSndCard *card){ - PASndData *d=(PASndData*)card->data; - d->write_started=FALSE; - if (d->read_started==FALSE){ - /* ms_thread_join(d->thread,NULL); */ - pasnd_closedriver(d); - } -} - -static mblk_t *pasnd_get(MSSndCard *card){ - PASndData *d=(PASndData*)card->data; - mblk_t *m; - ms_mutex_lock(&d->mutex); - m=getq(&d->rq); - ms_mutex_unlock(&d->mutex); - return m; -} - -static void pasnd_put(MSSndCard *card, mblk_t *m){ - PASndData *d=(PASndData*)card->data; - ms_mutex_lock(&d->mutex); - ms_bufferizer_put(d->bufferizer,m); - ms_mutex_unlock(&d->mutex); -} - - -static void pasnd_read_preprocess(MSFilter *f){ - MSSndCard *card=(MSSndCard*)f->data; - pasnd_start_r(card); -} - -static void pasnd_read_postprocess(MSFilter *f){ - MSSndCard *card=(MSSndCard*)f->data; - pasnd_stop_r(card); -} - -static void pasnd_read_process(MSFilter *f){ - MSSndCard *card=(MSSndCard*)f->data; - mblk_t *m; - while((m=pasnd_get(card))!=NULL){ - ms_queue_put(f->outputs[0],m); - } -} - -static void pasnd_write_preprocess(MSFilter *f){ - MSSndCard *card=(MSSndCard*)f->data; - pasnd_start_w(card); -} - -static void pasnd_write_postprocess(MSFilter *f){ - MSSndCard *card=(MSSndCard*)f->data; - pasnd_stop_w(card); -} - -static void pasnd_write_process(MSFilter *f){ - MSSndCard *card=(MSSndCard*)f->data; - mblk_t *m; - while((m=ms_queue_get(f->inputs[0]))!=NULL){ - pasnd_put(card,m); - } -} - -static int set_rate(MSFilter *f, void *arg){ - MSSndCard *card=(MSSndCard*)f->data; - PASndData *d=(PASndData*)card->data; - d->rate=*((int*)arg); - return 0; -} - -static int set_nchannels(MSFilter *f, void *arg){ - MSSndCard *card=(MSSndCard*)f->data; - PASndData *d=(PASndData*)card->data; - d->stereo=(*((int*)arg)==2); - return 0; -} - -static MSFilterMethod pasnd_methods[]={ - { MS_FILTER_SET_SAMPLE_RATE , set_rate }, - { MS_FILTER_SET_NCHANNELS , set_nchannels }, - { 0 , NULL } -}; - -MSFilterDesc pasnd_read_desc={ - MS_PASND_READ_ID, - "MSPasndRead", - "Sound capture filter for Port Audio Sound drivers", - MS_FILTER_OTHER, - NULL, - 0, - 1, - NULL, - pasnd_read_preprocess, - pasnd_read_process, - pasnd_read_postprocess, - NULL, - pasnd_methods -}; - - -MSFilterDesc pasnd_write_desc={ - MS_PASND_WRITE_ID, - "MSPasndWrite", - "Sound playback filter for Port Audio Sound drivers", - MS_FILTER_OTHER, - NULL, - 1, - 0, - NULL, - pasnd_write_preprocess, - pasnd_write_process, - pasnd_write_postprocess, - NULL, - pasnd_methods -}; - -MSFilter *ms_pasnd_read_new(MSSndCard *card){ - MSFilter *f=ms_filter_new_from_desc(&pasnd_read_desc); - f->data=card; - return f; -} - - -MSFilter *ms_pasnd_write_new(MSSndCard *card){ - MSFilter *f=ms_filter_new_from_desc(&pasnd_write_desc); - f->data=card; - return f; -} - -MS_FILTER_DESC_EXPORT(pasnd_read_desc) -MS_FILTER_DESC_EXPORT(pasnd_write_desc) diff --git a/linphone/mediastreamer2/src/pixconv.c b/linphone/mediastreamer2/src/pixconv.c deleted file mode 100644 index 24fc1c434..000000000 --- a/linphone/mediastreamer2/src/pixconv.c +++ /dev/null @@ -1,204 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifdef HAVE_CONFIG_H -#include "mediastreamer-config.h" -#endif - -#include "mediastreamer2/msfilter.h" -#include "mediastreamer2/msvideo.h" - -#include "ffmpeg-priv.h" - -extern void ms_ffmpeg_check_init(); - -int ms_pix_fmt_to_ffmpeg(MSPixFmt fmt){ - switch(fmt){ - case MS_RGB24: - return PIX_FMT_RGB24; - case MS_RGB24_REV: - return PIX_FMT_BGR24; - case MS_YUV420P: - return PIX_FMT_YUV420P; - case MS_YUYV: - return PIX_FMT_YUYV422; - case MS_UYVY: - return PIX_FMT_UYVY422; - case MS_YUY2: - return PIX_FMT_YUYV422; /* <- same as MS_YUYV */ - default: - ms_fatal("format not supported."); - return -1; - } - return -1; -} - -MSPixFmt ffmpeg_pix_fmt_to_ms(int fmt){ - switch(fmt){ - case PIX_FMT_RGB24: - return MS_RGB24; - case PIX_FMT_BGR24: - return MS_RGB24_REV; - case PIX_FMT_YUV420P: - return MS_YUV420P; - case PIX_FMT_YUYV422: - return MS_YUYV; - case PIX_FMT_UYVY422: - return MS_UYVY; /* same as MS_YUY2 */ - default: - ms_fatal("format not supported."); - return MS_YUV420P; /* default */ - } - return MS_YUV420P; /* default */ -} - -typedef struct PixConvState{ - YuvBuf outbuf; - mblk_t *yuv_msg; - struct SwsContext *sws_ctx; - MSVideoSize size; - enum PixelFormat in_fmt; - enum PixelFormat out_fmt; -}PixConvState; - -static void pixconv_init(MSFilter *f){ - PixConvState *s=(PixConvState *)ms_new(PixConvState,1); - s->yuv_msg=NULL; - s->size.width = MS_VIDEO_SIZE_CIF_W; - s->size.height = MS_VIDEO_SIZE_CIF_H; - s->in_fmt=PIX_FMT_YUV420P; - s->out_fmt=PIX_FMT_YUV420P; - s->sws_ctx=NULL; - f->data=s; - ms_ffmpeg_check_init(); -} - -static void pixconv_uninit(MSFilter *f){ - PixConvState *s=(PixConvState*)f->data; - if (s->sws_ctx!=NULL){ - sws_freeContext(s->sws_ctx); - s->sws_ctx=NULL; - } - if (s->yuv_msg!=NULL) freemsg(s->yuv_msg); - ms_free(s); -} - -static mblk_t * pixconv_alloc_mblk(PixConvState *s){ - if (s->yuv_msg!=NULL){ - int ref=s->yuv_msg->b_datap->db_ref; - if (ref==1){ - return dupmsg(s->yuv_msg); - }else{ - /*the last msg is still referenced by somebody else*/ - ms_message("Somebody still retaining yuv buffer (ref=%i)",ref); - freemsg(s->yuv_msg); - s->yuv_msg=NULL; - } - } - s->yuv_msg=yuv_buf_alloc(&s->outbuf,s->size.width,s->size.height); - return dupmsg(s->yuv_msg); -} - -static void pixconv_process(MSFilter *f){ - mblk_t *im,*om; - PixConvState *s=(PixConvState*)f->data; - - while((im=ms_queue_get(f->inputs[0]))!=NULL){ - if (s->in_fmt==s->out_fmt){ - om=im; - }else{ - AVPicture inbuf; - avpicture_fill(&inbuf,im->b_rptr,s->in_fmt,s->size.width,s->size.height); - om=pixconv_alloc_mblk(s); - if (s->sws_ctx==NULL){ - s->sws_ctx=sws_getContext(s->size.width,s->size.height, - s->in_fmt,s->size.width,s->size.height, - s->out_fmt,SWS_FAST_BILINEAR, - NULL, NULL, NULL); - } - if (s->in_fmt==PIX_FMT_BGR24){ - inbuf.data[0]+=inbuf.linesize[0]*(s->size.height-1); - inbuf.linesize[0]=-inbuf.linesize[0]; - } - if (sws_scale(s->sws_ctx,inbuf.data,inbuf.linesize, 0, - s->size.height, s->outbuf.planes, s->outbuf.strides)<0){ - ms_error("MSPixConv: Error in sws_scale()."); - } - freemsg(im); - } - if (om!=NULL) ms_queue_put(f->outputs[0],om); - } -} - -static int pixconv_set_vsize(MSFilter *f, void*arg){ - PixConvState *s=(PixConvState*)f->data; - s->size=*(MSVideoSize*)arg; - return 0; -} - -static int pixconv_set_pixfmt(MSFilter *f, void *arg){ - MSPixFmt fmt=*(MSPixFmt*)arg; - PixConvState *s=(PixConvState*)f->data; - s->in_fmt=(enum PixelFormat)ms_pix_fmt_to_ffmpeg(fmt); - return 0; -} - -static MSFilterMethod methods[]={ - { MS_FILTER_SET_VIDEO_SIZE, pixconv_set_vsize }, - { MS_FILTER_SET_PIX_FMT, pixconv_set_pixfmt }, - { 0 , NULL } -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_pix_conv_desc={ - MS_PIX_CONV_ID, - "MSPixConv", - N_("A pixel format converter"), - MS_FILTER_OTHER, - NULL, - 1, - 1, - pixconv_init, - NULL, - pixconv_process, - NULL, - pixconv_uninit, - methods -}; - -#else - -MSFilterDesc ms_pix_conv_desc={ - .id=MS_PIX_CONV_ID, - .name="MSPixConv", - .text=N_("A pixel format converter"), - .category=MS_FILTER_OTHER, - .ninputs=1, - .noutputs=1, - .init=pixconv_init, - .process=pixconv_process, - .uninit=pixconv_uninit, - .methods=methods -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_pix_conv_desc) - diff --git a/linphone/mediastreamer2/src/rfc2429.h b/linphone/mediastreamer2/src/rfc2429.h deleted file mode 100644 index 414b2ea56..000000000 --- a/linphone/mediastreamer2/src/rfc2429.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - The mediastreamer library aims at providing modular media processing and I/O - for linphone, but also for any telephony application. - 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 rfc2429_h -#define rfc2429_h - -#define MAKE_MASK(bits) ( (1<<(bits)) -1 ) - -static inline unsigned int rfc2429_get_P(const uint8_t *header){ - return (header[0]>>2) & 0x1; -} - -static inline void rfc2429_set_P(uint8_t *header, bool_t val){ - header[0]=header[0] | ( (val&0x1)<<2); -} - -static inline unsigned int rfc2429_get_V(const uint8_t *header){ - return (header[0]>>1) & 0x1; -} - -static inline unsigned int rfc2429_get_PLEN(const uint8_t *header){ - unsigned short *p=(unsigned short*)header; - return (ntohs(p[0])>>3) & MAKE_MASK(6); -} - -static inline unsigned int rfc2429_get_PEBIT(const uint8_t *header){ - unsigned short *p=(unsigned short*)header; - return ntohs(p[0]) & MAKE_MASK(3); -} - - -#endif diff --git a/linphone/mediastreamer2/src/rfc3984.c b/linphone/mediastreamer2/src/rfc3984.c deleted file mode 100644 index ffb2895b8..000000000 --- a/linphone/mediastreamer2/src/rfc3984.c +++ /dev/null @@ -1,321 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/rfc3984.h" -#include "mediastreamer2/msfilter.h" - -#define TYPE_FU_A 28 /*fragmented unit 0x1C*/ -#define TYPE_STAP_A 24 /*single time aggregation packet 0x18*/ - - -static inline void nal_header_init(uint8_t *h, uint8_t nri, uint8_t type){ - *h=((nri&0x3)<<5) | (type & ((1<<5)-1)); -} - -static inline uint8_t nal_header_get_type(const uint8_t *h){ - return (*h) & ((1<<5)-1); -} - -static inline uint8_t nal_header_get_nri(const uint8_t *h){ - return ((*h) >> 5) & 0x3; -} - -void rfc3984_init(Rfc3984Context *ctx){ - ms_queue_init(&ctx->q); - ctx->m=NULL; - ctx->maxsz=ms_get_payload_max_size(); - ctx->mode=0; - ctx->last_ts=0x943FEA43;/*some random value*/ - ctx->stap_a_allowed=TRUE; -} - -void rfc3984_set_max_payload_size(Rfc3984Context *ctx, int size){ - ctx->maxsz=size; -} - -static void send_packet(MSQueue *rtpq, uint32_t ts, mblk_t *m, bool_t marker){ - mblk_set_timestamp_info(m,ts); - mblk_set_marker_info(m,marker); - ms_queue_put(rtpq,m); -} - -static void put_nal_size(mblk_t *m, uint16_t sz){ - uint16_t size=htons(sz); - *(uint16_t*)m->b_wptr=size; - m->b_wptr+=2; -} - -static mblk_t * prepend_stapa(mblk_t *m){ - mblk_t *hm=allocb(3,0); - nal_header_init(hm->b_wptr,nal_header_get_nri(m->b_rptr),TYPE_STAP_A); - hm->b_wptr+=1; - put_nal_size(hm,msgdsize(m)); - hm->b_cont=m; - return hm; -} - -static mblk_t * concat_nalus(mblk_t *m1, mblk_t *m2){ - mblk_t *l=allocb(2,0); - /*eventually append a stap-A header to m1, if not already done*/ - if (nal_header_get_type(m1->b_rptr)!=TYPE_STAP_A){ - m1=prepend_stapa(m1); - } - put_nal_size(l,msgdsize(m2)); - l->b_cont=m2; - concatb(m1,l); - return m1; -} - -static mblk_t *prepend_fu_indicator_and_header(mblk_t *m, uint8_t indicator, - bool_t start, bool_t end, uint8_t type){ - mblk_t *h=allocb(2,0); - h->b_wptr[0]=indicator; - h->b_wptr[1]=((start&0x1)<<7)|((end&0x1)<<6)|type; - h->b_wptr+=2; - h->b_cont=m; - if (start) m->b_rptr++;/*skip original nalu header */ - return h; -} - -static void frag_nalu_and_send(MSQueue *rtpq, uint32_t ts, mblk_t *nalu, bool_t marker, int maxsize){ - mblk_t *m; - int payload_max_size=maxsize-2;/*minus FUA header*/ - uint8_t fu_indicator; - uint8_t type=nal_header_get_type(nalu->b_rptr); - uint8_t nri=nal_header_get_nri(nalu->b_rptr); - bool_t start=TRUE; - - nal_header_init(&fu_indicator,nri,TYPE_FU_A); - while(nalu->b_wptr-nalu->b_rptr>payload_max_size){ - m=dupb(nalu); - nalu->b_rptr+=payload_max_size; - m->b_wptr=nalu->b_rptr; - m=prepend_fu_indicator_and_header(m,fu_indicator,start,FALSE,type); - send_packet(rtpq,ts,m,FALSE); - start=FALSE; - } - /*send last packet */ - m=prepend_fu_indicator_and_header(nalu,fu_indicator,FALSE,TRUE,type); - send_packet(rtpq,ts,m,marker); -} - -static void rfc3984_pack_mode_0(Rfc3984Context *ctx, MSQueue *naluq, MSQueue *rtpq, uint32_t ts){ - mblk_t *m; - bool_t end; - int size; - while((m=ms_queue_get(naluq))!=NULL){ - end=ms_queue_empty(naluq); - size=m->b_wptr-m->b_rptr; - if (size>ctx->maxsz){ - ms_warning("This H264 packet does not fit into mtu: size=%i",size); - } - send_packet(rtpq,ts,m,end); - } -} - -/*process NALUs and pack them into rtp payloads */ -static void rfc3984_pack_mode_1(Rfc3984Context *ctx, MSQueue *naluq, MSQueue *rtpq, uint32_t ts){ - mblk_t *m,*prevm=NULL; - int prevsz=0,sz; - bool_t end; - while((m=ms_queue_get(naluq))!=NULL){ - end=ms_queue_empty(naluq); - sz=m->b_wptr-m->b_rptr; - if (ctx->stap_a_allowed){ - if (prevm!=NULL){ - if ((prevsz+sz)<(ctx->maxsz-2)){ - prevm=concat_nalus(prevm,m); - m=NULL; - prevsz+=sz+2;/*+2 for the stapa size field*/ - continue; - }else{ - /*send prevm packet: either single nal or STAP-A*/ - if (prevm->b_cont!=NULL){ - ms_debug("Sending STAP-A"); - }else - ms_debug("Sending previous msg as single NAL"); - send_packet(rtpq,ts,prevm,FALSE); - prevm=NULL; - prevsz=0; - } - } - if (sz<(ctx->maxsz/2)){ - /*try to aggregate it with next packet*/ - prevm=m; - prevsz=sz+3; /*STAP-A header + size*/ - m=NULL; - }else{ - - /*send as single nal or FU-A*/ - if (sz>ctx->maxsz){ - ms_debug("Sending FU-A packets"); - frag_nalu_and_send(rtpq,ts,m,end, ctx->maxsz); - }else{ - ms_debug("Sending Single NAL"); - send_packet(rtpq,ts,m,end); - } - } - }else{ - if (sz>ctx->maxsz){ - ms_debug("Sending FU-A packets"); - frag_nalu_and_send(rtpq,ts,m,end, ctx->maxsz); - }else{ - ms_debug("Sending Single NAL"); - send_packet(rtpq,ts,m,end); - } - } - } - if (prevm){ - ms_debug("Sending Single NAL (2)"); - send_packet(rtpq,ts,prevm,TRUE); - } -} - -static mblk_t * aggregate_fua(Rfc3984Context *ctx, mblk_t *im){ - mblk_t *om=NULL; - uint8_t fu_header; - uint8_t nri,type; - bool_t start,end; - fu_header=im->b_rptr[1]; - type=nal_header_get_type(&fu_header); - start=fu_header>>7; - end=(fu_header>>6)&0x1; - if (start){ - nri=nal_header_get_nri(im->b_rptr); - if (ctx->m!=NULL){ - ms_error("receiving FU-A start while previous FU-A is not " - "finished"); - freemsg(ctx->m); - ctx->m=NULL; - } - im->b_rptr++; - nal_header_init(im->b_rptr,nri,type); - ctx->m=im; - }else{ - if (ctx->m!=NULL){ - im->b_rptr+=2; - concatb(ctx->m,im); - }else{ - ms_error("Receiving continuation FU packet but no start."); - freemsg(im); - } - } - if (end && ctx->m){ - msgpullup(ctx->m,-1); - om=ctx->m; - ctx->m=NULL; - } - return om; -} - -/*process incoming rtp data and output NALUs, whenever possible*/ -void rfc3984_unpack(Rfc3984Context *ctx, mblk_t *im, MSQueue *out){ - uint8_t type=nal_header_get_type(im->b_rptr); - uint8_t *p; - int marker = mblk_get_marker_info(im); - uint32_t ts=mblk_get_timestamp_info(im); - - if (ctx->last_ts!=ts){ - /*a new frame is arriving, in case the marker bit was not set in previous frame, output it now*/ - /* unless this is a FU-A (workarond some other apps bugs)*/ - ctx->last_ts=ts; - if (ctx->m==NULL){ - while(!ms_queue_empty(&ctx->q)){ - ms_queue_put(out,ms_queue_get(&ctx->q)); - } - } - } - - if (im->b_cont) msgpullup(im,-1); - - if (type==TYPE_STAP_A){ - ms_debug("Receiving STAP-A"); - /*split into nalus*/ - uint16_t sz; - uint8_t *buf=(uint8_t*)&sz; - mblk_t *nal; - for(p=im->b_rptr+1;pb_wptr;){ - buf[0]=p[0]; - buf[1]=p[1]; - sz=ntohs(sz); - nal=dupb(im); - p+=2; - nal->b_rptr=p; - p+=sz; - nal->b_wptr=p; - if (p>im->b_wptr){ - ms_error("Malformed STAP-A packet"); - freemsg(nal); - break; - } - ms_queue_put(&ctx->q,nal); - } - freemsg(im); - }else if (type==TYPE_FU_A){ - ms_debug("Receiving FU-A"); - mblk_t *o=aggregate_fua(ctx,im); - if (o) ms_queue_put(&ctx->q,o); - }else{ - if (ctx->m){ - /*discontinued FU-A, purge it*/ - freemsg(ctx->m); - ctx->m=NULL; - } - /*single nal unit*/ - ms_debug("Receiving single NAL"); - ms_queue_put(&ctx->q,im); - } - - if (marker){ - ctx->last_ts=ts; - ms_debug("Marker bit set"); - /*end of frame, output everything*/ - while(!ms_queue_empty(&ctx->q)){ - ms_queue_put(out,ms_queue_get(&ctx->q)); - } - } -} - - -void rfc3984_pack(Rfc3984Context *ctx, MSQueue *naluq, MSQueue *rtpq, uint32_t ts){ - switch(ctx->mode){ - case 0: - rfc3984_pack_mode_0(ctx,naluq,rtpq,ts); - break; - case 1: - rfc3984_pack_mode_1(ctx,naluq,rtpq,ts); - break; - default: - ms_error("Bad or unsupported mode %i",ctx->mode); - } -} - -void rfc3984_uninit(Rfc3984Context *ctx){ - ms_queue_flush(&ctx->q); - if (ctx->m) freemsg(ctx->m); - ctx->m=NULL; -} - -void rfc3984_set_mode(Rfc3984Context *ctx, int mode){ - ctx->mode=mode; -} - -void rfc3984_enable_stap_a(Rfc3984Context *ctx, bool_t yesno){ - ctx->stap_a_allowed=yesno; -} diff --git a/linphone/mediastreamer2/src/sdlout.c b/linphone/mediastreamer2/src/sdlout.c deleted file mode 100644 index 0288cb295..000000000 --- a/linphone/mediastreamer2/src/sdlout.c +++ /dev/null @@ -1,375 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -#include "mediastreamer2/msfilter.h" -#include "mediastreamer2/msvideo.h" - -#include -#include - -typedef struct SdlOut -{ - MSVideoSize size; - MSVideoSize local_size; /*size of local preview */ - MSPixFmt format; - SDL_Surface *screen; - SDL_Overlay *overlay; - mblk_t *smallb; - int scale_factor; - bool_t lsize_init; -} SdlOut; - - -#define SCALE_FACTOR 6 - -static bool_t sdl_initialized=FALSE; - -static void sdl_out_init(MSFilter *f){ - SdlOut *obj=ms_new(SdlOut,1); - obj->size.width = MS_VIDEO_SIZE_CIF_W; - obj->size.height = MS_VIDEO_SIZE_CIF_H; - obj->local_size.width = MS_VIDEO_SIZE_CIF_W; - obj->local_size.height = MS_VIDEO_SIZE_CIF_H; - obj->lsize_init=FALSE; - obj->scale_factor=SCALE_FACTOR; - obj->format=MS_RGB24; - obj->screen=NULL; - obj->overlay=NULL; - obj->smallb=NULL; - -#if !defined(WIN32) && !defined(__APPLE__) - if (!sdl_initialized){ - - /* Initialize the SDL library */ - if( SDL_Init(SDL_INIT_VIDEO) < 0 ) { - ms_error("Couldn't initialize SDL: %s", SDL_GetError()); - return; - } - /* Clean up on exit */ - atexit(SDL_Quit); - sdl_initialized=TRUE; - } -#endif - f->data=obj; -} - -static void sdl_destroy_window(SdlOut *obj){ - if (obj->overlay!=NULL){ - SDL_FreeYUVOverlay(obj->overlay); - obj->overlay=NULL; - } - if (obj->screen!=NULL){ - SDL_FreeSurface(obj->screen); - obj->screen=NULL; - } -} - -static void sdl_out_uninit(MSFilter *f){ - SdlOut *s=(SdlOut*)f->data; - sdl_destroy_window(s); - if (s->smallb!=NULL) freemsg(s->smallb); - ms_free(s); -} - -static void sdl_create_window(SdlOut *obj){ - obj->screen = SDL_SetVideoMode(obj->size.width, obj->size.height, 0,SDL_SWSURFACE); - if ( obj->screen == NULL ) { - ms_warning("Couldn't set video mode: %s\n", - SDL_GetError()); - return ; - } - if (obj->screen->flags & SDL_HWSURFACE) ms_message("SDL surface created in hardware"); - SDL_WM_SetCaption("Linphone Video", NULL); - - if (obj->format==MS_YUV420P){ - ms_message("Using yuv overlay."); - obj->overlay=SDL_CreateYUVOverlay(obj->size.width,obj->size.height,SDL_YV12_OVERLAY,obj->screen); - if (obj->overlay==NULL){ - ms_warning("Couldn't create yuv overlay: %s\n", - SDL_GetError()); - return; - }else{ - if (obj->overlay->hw_overlay) ms_message("YUV overlay using hardware acceleration."); - } - } -} - -mblk_t * resize_yuv_small(unsigned char *pict, int w, int h, int scale){ - int i,j,id,jd; - int nh,nw; - unsigned char *smallpict; - int ysize,usize,ydsize,udsize; - int smallpict_sz; - unsigned char *dptr,*sptr; - mblk_t *smallb; - nw=w/scale; - nh=h/scale; - ysize=w*h; - usize=ysize/4; - ydsize=nw*nh; - udsize=ydsize/4; - smallpict_sz=(ydsize*3)/2; - smallb=allocb(smallpict_sz,0); - smallpict=smallb->b_wptr; - smallb->b_wptr+=smallpict_sz; - - dptr=smallpict; - sptr=pict; - for (j=0,jd=0;jb_rptr; - int i,j; - int jlim,ilim; - int off; - unsigned char *dptr; - - ilim=MIN(x+w,lay->w); - jlim=MIN(y+h,lay->h); - SDL_LockYUVOverlay(lay); - /* set Y */ - dptr=lay->pixels[0]; - for (j=y;jw; - for (i=x;ipixels[2]; - for (j=y/2;jw/2); - for (i=x/2;ipixels[1]; - for (j=y/2;jw/2); - for (i=x/2;ib_rptr; - int ysize=lay->pitches[0]*lay->h; - int usize; - w2=lay->w/2; - h2=lay->h/2; - usize=w2*h2; - SDL_LockYUVOverlay(lay); - memcpy(lay->pixels[0],data,ysize); - memcpy(lay->pixels[2],data+ysize,usize); - memcpy(lay->pixels[1],data+ysize+usize,usize); - SDL_UnlockYUVOverlay(lay); -} - -static void sdl_out_process(MSFilter *f){ - SdlOut *obj=(SdlOut*)f->data; - mblk_t *inm0=NULL; - mblk_t *inm1=NULL; - int err; - SDL_Rect smallrect; - SDL_Rect rect; - bool_t got_preview=FALSE; - -#if defined(WIN32) || defined(__APPLE__) - if (!sdl_initialized){ - - /* Initialize the SDL library */ - if( SDL_Init(SDL_INIT_VIDEO) < 0 ) { - ms_error("Couldn't initialize SDL: %s", SDL_GetError()); - return; - } - /* Clean up on exit */ - atexit(SDL_Quit); - sdl_initialized=TRUE; - } -#endif - - if (obj->screen==NULL){ - sdl_create_window(obj); - } - - rect.w=obj->size.width; - rect.h=obj->size.height; - rect.x=0; - rect.y=0; - smallrect.w=obj->size.width/SCALE_FACTOR; - smallrect.h=obj->size.height/SCALE_FACTOR; - smallrect.x=obj->size.width - smallrect.w ; - smallrect.y=obj->size.height -smallrect.h; - - - while (f->inputs[0]!=NULL && (inm0=ms_queue_get(f->inputs[0]))!=NULL){ - SDL_Surface *surf; - if (obj->format==MS_YUV420P){ - fill_overlay(obj->overlay,inm0); - }else { - surf=SDL_CreateRGBSurfaceFrom(inm0->b_rptr,obj->size.width,obj->size.height,24,obj->size.width*3,0,0,0,0); - - err=SDL_BlitSurface(surf,NULL,obj->screen,NULL); - if (err<0) ms_warning("Fail to blit surface: %s",SDL_GetError()); - SDL_FreeSurface(surf); - } - freemsg(inm0); - } - while (f->inputs[1]!=NULL && (inm1=ms_queue_get(f->inputs[1]))!=NULL){ - /* this message is blitted on the right,bottom corner of the screen */ - SDL_Surface *surf; - got_preview=TRUE; - if (!obj->lsize_init){ - /*attempt to guess the video size of the local preview buffer*/ - int bsize=msgdsize(inm1); - if (bsize<(MS_VIDEO_SIZE_CIF_W*MS_VIDEO_SIZE_CIF_H*3/2)){ - /*surely qcif ?*/ - obj->local_size.width=MS_VIDEO_SIZE_QCIF_W; - obj->local_size.height=MS_VIDEO_SIZE_QCIF_H; - ms_message("preview is in QCIF."); - obj->scale_factor=SCALE_FACTOR/2; - } - obj->lsize_init=TRUE; - } - if (obj->format==MS_YUV420P){ - if (obj->smallb!=NULL) { - freemsg(obj->smallb); - } - obj->smallb=resize_yuv_small(inm1->b_rptr,obj->local_size.width,obj->local_size.height,obj->scale_factor); - fill_overlay_at_pos(obj->overlay,obj->smallb,smallrect.x, smallrect.y, smallrect.w, smallrect.h); - freemsg(inm1); - }else { - surf=SDL_CreateRGBSurfaceFrom(inm1->b_rptr,obj->size.width,obj->size.height,24,obj->size.width*3,0,0,0,0); - - err=SDL_BlitSurface(surf,NULL,obj->screen,&smallrect); - if (err<0) ms_warning("Fail to blit surface: %s",SDL_GetError()); - SDL_FreeSurface(surf); - } - } - if (!got_preview){ - /* this is the case were we have only inm0, we have to redisplay inm1 */ - if (obj->format==MS_YUV420P){ - if (obj->smallb!=NULL){ - fill_overlay_at_pos(obj->overlay,obj->smallb,smallrect.x, smallrect.y, smallrect.w, smallrect.h); - } - } - } - - if (obj->format==MS_YUV420P) SDL_DisplayYUVOverlay(obj->overlay,&rect); - else SDL_UpdateRect(obj->screen,0,0,obj->size.width,obj->size.height); - -#if defined(WIN32) || defined(__APPLE__) - { - SDL_Event event; - SDL_PollEvent(&event); - } -#endif -} - -static int sdl_out_set_pix_fmt(MSFilter *f,void *arg){ - SdlOut *s=(SdlOut*)f->data; - s->format=*(MSPixFmt*)arg; - return 0; -} - -static int sdl_out_set_vsize(MSFilter *f,void *arg){ - SdlOut *s=(SdlOut*)f->data; - s->size=*(MSVideoSize*)arg; - s->local_size=*(MSVideoSize*)arg; - return 0; -} - -static MSFilterMethod methods[]={ - { MS_FILTER_SET_PIX_FMT , sdl_out_set_pix_fmt}, - { MS_FILTER_SET_VIDEO_SIZE , sdl_out_set_vsize }, - { 0 ,NULL} -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_sdl_out_desc={ - MS_SDL_OUT_ID, - "MSSdlOut", - N_("A video display window using SDL"), - MS_FILTER_OTHER, - NULL, - 2, - 0, - sdl_out_init, - NULL, - sdl_out_process, - NULL, - sdl_out_uninit, - methods -}; - -#else - -MSFilterDesc ms_sdl_out_desc={ - .id=MS_SDL_OUT_ID, - .name="MSSdlOut", - .text=N_("A video display window using SDL"), - .category=MS_FILTER_OTHER, - .ninputs=2, - .noutputs=0, - .init=sdl_out_init, - .process=sdl_out_process, - .uninit=sdl_out_uninit, - .methods=methods -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_sdl_out_desc) diff --git a/linphone/mediastreamer2/src/sizeconv.c b/linphone/mediastreamer2/src/sizeconv.c deleted file mode 100644 index 401f2aeb5..000000000 --- a/linphone/mediastreamer2/src/sizeconv.c +++ /dev/null @@ -1,235 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifdef HAVE_CONFIG_H -#include "mediastreamer-config.h" -#endif - -#include "mediastreamer2/msfilter.h" -#include "mediastreamer2/msticker.h" -#include "mediastreamer2/msvideo.h" - -#include "ffmpeg-priv.h" - -typedef struct SizeConvState{ - MSVideoSize target_vsize; - MSVideoSize in_vsize; - YuvBuf outbuf; - struct SwsContext *sws_ctx; - mblk_t *om; - float fps; - float start_time; - int frame_count; - queue_t rq; -} SizeConvState; - - -/*this MSFilter will do on the fly picture size conversion. It attempts to guess the picture size from the yuv buffer size. YUV420P is assumed on input. -For now it only supports QCIF->CIF, QVGA->CIF and CIF->CIF (does nothing in this case)*/ - -static void size_conv_init(MSFilter *f){ - SizeConvState *s=(SizeConvState *)ms_new(SizeConvState,1); - s->target_vsize.width = MS_VIDEO_SIZE_CIF_W; - s->target_vsize.height = MS_VIDEO_SIZE_CIF_H; - s->in_vsize.width=0; - s->in_vsize.height=0; - s->sws_ctx=NULL; - s->om=NULL; - s->start_time=0; - s->frame_count=-1; - s->fps=-1; /* default to process ALL frames */ - qinit(&s->rq); - f->data=s; -} - -static void size_conv_uninit(MSFilter *f){ - SizeConvState *s=(SizeConvState*)f->data; - ms_free(s); -} - -static void size_conv_postprocess(MSFilter *f){ - SizeConvState *s=(SizeConvState*)f->data; - if (s->sws_ctx!=NULL) { - sws_freeContext(s->sws_ctx); - s->sws_ctx=NULL; - } - if (s->om!=NULL){ - freemsg(s->om); - s->om=NULL; - } - flushq(&s->rq,0); - s->frame_count=-1; -} - -static mblk_t *size_conv_alloc_mblk(SizeConvState *s){ - if (s->om!=NULL){ - int ref=s->om->b_datap->db_ref; - if (ref==1){ - return dupmsg(s->om); - }else{ - /*the last msg is still referenced by somebody else*/ - ms_message("size_conv_alloc_mblk: Somebody still retaining yuv buffer (ref=%i)",ref); - freemsg(s->om); - s->om=NULL; - } - } - s->om=yuv_buf_alloc(&s->outbuf,s->target_vsize.width,s->target_vsize.height); - return dupmsg(s->om); -} - -static struct SwsContext * get_resampler(SizeConvState *s, int w, int h){ - if (s->in_vsize.width!=w || - s->in_vsize.height!=h || s->sws_ctx==NULL){ - if (s->sws_ctx!=NULL){ - sws_freeContext(s->sws_ctx); - s->sws_ctx=NULL; - } - s->sws_ctx=sws_getContext(w,h,PIX_FMT_YUV420P, - s->target_vsize.width,s->target_vsize.height,PIX_FMT_YUV420P, - SWS_FAST_BILINEAR,NULL, NULL, NULL); - s->in_vsize.width=w; - s->in_vsize.height=h; - } - return s->sws_ctx; -} - -static void size_conv_process(MSFilter *f){ - SizeConvState *s=(SizeConvState*)f->data; - YuvBuf inbuf; - mblk_t *im; - int cur_frame; - - ms_filter_lock(f); - - if (s->frame_count==-1){ - s->start_time=(float)f->ticker->time; - s->frame_count=0; - } - while((im=ms_queue_get(f->inputs[0]))!=NULL ){ - putq(&s->rq, im); - } - - cur_frame=(int)((f->ticker->time-s->start_time)*s->fps/1000.0); - if (cur_frame<=s->frame_count && s->fps>=0) { - /* too much frame */ - while(s->rq.q_mcount>1){ - ms_message("MSSizeConv: extra frame removed."); - im=getq(&s->rq); - freemsg(im); - } - ms_filter_unlock(f); - return; - } - - if (cur_frame>s->frame_count && s->fps>=0) { - /*keep the most recent frame if several frames have been captured */ - while(s->rq.q_mcount>1){ - ms_message("MSSizeConv: extra frame removed."); - im=getq(&s->rq); - freemsg(im); - } - } - while((im=getq(&s->rq))!=NULL ){ - if (yuv_buf_init_from_mblk(&inbuf,im)==0){ - if (inbuf.w==s->target_vsize.width && - inbuf.h==s->target_vsize.height){ - ms_queue_put(f->outputs[0],im); - }else{ - struct SwsContext *sws_ctx=get_resampler(s,inbuf.w,inbuf.h); - mblk_t *om=size_conv_alloc_mblk(s); - if (sws_scale(sws_ctx,inbuf.planes,inbuf.strides, 0, - inbuf.h, s->outbuf.planes, s->outbuf.strides)<0){ - ms_error("MSSizeConv: error in sws_scale()."); - } - ms_queue_put(f->outputs[0],om); - freemsg(im); - } - s->frame_count++; - }else freemsg(im); - } - - ms_filter_unlock(f); -} - - -static int sizeconv_set_vsize(MSFilter *f, void*arg){ - SizeConvState *s=(SizeConvState*)f->data; - ms_filter_lock(f); - s->target_vsize=*(MSVideoSize*)arg; - freemsg(s->om); - s->om=NULL; - if (s->sws_ctx!=NULL) { - sws_freeContext(s->sws_ctx); - s->sws_ctx=NULL; - } - ms_filter_unlock(f); - return 0; -} - -static int sizeconv_set_fps(MSFilter *f, void *arg){ - SizeConvState *s=(SizeConvState*)f->data; - s->fps=*((float*)arg); - s->frame_count=-1; /* reset counter used for fps */ - return 0; -} - - -static MSFilterMethod methods[]={ - { MS_FILTER_SET_FPS , sizeconv_set_fps }, - { MS_FILTER_SET_VIDEO_SIZE, sizeconv_set_vsize }, - { 0 , NULL } -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_size_conv_desc={ - MS_SIZE_CONV_ID, - "MSSizeConv", - N_("A video size converter"), - MS_FILTER_OTHER, - NULL, - 1, - 1, - size_conv_init, - NULL, - size_conv_process, - size_conv_postprocess, - size_conv_uninit, - methods -}; - -#else - -MSFilterDesc ms_size_conv_desc={ - .id=MS_SIZE_CONV_ID, - .name="MSSizeConv", - .text=N_("a small video size converter"), - .ninputs=1, - .noutputs=1, - .init=size_conv_init, - .process=size_conv_process, - .postprocess=size_conv_postprocess, - .uninit=size_conv_uninit, - .methods=methods -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_size_conv_desc) - diff --git a/linphone/mediastreamer2/src/speexec.c b/linphone/mediastreamer2/src/speexec.c deleted file mode 100644 index 6e55faf27..000000000 --- a/linphone/mediastreamer2/src/speexec.c +++ /dev/null @@ -1,381 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/msspeexec.h" - -#include -#include - -#ifdef HAVE_CONFIG_H -#include "mediastreamer-config.h" -#endif - -#ifdef WIN32 -#include /* for alloca */ -#endif - -static const int framesize=128; -static const int filter_length=2048; /*250 ms*/ - -typedef struct SpeexECState{ - SpeexEchoState *ecstate; - MSBufferizer speak_delay; - int size_delay; - int playback_delay; - MSBufferizer in[2]; - int framesize; - int filterlength; - int samplerate; - SpeexPreprocessState *den; - int ref; - int echo; - int out; - int delay_ms; - int tail_length_ms; -}SpeexECState; - -static void speex_ec_init(MSFilter *f){ - SpeexECState *s=(SpeexECState *)ms_new(SpeexECState,1); - - s->samplerate=8000; - s->framesize=framesize; - s->filterlength=filter_length; - - ms_bufferizer_init(&s->speak_delay); - s->size_delay=0; - s->delay_ms=0; - s->playback_delay=0; - s->tail_length_ms=250; - - ms_bufferizer_init(&s->in[0]); - ms_bufferizer_init(&s->in[1]); - s->ecstate=NULL; - s->den = NULL; - - f->data=s; -} - -static void speex_ec_uninit(MSFilter *f){ - SpeexECState *s=(SpeexECState*)f->data; - ms_bufferizer_uninit(&s->speak_delay); - ms_bufferizer_uninit(&s->in[0]); - ms_bufferizer_uninit(&s->in[1]); - if (s->ecstate!=NULL) - speex_echo_state_destroy(s->ecstate); - if (s->den!=NULL) - speex_preprocess_state_destroy(s->den); - - ms_free(s); -} - - -static void speex_ec_preprocess(MSFilter *f){ - SpeexECState *s=(SpeexECState*)f->data; - if (s->ecstate!=NULL) - speex_echo_state_destroy(s->ecstate); - if (s->den!=NULL) - speex_preprocess_state_destroy(s->den); - - if (s->tail_length_ms!=0) - s->filterlength=(s->tail_length_ms*s->samplerate)/1000; - if (s->delay_ms!=0) - s->playback_delay=s->delay_ms*s->samplerate/1000; - ms_message("Initializing speex echo canceler with framesize=%i, filterlength=%i, playback_delay=%i", - s->framesize,s->filterlength,s->playback_delay); - s->ecstate=speex_echo_state_init(s->framesize,s->filterlength); - s->den = speex_preprocess_state_init(s->framesize, s->samplerate); - speex_echo_ctl(s->ecstate, SPEEX_ECHO_SET_SAMPLING_RATE, &s->samplerate); - speex_preprocess_ctl(s->den, SPEEX_PREPROCESS_SET_ECHO_STATE, s->ecstate); -} - -/* inputs[0]= reference signal (sent to soundcard) - * inputs[1]= near speech & echo signal (read from soundcard) - * outputs[1]= near end speech, echo removed - towards far end -*/ -static void speex_ec_process(MSFilter *f){ - SpeexECState *s=(SpeexECState*)f->data; - int nbytes=s->framesize*2; - uint8_t *in1; - mblk_t *om0,*om1; -#ifdef AMD_WIN32_HACK - static int count=0; -#endif - mblk_t *m; - mblk_t *md; - - /* first fill delayed buffer until playback delay is reached (only in first n calls) */ - if (s->size_delayplayback_delay){ - while((m=ms_queue_get(f->inputs[0]))!=NULL && s->size_delayplayback_delay){ - // Duplicate queue : one to write to the output speaker, the other will be delayed for AEC - int size=msgdsize(m); - md = copyb(m); - s->size_delay = s->size_delay + size; - ms_bufferizer_put(&s->speak_delay,md); - ms_bufferizer_put(&s->in[0],m); - } - - if (s->size_delay<=s->playback_delay) - { - /* make sure we always send block with same size */ - while (ms_bufferizer_get_avail(&s->speak_delay)>=nbytes) - { - om0=allocb(nbytes,0); - ms_bufferizer_read(&s->speak_delay,(uint8_t*)om0->b_wptr,nbytes); - om0->b_wptr+=nbytes; - ms_queue_put(f->outputs[0],om0); - } - - /* make sure we always send block with same size */ - ms_bufferizer_put_from_queue(&s->in[1],f->inputs[1]); - while (ms_bufferizer_get_avail(&s->in[1])>=nbytes) - { - om0=allocb(nbytes,0); - ms_bufferizer_read(&s->in[1],(uint8_t*)om0->b_wptr,nbytes); - om0->b_wptr+=nbytes; - ms_queue_put(f->outputs[1],om0); - } - /* we are now equal and speaker is delayed */ - return; - } - } - - ms_bufferizer_put_from_queue(&s->in[1],f->inputs[1]); - - /*read input and put in bufferizers*/ - while((m=ms_queue_get(f->inputs[0]))!=NULL){ - md = copyb(m); - // Duplicate queue : one to write to the output speaker, the other will be delayed for AEC - ms_bufferizer_put(&s->in[0],m); - ms_bufferizer_put(&s->speak_delay,md); - } - - - in1=(uint8_t*)alloca(nbytes); - - //ms_debug("speexec: in0=%i, in1=%i",ms_bufferizer_get_avail(&s->in[0]),ms_bufferizer_get_avail(&s->in[1])); - - while (ms_bufferizer_get_avail(&s->speak_delay)>=nbytes && ms_bufferizer_get_avail(&s->in[1])>=nbytes){ - om0=allocb(nbytes,0); - ms_bufferizer_read(&s->speak_delay,(uint8_t*)om0->b_wptr,nbytes); - om0->b_wptr+=nbytes; - ms_queue_put(f->outputs[0],om0); - - om0=allocb(nbytes,0); - ms_bufferizer_read(&s->in[0],(uint8_t*)om0->b_wptr,nbytes); - /* we have reference signal */ - /* the reference signal is sent through outputs[0]*/ - - om0->b_wptr+=nbytes; - //ms_queue_put(f->outputs[0],om0); - - ms_bufferizer_read(&s->in[1],in1,nbytes); - /* we have echo signal */ - om1=allocb(nbytes,0); - speex_echo_cancellation(s->ecstate,(short*)in1,(short*)om0->b_rptr,(short*)om1->b_wptr); - speex_preprocess_run(s->den, (short*)om1->b_wptr); - ms_filter_notify(f, MS_SPEEX_EC_ECHO_STATE, (void*)s->ecstate); - ms_filter_notify(f, MS_SPEEX_EC_PREPROCESS_MIC, (void*)s->den); - - om1->b_wptr+=nbytes; - ms_queue_put(f->outputs[1],om1); -#ifdef AMD_WIN32_HACK - count++; - if (count==100*3) - { - ms_message("periodic reset of echo canceller."); - speex_echo_state_reset(s->ecstate); - count=0; - } -#endif - freeb(om0); - } - - if (ms_bufferizer_get_avail(&s->speak_delay)> 5*320*(s->samplerate/8000)) /* above 4*20ms -> useless */ - { - /* reset evrything */ - ms_warning("speexec: -reset of echo canceller- in0=%i, in1=%i",ms_bufferizer_get_avail(&s->in[0]),ms_bufferizer_get_avail(&s->in[1])); - flushq(&s->in[1].q,0); - flushq(&s->in[0].q,0); - flushq(&s->speak_delay.q,0); - ms_bufferizer_init(&s->in[0]); - ms_bufferizer_init(&s->in[1]); - ms_bufferizer_init(&s->speak_delay); - s->size_delay=0; - speex_echo_state_reset(s->ecstate); - } - - while (ms_bufferizer_get_avail(&s->in[1])> 5*320*(s->samplerate/8000)){ - om1=allocb(nbytes,0); - ms_bufferizer_read(&s->in[1],(uint8_t*)om1->b_wptr,nbytes); - om1->b_wptr+=nbytes; - ms_queue_put(f->outputs[1],om1); - ms_message("too much echo signal, sending anyway."); - speex_echo_state_reset(s->ecstate); - } - -} - -static void speex_ec_postprocess(MSFilter *f){ - SpeexECState *s=(SpeexECState*)f->data; - ms_bufferizer_uninit(&s->in[0]); - ms_bufferizer_uninit(&s->in[1]); - ms_bufferizer_uninit(&s->speak_delay); - ms_bufferizer_init(&s->in[0]); - ms_bufferizer_init(&s->in[1]); - ms_bufferizer_init(&s->speak_delay); - s->size_delay=0; - - if (s->ecstate!=NULL){ - speex_echo_state_destroy(s->ecstate); - s->ecstate=NULL; - } - if (s->den!=NULL){ - speex_preprocess_state_destroy(s->den); - s->den=NULL; - } -} - -static int speex_ec_set_sr(MSFilter *f, void *arg){ - SpeexECState *s=(SpeexECState*)f->data; - - s->samplerate = *(int*)arg; - - if (s->ecstate!=NULL){ - speex_echo_state_destroy(s->ecstate); - if (s->den!=NULL) - speex_preprocess_state_destroy(s->den); - - s->ecstate=speex_echo_state_init(s->framesize,s->filterlength); - s->den = speex_preprocess_state_init(s->framesize, s->samplerate); - speex_echo_ctl(s->ecstate, SPEEX_ECHO_SET_SAMPLING_RATE, &s->samplerate); - speex_preprocess_ctl(s->den, SPEEX_PREPROCESS_SET_ECHO_STATE, s->ecstate); - } - return 0; -} - -static int speex_ec_set_framesize(MSFilter *f, void *arg){ - SpeexECState *s=(SpeexECState*)f->data; - s->framesize = *(int*)arg; - - if (s->ecstate!=NULL){ - speex_echo_state_destroy(s->ecstate); - if (s->den!=NULL) - speex_preprocess_state_destroy(s->den); - - s->ecstate=speex_echo_state_init(s->framesize,s->filterlength); - s->den = speex_preprocess_state_init(s->framesize, s->samplerate); - speex_echo_ctl(s->ecstate, SPEEX_ECHO_SET_SAMPLING_RATE, &s->samplerate); - speex_preprocess_ctl(s->den, SPEEX_PREPROCESS_SET_ECHO_STATE, s->ecstate); - } - return 0; -} - -static int speex_ec_set_filterlength(MSFilter *f, void *arg){ - SpeexECState *s=(SpeexECState*)f->data; - s->filterlength = (*(int*)arg)*(s->samplerate/8000); - s->tail_length_ms=0;/*trust the length in sample, not the length in milliseconds*/ - if (s->ecstate!=NULL) - speex_echo_state_destroy(s->ecstate); - if (s->den!=NULL) - speex_preprocess_state_destroy(s->den); - - s->ecstate=speex_echo_state_init(s->framesize,s->filterlength); - s->den = speex_preprocess_state_init(s->framesize, s->samplerate); - speex_echo_ctl(s->ecstate, SPEEX_ECHO_SET_SAMPLING_RATE, &s->samplerate); - speex_preprocess_ctl(s->den, SPEEX_PREPROCESS_SET_ECHO_STATE, s->ecstate); - return 0; -} - -static int speex_ec_set_delay2(MSFilter *f, void *arg){ - SpeexECState *s=(SpeexECState*)f->data; - s->delay_ms = *(int*)arg; - return 0; -} - -static int speex_ec_set_tail_length2(MSFilter *f, void *arg){ - SpeexECState *s=(SpeexECState*)f->data; - s->tail_length_ms=*(int*)arg; - return 0; -} - -static int speex_ec_set_playbackdelay(MSFilter *f, void *arg){ - SpeexECState *s=(SpeexECState*)f->data; - s->playback_delay = *(int*)arg; - - flushq(&s->in[1].q,0); - flushq(&s->in[0].q,0); - flushq(&s->speak_delay.q,0); - ms_bufferizer_init(&s->in[0]); - ms_bufferizer_init(&s->in[1]); - ms_bufferizer_init(&s->speak_delay); - s->size_delay=0; - speex_echo_state_reset(s->ecstate); - return 0; -} - -static MSFilterMethod speex_ec_methods[]={ - { MS_FILTER_SET_SAMPLE_RATE, speex_ec_set_sr }, - { MS_SPEEX_EC_SET_TAIL_LENGTH , speex_ec_set_tail_length2 }, - { MS_SPEEX_EC_SET_DELAY , speex_ec_set_delay2 }, - { MS_SPEEX_EC_SET_FRAME_SIZE , speex_ec_set_framesize }, -/*these are kept for backward compatibility */ - { MS_FILTER_SET_FRAMESIZE, speex_ec_set_framesize }, - { MS_FILTER_SET_FILTERLENGTH, speex_ec_set_filterlength }, - { MS_FILTER_SET_PLAYBACKDELAY, speex_ec_set_playbackdelay }, - { 0 , NULL} -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_speex_ec_desc={ - MS_SPEEX_EC_ID, - "MSSpeexEC", - N_("Echo canceller using speex library"), - MS_FILTER_OTHER, - NULL, - 2, - 2, - speex_ec_init, - speex_ec_preprocess, - speex_ec_process, - speex_ec_postprocess, - speex_ec_uninit, - speex_ec_methods -}; - -#else - -MSFilterDesc ms_speex_ec_desc={ - .id=MS_SPEEX_EC_ID, - .name="MSSpeexEC", - .text=N_("Echo canceller using speex library"), - .category=MS_FILTER_OTHER, - .ninputs=2, - .noutputs=2, - .init=speex_ec_init, - .preprocess=speex_ec_preprocess, - .process=speex_ec_process, - .postprocess=speex_ec_postprocess, - .uninit=speex_ec_uninit, - .methods=speex_ec_methods -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_speex_ec_desc) diff --git a/linphone/mediastreamer2/src/swscale.h b/linphone/mediastreamer2/src/swscale.h deleted file mode 100644 index a0c735b69..000000000 --- a/linphone/mediastreamer2/src/swscale.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (C) 2001-2003 Michael Niedermayer - * - * This file is part of FFmpeg. - * - * FFmpeg 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. - * - * FFmpeg 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 FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef FFMPEG_SWSCALE_H -#define FFMPEG_SWSCALE_H - -/** - * @file swscale.h - * @brief - * external api for the swscale stuff - */ - -#include "libavutil/avutil.h" - -#define LIBSWSCALE_VERSION_MAJOR 0 -#define LIBSWSCALE_VERSION_MINOR 5 -#define LIBSWSCALE_VERSION_MICRO 1 - -#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \ - LIBSWSCALE_VERSION_MINOR, \ - LIBSWSCALE_VERSION_MICRO) -#define LIBSWSCALE_VERSION AV_VERSION(LIBSWSCALE_VERSION_MAJOR, \ - LIBSWSCALE_VERSION_MINOR, \ - LIBSWSCALE_VERSION_MICRO) -#define LIBSWSCALE_BUILD LIBSWSCALE_VERSION_INT - -#define LIBSWSCALE_IDENT "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION) - -/* values for the flags, the stuff on the command line is different */ -#define SWS_FAST_BILINEAR 1 -#define SWS_BILINEAR 2 -#define SWS_BICUBIC 4 -#define SWS_X 8 -#define SWS_POINT 0x10 -#define SWS_AREA 0x20 -#define SWS_BICUBLIN 0x40 -#define SWS_GAUSS 0x80 -#define SWS_SINC 0x100 -#define SWS_LANCZOS 0x200 -#define SWS_SPLINE 0x400 - -#define SWS_SRC_V_CHR_DROP_MASK 0x30000 -#define SWS_SRC_V_CHR_DROP_SHIFT 16 - -#define SWS_PARAM_DEFAULT 123456 - -#define SWS_PRINT_INFO 0x1000 - -//the following 3 flags are not completely implemented -//internal chrominace subsampling info -#define SWS_FULL_CHR_H_INT 0x2000 -//input subsampling info -#define SWS_FULL_CHR_H_INP 0x4000 -#define SWS_DIRECT_BGR 0x8000 -#define SWS_ACCURATE_RND 0x40000 - -#define SWS_CPU_CAPS_MMX 0x80000000 -#define SWS_CPU_CAPS_MMX2 0x20000000 -#define SWS_CPU_CAPS_3DNOW 0x40000000 -#define SWS_CPU_CAPS_ALTIVEC 0x10000000 -#define SWS_CPU_CAPS_BFIN 0x01000000 - -#define SWS_MAX_REDUCE_CUTOFF 0.002 - -#define SWS_CS_ITU709 1 -#define SWS_CS_FCC 4 -#define SWS_CS_ITU601 5 -#define SWS_CS_ITU624 5 -#define SWS_CS_SMPTE170M 5 -#define SWS_CS_SMPTE240M 7 -#define SWS_CS_DEFAULT 5 - - - -// when used for filters they must have an odd number of elements -// coeffs cannot be shared between vectors -typedef struct { - double *coeff; - int length; -} SwsVector; - -// vectors can be shared -typedef struct { - SwsVector *lumH; - SwsVector *lumV; - SwsVector *chrH; - SwsVector *chrV; -} SwsFilter; - -struct SwsContext; - -void sws_freeContext(struct SwsContext *swsContext); - -struct SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags, - SwsFilter *srcFilter, SwsFilter *dstFilter, double *param); -int sws_scale(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY, - int srcSliceH, uint8_t* dst[], int dstStride[]); -int sws_scale_ordered(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY, - int srcSliceH, uint8_t* dst[], int dstStride[]) attribute_deprecated; - - -int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation); -int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table, int *srcRange, int **table, int *dstRange, int *brightness, int *contrast, int *saturation); -SwsVector *sws_getGaussianVec(double variance, double quality); -SwsVector *sws_getConstVec(double c, int length); -SwsVector *sws_getIdentityVec(void); -void sws_scaleVec(SwsVector *a, double scalar); -void sws_normalizeVec(SwsVector *a, double height); -void sws_convVec(SwsVector *a, SwsVector *b); -void sws_addVec(SwsVector *a, SwsVector *b); -void sws_subVec(SwsVector *a, SwsVector *b); -void sws_shiftVec(SwsVector *a, int shift); -SwsVector *sws_cloneVec(SwsVector *a); - -void sws_printVec(SwsVector *a); -void sws_freeVec(SwsVector *a); - -SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur, - float lumaSarpen, float chromaSharpen, - float chromaHShift, float chromaVShift, - int verbose); -void sws_freeFilter(SwsFilter *filter); - -struct SwsContext *sws_getCachedContext(struct SwsContext *context, - int srcW, int srcH, int srcFormat, - int dstW, int dstH, int dstFormat, int flags, - SwsFilter *srcFilter, SwsFilter *dstFilter, double *param); - -#endif /* FFMPEG_SWSCALE_H */ diff --git a/linphone/mediastreamer2/src/tee.c b/linphone/mediastreamer2/src/tee.c deleted file mode 100644 index 23c5be4c0..000000000 --- a/linphone/mediastreamer2/src/tee.c +++ /dev/null @@ -1,110 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/mstee.h" - -#define MS_TEE_NOUTPUTS 10 - -typedef struct _TeeData{ - bool_t muted[MS_TEE_NOUTPUTS]; -}TeeData; - -static void tee_init(MSFilter *f){ - f->data=ms_new0(TeeData,1); -} - -static void tee_uninit(MSFilter *f){ - ms_free(f->data); -} - -static void tee_process(MSFilter *f){ - TeeData *d=(TeeData*)f->data; - mblk_t *im; - int i; - while((im=ms_queue_get(f->inputs[0]))!=NULL){ - for(i=0;idesc->noutputs;i++){ - if (f->outputs[i]!=NULL && !d->muted[i]) - ms_queue_put(f->outputs[i],dupmsg(im)); - } - freemsg(im); - } -} - -static int tee_mute(MSFilter *f, void *arg){ - TeeData *d=(TeeData*)f->data; - int pin=((int*)arg)[0]; - if (pin>=0 && pinmuted[pin]=TRUE; - return 0; - } - return -1; -} - -static int tee_unmute(MSFilter *f, void *arg){ - TeeData *d=(TeeData*)f->data; - int pin=((int*)arg)[0]; - if (pin>=0 && pinmuted[pin]=FALSE; - return 0; - } - return -1; -} - -static MSFilterMethod tee_methods[]={ - { MS_TEE_MUTE , tee_mute }, - { MS_TEE_UNMUTE , tee_unmute }, - { 0 , NULL } -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_tee_desc={ - MS_TEE_ID, - "MSTee", - N_("A filter that reads from input and copy to its multiple outputs."), - MS_FILTER_OTHER, - NULL, - 1, - MS_TEE_NOUTPUTS, - tee_init, - NULL, - tee_process, - NULL, - tee_uninit, - tee_methods -}; - -#else - -MSFilterDesc ms_tee_desc={ - .id=MS_TEE_ID, - .name="MSTee", - .text=N_("A filter that reads from input and copy to its multiple outputs."), - .category=MS_FILTER_OTHER, - .ninputs=1, - .noutputs=MS_TEE_NOUTPUTS, - .init=tee_init, - .process=tee_process, - .uninit=tee_uninit, - .methods=tee_methods -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_tee_desc) diff --git a/linphone/mediastreamer2/src/theora.c b/linphone/mediastreamer2/src/theora.c deleted file mode 100644 index 4f043254c..000000000 --- a/linphone/mediastreamer2/src/theora.c +++ /dev/null @@ -1,590 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/msfilter.h" -#include "mediastreamer2/msticker.h" -#include "mediastreamer2/msvideo.h" - -#include - -typedef struct EncState{ - theora_state tstate; - theora_info tinfo; - yuv_buffer yuv; - mblk_t *packed_conf; - uint64_t start_time; - uint64_t conf_time; - unsigned int mtu; - unsigned int nframes; -} EncState; - -static void enc_init(MSFilter *f){ - EncState *s=(EncState *)ms_new(EncState,1); - theora_info_init(&s->tinfo); - s->tinfo.width=MS_VIDEO_SIZE_CIF_W; - s->tinfo.height=MS_VIDEO_SIZE_CIF_H; - s->tinfo.frame_width=MS_VIDEO_SIZE_CIF_W; - s->tinfo.frame_height=MS_VIDEO_SIZE_CIF_H; - s->tinfo.offset_x=0; - s->tinfo.offset_y=0; - s->tinfo.target_bitrate=500000; - s->tinfo.pixelformat=OC_PF_420; - s->tinfo.fps_numerator=15; - s->tinfo.fps_denominator=1; - s->tinfo.aspect_numerator=1; - s->tinfo.aspect_denominator=1; - s->tinfo.colorspace=OC_CS_UNSPECIFIED; - s->tinfo.dropframes_p=0; - s->tinfo.quick_p=1; - s->tinfo.quality=63; - s->tinfo.keyframe_auto_p=1; - s->tinfo.keyframe_frequency=64; - s->tinfo.keyframe_frequency_force=64; - s->tinfo.keyframe_data_target_bitrate=s->tinfo.target_bitrate*1.2; - s->tinfo.keyframe_auto_threshold=80; - s->tinfo.keyframe_mindistance=8; - s->tinfo.noise_sensitivity=1; - s->packed_conf=NULL; - s->start_time=0; - s->conf_time=0; - s->mtu=ms_get_payload_max_size()-6; - s->nframes=0; - f->data=s; -} - -static void enc_uninit(MSFilter *f){ - EncState *s=(EncState*)f->data; - theora_info_clear(&s->tinfo); - ms_free(s); -} - -static int enc_set_vsize(MSFilter *f, void*data){ - MSVideoSize *vs=(MSVideoSize*)data; - EncState *s=(EncState*)f->data; - s->tinfo.width=vs->width; - s->tinfo.height=vs->height; - s->tinfo.frame_width=vs->width; - s->tinfo.frame_height=vs->height; - return 0; -} - -static int enc_get_vsize(MSFilter *f, void *data){ - EncState *s=(EncState*)f->data; - MSVideoSize *vs=(MSVideoSize*)data; - vs->width=s->tinfo.width; - vs->height=s->tinfo.height; - return 0; -} - -static int enc_add_attr(MSFilter *f, void*data){ - /*const char *attr=(const char*)data; - EncState *s=(EncState*)f->data;*/ - return 0; -} - -static int enc_set_fps(MSFilter *f, void *data){ - float *fps=(float*)data; - EncState *s=(EncState*)f->data; - s->tinfo.fps_numerator=*fps; - s->tinfo.keyframe_frequency=(*fps)*5; - s->tinfo.keyframe_frequency_force=(*fps)*5; - return 0; -} - -static int enc_get_fps(MSFilter *f, void *data){ - EncState *s=(EncState*)f->data; - float *fps=(float*)data; - *fps=s->tinfo.fps_numerator; - return 0; -} - -static int enc_set_br(MSFilter *f, void*data){ - int br=*(int*)data; - EncState *s=(EncState*)f->data; - MSVideoSize vsize; - float fps; - float codecbr=(float)br; - vsize.width=s->tinfo.width; - vsize.height=s->tinfo.height; - fps=s->tinfo.fps_numerator; - s->tinfo.target_bitrate=codecbr*0.9; - s->tinfo.keyframe_data_target_bitrate=codecbr; - /*those default settings would need to be affined*/ - if (br>=1024000){ - vsize.width = MS_VIDEO_SIZE_4CIF_W; - vsize.height = MS_VIDEO_SIZE_4CIF_H; - s->tinfo.quality=15; - fps=30; - }else if (br>=512000){ - vsize.width = MS_VIDEO_SIZE_CIF_W; - vsize.height = MS_VIDEO_SIZE_CIF_H; - s->tinfo.quality=15; - fps=15; - }else if (br>=256000){ - vsize.width = MS_VIDEO_SIZE_CIF_W; - vsize.height = MS_VIDEO_SIZE_CIF_H; - s->tinfo.quality=5; - fps=15; - }else if(br>=128000){ - vsize.width=MS_VIDEO_SIZE_QCIF_W; - vsize.height=MS_VIDEO_SIZE_QCIF_H; - s->tinfo.quality=20; - fps=10; - }else if(br>=64000){ - vsize.width=MS_VIDEO_SIZE_QCIF_W; - vsize.height=MS_VIDEO_SIZE_QCIF_H; - s->tinfo.quality=7; - fps=7; - } - enc_set_vsize(f,&vsize); - enc_set_fps(f,&fps); - return 0; -} - -static int enc_set_mtu(MSFilter *f, void*data){ - EncState *s=(EncState*)f->data; - s->mtu=*(int*)data; - return 0; -} - -#define THEORA_RAW_DATA 0 -#define THEORA_PACKED_CONF 1 -#define THEORA_COMMENT 2 -#define THEORA_RESERVED 3 - -#define NOT_FRAGMENTED 0 -#define START_FRAGMENT 1 -#define CONT_FRAGMENT 2 -#define END_FRAGMENT 3 - - -static inline void payload_header_set(uint8_t *buf, uint32_t ident, uint8_t ft, uint8_t tdt, uint8_t pkts){ - uint32_t tmp; - tmp=((ident&0xFFFFFF)<<8) | ((ft&0x3)<<6) | ((tdt&0x3)<<4) | (pkts&0xf); - *((uint32_t*)buf)=htonl(tmp); -} - -static inline uint32_t payload_header_get_ident(uint8_t *buf){ - uint32_t *tmp=(uint32_t*)buf; - return (ntohl(*tmp)>>8) & 0xFFFFFF; -} - -static inline uint32_t payload_header_get_tdt(uint8_t *buf){ - uint32_t *tmp=(uint32_t*)buf; - return ((ntohl(*tmp))>>4) & 0x3; -} - -static inline uint32_t payload_header_get_ft(uint8_t *buf){ - uint32_t *tmp=(uint32_t*)buf; - return ((ntohl(*tmp))>>6) & 0x3; -} - -static inline uint32_t payload_header_get_pkts(uint8_t *buf){ - uint32_t *tmp=(uint32_t*)buf; - return ntohl(*tmp) & 0xf; -} - -static int create_packed_conf(EncState *s){ - ogg_packet p; - theora_state *tstate=&s->tstate; - mblk_t *h,*t; - if (theora_encode_header(tstate,&p)!=0){ - ms_error("theora_encode_header() error."); - return -1; - } - h=allocb(p.bytes,0); - memcpy(h->b_wptr,p.packet,p.bytes); - h->b_wptr+=p.bytes; - if (theora_encode_tables(tstate,&p)!=0){ - ms_error("theora_encode_tables error."); - freemsg(h); - return -1; - } - t=allocb(p.bytes,0); - memcpy(t->b_wptr,p.packet,p.bytes); - t->b_wptr+=p.bytes; - h->b_cont=t; - msgpullup(h,-1); - s->packed_conf=h; - return 0; -} - -static void enc_preprocess(MSFilter *f){ - EncState *s=(EncState*)f->data; - int err; - if ((err=theora_encode_init(&s->tstate,&s->tinfo))!=0){ - ms_error("error in theora_encode_init() : %i !",err); - } - s->yuv.y_width=s->tinfo.width; - s->yuv.y_height=s->tinfo.height; - s->yuv.y_stride=s->tinfo.width; - s->yuv.uv_width=s->tinfo.width/2; - s->yuv.uv_height=s->tinfo.height/2; - s->yuv.uv_stride=s->tinfo.width/2; - create_packed_conf(s); - s->conf_time=0; - s->nframes=0; -} - -static void enc_postprocess(MSFilter *f){ - EncState *s=(EncState*)f->data; - theora_clear(&s->tstate); - - //If preprocess is called after postprocess, - //then we loose all info... - //theora_info_clear(&s->tinfo); - - if (s->packed_conf) { - freemsg(s->packed_conf); - s->packed_conf=NULL; - } -} - -static void enc_fill_yuv(yuv_buffer *yuv, mblk_t *im){ - yuv->y=(uint8_t*)im->b_rptr; - yuv->u=(uint8_t*)im->b_rptr+(yuv->y_stride*yuv->y_height); - yuv->v=(uint8_t*)yuv->u+(yuv->uv_stride*yuv->uv_height); -} - - -static void packetize_and_send(MSFilter *f, EncState *s, mblk_t *om, uint32_t timestamp, uint8_t tdt){ - mblk_t *packet; - mblk_t *h; - int npackets=0; - static const int ident=0xdede; - while(om!=NULL){ - if (om->b_wptr-om->b_rptr>=s->mtu){ - packet=dupb(om); - packet->b_wptr=packet->b_rptr+s->mtu; - om->b_rptr=packet->b_wptr; - }else { - packet=om; - om=NULL; - } - ++npackets; - h=allocb(6,0); - if (npackets==1){ - if (om==NULL) - payload_header_set(h->b_wptr,ident,NOT_FRAGMENTED,tdt,1); - else - payload_header_set(h->b_wptr,ident,START_FRAGMENT,tdt,1); - }else{ - if (om==NULL) - payload_header_set(h->b_wptr,ident,END_FRAGMENT,tdt,1); - else - payload_header_set(h->b_wptr,ident,CONT_FRAGMENT,tdt,1); - } - h->b_wptr+=4; - *((uint16_t*)h->b_wptr)=htons(msgdsize(packet)); - h->b_wptr+=2; - h->b_cont=packet; - mblk_set_timestamp_info(h,timestamp); - ms_debug("sending theora frame of size %i",msgdsize(h)); - ms_queue_put(f->outputs[0],h); - } -} - -bool_t need_send_conf(EncState *s, uint64_t elapsed){ - /*send immediately then 10 seconds later */ - if ( (elapsed==0 && s->conf_time==0) - || (elapsed>=3000 && s->conf_time==1) - || (elapsed>=10000 && s->conf_time==2)){ - s->conf_time++; - return TRUE; - } - return FALSE; -} - -static void enc_process(MSFilter *f){ - mblk_t *im,*om; - ogg_packet op; - EncState *s=(EncState*)f->data; - uint64_t timems=f->ticker->time; - uint32_t timestamp=timems*90; - uint64_t elapsed; - - - while((im=ms_queue_get(f->inputs[0]))!=NULL){ - /*for the firsts frames only send theora packed conf*/ - om=NULL; - if (s->nframes==0){ - s->start_time=timems; - } - elapsed=timems-s->start_time; - - if (need_send_conf(s,elapsed)){ - if (s->packed_conf) { - om=dupmsg(s->packed_conf); - ms_message("sending theora packed conf (%i bytes)",msgdsize(om)); - packetize_and_send(f,s,om,timestamp,THEORA_PACKED_CONF); - }else { - ms_error("No packed conf to send."); - } - }else{ - enc_fill_yuv(&s->yuv,im); - ms_debug("subtmitting yuv frame to theora encoder..."); - if (theora_encode_YUVin(&s->tstate,&s->yuv)!=0){ - ms_error("theora_encode_YUVin error."); - }else{ - if (theora_encode_packetout(&s->tstate,0,&op)==1){ - ms_debug("Got theora coded frame"); - om=allocb(op.bytes,0); - memcpy(om->b_wptr,op.packet,op.bytes); - om->b_wptr+=op.bytes; - packetize_and_send(f,s,om,timestamp,THEORA_RAW_DATA); - } - } - } - freemsg(im); - s->nframes++; - } -} - -static MSFilterMethod enc_methods[]={ - { MS_FILTER_SET_VIDEO_SIZE, enc_set_vsize }, - { MS_FILTER_SET_FPS, enc_set_fps }, - { MS_FILTER_GET_VIDEO_SIZE, enc_get_vsize }, - { MS_FILTER_GET_FPS, enc_get_fps }, - { MS_FILTER_ADD_ATTR, enc_add_attr }, - { MS_FILTER_SET_BITRATE, enc_set_br }, - { MS_FILTER_SET_MTU, enc_set_mtu }, - { 0 , NULL } -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_theora_enc_desc={ - MS_THEORA_ENC_ID, - "MSTheoraEnc", - N_("The theora video encoder from xiph.org"), - MS_FILTER_ENCODER, - "theora", - 1, - 1, - enc_init, - enc_preprocess, - enc_process, - enc_postprocess, - enc_uninit, - enc_methods -}; - -#else - -MSFilterDesc ms_theora_enc_desc={ - .id=MS_THEORA_ENC_ID, - .name="MSTheoraEnc", - .text=N_("The open-source and royalty-free 'theora' video codec from xiph.org"), - .category=MS_FILTER_ENCODER, - .enc_fmt="theora", - .ninputs=1, - .noutputs=1, - .init=enc_init, - .preprocess=enc_preprocess, - .process=enc_process, - .postprocess=enc_postprocess, - .uninit=enc_uninit, - .methods=enc_methods -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_theora_enc_desc) - -typedef struct DecState{ - theora_state tstate; - theora_info tinfo; - mblk_t *yuv; - mblk_t *curframe; - bool_t ready; -}DecState; - -static void dec_init(MSFilter *f){ - DecState *s=(DecState *)ms_new(DecState,1); - s->ready=FALSE; - theora_info_init(&s->tinfo); - s->yuv=NULL; - s->curframe=NULL; - f->data=s; -} - -static void dec_uninit(MSFilter *f){ - DecState *s=(DecState*)f->data; - if (s->yuv!=NULL) freemsg(s->yuv); - if (s->curframe!=NULL) freemsg(s->curframe); - theora_info_clear(&s->tinfo); - ms_free(s); -} - -static bool_t dec_init_theora(DecState *s, ogg_packet *op){ - theora_comment tcom; - static const int ident_packet_size=42; - theora_comment_init(&tcom); - tcom.vendor="dummy"; - op->b_o_s=1; - if (theora_decode_header(&s->tinfo,&tcom,op)==0){ - op->packet+=ident_packet_size; - op->bytes-=ident_packet_size; - /*recall once to decode tables*/ - if (theora_decode_header(&s->tinfo,&tcom,op)==0){ - if (theora_decode_init(&s->tstate,&s->tinfo)==0){ - ms_debug("theora decoder ready, pixfmt=%i", - s->tinfo.pixelformat); - return TRUE; - } - }else{ - ms_warning("error decoding theora tables"); - } - }else{ - ms_warning("error decoding theora header"); - } - return FALSE; -} -/* remove payload header and agregates fragmented packets */ -static mblk_t *dec_unpacketize(MSFilter *f, DecState *s, mblk_t *im, int *tdt){ - uint8_t ft; - *tdt=payload_header_get_tdt((uint8_t*)im->b_rptr); - ft=payload_header_get_ft((uint8_t*)im->b_rptr); - im->b_rptr+=6; - - if (ft==NOT_FRAGMENTED) return im; - if (ft==START_FRAGMENT){ - if (s->curframe!=NULL) - freemsg(s->curframe); - s->curframe=im; - }else if (ft==CONT_FRAGMENT){ - if (s->curframe!=NULL) - concatb(s->curframe,im); - else - freemsg(im); - }else{/*end fragment*/ - if (s->curframe!=NULL){ - mblk_t *ret; - concatb(s->curframe,im); - msgpullup(s->curframe,-1); - ret=s->curframe; - s->curframe=NULL; - return ret; - }else - freemsg(im); - } - return NULL; -} - -static void dec_process_frame(MSFilter *f, DecState *s, ogg_packet *op){ - yuv_buffer yuv; - if (theora_decode_packetin(&s->tstate,op)==0){ - if (theora_decode_YUVout(&s->tstate,&yuv)==0){ - mblk_t *om; - int i; - int ylen=yuv.y_width*yuv.y_height; - int uvlen=yuv.uv_width*yuv.uv_height; - ms_debug("Got yuv buffer from theora decoder"); - if (s->yuv==NULL){ - int len=(ylen)+(2*uvlen); - s->yuv=allocb(len,0); - } - om=dupb(s->yuv); - for(i=0;ib_wptr,yuv.y+yuv.y_stride*i,yuv.y_width); - om->b_wptr+=yuv.y_width; - } - for(i=0;ib_wptr,yuv.u+yuv.uv_stride*i,yuv.uv_width); - om->b_wptr+=yuv.uv_width; - } - for(i=0;ib_wptr,yuv.v+yuv.uv_stride*i,yuv.uv_width); - om->b_wptr+=yuv.uv_width; - } - ms_queue_put(f->outputs[0],om); - } - }else{ - ms_warning("theora decoding error"); - } -} - -static void dec_process(MSFilter *f){ - mblk_t *im; - mblk_t *m; - ogg_packet op; - int tdt; - DecState *s=(DecState*)f->data; - while( (im=ms_queue_get(f->inputs[0]))!=0) { - m=dec_unpacketize(f,s,im,&tdt); - if (m!=NULL){ - /* now in im we have only the theora data*/ - op.packet=(uint8_t*)m->b_rptr; - op.bytes=m->b_wptr-m->b_rptr; - op.b_o_s=0; - op.e_o_s=0; - op.granulepos=0; - op.packetno=0; - if (tdt!=THEORA_RAW_DATA) /*packed conf*/ { - if (!s->ready){ - if (dec_init_theora(s,&op)) - s->ready=TRUE; - } - }else{ - if (s->ready){ - dec_process_frame(f,s,&op); - }else{ - ms_warning("skipping theora packet because decoder was not initialized yet with theora header and tables"); - } - } - freemsg(m); - } - } -} - -#ifdef _MSC_VER - -MSFilterDesc ms_theora_dec_desc={ - MS_THEORA_DEC_ID, - "MSTheoraDec", - N_("The theora video decoder from xiph.org"), - MS_FILTER_DECODER, - "theora", - 1, - 1, - dec_init, - NULL, - dec_process, - NULL, - dec_uninit, - NULL -}; - -#else - -MSFilterDesc ms_theora_dec_desc={ - .id=MS_THEORA_DEC_ID, - .name="MSTheoraDec", - .text=N_("The theora video decoder from xiph.org"), - .category=MS_FILTER_DECODER, - .enc_fmt="theora", - .ninputs=1, - .noutputs=1, - .init=dec_init, - .process=dec_process, - .uninit=dec_uninit -}; - -#endif -MS_FILTER_DESC_EXPORT(ms_theora_dec_desc) diff --git a/linphone/mediastreamer2/src/ulaw.c b/linphone/mediastreamer2/src/ulaw.c deleted file mode 100644 index 5d948f434..000000000 --- a/linphone/mediastreamer2/src/ulaw.c +++ /dev/null @@ -1,227 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/msfilter.h" -#include "g711common.h" - -typedef struct _UlawEncData{ - MSBufferizer *bz; - int ptime; - uint32_t ts; -} UlawEncData; - -static UlawEncData * ulaw_enc_data_new(){ - UlawEncData *obj=(UlawEncData *)ms_new(UlawEncData,1); - obj->bz=ms_bufferizer_new(); - obj->ptime=0; - obj->ts=0; - return obj; -} - -static void ulaw_enc_data_destroy(UlawEncData *obj){ - ms_bufferizer_destroy(obj->bz); - ms_free(obj); -} - -static void ulaw_enc_init(MSFilter *obj){ - obj->data=ulaw_enc_data_new(); -} - -static void ulaw_enc_uninit(MSFilter *obj){ - ulaw_enc_data_destroy((UlawEncData*)obj->data); -} - -static void ulaw_enc_process(MSFilter *obj){ - UlawEncData *dt=(UlawEncData*)obj->data; - MSBufferizer *bz=dt->bz; - uint8_t buffer[2240]; - int frame_per_packet=2; - int size_of_pcm=320; - - mblk_t *m; - - if (dt->ptime>=10) - { - frame_per_packet = dt->ptime/10; - } - - if (frame_per_packet<=0) - frame_per_packet=1; - if (frame_per_packet>14) /* 7*20 == 140 ms max */ - frame_per_packet=14; - - size_of_pcm = 160*frame_per_packet; /* ex: for 20ms -> 160*2==320 */ - - while((m=ms_queue_get(obj->inputs[0]))!=NULL){ - ms_bufferizer_put(bz,m); - } - - while (ms_bufferizer_read(bz,buffer,size_of_pcm)==size_of_pcm){ - mblk_t *o=allocb(size_of_pcm/2,0); - int i; - for (i=0;ib_wptr=s16_to_ulaw(((int16_t*)buffer)[i]); - o->b_wptr++; - } - mblk_set_timestamp_info(o,dt->ts); - dt->ts+=size_of_pcm/2; - ms_queue_put(obj->outputs[0],o); - } -} - -static int enc_add_fmtp(MSFilter *f, void *arg){ - const char *fmtp=(const char *)arg; - UlawEncData *s=(UlawEncData*)f->data; - char val[30]; - if (fmtp_get_value(fmtp,"ptime",val,sizeof(val))){ - s->ptime=atoi(val); - ms_message("MSUlawEnc: got ptime=%i",s->ptime); - } - return 0; -} - - -static int enc_add_attr(MSFilter *f, void *arg){ - const char *fmtp=(const char *)arg; - UlawEncData *s=(UlawEncData*)f->data; - if (strstr(fmtp,"ptime:10")!=NULL){ - s->ptime=10; - }else if (strstr(fmtp,"ptime:20")!=NULL){ - s->ptime=20; - }else if (strstr(fmtp,"ptime:30")!=NULL){ - s->ptime=30; - }else if (strstr(fmtp,"ptime:40")!=NULL){ - s->ptime=40; - }else if (strstr(fmtp,"ptime:50")!=NULL){ - s->ptime=50; - }else if (strstr(fmtp,"ptime:60")!=NULL){ - s->ptime=60; - }else if (strstr(fmtp,"ptime:70")!=NULL){ - s->ptime=70; - }else if (strstr(fmtp,"ptime:80")!=NULL){ - s->ptime=80; - }else if (strstr(fmtp,"ptime:90")!=NULL){ - s->ptime=90; - }else if (strstr(fmtp,"ptime:100")!=NULL){ - s->ptime=100; - }else if (strstr(fmtp,"ptime:110")!=NULL){ - s->ptime=110; - }else if (strstr(fmtp,"ptime:120")!=NULL){ - s->ptime=120; - }else if (strstr(fmtp,"ptime:130")!=NULL){ - s->ptime=130; - }else if (strstr(fmtp,"ptime:140")!=NULL){ - s->ptime=140; - } - return 0; -} - -static MSFilterMethod enc_methods[]={ - { MS_FILTER_ADD_ATTR , enc_add_attr}, - { MS_FILTER_ADD_FMTP , enc_add_fmtp}, - { 0 , NULL } -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_ulaw_enc_desc={ - MS_ULAW_ENC_ID, - "MSUlawEnc", - N_("ITU-G.711 ulaw encoder"), - MS_FILTER_ENCODER, - "pcmu", - 1, - 1, - ulaw_enc_init, - NULL, - ulaw_enc_process, - NULL, - ulaw_enc_uninit, - enc_methods -}; - -#else - -MSFilterDesc ms_ulaw_enc_desc={ - .id=MS_ULAW_ENC_ID, - .name="MSUlawEnc", - .text=N_("ITU-G.711 ulaw encoder"), - .category=MS_FILTER_ENCODER, - .enc_fmt="pcmu", - .ninputs=1, - .noutputs=1, - .init=ulaw_enc_init, - .process=ulaw_enc_process, - .uninit=ulaw_enc_uninit, - .methods=enc_methods -}; - -#endif - -static void ulaw_dec_process(MSFilter *obj){ - mblk_t *m; - while((m=ms_queue_get(obj->inputs[0]))!=NULL){ - mblk_t *o; - msgpullup(m,-1); - o=allocb((m->b_wptr-m->b_rptr)*2,0); - for(;m->b_rptrb_wptr;m->b_rptr++,o->b_wptr+=2){ - *((int16_t*)(o->b_wptr))=ulaw_to_s16(*m->b_rptr); - } - freemsg(m); - ms_queue_put(obj->outputs[0],o); - } -} - -#ifdef _MSC_VER - -MSFilterDesc ms_ulaw_dec_desc={ - MS_ULAW_DEC_ID, - "MSUlawDec", - N_("ITU-G.711 ulaw decoder"), - MS_FILTER_DECODER, - "pcmu", - 1, - 1, - NULL, - NULL, - ulaw_dec_process, - NULL, - NULL, - NULL -}; - -#else - -MSFilterDesc ms_ulaw_dec_desc={ - .id=MS_ULAW_DEC_ID, - .name="MSUlawDec", - .text=N_("ITU-G.711 ulaw decoder"), - .category=MS_FILTER_DECODER, - .enc_fmt="pcmu", - .ninputs=1, - .noutputs=1, - .process=ulaw_dec_process, -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_ulaw_dec_desc) -MS_FILTER_DESC_EXPORT(ms_ulaw_enc_desc) - - diff --git a/linphone/mediastreamer2/src/vfw-missing.h b/linphone/mediastreamer2/src/vfw-missing.h deleted file mode 100755 index 0c9006cbb..000000000 --- a/linphone/mediastreamer2/src/vfw-missing.h +++ /dev/null @@ -1,286 +0,0 @@ -#ifndef vfw_missing_h -#define vfw_missing_h - -typedef struct videohdr_tag { - LPBYTE lpData; /* pointer to locked data buffer */ - DWORD dwBufferLength; /* Length of data buffer */ - DWORD dwBytesUsed; /* Bytes actually used */ - DWORD dwTimeCaptured; /* Milliseconds from start of stream */ - DWORD_PTR dwUser; /* for client's use */ - DWORD dwFlags; /* assorted flags (see defines) */ - DWORD_PTR dwReserved[4]; /* reserved for driver */ -} VIDEOHDR, NEAR *PVIDEOHDR, FAR * LPVIDEOHDR; - -typedef struct tagCaptureParms { - DWORD dwRequestMicroSecPerFrame; // Requested capture rate - BOOL fMakeUserHitOKToCapture; // Show "Hit OK to cap" dlg? - UINT wPercentDropForError; // Give error msg if > (10%) - BOOL fYield; // Capture via background task? - DWORD dwIndexSize; // Max index size in frames (32K) - UINT wChunkGranularity; // Junk chunk granularity (2K) - BOOL fUsingDOSMemory; // Use DOS buffers? - UINT wNumVideoRequested; // # video buffers, If 0, autocalc - BOOL fCaptureAudio; // Capture audio? - UINT wNumAudioRequested; // # audio buffers, If 0, autocalc - UINT vKeyAbort; // Virtual key causing abort - BOOL fAbortLeftMouse; // Abort on left mouse? - BOOL fAbortRightMouse; // Abort on right mouse? - BOOL fLimitEnabled; // Use wTimeLimit? - UINT wTimeLimit; // Seconds to capture - BOOL fMCIControl; // Use MCI video source? - BOOL fStepMCIDevice; // Step MCI device? - DWORD dwMCIStartTime; // Time to start in MS - DWORD dwMCIStopTime; // Time to stop in MS - BOOL fStepCaptureAt2x; // Perform spatial averaging 2x - UINT wStepCaptureAverageFrames; // Temporal average n Frames - DWORD dwAudioBufferSize; // Size of audio bufs (0 = default) - BOOL fDisableWriteCache; // Attempt to disable write cache - UINT AVStreamMaster; // Which stream controls length? -} CAPTUREPARMS, *PCAPTUREPARMS, FAR *LPCAPTUREPARMS; - -typedef struct { - UINT uiImageWidth; - UINT uiImageHeight; - BOOL fLiveWindow; - BOOL fOverlayWindow; - BOOL fScale; - POINT ptScroll; - BOOL fUsingDefaultPalette; - BOOL fAudioHardware; - BOOL fCapFileExists; - DWORD dwCurrentVideoFrame; - DWORD dwCurrentVideoFramesDropped; - DWORD dwCurrentWaveSamples; - DWORD dwCurrentTimeElapsedMS; - HPALETTE hPalCurrent; - BOOL fCapturingNow; - DWORD dwReturn; - UINT wNumVideoAllocated; - UINT wNumAudioAllocated; -} CAPSTATUS, *PCAPSTATUS, FAR *LPCAPSTATUS; - - -#ifdef __cplusplus -/* SendMessage in C++*/ -#define AVICapSM(hwnd,m,w,l) ( (::IsWindow(hwnd)) ? ::SendMessage(hwnd,m,w,l) : 0) -#else -/* SendMessage in C */ -#define AVICapSM(hwnd,m,w,l) ( (IsWindow(hwnd)) ? SendMessage(hwnd,m,w,l) : 0) -#endif /* __cplusplus */ - -#define WM_CAP_START WM_USER - -// start of unicode messages -#define WM_CAP_UNICODE_START WM_USER+100 - -#define WM_CAP_GET_CAPSTREAMPTR (WM_CAP_START+ 1) - -#define WM_CAP_SET_CALLBACK_ERRORW (WM_CAP_UNICODE_START+ 2) -#define WM_CAP_SET_CALLBACK_STATUSW (WM_CAP_UNICODE_START+ 3) -#define WM_CAP_SET_CALLBACK_ERRORA (WM_CAP_START+ 2) -#define WM_CAP_SET_CALLBACK_STATUSA (WM_CAP_START+ 3) -#ifdef UNICODE -#define WM_CAP_SET_CALLBACK_ERROR WM_CAP_SET_CALLBACK_ERRORW -#define WM_CAP_SET_CALLBACK_STATUS WM_CAP_SET_CALLBACK_STATUSW -#else -#define WM_CAP_SET_CALLBACK_ERROR WM_CAP_SET_CALLBACK_ERRORA -#define WM_CAP_SET_CALLBACK_STATUS WM_CAP_SET_CALLBACK_STATUSA -#endif - - -#define WM_CAP_SET_CALLBACK_YIELD (WM_CAP_START+ 4) -#define WM_CAP_SET_CALLBACK_FRAME (WM_CAP_START+ 5) -#define WM_CAP_SET_CALLBACK_VIDEOSTREAM (WM_CAP_START+ 6) -#define WM_CAP_SET_CALLBACK_WAVESTREAM (WM_CAP_START+ 7) -#define WM_CAP_GET_USER_DATA (WM_CAP_START+ 8) -#define WM_CAP_SET_USER_DATA (WM_CAP_START+ 9) - -#define WM_CAP_DRIVER_CONNECT (WM_CAP_START+ 10) -#define WM_CAP_DRIVER_DISCONNECT (WM_CAP_START+ 11) - -#define WM_CAP_DRIVER_GET_NAMEA (WM_CAP_START+ 12) -#define WM_CAP_DRIVER_GET_VERSIONA (WM_CAP_START+ 13) -#define WM_CAP_DRIVER_GET_NAMEW (WM_CAP_UNICODE_START+ 12) -#define WM_CAP_DRIVER_GET_VERSIONW (WM_CAP_UNICODE_START+ 13) -#ifdef UNICODE -#define WM_CAP_DRIVER_GET_NAME WM_CAP_DRIVER_GET_NAMEW -#define WM_CAP_DRIVER_GET_VERSION WM_CAP_DRIVER_GET_VERSIONW -#else -#define WM_CAP_DRIVER_GET_NAME WM_CAP_DRIVER_GET_NAMEA -#define WM_CAP_DRIVER_GET_VERSION WM_CAP_DRIVER_GET_VERSIONA -#endif - -#define WM_CAP_DRIVER_GET_CAPS (WM_CAP_START+ 14) - -#define WM_CAP_FILE_SET_CAPTURE_FILEA (WM_CAP_START+ 20) -#define WM_CAP_FILE_GET_CAPTURE_FILEA (WM_CAP_START+ 21) -#define WM_CAP_FILE_SAVEASA (WM_CAP_START+ 23) -#define WM_CAP_FILE_SAVEDIBA (WM_CAP_START+ 25) -#define WM_CAP_FILE_SET_CAPTURE_FILEW (WM_CAP_UNICODE_START+ 20) -#define WM_CAP_FILE_GET_CAPTURE_FILEW (WM_CAP_UNICODE_START+ 21) -#define WM_CAP_FILE_SAVEASW (WM_CAP_UNICODE_START+ 23) -#define WM_CAP_FILE_SAVEDIBW (WM_CAP_UNICODE_START+ 25) -#ifdef UNICODE -#define WM_CAP_FILE_SET_CAPTURE_FILE WM_CAP_FILE_SET_CAPTURE_FILEW -#define WM_CAP_FILE_GET_CAPTURE_FILE WM_CAP_FILE_GET_CAPTURE_FILEW -#define WM_CAP_FILE_SAVEAS WM_CAP_FILE_SAVEASW -#define WM_CAP_FILE_SAVEDIB WM_CAP_FILE_SAVEDIBW -#else -#define WM_CAP_FILE_SET_CAPTURE_FILE WM_CAP_FILE_SET_CAPTURE_FILEA -#define WM_CAP_FILE_GET_CAPTURE_FILE WM_CAP_FILE_GET_CAPTURE_FILEA -#define WM_CAP_FILE_SAVEAS WM_CAP_FILE_SAVEASA -#define WM_CAP_FILE_SAVEDIB WM_CAP_FILE_SAVEDIBA -#endif - -// out of order to save on ifdefs -#define WM_CAP_FILE_ALLOCATE (WM_CAP_START+ 22) -#define WM_CAP_FILE_SET_INFOCHUNK (WM_CAP_START+ 24) - -#define WM_CAP_EDIT_COPY (WM_CAP_START+ 30) - -#define WM_CAP_SET_AUDIOFORMAT (WM_CAP_START+ 35) -#define WM_CAP_GET_AUDIOFORMAT (WM_CAP_START+ 36) - -#define WM_CAP_DLG_VIDEOFORMAT (WM_CAP_START+ 41) -#define WM_CAP_DLG_VIDEOSOURCE (WM_CAP_START+ 42) -#define WM_CAP_DLG_VIDEODISPLAY (WM_CAP_START+ 43) -#define WM_CAP_GET_VIDEOFORMAT (WM_CAP_START+ 44) -#define WM_CAP_SET_VIDEOFORMAT (WM_CAP_START+ 45) -#define WM_CAP_DLG_VIDEOCOMPRESSION (WM_CAP_START+ 46) - -#define WM_CAP_SET_PREVIEW (WM_CAP_START+ 50) -#define WM_CAP_SET_OVERLAY (WM_CAP_START+ 51) -#define WM_CAP_SET_PREVIEWRATE (WM_CAP_START+ 52) -#define WM_CAP_SET_SCALE (WM_CAP_START+ 53) -#define WM_CAP_GET_STATUS (WM_CAP_START+ 54) -#define WM_CAP_SET_SCROLL (WM_CAP_START+ 55) - -#define WM_CAP_GRAB_FRAME (WM_CAP_START+ 60) -#define WM_CAP_GRAB_FRAME_NOSTOP (WM_CAP_START+ 61) - -#define WM_CAP_SEQUENCE (WM_CAP_START+ 62) -#define WM_CAP_SEQUENCE_NOFILE (WM_CAP_START+ 63) -#define WM_CAP_SET_SEQUENCE_SETUP (WM_CAP_START+ 64) -#define WM_CAP_GET_SEQUENCE_SETUP (WM_CAP_START+ 65) - -#define WM_CAP_SET_MCI_DEVICEA (WM_CAP_START+ 66) -#define WM_CAP_GET_MCI_DEVICEA (WM_CAP_START+ 67) -#define WM_CAP_SET_MCI_DEVICEW (WM_CAP_UNICODE_START+ 66) -#define WM_CAP_GET_MCI_DEVICEW (WM_CAP_UNICODE_START+ 67) -#ifdef UNICODE -#define WM_CAP_SET_MCI_DEVICE WM_CAP_SET_MCI_DEVICEW -#define WM_CAP_GET_MCI_DEVICE WM_CAP_GET_MCI_DEVICEW -#else -#define WM_CAP_SET_MCI_DEVICE WM_CAP_SET_MCI_DEVICEA -#define WM_CAP_GET_MCI_DEVICE WM_CAP_GET_MCI_DEVICEA -#endif - - - -#define WM_CAP_STOP (WM_CAP_START+ 68) -#define WM_CAP_ABORT (WM_CAP_START+ 69) - -#define WM_CAP_SINGLE_FRAME_OPEN (WM_CAP_START+ 70) -#define WM_CAP_SINGLE_FRAME_CLOSE (WM_CAP_START+ 71) -#define WM_CAP_SINGLE_FRAME (WM_CAP_START+ 72) - -#define WM_CAP_PAL_OPENA (WM_CAP_START+ 80) -#define WM_CAP_PAL_SAVEA (WM_CAP_START+ 81) -#define WM_CAP_PAL_OPENW (WM_CAP_UNICODE_START+ 80) -#define WM_CAP_PAL_SAVEW (WM_CAP_UNICODE_START+ 81) -#ifdef UNICODE -#define WM_CAP_PAL_OPEN WM_CAP_PAL_OPENW -#define WM_CAP_PAL_SAVE WM_CAP_PAL_SAVEW -#else -#define WM_CAP_PAL_OPEN WM_CAP_PAL_OPENA -#define WM_CAP_PAL_SAVE WM_CAP_PAL_SAVEA -#endif - -#define WM_CAP_PAL_PASTE (WM_CAP_START+ 82) -#define WM_CAP_PAL_AUTOCREATE (WM_CAP_START+ 83) -#define WM_CAP_PAL_MANUALCREATE (WM_CAP_START+ 84) - -// Following added post VFW 1.1 -#define WM_CAP_SET_CALLBACK_CAPCONTROL (WM_CAP_START+ 85) - - -// Defines end of the message range -#define WM_CAP_UNICODE_END WM_CAP_PAL_SAVEW -#define WM_CAP_END WM_CAP_UNICODE_END - -#define capSetCallbackOnError(hwnd, fpProc) ((BOOL)AVICapSM(hwnd, WM_CAP_SET_CALLBACK_ERROR, 0, (LPARAM)(LPVOID)(fpProc))) -#define capSetCallbackOnStatus(hwnd, fpProc) ((BOOL)AVICapSM(hwnd, WM_CAP_SET_CALLBACK_STATUS, 0, (LPARAM)(LPVOID)(fpProc))) -#define capSetCallbackOnYield(hwnd, fpProc) ((BOOL)AVICapSM(hwnd, WM_CAP_SET_CALLBACK_YIELD, 0, (LPARAM)(LPVOID)(fpProc))) -#define capSetCallbackOnFrame(hwnd, fpProc) ((BOOL)AVICapSM(hwnd, WM_CAP_SET_CALLBACK_FRAME, 0, (LPARAM)(LPVOID)(fpProc))) -#define capSetCallbackOnVideoStream(hwnd, fpProc) ((BOOL)AVICapSM(hwnd, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, (LPARAM)(LPVOID)(fpProc))) -#define capSetCallbackOnWaveStream(hwnd, fpProc) ((BOOL)AVICapSM(hwnd, WM_CAP_SET_CALLBACK_WAVESTREAM, 0, (LPARAM)(LPVOID)(fpProc))) -#define capSetCallbackOnCapControl(hwnd, fpProc) ((BOOL)AVICapSM(hwnd, WM_CAP_SET_CALLBACK_CAPCONTROL, 0, (LPARAM)(LPVOID)(fpProc))) - -#define capSetUserData(hwnd, lUser) ((BOOL)AVICapSM(hwnd, WM_CAP_SET_USER_DATA, 0, (LPARAM)lUser)) -#define capGetUserData(hwnd) (AVICapSM(hwnd, WM_CAP_GET_USER_DATA, 0, 0)) - -#define capDriverConnect(hwnd, i) ((BOOL)AVICapSM(hwnd, WM_CAP_DRIVER_CONNECT, (WPARAM)(i), 0L)) -#define capDriverDisconnect(hwnd) ((BOOL)AVICapSM(hwnd, WM_CAP_DRIVER_DISCONNECT, (WPARAM)0, 0L)) -#define capDriverGetName(hwnd, szName, wSize) ((BOOL)AVICapSM(hwnd, WM_CAP_DRIVER_GET_NAME, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPTSTR)(szName))) -#define capDriverGetVersion(hwnd, szVer, wSize) ((BOOL)AVICapSM(hwnd, WM_CAP_DRIVER_GET_VERSION, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPTSTR)(szVer))) -#define capDriverGetCaps(hwnd, s, wSize) ((BOOL)AVICapSM(hwnd, WM_CAP_DRIVER_GET_CAPS, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPCAPDRIVERCAPS)(s))) - -#define capFileSetCaptureFile(hwnd, szName) ((BOOL)AVICapSM(hwnd, WM_CAP_FILE_SET_CAPTURE_FILE, 0, (LPARAM)(LPVOID)(LPTSTR)(szName))) -#define capFileGetCaptureFile(hwnd, szName, wSize) ((BOOL)AVICapSM(hwnd, WM_CAP_FILE_GET_CAPTURE_FILE, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPTSTR)(szName))) -#define capFileAlloc(hwnd, dwSize) ((BOOL)AVICapSM(hwnd, WM_CAP_FILE_ALLOCATE, 0, (LPARAM)(DWORD)(dwSize))) -#define capFileSaveAs(hwnd, szName) ((BOOL)AVICapSM(hwnd, WM_CAP_FILE_SAVEAS, 0, (LPARAM)(LPVOID)(LPTSTR)(szName))) -#define capFileSetInfoChunk(hwnd, lpInfoChunk) ((BOOL)AVICapSM(hwnd, WM_CAP_FILE_SET_INFOCHUNK, (WPARAM)0, (LPARAM)(LPCAPINFOCHUNK)(lpInfoChunk))) -#define capFileSaveDIB(hwnd, szName) ((BOOL)AVICapSM(hwnd, WM_CAP_FILE_SAVEDIB, 0, (LPARAM)(LPVOID)(LPTSTR)(szName))) - -#define capEditCopy(hwnd) ((BOOL)AVICapSM(hwnd, WM_CAP_EDIT_COPY, 0, 0L)) - -#define capSetAudioFormat(hwnd, s, wSize) ((BOOL)AVICapSM(hwnd, WM_CAP_SET_AUDIOFORMAT, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPWAVEFORMATEX)(s))) -#define capGetAudioFormat(hwnd, s, wSize) ((DWORD)AVICapSM(hwnd, WM_CAP_GET_AUDIOFORMAT, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPWAVEFORMATEX)(s))) -#define capGetAudioFormatSize(hwnd) ((DWORD)AVICapSM(hwnd, WM_CAP_GET_AUDIOFORMAT, (WPARAM)0, (LPARAM)0L)) - -#define capDlgVideoFormat(hwnd) ((BOOL)AVICapSM(hwnd, WM_CAP_DLG_VIDEOFORMAT, 0, 0L)) -#define capDlgVideoSource(hwnd) ((BOOL)AVICapSM(hwnd, WM_CAP_DLG_VIDEOSOURCE, 0, 0L)) -#define capDlgVideoDisplay(hwnd) ((BOOL)AVICapSM(hwnd, WM_CAP_DLG_VIDEODISPLAY, 0, 0L)) -#define capDlgVideoCompression(hwnd) ((BOOL)AVICapSM(hwnd, WM_CAP_DLG_VIDEOCOMPRESSION, 0, 0L)) - -#define capGetVideoFormat(hwnd, s, wSize) ((DWORD)AVICapSM(hwnd, WM_CAP_GET_VIDEOFORMAT, (WPARAM)(wSize), (LPARAM)(LPVOID)(s))) -#define capGetVideoFormatSize(hwnd) ((DWORD)AVICapSM(hwnd, WM_CAP_GET_VIDEOFORMAT, 0, 0L)) -#define capSetVideoFormat(hwnd, s, wSize) ((BOOL)AVICapSM(hwnd, WM_CAP_SET_VIDEOFORMAT, (WPARAM)(wSize), (LPARAM)(LPVOID)(s))) - -#define capPreview(hwnd, f) ((BOOL)AVICapSM(hwnd, WM_CAP_SET_PREVIEW, (WPARAM)(BOOL)(f), 0L)) -#define capPreviewRate(hwnd, wMS) ((BOOL)AVICapSM(hwnd, WM_CAP_SET_PREVIEWRATE, (WPARAM)(wMS), 0)) -#define capOverlay(hwnd, f) ((BOOL)AVICapSM(hwnd, WM_CAP_SET_OVERLAY, (WPARAM)(BOOL)(f), 0L)) -#define capPreviewScale(hwnd, f) ((BOOL)AVICapSM(hwnd, WM_CAP_SET_SCALE, (WPARAM)(BOOL)f, 0L)) -#define capGetStatus(hwnd, s, wSize) ((BOOL)AVICapSM(hwnd, WM_CAP_GET_STATUS, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPCAPSTATUS)(s))) -#define capSetScrollPos(hwnd, lpP) ((BOOL)AVICapSM(hwnd, WM_CAP_SET_SCROLL, (WPARAM)0, (LPARAM)(LPPOINT)(lpP))) - -#define capGrabFrame(hwnd) ((BOOL)AVICapSM(hwnd, WM_CAP_GRAB_FRAME, (WPARAM)0, (LPARAM)0L)) -#define capGrabFrameNoStop(hwnd) ((BOOL)AVICapSM(hwnd, WM_CAP_GRAB_FRAME_NOSTOP, (WPARAM)0, (LPARAM)0L)) - -#define capCaptureSequence(hwnd) ((BOOL)AVICapSM(hwnd, WM_CAP_SEQUENCE, (WPARAM)0, (LPARAM)0L)) -#define capCaptureSequenceNoFile(hwnd) ((BOOL)AVICapSM(hwnd, WM_CAP_SEQUENCE_NOFILE, (WPARAM)0, (LPARAM)0L)) -#define capCaptureStop(hwnd) ((BOOL)AVICapSM(hwnd, WM_CAP_STOP, (WPARAM)0, (LPARAM)0L)) -#define capCaptureAbort(hwnd) ((BOOL)AVICapSM(hwnd, WM_CAP_ABORT, (WPARAM)0, (LPARAM)0L)) - -#define capCaptureSingleFrameOpen(hwnd) ((BOOL)AVICapSM(hwnd, WM_CAP_SINGLE_FRAME_OPEN, (WPARAM)0, (LPARAM)0L)) -#define capCaptureSingleFrameClose(hwnd) ((BOOL)AVICapSM(hwnd, WM_CAP_SINGLE_FRAME_CLOSE, (WPARAM)0, (LPARAM)0L)) -#define capCaptureSingleFrame(hwnd) ((BOOL)AVICapSM(hwnd, WM_CAP_SINGLE_FRAME, (WPARAM)0, (LPARAM)0L)) - -#define capCaptureGetSetup(hwnd, s, wSize) ((BOOL)AVICapSM(hwnd, WM_CAP_GET_SEQUENCE_SETUP, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPCAPTUREPARMS)(s))) -#define capCaptureSetSetup(hwnd, s, wSize) ((BOOL)AVICapSM(hwnd, WM_CAP_SET_SEQUENCE_SETUP, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPCAPTUREPARMS)(s))) - -#define capSetMCIDeviceName(hwnd, szName) ((BOOL)AVICapSM(hwnd, WM_CAP_SET_MCI_DEVICE, 0, (LPARAM)(LPVOID)(LPTSTR)(szName))) -#define capGetMCIDeviceName(hwnd, szName, wSize) ((BOOL)AVICapSM(hwnd, WM_CAP_GET_MCI_DEVICE, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPTSTR)(szName))) - -#define capPaletteOpen(hwnd, szName) ((BOOL)AVICapSM(hwnd, WM_CAP_PAL_OPEN, 0, (LPARAM)(LPVOID)(LPTSTR)(szName))) -#define capPaletteSave(hwnd, szName) ((BOOL)AVICapSM(hwnd, WM_CAP_PAL_SAVE, 0, (LPARAM)(LPVOID)(LPTSTR)(szName))) -#define capPalettePaste(hwnd) ((BOOL)AVICapSM(hwnd, WM_CAP_PAL_PASTE, (WPARAM) 0, (LPARAM)0L)) -#define capPaletteAuto(hwnd, iFrames, iColors) ((BOOL)AVICapSM(hwnd, WM_CAP_PAL_AUTOCREATE, (WPARAM)(iFrames), (LPARAM)(DWORD)(iColors))) -#define capPaletteManual(hwnd, fGrab, iColors) ((BOOL)AVICapSM(hwnd, WM_CAP_PAL_MANUALCREATE, (WPARAM)(fGrab), (LPARAM)(DWORD)(iColors))) - -#define AVSTREAMMASTER_AUDIO 0 /* Audio master (VFW 1.0, 1.1) */ -#define AVSTREAMMASTER_NONE 1 /* No master */ - - -#endif - diff --git a/linphone/mediastreamer2/src/videodec.c b/linphone/mediastreamer2/src/videodec.c deleted file mode 100644 index 1ea0b1f22..000000000 --- a/linphone/mediastreamer2/src/videodec.c +++ /dev/null @@ -1,858 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifdef HAVE_CONFIG_H -#include "mediastreamer-config.h" -#endif - -#include "ffmpeg-priv.h" - -#include "mediastreamer2/msfilter.h" -#include "mediastreamer2/msvideo.h" -#include "rfc2429.h" - - -extern void ms_ffmpeg_check_init(); - -typedef struct DecState{ - AVCodecContext av_context; - AVCodec *av_codec; - enum CodecID codec; - mblk_t *input; - YuvBuf outbuf; - mblk_t *yuv_msg; - struct SwsContext *sws_ctx; - enum PixelFormat output_pix_fmt; - uint8_t dci[512]; - int dci_size; - bool_t snow_initialized; -}DecState; - - -static void dec_init(MSFilter *f, enum CodecID cid){ - DecState *s=(DecState *)ms_new0(DecState,1); - ms_ffmpeg_check_init(); - - avcodec_get_context_defaults(&s->av_context); - s->av_codec=NULL; - s->codec=cid; - s->input=NULL; - s->yuv_msg=NULL; - s->output_pix_fmt=PIX_FMT_YUV420P; - s->snow_initialized=FALSE; - s->outbuf.w=0; - s->outbuf.h=0; - s->sws_ctx=NULL; - f->data=s; - - s->av_codec=avcodec_find_decoder(s->codec); - if (s->av_codec==NULL){ - ms_error("Could not find decoder %i!",s->codec); - } - /* - s->av_context.width=MS_VIDEO_SIZE_QCIF_W; - s->av_context.height=MS_VIDEO_SIZE_QCIF_H; - */ -} - -static void dec_h263_init(MSFilter *f){ - dec_init(f,CODEC_ID_H263); -} - -static void dec_mpeg4_init(MSFilter *f){ - dec_init(f,CODEC_ID_MPEG4); -} - -static void dec_mjpeg_init(MSFilter *f){ - dec_init(f,CODEC_ID_MJPEG); -} - -static void dec_snow_init(MSFilter *f){ - dec_init(f,CODEC_ID_SNOW); -} - -static void dec_uninit(MSFilter *f){ - DecState *s=(DecState*)f->data; - if (s->input!=NULL) freemsg(s->input); - if (s->yuv_msg!=NULL) freemsg(s->yuv_msg); - if (s->sws_ctx!=NULL){ - sws_freeContext(s->sws_ctx); - s->sws_ctx=NULL; - } - ms_free(s); -} - -static int dec_add_fmtp(MSFilter *f, void *data){ - const char *fmtp=(const char*)data; - DecState *s=(DecState*)f->data; - char config[512]; - if (fmtp_get_value(fmtp,"config",config,sizeof(config))){ - /*convert hexa decimal config string into a bitstream */ - int i,j,max=strlen(config); - char octet[3]; - octet[2]=0; - for(i=0,j=0;idci[j]=(uint8_t)strtol(octet,NULL,16); - } - s->dci_size=j; - ms_message("Got mpeg4 config string: %s",config); - } - return 0; -} - -static void dec_preprocess(MSFilter *f){ - DecState *s=(DecState*)f->data; - int error; - /* we must know picture size before initializing snow decoder*/ - if (s->codec!=CODEC_ID_SNOW){ - error=avcodec_open(&s->av_context, s->av_codec); - if (error!=0) ms_error("avcodec_open() failed: %i",error); - if (s->codec==CODEC_ID_MPEG4 && s->dci_size>0){ - s->av_context.extradata=s->dci; - s->av_context.extradata_size=s->dci_size; - } - } -} - -static void dec_postprocess(MSFilter *f){ - DecState *s=(DecState*)f->data; - if (s->av_context.codec!=NULL){ - avcodec_close(&s->av_context); - s->av_context.codec=NULL; - } -} - -static mblk_t * skip_rfc2190_header(mblk_t *inm){ - if (msgdsize(inm) >= 4) { - uint8_t *ph = inm->b_rptr; - int F = (ph[0]>>7) & 0x1; - int P = (ph[0]>>6) & 0x1; - if (F == 0) inm->b_rptr += 4; // mode A - else if (P == 0) inm->b_rptr += 8; // mode B - else inm->b_rptr += 12; // mode C - } else { - freemsg(inm); - inm=NULL; - } - return inm; -} - -static mblk_t * skip_rfc2429_header(mblk_t *inm){ - if (msgdsize(inm) >= 2){ - uint32_t *p = (uint32_t*)inm->b_rptr; - uint8_t *ph=inm->b_rptr; - int PLEN; - int gob_num; - bool_t P; - - P=rfc2429_get_P(ph); - PLEN=rfc2429_get_PLEN(ph); - /*printf("receiving new packet; P=%i; V=%i; PLEN=%i; PEBIT=%i\n",P,rfc2429_get_V(ph),PLEN,rfc2429_get_PEBIT(ph)); - */ - gob_num = (ntohl(*p) >> 10) & 0x1f; - /*ms_message("gob %i, size %i", gob_num, msgdsize(inm)); - ms_message("ms_AVdecoder_process: received %08x %08x", ntohl(p[0]), ntohl(p[1]));*/ - - /* remove H.263 Payload Header */ - if (PLEN>0){ - /* we ignore the redundant picture header and - directly go to the bitstream */ - inm->b_rptr+=PLEN; - } - if (P){ - inm->b_rptr[0]=inm->b_rptr[1]=0; - }else{ - /* no PSC omitted */ - inm->b_rptr+=2; - } - return inm; - }else freemsg(inm); - return NULL; -} - -static mblk_t * parse_snow_header(DecState *s,mblk_t *inm){ - if (msgdsize(inm) >= 4){ - uint32_t h = ntohl(*(uint32_t*)inm->b_rptr); - if (!s->snow_initialized){ - int error; - s->av_context.width=h>>16; - s->av_context.height=h&0xffff; - error=avcodec_open(&s->av_context, s->av_codec); - if (error!=0) ms_error("avcodec_open() failed for snow: %i",error); - else { - s->snow_initialized=TRUE; - ms_message("Snow decoder initialized,size=%ix%i", - s->av_context.width, - s->av_context.height); - } - } - inm->b_rptr+=4; - return inm; - }else { - freemsg(inm); - return NULL; - } -} - -struct jpeghdr { - //unsigned int tspec:8; /* type-specific field */ - unsigned int off:32; /* fragment byte offset */ - uint8_t type; /* id of jpeg decoder params */ - uint8_t q; /* quantization factor (or table id) */ - uint8_t width; /* frame width in 8 pixel blocks */ - uint8_t height; /* frame height in 8 pixel blocks */ -}; - -struct jpeghdr_rst { - uint16_t dri; - unsigned int f:1; - unsigned int l:1; - unsigned int count:14; -}; - -struct jpeghdr_qtable { - uint8_t mbz; - uint8_t precision; - uint16_t length; -}; - - -static u_char lum_dc_codelens[] = { - 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, -}; - -static u_char lum_dc_symbols[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, -}; - -static u_char lum_ac_codelens[] = { - 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d, -}; - -static u_char lum_ac_symbols[] = { - 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, - 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, - 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, - 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0, - 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16, - 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28, - 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, - 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, - 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, - 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, - 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, - 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, - 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, - 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, - 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, - 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, - 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2, - 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, - 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, - 0xf9, 0xfa, -}; - -static u_char chm_dc_codelens[] = { - 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, -}; - -static u_char chm_dc_symbols[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, -}; - -static u_char chm_ac_codelens[] = { - 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77, -}; - -static u_char chm_ac_symbols[] = { - 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, - 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, - 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, - 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, - 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34, - 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26, - 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38, - 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, - 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, - 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, - 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, - 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, - 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, - 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, - 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, - 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, - 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, - 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, - 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, - 0xf9, 0xfa, -}; - -static u_char * -MakeQuantHeader(u_char *p, u_char *qt, int tableNo, int table_len) -{ - *p++ = 0xff; - *p++ = 0xdb; /* DQT */ - *p++ = 0; /* length msb */ - *p++ = table_len+3; /* length lsb */ - *p++ = tableNo; - memcpy(p, qt, table_len); - return (p + table_len); -} - -static u_char * -MakeHuffmanHeader(u_char *p, u_char *codelens, int ncodes, - u_char *symbols, int nsymbols, int tableNo, - int tableClass) -{ - *p++ = 0xff; - *p++ = 0xc4; /* DHT */ - *p++ = 0; /* length msb */ - *p++ = 3 + ncodes + nsymbols; /* length lsb */ - *p++ = (tableClass << 4) | tableNo; - memcpy(p, codelens, ncodes); - p += ncodes; - memcpy(p, symbols, nsymbols); - p += nsymbols; - return (p); -} - -static u_char * -MakeDRIHeader(u_char *p, u_short dri) { - *p++ = 0xff; - *p++ = 0xdd; /* DRI */ - *p++ = 0x0; /* length msb */ - *p++ = 4; /* length lsb */ - *p++ = dri >> 8; /* dri msb */ - *p++ = dri & 0xff; /* dri lsb */ - return (p); -} - -/* - * Arguments: - * type, width, height: as supplied in RTP/JPEG header - * lqt, cqt: quantization tables as either derived from - * the Q field using MakeTables() or as specified - * in section 4.2. - * dri: restart interval in MCUs, or 0 if no restarts. - * - * p: pointer to return area - * - * Return value: - * The length of the generated headers. - * - * Generate a frame and scan headers that can be prepended to the - * RTP/JPEG data payload to produce a JPEG compressed image in - * interchange format (except for possible trailing garbage and - * absence of an EOI marker to terminate the scan). - */ -static int MakeHeaders(u_char *p, int type, int w, int h, u_char *lqt, - u_char *cqt, unsigned table_len, u_short dri) -{ - u_char *start = p; - - /* convert from blocks to pixels */ - w <<= 3; - h <<= 3; - - *p++ = 0xff; - *p++ = 0xd8; /* SOI */ - - if (table_len>64) - { - p = MakeQuantHeader(p, lqt, 0, table_len/2); - p = MakeQuantHeader(p, cqt, 1, table_len/2); - } - else - { - p = MakeQuantHeader(p, lqt, 0, table_len); - //p = MakeQuantHeader(p, lqt, 1, table_len); - } - if (dri != 0) - p = MakeDRIHeader(p, dri); - - *p++ = 0xff; - *p++ = 0xc0; /* SOF */ - *p++ = 0; /* length msb */ - *p++ = 17; /* length lsb */ - *p++ = 8; /* 8-bit precision */ - *p++ = h >> 8; /* height msb */ - *p++ = h; /* height lsb */ - *p++ = w >> 8; /* width msb */ - *p++ = w; /* wudth lsb */ - *p++ = 3; /* number of components */ - *p++ = 0; /* comp 0 */ - if (type == 0) - *p++ = 0x21; /* hsamp = 2, vsamp = 1 */ - else - *p++ = 0x22; /* hsamp = 2, vsamp = 2 */ - *p++ = 0; /* quant table 0 */ - *p++ = 1; /* comp 1 */ - *p++ = 0x11; /* hsamp = 1, vsamp = 1 */ - *p++ = table_len <= 64 ? 0x00 : 0x01; //1 /* quant table 1 */ - *p++ = 2; /* comp 2 */ - *p++ = 0x11; /* hsamp = 1, vsamp = 1 */ - *p++ = table_len <= 64 ? 0x00 : 0x01; //1; /* quant table 1 */ - p = MakeHuffmanHeader(p, lum_dc_codelens, - sizeof(lum_dc_codelens), - lum_dc_symbols, - sizeof(lum_dc_symbols), 0, 0); - p = MakeHuffmanHeader(p, lum_ac_codelens, - sizeof(lum_ac_codelens), - lum_ac_symbols, - sizeof(lum_ac_symbols), 0, 1); - p = MakeHuffmanHeader(p, chm_dc_codelens, - sizeof(chm_dc_codelens), - chm_dc_symbols, - sizeof(chm_dc_symbols), 1, 0); - p = MakeHuffmanHeader(p, chm_ac_codelens, - sizeof(chm_ac_codelens), - chm_ac_symbols, - sizeof(chm_ac_symbols), 1, 1); - - *p++ = 0xff; - *p++ = 0xda; /* SOS */ - *p++ = 0; /* length msb */ - *p++ = 12; /* length lsb */ - *p++ = 3; /* 3 components */ - *p++ = 0; /* comp 0 */ - *p++ = 0; /* huffman table 0 */ - *p++ = 1; /* comp 1 */ - *p++ = 0x11; /* huffman table 1 */ - *p++ = 2; /* comp 2 */ - *p++ = 0x11; /* huffman table 1 */ - *p++ = 0; /* first DCT coeff */ - *p++ = 63; /* last DCT coeff */ - *p++ = 0; /* sucessive approx. */ - - return (p - start); -}; - - -/* - * Table K.1 from JPEG spec. - */ -static const int jpeg_luma_quantizer[64] = { - 16, 11, 10, 16, 24, 40, 51, 61, - 12, 12, 14, 19, 26, 58, 60, 55, - 14, 13, 16, 24, 40, 57, 69, 56, - 14, 17, 22, 29, 51, 87, 80, 62, - 18, 22, 37, 56, 68, 109, 103, 77, - 24, 35, 55, 64, 81, 104, 113, 92, - 49, 64, 78, 87, 103, 121, 120, 101, - 72, 92, 95, 98, 112, 100, 103, 99 -}; - -/* - * Table K.2 from JPEG spec. - */ -static const int jpeg_chroma_quantizer[64] = { - 17, 18, 24, 47, 99, 99, 99, 99, - 18, 21, 26, 66, 99, 99, 99, 99, - 24, 26, 56, 99, 99, 99, 99, 99, - 47, 66, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99 -}; - -/* - * Call MakeTables with the Q factor and two u_char[64] return arrays - */ -static void MakeTables(int q, u_char *lqt, u_char *cqt) -{ - int i; - int factor = q; - - if (q < 1) factor = 1; - if (q > 99) factor = 99; - if (q < 50) - q = 5000 / factor; - else - q = 200 - factor*2; - - for (i=0; i < 64; i++) { - int lq = (jpeg_luma_quantizer[i] * q + 50) / 100; - int cq = (jpeg_chroma_quantizer[i] * q + 50) / 100; - - /* Limit the quantizers to 1 <= q <= 255 */ - if (lq < 1) lq = 1; - else if (lq > 255) lq = 255; - lqt[i] = lq; - - if (cq < 1) cq = 1; - else if (cq > 255) cq = 255; - cqt[i] = cq; - } -} - -static mblk_t * -read_rfc2435_header(DecState *s,mblk_t *inm) -{ - if (msgdsize(inm) >= sizeof(struct jpeghdr)) { - struct jpeghdr *hdr = (struct jpeghdr *)inm->b_rptr; - uint32_t off = ntohl(*(uint32_t*)inm->b_rptr); - uint16_t dri=0; - uint16_t table_len=0; - int len=0; - - mblk_t *headers=NULL; - - inm->b_rptr += sizeof(struct jpeghdr); - if (hdr->type>63){ - struct jpeghdr_rst *rsthdr = (struct jpeghdr_rst *)inm->b_rptr; - dri = ntohs(rsthdr->dri); - inm->b_rptr += sizeof(struct jpeghdr_rst); - } - - if (off==0){ - if (hdr->q>=128){ - inm->b_rptr++; /* MBZ */ - inm->b_rptr++; /* Precision */ - table_len = ntohs(*((uint16_t*)(inm->b_rptr))); - inm->b_rptr++; /* len */ - inm->b_rptr++; /* len */ - headers = allocb(495 + table_len*2 + (dri > 0 ? 6 : 0), 0); - len = MakeHeaders(headers->b_rptr, hdr->type, hdr->width, hdr->height, - inm->b_rptr, inm->b_rptr+table_len/2, table_len, dri); - inm->b_rptr += table_len; - headers->b_wptr += len; - }else{ - uint8_t lqt_cqt[128]; - MakeTables(hdr->q, lqt_cqt, lqt_cqt+64); - table_len=128; - headers = allocb(495 + table_len + (dri > 0 ? 6 : 0), 0); - len = MakeHeaders(headers->b_rptr, hdr->type, hdr->width, hdr->height, - lqt_cqt, lqt_cqt+64, table_len, dri); - headers->b_wptr += len; - } - } - - if (headers!=NULL) - { - /* prepend headers to JPEG RTP data */ - if (mblk_get_marker_info(inm)) - mblk_set_marker_info(headers, TRUE); - headers->b_cont=inm; - msgpullup(headers, -1); - return headers; - } - } else { - freemsg(inm); - inm=NULL; - } - return inm; -} - -static mblk_t *get_as_yuvmsg(MSFilter *f, DecState *s, AVFrame *orig){ - AVCodecContext *ctx=&s->av_context; - - if (s->outbuf.w!=ctx->width || s->outbuf.h!=ctx->height){ - if (s->sws_ctx!=NULL){ - sws_freeContext(s->sws_ctx); - s->sws_ctx=NULL; - } - s->yuv_msg=yuv_buf_alloc(&s->outbuf,ctx->width,ctx->height); - s->outbuf.w=ctx->width; - s->outbuf.h=ctx->height; - s->sws_ctx=sws_getContext(ctx->width,ctx->height,ctx->pix_fmt, - ctx->width,ctx->height,s->output_pix_fmt,SWS_FAST_BILINEAR, - NULL, NULL, NULL); - } - if (sws_scale(s->sws_ctx,orig->data,orig->linesize, 0, - ctx->height, s->outbuf.planes, s->outbuf.strides)<0){ - ms_error("%s: error in sws_scale().",f->desc->name); - } - return dupmsg(s->yuv_msg); -} - -static void dec_process_frame(MSFilter *f, mblk_t *inm){ - DecState *s=(DecState*)f->data; - AVFrame orig; - int got_picture; - /* get a picture from the input queue */ - - if (f->desc->id==MS_H263_DEC_ID) inm=skip_rfc2429_header(inm); - else if (f->desc->id==MS_H263_OLD_DEC_ID) inm=skip_rfc2190_header(inm); - else if (s->codec==CODEC_ID_SNOW && s->input==NULL) inm=parse_snow_header(s,inm); - else if (s->codec==CODEC_ID_MJPEG && f->desc->id==MS_JPEG_DEC_ID) inm=read_rfc2435_header(s,inm); - if (inm){ - /* accumulate the video packet until we have the rtp markbit*/ - if (s->input==NULL){ - s->input=inm; - }else{ - concatb(s->input,inm); - } - - if (mblk_get_marker_info(inm)){ - mblk_t *frame; - int remain,len; - /*ms_message("got marker bit !");*/ - /*append some padding bytes for ffmpeg to safely - read extra bytes...*/ - msgpullup(s->input,msgdsize(s->input)+8); - frame=s->input; - s->input=NULL; - while ( (remain=frame->b_wptr-frame->b_rptr)> 0) { - AVPacket pkt; - av_init_packet(&pkt); - pkt.data = frame->b_rptr; - pkt.size = remain; - len=avcodec_decode_video2(&s->av_context,&orig,&got_picture,&pkt); - /*len=avcodec_decode_video(&s->av_context,&orig,&got_picture,(uint8_t*)frame->b_rptr,remain );*/ - if (len<=0) { - ms_warning("ms_AVdecoder_process: error %i.",len); - break; - } - if (got_picture) { - ms_queue_put(f->outputs[0],get_as_yuvmsg(f,s,&orig)); - } - frame->b_rptr+=len; - } - freemsg(frame); - } - } -} - -static void dec_process(MSFilter *f){ - mblk_t *inm; - while((inm=ms_queue_get(f->inputs[0]))!=0){ - dec_process_frame(f,inm); - } -} - - -static MSFilterMethod methods[]={ - { MS_FILTER_ADD_FMTP , dec_add_fmtp }, - { 0 , NULL } -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_h263_dec_desc={ - MS_H263_DEC_ID, - "MSH263Dec", - N_("A H.263 decoder using ffmpeg library"), - MS_FILTER_DECODER, - "H263-1998", - 1, - 1, - dec_h263_init, - dec_preprocess, - dec_process, - dec_postprocess, - dec_uninit, - methods -}; - -MSFilterDesc ms_h263_old_dec_desc={ - MS_H263_OLD_DEC_ID, - "MSH263OldDec", - N_("A H.263 decoder using ffmpeg library"), - MS_FILTER_DECODER, - "H263", - 1, - 1, - dec_h263_init, - dec_preprocess, - dec_process, - dec_postprocess, - dec_uninit, - methods -}; - - -MSFilterDesc ms_mpeg4_dec_desc={ - MS_MPEG4_DEC_ID, - "MSMpeg4Dec", - N_("A MPEG4 decoder using ffmpeg library"), - MS_FILTER_DECODER, - "MP4V-ES", - 1, - 1, - dec_mpeg4_init, - dec_preprocess, - dec_process, - dec_postprocess, - dec_uninit, - methods -}; - -MSFilterDesc ms_jpeg_dec_desc={ - MS_JPEG_DEC_ID, - "MSJpegDec", - N_("A RTP/JPEG decoder using ffmpeg library"), - MS_FILTER_DECODER, - "JPEG", - 1, - 1, - dec_mjpeg_init, - dec_preprocess, - dec_process, - dec_postprocess, - dec_uninit, - methods -}; - -MSFilterDesc ms_mjpeg_dec_desc={ - MS_MJPEG_DEC_ID, - "MSMJpegDec", - N_("A MJPEG decoder using ffmpeg library"), - MS_FILTER_DECODER, - "MJPEG", - 1, - 1, - dec_mjpeg_init, - dec_preprocess, - dec_process, - dec_postprocess, - dec_uninit, - methods -}; - -MSFilterDesc ms_snow_dec_desc={ - MS_SNOW_DEC_ID, - "MSSnowDec", - N_("A snow decoder using ffmpeg library"), - MS_FILTER_DECODER, - "snow", - 1, - 1, - dec_snow_init, - dec_preprocess, - dec_process, - dec_postprocess, - dec_uninit, - methods -}; - -#else - -MSFilterDesc ms_h263_dec_desc={ - .id=MS_H263_DEC_ID, - .name="MSH263Dec", - .text=N_("A H.263 decoder using ffmpeg library"), - .category=MS_FILTER_DECODER, - .enc_fmt="H263-1998", - .ninputs=1, - .noutputs=1, - .init=dec_h263_init, - .preprocess=dec_preprocess, - .process=dec_process, - .postprocess=dec_postprocess, - .uninit=dec_uninit, - .methods= methods -}; - -MSFilterDesc ms_h263_old_dec_desc={ - .id=MS_H263_OLD_DEC_ID, - .name="MSH263OldDec", - .text=N_("A H.263 decoder using ffmpeg library"), - .category=MS_FILTER_DECODER, - .enc_fmt="H263", - .ninputs=1, - .noutputs=1, - .init=dec_h263_init, - .preprocess=dec_preprocess, - .process=dec_process, - .postprocess=dec_postprocess, - .uninit=dec_uninit, - .methods= methods -}; - - -MSFilterDesc ms_mpeg4_dec_desc={ - .id=MS_MPEG4_DEC_ID, - .name="MSMpeg4Dec", - .text="A MPEG4 decoder using ffmpeg library", - .category=MS_FILTER_DECODER, - .enc_fmt="MP4V-ES", - .ninputs=1, - .noutputs=1, - .init=dec_mpeg4_init, - .preprocess=dec_preprocess, - .process=dec_process, - .postprocess=dec_postprocess, - .uninit=dec_uninit, - .methods= methods -}; - -MSFilterDesc ms_jpeg_dec_desc={ - .id=MS_JPEG_DEC_ID, - .name="MSJpegDec", - .text="A RTP/MJEPG decoder using ffmpeg library", - .category=MS_FILTER_DECODER, - .enc_fmt="JPEG", - .ninputs=1, - .noutputs=1, - .init=dec_mjpeg_init, - .preprocess=dec_preprocess, - .process=dec_process, - .postprocess=dec_postprocess, - .uninit=dec_uninit, - .methods= methods -}; - -MSFilterDesc ms_mjpeg_dec_desc={ - .id=MS_MJPEG_DEC_ID, - .name="MSMJpegDec", - .text="A MJEPG decoder using ffmpeg library", - .category=MS_FILTER_DECODER, - .enc_fmt="MJPEG", - .ninputs=1, - .noutputs=1, - .init=dec_mjpeg_init, - .preprocess=dec_preprocess, - .process=dec_process, - .postprocess=dec_postprocess, - .uninit=dec_uninit, - .methods= methods -}; - -MSFilterDesc ms_snow_dec_desc={ - .id=MS_SNOW_DEC_ID, - .name="MSSnowDec", - .text="A snow decoder using ffmpeg library", - .category=MS_FILTER_DECODER, - .enc_fmt="x-snow", - .ninputs=1, - .noutputs=1, - .init=dec_snow_init, - .preprocess=dec_preprocess, - .process=dec_process, - .postprocess=dec_postprocess, - .uninit=dec_uninit, - .methods= methods -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_mpeg4_dec_desc) -MS_FILTER_DESC_EXPORT(ms_h263_dec_desc) -MS_FILTER_DESC_EXPORT(ms_h263_old_dec_desc) -MS_FILTER_DESC_EXPORT(ms_snow_dec_desc) - -/* decode JPEG image with RTP/jpeg headers */ -MS_FILTER_DESC_EXPORT(ms_jpeg_dec_desc) -/* decode JPEG image with jpeg headers */ -MS_FILTER_DESC_EXPORT(ms_mjpeg_dec_desc) diff --git a/linphone/mediastreamer2/src/videoenc.c b/linphone/mediastreamer2/src/videoenc.c deleted file mode 100644 index 3cbf5f69a..000000000 --- a/linphone/mediastreamer2/src/videoenc.c +++ /dev/null @@ -1,1041 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifdef HAVE_CONFIG_H -#include "mediastreamer-config.h" -#endif - -#ifdef HAVE_LIBAVCODEC_AVCODEC_H -#include -#else -#include -#endif - -#include "mediastreamer2/msfilter.h" -#include "mediastreamer2/msvideo.h" -#include "mediastreamer2/msticker.h" - -#ifdef _WIN32 -#include -#else -#include /* ntohl(3) */ -#endif - -#include "rfc2429.h" - -static bool_t avcodec_initialized=FALSE; - -#ifdef ENABLE_LOG_FFMPEG - -void ms_ffmpeg_log_callback(void* ptr, int level, const char* fmt, va_list vl) -{ - static char message[8192]; - - vsnprintf(message, sizeof message, fmt, vl); - ms_message(message); -} - -#endif - -void ms_ffmpeg_check_init(){ - if(!avcodec_initialized){ - avcodec_init(); - avcodec_register_all(); - avcodec_initialized=TRUE; -#ifdef ENABLE_LOG_FFMPEG - av_log_set_level(AV_LOG_WARNING); - av_log_set_callback(&ms_ffmpeg_log_callback); -#endif - } -} - -typedef struct EncState{ - AVCodecContext av_context; - AVCodec *av_codec; - enum CodecID codec; - mblk_t *comp_buf; - MSVideoSize vsize; - int mtu; /* network maximum transmission unit in bytes */ - int profile; - float fps; - int maxbr; - int qmin; - uint32_t framenum; - bool_t req_vfu; -}EncState; - -static int enc_set_fps(MSFilter *f, void *arg){ - EncState *s=(EncState*)f->data; - s->fps=*(float*)arg; - return 0; -} - -static int enc_get_fps(MSFilter *f, void *arg){ - EncState *s=(EncState*)f->data; - *(float*)arg=s->fps; - return 0; -} - -static int enc_set_vsize(MSFilter *f,void *arg){ - EncState *s=(EncState*)f->data; - s->vsize=*(MSVideoSize*)arg; - return 0; -} - -static int enc_get_vsize(MSFilter *f,void *arg){ - EncState *s=(EncState*)f->data; - *(MSVideoSize*)arg=s->vsize; - return 0; -} - -static int enc_set_mtu(MSFilter *f,void *arg){ - EncState *s=(EncState*)f->data; - s->mtu=*(int*)arg; - return 0; -} - -static bool_t parse_video_fmtp(const char *fmtp, float *fps, MSVideoSize *vsize){ - char *tmp=ms_strdup(fmtp); - char *semicolon; - char *equal; - bool_t ret=TRUE; - - ms_message("parsing %s",fmtp); - /*extract fisrt pair */ - if ((semicolon=strchr(tmp,';'))!=NULL){ - *semicolon='\0'; - } - if ((equal=strchr(tmp,'='))!=NULL){ - int divider; - *equal='\0'; - if (strcasecmp(tmp,"CIF")==0){ - if (vsize->width>=MS_VIDEO_SIZE_CIF_W){ - vsize->width=MS_VIDEO_SIZE_CIF_W; - vsize->height=MS_VIDEO_SIZE_CIF_H; - } - }else if (strcasecmp(tmp,"QCIF")==0){ - vsize->width=MS_VIDEO_SIZE_QCIF_W; - vsize->height=MS_VIDEO_SIZE_QCIF_H; - }else{ - ms_warning("unsupported video size %s",tmp); - ret=FALSE; - } - divider=atoi(equal+1); - if (divider!=0){ - float newfps=29.97/divider; - if (*fps>newfps) *fps=newfps; - }else{ - ms_warning("Could not find video fps"); - ret=FALSE; - } - }else ret=FALSE; - ms_free(tmp); - return ret; -} - -static int enc_add_fmtp(MSFilter *f,void *arg){ - EncState *s=(EncState*)f->data; - const char *fmtp=(const char*)arg; - char val[10]; - if (fmtp_get_value(fmtp,"profile",val,sizeof(val))){ - s->profile=atoi(val); - }else parse_video_fmtp(fmtp,&s->fps,&s->vsize); - return 0; -} - -static int enc_req_vfu(MSFilter *f, void *unused){ - EncState *s=(EncState*)f->data; - s->req_vfu=TRUE; - return 0; -} - -static void enc_init(MSFilter *f, enum CodecID codec) -{ - EncState *s=(EncState *)ms_new(EncState,1); - f->data=s; - ms_ffmpeg_check_init(); - s->profile=0;/*always default to profile 0*/ - s->comp_buf=NULL; - s->fps=15; - s->mtu=ms_get_payload_max_size()-2;/*-2 for the H263 payload header*/ - s->maxbr=500000; - s->codec=codec; - s->vsize.width=MS_VIDEO_SIZE_CIF_W; - s->vsize.height=MS_VIDEO_SIZE_CIF_H; - s->qmin=2; - s->req_vfu=FALSE; - s->framenum=0; - s->av_context.codec=NULL; -} - -static void enc_h263_init(MSFilter *f){ - enc_init(f,CODEC_ID_H263P); -} - -static void enc_mpeg4_init(MSFilter *f){ - enc_init(f,CODEC_ID_MPEG4); -} - -static void enc_snow_init(MSFilter *f){ - enc_init(f,CODEC_ID_SNOW); -} - -static void enc_mjpeg_init(MSFilter *f){ - enc_init(f,CODEC_ID_MJPEG); -} - -static void prepare(EncState *s){ - AVCodecContext *c=&s->av_context; - avcodec_get_context_defaults(c); - if (s->codec==CODEC_ID_MJPEG) - { - ms_message("Codec bitrate set to %i",c->bit_rate); - c->width = s->vsize.width; - c->height = s->vsize.height; - c->time_base.num = 1; - c->time_base.den = (int)s->fps; - c->gop_size=(int)s->fps*5; /*emit I frame every 5 seconds*/ - c->pix_fmt=PIX_FMT_YUVJ420P; - s->comp_buf=allocb(c->bit_rate*2,0); - return; - } - - /* put codec parameters */ - c->bit_rate=(float)s->maxbr*0.7; - c->bit_rate_tolerance=s->fps!=1?(float)c->bit_rate/(s->fps-1):c->bit_rate; - - if (s->codec!=CODEC_ID_SNOW && s->maxbr<256000){ - /*snow does not like 1st pass rate control*/ - /*and rate control eats too much cpu with CIF high fps pictures*/ - c->rc_max_rate=(float)s->maxbr*0.8; - c->rc_min_rate=0; - c->rc_buffer_size=c->rc_max_rate; - }else{ - /*use qmin instead*/ - c->qmin=s->qmin; - } - - ms_message("Codec bitrate set to %i",c->bit_rate); - c->width = s->vsize.width; - c->height = s->vsize.height; - c->time_base.num = 1; - c->time_base.den = (int)s->fps; - c->gop_size=(int)s->fps*5; /*emit I frame every 5 seconds*/ - c->pix_fmt=PIX_FMT_YUV420P; - s->comp_buf=allocb(c->bit_rate*2,0); - if (s->codec==CODEC_ID_SNOW){ - c->strict_std_compliance=-2; - } - -} - -static void prepare_h263(EncState *s){ - AVCodecContext *c=&s->av_context; - /* we don't use the rtp_callback but use rtp_mode that forces ffmpeg to insert - Start Codes as much as possible in the bitstream */ -#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) - c->rtp_mode = 1; -#endif - c->rtp_payload_size = s->mtu/2; - if (s->profile==0){ - s->codec=CODEC_ID_H263; - }else{ - c->flags|=CODEC_FLAG_H263P_UMV; - c->flags|=CODEC_FLAG_AC_PRED; - c->flags|=CODEC_FLAG_H263P_SLICE_STRUCT; - /* - c->flags|=CODEC_FLAG_OBMC; - c->flags|=CODEC_FLAG_AC_PRED; - */ - s->codec=CODEC_ID_H263P; - } -} - -static void prepare_mpeg4(EncState *s){ - AVCodecContext *c=&s->av_context; - c->max_b_frames=0; /*don't use b frames*/ - c->flags|=CODEC_FLAG_AC_PRED; - c->flags|=CODEC_FLAG_H263P_UMV; - /*c->flags|=CODEC_FLAG_QPEL;*/ /*don't enable this one: this forces profile_level to advanced simple profile */ - c->flags|=CODEC_FLAG_4MV; - c->flags|=CODEC_FLAG_GMC; - c->flags|=CODEC_FLAG_LOOP_FILTER; - c->flags|=CODEC_FLAG_H263P_SLICE_STRUCT; -} - -static void enc_uninit(MSFilter *f){ - EncState *s=(EncState*)f->data; - ms_free(s); -} -#if 0 -static void enc_set_rc(EncState *s, AVCodecContext *c){ - int factor=c->width/MS_VIDEO_SIZE_QCIF_W; - c->rc_min_rate=0; - c->bit_rate=400; /* this value makes around 100kbit/s at QCIF=2 */ - c->rc_max_rate=c->bit_rate+1; - c->rc_buffer_size=20000*factor; /* food recipe */ -} -#endif - -static void enc_preprocess(MSFilter *f){ - EncState *s=(EncState*)f->data; - int error; - prepare(s); - if (s->codec==CODEC_ID_H263P || s->codec==CODEC_ID_H263) - prepare_h263(s); - else if (s->codec==CODEC_ID_MPEG4) - prepare_mpeg4(s); - else if (s->codec==CODEC_ID_SNOW){ - /**/ - }else if (s->codec==CODEC_ID_MJPEG){ - /**/ - }else { - ms_error("Unsupported codec id %i",s->codec); - return; - } - s->av_codec=avcodec_find_encoder(s->codec); - if (s->av_codec==NULL){ - ms_error("could not find encoder for codec id %i",s->codec); - return; - } - error=avcodec_open(&s->av_context, s->av_codec); - if (error!=0) { - ms_error("avcodec_open() failed: %i",error); - return; - } - ms_debug("image format is %i.",s->av_context.pix_fmt); - ms_message("qmin=%i qmax=%i",s->av_context.qmin,s->av_context.qmax); -} - -static void enc_postprocess(MSFilter *f){ - EncState *s=(EncState*)f->data; - if (s->av_context.codec!=NULL){ - avcodec_close(&s->av_context); - s->av_context.codec=NULL; - } - if (s->comp_buf!=NULL) { - freemsg(s->comp_buf); - s->comp_buf=NULL; - } -} - -static void add_rfc2190_header(mblk_t **packet, AVCodecContext *context){ - mblk_t *header; - header = allocb(4, 0); - memset(header->b_wptr, 0, 4); - // assume video size is CIF or QCIF - if (context->width == 352 && context->height == 288) header->b_wptr[1] = 0x60; - else header->b_wptr[1] = 0x40; - if (context->coded_frame->pict_type != FF_I_TYPE) header->b_wptr[1] |= 0x10; - header->b_wptr += 4; - header->b_cont = *packet; - *packet = header; -} - -#if 0 -static int get_gbsc(uint8_t *psc, uint8_t *end) -{ - int len = end-psc; - uint32_t buf; - int i, j, k; - k = len; - for (i = 2; i < len-4; i++) { - buf = *((uint32_t *)(psc+i)); - for (j = 0; j < 8; j++) { - if (((buf >> j) & 0x00FCFFFF) == 0x00800000) {/*PSC*/ - i += 2; - k=i; - break; - } else if (((buf >> j) & 0x0080FFFF) == 0x00800000) {/*GBSC*/ - i += 2; - k = i; - break; - } - } - } - return k; -} -#else -static int get_gbsc_bytealigned(uint8_t *begin, uint8_t *end){ - int i; - int len = end - begin; - for (i = len - 2; /*len + length of scan window*/ - i > 2 + 2; /*length of scan window + 2 avoidance of 1st gob or psc*/ - i--){ - if(*(begin + i) == 0 && - *(begin + i+1) == 0 && - (*(begin + i+2) & 0x80) == 0x80){ - /*ms_message("JV psc/gob found! %2x %2x %2x", *(begin + i), *(begin + i+1), *(begin + i + 2));*/ - return i; - } - } - /*ms_message("JV no psc or gob found!");*/ - return len; -} -#endif - -static void rfc2190_generate_packets(MSFilter *f, EncState *s, mblk_t *frame, uint32_t timestamp){ - mblk_t *packet=NULL; - - while (frame->b_rptrb_wptr){ - packet=dupb(frame); - /*frame->b_rptr=packet->b_wptr=packet->b_rptr+get_gbsc(packet->b_rptr, MIN(packet->b_rptr+s->mtu,frame->b_wptr));*/ - frame->b_rptr = packet->b_wptr = - packet->b_rptr + get_gbsc_bytealigned(packet->b_rptr, MIN(packet->b_rptr+s->mtu,frame->b_wptr)); - add_rfc2190_header(&packet, &s->av_context); - mblk_set_timestamp_info(packet,timestamp); - ms_queue_put(f->outputs[0],packet); - } - /* the marker bit is set on the last packet, if any.*/ - mblk_set_marker_info(packet,TRUE); -} - -static void mpeg4_fragment_and_send(MSFilter *f,EncState *s,mblk_t *frame, uint32_t timestamp){ - uint8_t *rptr; - mblk_t *packet=NULL; - int len; - for (rptr=frame->b_rptr;rptrb_wptr;){ - len=MIN(s->mtu,(frame->b_wptr-rptr)); - packet=dupb(frame); - packet->b_rptr=rptr; - packet->b_wptr=rptr+len; - mblk_set_timestamp_info(packet,timestamp); - ms_queue_put(f->outputs[0],packet); - rptr+=len; - } - /*set marker bit on last packet*/ - mblk_set_marker_info(packet,TRUE); -} - -static void rfc4629_generate_follow_on_packets(MSFilter *f, EncState *s, mblk_t *frame, uint32_t timestamp, uint8_t *psc, uint8_t *end, bool_t last_packet){ - mblk_t *packet; - int len=end-psc; - - packet=dupb(frame); - packet->b_rptr=psc; - packet->b_wptr=end; - /*ms_message("generating packet of size %i",end-psc);*/ - rfc2429_set_P(psc,1); - mblk_set_timestamp_info(packet,timestamp); - - - if (len>s->mtu){ - /*need to slit the packet using "follow-on" packets */ - /*compute the number of packets need (rounded up)*/ - int num=(len+s->mtu-1)/s->mtu; - int i; - uint8_t *pos; - /*adjust the first packet generated*/ - pos=packet->b_wptr=packet->b_rptr+s->mtu; - ms_queue_put(f->outputs[0],packet); - ms_debug("generating %i follow-on packets",num); - for (i=1;ib_rptr=pos; - pos=packet->b_wptr=MIN(pos+s->mtu,end); - header=allocb(2,0); - header->b_wptr[0]=0; - header->b_wptr[1]=0; - header->b_wptr+=2; - /*no P bit is set */ - header->b_cont=packet; - packet=header; - mblk_set_timestamp_info(packet,timestamp); - ms_queue_put(f->outputs[0],packet); - } - }else ms_queue_put(f->outputs[0],packet); - /* the marker bit is set on the last packet, if any.*/ - mblk_set_marker_info(packet,last_packet); -} - -/* returns the last psc position just below packet_size */ -static uint8_t *get_psc(uint8_t *begin,uint8_t *end, int packet_size){ - int i; - uint8_t *ret=NULL; - uint8_t *p; - if (begin==end) return NULL; - for(i=1,p=begin+1;p= 128, or undefined otherwise. - * lqt: The quantization table for the luminance channel if q >= 128 - * cqt: The quantization table for the chrominance channels if - * q >= 128 - * - * Return value: - * the sequence number to be sent for the first packet of the next - * frame. - * - * The following are assumed to be defined: - * - * PACKET_SIZE - The size of the outgoing packet - * send_packet(u_int8 *data, int len) - Sends the packet to the network - */ - -static void mjpeg_fragment_and_send(MSFilter *f,EncState *s,mblk_t *frame, uint32_t timestamp, - uint8_t type, uint8_t typespec, int dri, - uint8_t q, mblk_t *lqt, mblk_t *cqt) { - struct jpeghdr jpghdr; - struct jpeghdr_rst rsthdr; - struct jpeghdr_qtable qtblhdr; - int bytes_left = msgdsize(frame); - int data_len; - - mblk_t *packet; - - /* Initialize JPEG header - */ - //jpghdr.tspec = typespec; - jpghdr.off = 0; - jpghdr.type = type | ((dri != 0) ? RTP_JPEG_RESTART : 0); - jpghdr.q = q; - jpghdr.width = s->vsize.width / 8; - jpghdr.height = s->vsize.height / 8; - - /* Initialize DRI header - */ - if (dri != 0) { - rsthdr.dri = htons(dri); - rsthdr.f = 1; /* This code does not align RIs */ - rsthdr.l = 1; - rsthdr.count = 0x3fff; - } - - /* Initialize quantization table header - */ - if (q >= 128) { - qtblhdr.mbz = 0; - qtblhdr.precision = 0; /* This code uses 8 bit tables only */ - qtblhdr.length = htons(msgdsize(lqt)+msgdsize(cqt)); /* 2 64-byte tables */ - } - - while (bytes_left > 0) { - packet = allocb(s->mtu, 0); - - jpghdr.off = htonl(jpghdr.off); - memcpy(packet->b_wptr, &jpghdr, sizeof(jpghdr)); - jpghdr.off = ntohl(jpghdr.off); - packet->b_wptr += sizeof(jpghdr); - - if (dri != 0) { - memcpy(packet->b_wptr, &rsthdr, sizeof(rsthdr)); - packet->b_wptr += sizeof(rsthdr); - } - - if (q >= 128 && jpghdr.off == 0) { - memcpy(packet->b_wptr, &qtblhdr, sizeof(qtblhdr)); - packet->b_wptr += sizeof(qtblhdr); - if (msgdsize(lqt)){ - memcpy(packet->b_wptr, lqt->b_rptr, msgdsize(lqt)); - packet->b_wptr += msgdsize(lqt); - } - if (msgdsize(cqt)){ - memcpy(packet->b_wptr, cqt->b_rptr, msgdsize(cqt)); - packet->b_wptr += msgdsize(cqt); - } - } - - data_len = s->mtu - (packet->b_wptr - packet->b_rptr); - if (data_len >= bytes_left) { - data_len = bytes_left; - mblk_set_marker_info(packet,TRUE); - } - - memcpy(packet->b_wptr, frame->b_rptr + jpghdr.off, data_len); - packet->b_wptr=packet->b_wptr + data_len; - - mblk_set_timestamp_info(packet,timestamp); - ms_queue_put(f->outputs[0],packet); - - jpghdr.off += data_len; - bytes_left -= data_len; - } -} - -static int find_marker(uint8_t **pbuf_ptr, uint8_t *buf_end){ - - uint8_t *buf_ptr; - unsigned int v, v2; - int val; - - buf_ptr = *pbuf_ptr; - while (buf_ptr < buf_end) { - v = *buf_ptr++; - v2 = *buf_ptr; - if ((v == 0xff) && (v2 >= 0xc0) && (v2 <= 0xfe) && buf_ptr < buf_end) { - val = *buf_ptr++; - *pbuf_ptr = buf_ptr; - return val; - } - } - val = -1; - return val; -} - -static mblk_t *skip_jpeg_headers(mblk_t *full_frame, mblk_t **lqt, mblk_t **cqt){ - int err; - uint8_t *pbuf_ptr=full_frame->b_rptr; - uint8_t *buf_end=full_frame->b_wptr; - - ms_message("image size: %i)", buf_end-pbuf_ptr); - - *lqt=NULL; - *cqt=NULL; - - err = find_marker(&pbuf_ptr, buf_end); - while (err!=-1) - { - ms_message("marker found: %x (offset from beginning%i)", err, pbuf_ptr-full_frame->b_rptr); - if (err==0xdb) - { - /* copy DQT table */ - int len = ntohs(*(uint16_t*)(pbuf_ptr)); - if (*lqt==NULL) - { - mblk_t *_lqt = allocb(len-3, 0); - memcpy(_lqt->b_rptr, pbuf_ptr+3, len-3); - _lqt->b_wptr += len-3; - *lqt = _lqt; - //*cqt = dupb(*lqt); - } - else - { - mblk_t *_cqt = allocb(len-3, 0); - memcpy(_cqt->b_rptr, pbuf_ptr+3, len-3); - _cqt->b_wptr += len-3; - *cqt = _cqt; - } - } - if (err==0xda) - { - uint16_t *bistream=(uint16_t *)pbuf_ptr; - uint16_t len = ntohs(*bistream); - full_frame->b_rptr = pbuf_ptr+len; - } - err = find_marker(&pbuf_ptr, buf_end); - } - return full_frame; -} - -static void split_and_send(MSFilter *f, EncState *s, mblk_t *frame){ - uint8_t *lastpsc; - uint8_t *psc; - uint32_t timestamp=f->ticker->time*90LL; - - if (s->codec==CODEC_ID_MPEG4 || s->codec==CODEC_ID_SNOW) - { - mpeg4_fragment_and_send(f,s,frame,timestamp); - return; - } - else if (s->codec==CODEC_ID_MJPEG) - { - mblk_t *lqt=NULL; - mblk_t *cqt=NULL; - skip_jpeg_headers(frame, &lqt, &cqt); - mjpeg_fragment_and_send(f,s,frame,timestamp, - 1, /* 420? */ - 0, - 0, /* dri ?*/ - 255, /* q */ - lqt, - cqt); - return; - } - - ms_debug("processing frame of size %i",frame->b_wptr-frame->b_rptr); - if (f->desc->id==MS_H263_ENC_ID){ - lastpsc=frame->b_rptr; - while(1){ - psc=get_psc(lastpsc+2,frame->b_wptr,s->mtu); - if (psc!=NULL){ - rfc4629_generate_follow_on_packets(f,s,frame,timestamp,lastpsc,psc,FALSE); - lastpsc=psc; - }else break; - } - /* send the end of frame */ - rfc4629_generate_follow_on_packets(f,s,frame, timestamp,lastpsc,frame->b_wptr,TRUE); - }else if (f->desc->id==MS_H263_OLD_ENC_ID){ - rfc2190_generate_packets(f,s,frame,timestamp); - }else{ - ms_fatal("Ca va tres mal."); - } -} - -static void process_frame(MSFilter *f, mblk_t *inm){ - EncState *s=(EncState*)f->data; - AVFrame pict; - AVCodecContext *c=&s->av_context; - int error; - mblk_t *comp_buf=s->comp_buf; - int comp_buf_sz=comp_buf->b_datap->db_lim-comp_buf->b_datap->db_base; - - /* convert image if necessary */ - avcodec_get_frame_defaults(&pict); - avpicture_fill((AVPicture*)&pict,(uint8_t*)inm->b_rptr,c->pix_fmt,c->width,c->height); - - /* timestamp used by ffmpeg, unset here */ - pict.pts=AV_NOPTS_VALUE; - - if (s->framenum==(int)(s->fps*2.0) || s->framenum==(int)(s->fps*4.0)){ - /*sends an I frame at 2 seconds and 4 seconds after the beginning of the call*/ - s->req_vfu=TRUE; - } - if (s->req_vfu){ - pict.pict_type=FF_I_TYPE; - s->req_vfu=FALSE; - } - comp_buf->b_rptr=comp_buf->b_wptr=comp_buf->b_datap->db_base; - if (s->codec==CODEC_ID_SNOW){ - //prepend picture size - uint32_t header=((s->vsize.width&0xffff)<<16) | (s->vsize.height&0xffff); - *(uint32_t*)comp_buf->b_wptr=htonl(header); - comp_buf->b_wptr+=4; - comp_buf_sz-=4; - } - error=avcodec_encode_video(c, (uint8_t*)comp_buf->b_wptr,comp_buf_sz, &pict); - if (error<=0) ms_warning("ms_AVencoder_process: error %i.",error); - else{ - s->framenum++; - if (c->coded_frame->pict_type==FF_I_TYPE){ - ms_message("Emitting I-frame"); - } - comp_buf->b_wptr+=error; - split_and_send(f,s,comp_buf); - } - freemsg(inm); -} - -static void enc_process(MSFilter *f){ - mblk_t *inm; - EncState *s=(EncState*)f->data; - if (s->av_context.codec==NULL) { - ms_queue_flush(f->inputs[0]); - return; - } - ms_filter_lock(f); - while((inm=ms_queue_get(f->inputs[0]))!=0){ - process_frame(f,inm); - } - ms_filter_unlock(f); -} - - -static int enc_get_br(MSFilter *f, void *arg){ - EncState *s=(EncState*)f->data; - *(int*)arg=s->maxbr; - return 0; -} - -static int enc_set_br(MSFilter *f, void *arg){ - EncState *s=(EncState*)f->data; - bool_t snow=s->codec==CODEC_ID_SNOW; - s->maxbr=*(int*)arg; - if (s->maxbr>=1024000 && s->codec!=CODEC_ID_H263P){ - s->vsize.width = MS_VIDEO_SIZE_SVGA_W; - s->vsize.height = MS_VIDEO_SIZE_SVGA_H; - s->fps=17; - }else if (s->maxbr>=800000 && s->codec!=CODEC_ID_H263P){ - s->vsize.width = MS_VIDEO_SIZE_VGA_W; - s->vsize.height = MS_VIDEO_SIZE_VGA_H; - s->fps=17; - }else if (s->maxbr>=512000){ - s->vsize.width=MS_VIDEO_SIZE_CIF_W; - s->vsize.height=MS_VIDEO_SIZE_CIF_H; - s->fps=17; - }else if (s->maxbr>=256000){ - s->vsize.width=MS_VIDEO_SIZE_CIF_W; - s->vsize.height=MS_VIDEO_SIZE_CIF_H; - s->fps=10; - s->qmin=3; - }else if (s->maxbr>=128000){ - s->vsize.width=MS_VIDEO_SIZE_QCIF_W; - s->vsize.height=MS_VIDEO_SIZE_QCIF_H; - s->fps=10; - s->qmin=3; - }else if (s->maxbr>=64000){ - s->vsize.width=MS_VIDEO_SIZE_QCIF_W; - s->vsize.height=MS_VIDEO_SIZE_QCIF_H; - s->fps=snow ? 7 : 5; - s->qmin=snow ? 4 : 5; - }else{ - s->vsize.width=MS_VIDEO_SIZE_QCIF_W; - s->vsize.height=MS_VIDEO_SIZE_QCIF_H; - s->fps=5; - s->qmin=5; - } - if (s->av_context.codec!=NULL){ - /*apply new settings dynamically*/ - ms_filter_lock(f); - enc_postprocess(f); - enc_preprocess(f); - ms_filter_unlock(f); - } - return 0; -} - - -static MSFilterMethod methods[]={ - { MS_FILTER_SET_FPS , enc_set_fps }, - { MS_FILTER_GET_FPS , enc_get_fps }, - { MS_FILTER_SET_VIDEO_SIZE , enc_set_vsize }, - { MS_FILTER_GET_VIDEO_SIZE , enc_get_vsize }, - { MS_FILTER_ADD_FMTP , enc_add_fmtp }, - { MS_FILTER_SET_BITRATE , enc_set_br }, - { MS_FILTER_GET_BITRATE , enc_get_br }, - { MS_FILTER_SET_MTU , enc_set_mtu }, - { MS_FILTER_REQ_VFU , enc_req_vfu }, - { 0 , NULL } -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_h263_enc_desc={ - MS_H263_ENC_ID, - "MSH263Enc", - N_("A video H.263 encoder using ffmpeg library."), - MS_FILTER_ENCODER, - "H263-1998", - 1, /*MS_YUV420P is assumed on this input */ - 1, - enc_h263_init, - enc_preprocess, - enc_process, - enc_postprocess, - enc_uninit, - methods -}; - -MSFilterDesc ms_h263_old_enc_desc={ - MS_H263_OLD_ENC_ID, - "MSH263OldEnc", - N_("A video H.263 encoder using ffmpeg library. It is compliant with old RFC2190 spec."), - MS_FILTER_ENCODER, - "H263", - 1, /*MS_YUV420P is assumed on this input */ - 1, - enc_h263_init, - enc_preprocess, - enc_process, - enc_postprocess, - enc_uninit, - methods -}; - -MSFilterDesc ms_mpeg4_enc_desc={ - MS_MPEG4_ENC_ID, - "MSMpeg4Enc", - N_("A video MPEG4 encoder using ffmpeg library."), - MS_FILTER_ENCODER, - "MP4V-ES", - 1, /*MS_YUV420P is assumed on this input */ - 1, - enc_mpeg4_init, - enc_preprocess, - enc_process, - enc_postprocess, - enc_uninit, - methods -}; - -MSFilterDesc ms_snow_enc_desc={ - MS_SNOW_ENC_ID, - "MSSnowEnc", - N_("A video snow encoder using ffmpeg library."), - MS_FILTER_ENCODER, - "x-snow", - 1, /*MS_YUV420P is assumed on this input */ - 1, - enc_snow_init, - enc_preprocess, - enc_process, - enc_postprocess, - enc_uninit, - methods -}; - -MSFilterDesc ms_mjpeg_enc_desc={ - MS_JPEG_ENC_ID, - "MSJpegEnc", - N_("A RTP/MJPEG encoder using ffmpeg library."), - MS_FILTER_ENCODER, - "JPEG", - 1, /*MS_YUV420P is assumed on this input */ - 1, - enc_mjpeg_init, - enc_preprocess, - enc_process, - enc_postprocess, - enc_uninit, - methods -}; - -#else - -MSFilterDesc ms_h263_enc_desc={ - .id=MS_H263_ENC_ID, - .name="MSH263Enc", - .text=N_("A video H.263 encoder using ffmpeg library."), - .category=MS_FILTER_ENCODER, - .enc_fmt="H263-1998", - .ninputs=1, /*MS_YUV420P is assumed on this input */ - .noutputs=1, - .init=enc_h263_init, - .preprocess=enc_preprocess, - .process=enc_process, - .postprocess=enc_postprocess, - .uninit=enc_uninit, - .methods=methods -}; - -MSFilterDesc ms_h263_old_enc_desc={ - .id=MS_H263_OLD_ENC_ID, - .name="MSH263Enc", - .text=N_("A video H.263 encoder using ffmpeg library, compliant with old RFC2190 spec."), - .category=MS_FILTER_ENCODER, - .enc_fmt="H263", - .ninputs=1, /*MS_YUV420P is assumed on this input */ - .noutputs=1, - .init=enc_h263_init, - .preprocess=enc_preprocess, - .process=enc_process, - .postprocess=enc_postprocess, - .uninit=enc_uninit, - .methods=methods -}; - -MSFilterDesc ms_mpeg4_enc_desc={ - .id=MS_MPEG4_ENC_ID, - .name="MSMpeg4Enc", - .text=N_("A video MPEG4 encoder using ffmpeg library."), - .category=MS_FILTER_ENCODER, - .enc_fmt="MP4V-ES", - .ninputs=1, /*MS_YUV420P is assumed on this input */ - .noutputs=1, - .init=enc_mpeg4_init, - .preprocess=enc_preprocess, - .process=enc_process, - .postprocess=enc_postprocess, - .uninit=enc_uninit, - .methods=methods -}; - -MSFilterDesc ms_snow_enc_desc={ - .id=MS_SNOW_ENC_ID, - .name="MSSnowEnc", - .text=N_("The snow codec is royalty-free and is open-source. \n" - "It uses innovative techniques that makes it one of most promising video " - "codec. It is implemented within the ffmpeg project.\n" - "However it is under development, quite unstable and compatibility with other versions " - "cannot be guaranteed."), - .category=MS_FILTER_ENCODER, - .enc_fmt="x-snow", - .ninputs=1, /*MS_YUV420P is assumed on this input */ - .noutputs=1, - .init=enc_snow_init, - .preprocess=enc_preprocess, - .process=enc_process, - .postprocess=enc_postprocess, - .uninit=enc_uninit, - .methods=methods -}; - -MSFilterDesc ms_mjpeg_enc_desc={ - .id=MS_JPEG_ENC_ID, - .name="MSMJpegEnc", - .text=N_("A MJPEG encoder using ffmpeg library."), - .category=MS_FILTER_ENCODER, - .enc_fmt="JPEG", - .ninputs=1, /*MS_YUV420P is assumed on this input */ - .noutputs=1, - .init=enc_mjpeg_init, - .preprocess=enc_preprocess, - .process=enc_process, - .postprocess=enc_postprocess, - .uninit=enc_uninit, - .methods=methods -}; - -#endif - -void __register_ffmpeg_encoders_if_possible(void){ - ms_ffmpeg_check_init(); - if (avcodec_find_encoder(CODEC_ID_MPEG4)) - ms_filter_register(&ms_mpeg4_enc_desc); - if (avcodec_find_encoder(CODEC_ID_H263)){ - ms_filter_register(&ms_h263_enc_desc); - ms_filter_register(&ms_h263_old_enc_desc); - } - if (avcodec_find_encoder(CODEC_ID_SNOW)) - ms_filter_register(&ms_snow_enc_desc); - if (avcodec_find_encoder(CODEC_ID_MJPEG)) - { - ms_filter_register(&ms_mjpeg_enc_desc); - } -} - diff --git a/linphone/mediastreamer2/src/videoout.c b/linphone/mediastreamer2/src/videoout.c deleted file mode 100644 index 51e6a3eff..000000000 --- a/linphone/mediastreamer2/src/videoout.c +++ /dev/null @@ -1,1005 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifdef HAVE_CONFIG_H -#include "mediastreamer-config.h" -#endif - -#include "mediastreamer2/msfilter.h" -#include "mediastreamer2/msvideo.h" - -/*required for dllexport of win_display_desc */ -#define INVIDEOUT_C 1 -#include "mediastreamer2/msvideoout.h" - -#include "ffmpeg-priv.h" - -static int video_out_set_vsize(MSFilter *f,void *arg); - -bool_t ms_display_poll_event(MSDisplay *d, MSDisplayEvent *ev){ - if (d->desc->pollevent) - return d->desc->pollevent(d,ev); - else return FALSE; -} - -#ifdef HAVE_SDL - -#include -#include - -static bool_t sdl_initialized=FALSE; - -static ms_mutex_t sdl_mutex; - -static SDL_Surface *sdl_screen=0; - -#ifdef HAVE_X11_XLIB_H - -#include - -static long sdl_get_native_window_id(){ - SDL_SysWMinfo info; - SDL_VERSION(&info.version); - if ( SDL_GetWMInfo(&info) ) { - if ( info.subsystem == SDL_SYSWM_X11 ) { - return (long) info.info.x11.wmwindow; - } - } - return 0; -} - -static void sdl_show_window(bool_t show){ - SDL_SysWMinfo info; - SDL_VERSION(&info.version); - if ( SDL_GetWMInfo(&info) ) { - if ( info.subsystem == SDL_SYSWM_X11 ) { - Display *display; - Window window; - - info.info.x11.lock_func(); - display = info.info.x11.display; - window = info.info.x11.wmwindow; - if (show) - XMapWindow(display,window); - else - XUnmapWindow(display,window); - info.info.x11.unlock_func(); - } - } -} - -#else - -static void sdl_show_window(bool_t show){ - ms_warning("SDL window show/hide not implemented"); -} - -static long sdl_get_native_window_id(){ - ms_warning("sdl_get_native_window_id not implemented"); - return 0; -} - -#endif - -static void sdl_display_uninit(MSDisplay *obj); - -static SDL_Overlay * sdl_create_window(int w, int h){ - static bool_t once=TRUE; - SDL_Overlay *lay; - sdl_screen = SDL_SetVideoMode(w,h, 0,SDL_SWSURFACE|SDL_RESIZABLE); - if (sdl_screen == NULL ) { - ms_warning("Couldn't set video mode: %s\n", - SDL_GetError()); - return NULL; - } - if (sdl_screen->flags & SDL_HWSURFACE) ms_message("SDL surface created in hardware"); - if (once) { - SDL_WM_SetCaption("Video window", NULL); - once=FALSE; - } - ms_message("Using yuv overlay."); - lay=SDL_CreateYUVOverlay(w , h ,SDL_YV12_OVERLAY,sdl_screen); - if (lay==NULL){ - ms_warning("Couldn't create yuv overlay: %s\n", - SDL_GetError()); - return NULL; - }else{ - ms_message("%i x %i YUV overlay created: hw_accel=%i, pitches=%i,%i,%i",lay->w,lay->h,lay->hw_overlay, - lay->pitches[0],lay->pitches[1],lay->pitches[2]); - ms_message("planes= %p %p %p %i %i",lay->pixels[0],lay->pixels[1],lay->pixels[2], - lay->pixels[1]-lay->pixels[0],lay->pixels[2]-lay->pixels[1]); - } - return lay; -} - -static bool_t sdl_display_init(MSDisplay *obj, MSPicture *fbuf){ - SDL_Overlay *lay; - if (!sdl_initialized){ - /* Initialize the SDL library */ - if( SDL_Init(SDL_INIT_VIDEO) < 0 ) { - ms_error("Couldn't initialize SDL: %s", SDL_GetError()); - return FALSE; - } - /* Clean up on exit */ - atexit(SDL_Quit); - sdl_initialized=TRUE; - ms_mutex_init(&sdl_mutex,NULL); - } - ms_mutex_lock(&sdl_mutex); - if (obj->data!=NULL){ - SDL_FreeYUVOverlay((SDL_Overlay*)obj->data); - } - - lay=sdl_create_window(fbuf->w, fbuf->h); - if (lay){ - fbuf->planes[0]=lay->pixels[0]; - fbuf->planes[1]=lay->pixels[2]; - fbuf->planes[2]=lay->pixels[1]; - fbuf->planes[3]=NULL; - fbuf->strides[0]=lay->pitches[0]; - fbuf->strides[1]=lay->pitches[2]; - fbuf->strides[2]=lay->pitches[1]; - fbuf->strides[3]=0; - fbuf->w=lay->w; - fbuf->h=lay->h; - obj->data=lay; - sdl_show_window(TRUE); - obj->window_id=sdl_get_native_window_id(); - ms_mutex_unlock(&sdl_mutex); - return TRUE; - } - ms_mutex_unlock(&sdl_mutex); - return FALSE; -} - -static void sdl_display_lock(MSDisplay *obj){ - ms_mutex_lock(&sdl_mutex); - SDL_LockYUVOverlay((SDL_Overlay*)obj->data); - ms_mutex_unlock(&sdl_mutex); -} - -static void sdl_display_unlock(MSDisplay *obj){ - SDL_Overlay *lay=(SDL_Overlay*)obj->data; - ms_mutex_lock(&sdl_mutex); - SDL_UnlockYUVOverlay(lay); - ms_mutex_unlock(&sdl_mutex); -} - -static void sdl_display_update(MSDisplay *obj){ - SDL_Rect rect; - SDL_Overlay *lay=(SDL_Overlay*)obj->data; - rect.x=0; - rect.y=0; - rect.w=lay->w; - rect.h=lay->h; - ms_mutex_lock(&sdl_mutex); - SDL_DisplayYUVOverlay(lay,&rect); - ms_mutex_unlock(&sdl_mutex); -} - -static bool_t sdl_poll_event(MSDisplay *obj, MSDisplayEvent *ev){ - SDL_Event event; - bool_t ret=FALSE; - if (sdl_screen==NULL) return FALSE; - ms_mutex_lock(&sdl_mutex); - if (SDL_PollEvent(&event)){ - ms_mutex_unlock(&sdl_mutex); - switch(event.type){ - case SDL_VIDEORESIZE: - ev->evtype=MS_DISPLAY_RESIZE_EVENT; - ev->w=event.resize.w; - ev->h=event.resize.h; - return TRUE; - break; - default: - break; - } - }else ms_mutex_unlock(&sdl_mutex); - return ret; -} - -static void sdl_display_uninit(MSDisplay *obj){ - SDL_Overlay *lay=(SDL_Overlay*)obj->data; - SDL_Event event; - int i; - if (lay==NULL) - return; - if (lay!=NULL) - SDL_FreeYUVOverlay(lay); - if (sdl_screen!=NULL){ - SDL_FreeSurface(sdl_screen); - sdl_screen=NULL; - } -#ifdef __linux - /*purge the event queue before leaving*/ - for(i=0;SDL_PollEvent(&event) && i<100;++i){ - } -#endif - sdl_show_window(FALSE); -} - -MSDisplayDesc ms_sdl_display_desc={ - .init=sdl_display_init, - .lock=sdl_display_lock, - .unlock=sdl_display_unlock, - .update=sdl_display_update, - .uninit=sdl_display_uninit, - .pollevent=sdl_poll_event, -}; - -#elif defined(WIN32) - -#include - - -typedef struct _WinDisplay{ - HWND window; - HDRAWDIB ddh; - MSPicture fb; - MSDisplayEvent last_rsz; - uint8_t *rgb; - uint8_t *black; - int last_rect_w; - int last_rect_h; - int rgb_len; - struct SwsContext *sws; - bool_t new_ev; -}WinDisplay; - -static LRESULT CALLBACK window_proc( - HWND hwnd, // handle to window - UINT uMsg, // message identifier - WPARAM wParam, // first message parameter - LPARAM lParam) // second message parameter -{ - switch(uMsg){ - case WM_DESTROY: - break; - case WM_SIZE: - if (wParam==SIZE_RESTORED){ - int h=(lParam>>16) & 0xffff; - int w=lParam & 0xffff; - MSDisplay *obj; - WinDisplay *wd; - ms_message("Resized to %i,%i",w,h); - obj=(MSDisplay*)GetWindowLongPtr(hwnd,GWLP_USERDATA); - if (obj!=NULL){ - wd=(WinDisplay*)obj->data; - wd->last_rsz.evtype=MS_DISPLAY_RESIZE_EVENT; - wd->last_rsz.w=w; - wd->last_rsz.h=h; - wd->new_ev=TRUE; - }else{ - ms_error("Could not retrieve MSDisplay from window !"); - } - } - break; - default: - return DefWindowProc(hwnd, uMsg, wParam, lParam); - } - return 0; -} - -static HWND create_window(int w, int h) -{ - WNDCLASS wc; - HINSTANCE hInstance = GetModuleHandle(NULL); - HWND hwnd; - RECT rect; - wc.style = 0 ; - wc.lpfnWndProc = window_proc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = NULL; - wc.hIcon = NULL; - wc.hCursor = LoadCursor(hInstance, IDC_ARROW); - wc.hbrBackground = NULL; - wc.lpszMenuName = NULL; - wc.lpszClassName = "Video Window"; - - if(!RegisterClass(&wc)) - { - /* already registred! */ - } - rect.left=100; - rect.top=100; - rect.right=rect.left+w; - rect.bottom=rect.top+h; - if (!AdjustWindowRect(&rect,WS_OVERLAPPEDWINDOW|WS_VISIBLE /*WS_CAPTION WS_TILED|WS_BORDER*/,FALSE)){ - ms_error("AdjustWindowRect failed."); - } - ms_message("AdjustWindowRect: %li,%li %li,%li",rect.left,rect.top,rect.right,rect.bottom); - hwnd=CreateWindow("Video Window", "Video window", - WS_OVERLAPPEDWINDOW /*WS_THICKFRAME*/ | WS_VISIBLE , - CW_USEDEFAULT, CW_USEDEFAULT, rect.right-rect.left,rect.bottom-rect.top, - NULL, NULL, hInstance, NULL); - if (hwnd==NULL){ - ms_error("Fail to create video window"); - } - return hwnd; -} - -static bool_t win_display_init(MSDisplay *obj, MSPicture *fbuf){ - WinDisplay *wd=(WinDisplay*)obj->data; - int ysize,usize; - - if (wd!=NULL) - { - if (wd->ddh) DrawDibClose(wd->ddh); - wd->ddh=NULL; - if (wd->fb.planes[0]) ms_free(wd->fb.planes[0]); - wd->fb.planes[0]=NULL; - wd->fb.planes[1]=NULL; - wd->fb.planes[2]=NULL; - wd->fb.planes[3]=NULL; - if (wd->rgb) ms_free(wd->rgb); - if (wd->black) ms_free(wd->black); - wd->rgb=NULL; - wd->black=NULL; - wd->rgb_len=0; - sws_freeContext(wd->sws); - wd->sws=NULL; - wd->last_rect_w=0; - wd->last_rect_h=0; - } - else - wd=(WinDisplay*)ms_new0(WinDisplay,1); - - obj->data=wd; - - wd->fb.w=fbuf->w; - wd->fb.h=fbuf->h; - - if (wd->window==NULL){ - if (obj->use_external_window && obj->window_id!=0){ - void *p; - wd->window=(HWND)obj->window_id; - p=(void*)GetWindowLongPtr(wd->window,GWLP_USERDATA); - if (p!=NULL){ - ms_error("Gulp: this externally supplied windows seems to " - "already have a userdata ! resizing will crash !"); - }else SetWindowLongPtr(wd->window,GWLP_USERDATA,(LONG_PTR)obj); - }else{ - wd->window=create_window(wd->fb.w,wd->fb.h); - obj->window_id=(long)wd->window; - if (wd->window!=NULL) SetWindowLongPtr(wd->window,GWLP_USERDATA,(LONG_PTR)obj); - else return FALSE; - } - }else if (!obj->use_external_window){ - /* the window might need to be resized*/ - RECT cur; - GetWindowRect(wd->window,&cur); - MoveWindow(wd->window,cur.left, cur.top, wd->fb.w, wd->fb.h,TRUE); - } - - if (wd->ddh==NULL) wd->ddh=DrawDibOpen(); - if (wd->ddh==NULL){ - ms_error("DrawDibOpen() failed."); - return FALSE; - } - /*allocate yuv and rgb buffers*/ - if (wd->fb.planes[0]) ms_free(wd->fb.planes[0]); - if (wd->rgb) ms_free(wd->rgb); - if (wd->black) ms_free(wd->black); - ysize=wd->fb.w*wd->fb.h; - usize=ysize/4; - fbuf->planes[0]=wd->fb.planes[0]=(uint8_t*)ms_malloc0(ysize+2*usize); - fbuf->planes[1]=wd->fb.planes[1]=wd->fb.planes[0]+ysize; - fbuf->planes[2]=wd->fb.planes[2]=wd->fb.planes[1]+usize; - fbuf->planes[3]=NULL; - fbuf->strides[0]=wd->fb.strides[0]=wd->fb.w; - fbuf->strides[1]=wd->fb.strides[1]=wd->fb.w/2; - fbuf->strides[2]=wd->fb.strides[2]=wd->fb.w/2; - fbuf->strides[3]=0; - - wd->rgb_len=ysize*3; - wd->rgb=(uint8_t*)ms_malloc0(wd->rgb_len); - wd->black = (uint8_t*)ms_malloc0(wd->rgb_len); - wd->last_rect_w=0; - wd->last_rect_h=0; - return TRUE; -} - -typedef struct rgb{ - uint8_t r,g,b; -} rgb_t; - -typedef struct yuv{ - uint8_t y,u,v; -} yuv_t; - - - -static void yuv420p_to_rgb(WinDisplay *wd, MSPicture *src, uint8_t *rgb){ - int rgb_stride=-src->w*3; - uint8_t *p; - - p=rgb+(src->w*3*(src->h-1)); - if (wd->sws==NULL){ - wd->sws=sws_getContext(src->w,src->h,PIX_FMT_YUV420P, - src->w,src->h, PIX_FMT_BGR24, - SWS_FAST_BILINEAR, NULL, NULL, NULL); - } - if (sws_scale(wd->sws,src->planes,src->strides, 0, - src->h, &p, &rgb_stride)<0){ - ms_error("Error in 420->rgb sws_scale()."); - } -} - -static int gcd(int m, int n) -{ - if(n == 0) - return m; - else - return gcd(n, m % n); -} - -static void reduce(int *num, int *denom) -{ - int divisor = gcd(*num, *denom); - *num /= divisor; - *denom /= divisor; -} - -static void win_display_update(MSDisplay *obj){ - WinDisplay *wd=(WinDisplay*)obj->data; - HDC hdc; - BITMAPINFOHEADER bi; - RECT rect; - bool_t ret; - int ratiow; - int ratioh; - int w; - int h; - - if (wd->window==NULL) return; - hdc=GetDC(wd->window); - if (hdc==NULL) { - ms_error("Could not get window dc"); - return; - } - yuv420p_to_rgb(wd, &wd->fb, wd->rgb); - memset(&bi,0,sizeof(bi)); - bi.biSize=sizeof(bi); - GetClientRect(wd->window,&rect); - - bi.biWidth=wd->fb.w; - bi.biHeight=wd->fb.h; - bi.biPlanes=1; - bi.biBitCount=24; - bi.biCompression=BI_RGB; - bi.biSizeImage=wd->rgb_len; - - ratiow=wd->fb.w; - ratioh=wd->fb.h; - reduce(&ratiow, &ratioh); - w = rect.right/ratiow*ratiow; - h = rect.bottom/ratioh*ratioh; - - if (h*ratiow>w*ratioh) - { - w = w; - h = w*ratioh/ratiow; - } - else - { - h = h; - w = h*ratiow/ratioh; - } - - if (h*wd->fb.w!=w*wd->fb.h) - ms_error("wrong ratio"); - - //if (wd->last_rect_w!=rect.right || wd->last_rect_h!=rect.bottom) - { - ret=DrawDibDraw(wd->ddh,hdc,0,0, - (rect.right-w)/2,rect.bottom, - &bi,wd->black, - 0,0,bi.biWidth,bi.biHeight,0); - - ret=DrawDibDraw(wd->ddh,hdc,0,0, - rect.right,(rect.bottom-h)/2, - &bi,wd->black, - 0,0,bi.biWidth,bi.biHeight,0); - - ret=DrawDibDraw(wd->ddh,hdc,0,(rect.bottom)-((rect.bottom-h+1)&~0x1)/2, - rect.right,((rect.bottom-h+1)&~0x1)/2, - &bi,wd->black, - 0,0,bi.biWidth,bi.biHeight,0); - - ret=DrawDibDraw(wd->ddh,hdc,(rect.right)-((rect.right-w+1)&~0x1)/2,0, - ((rect.right-w+1)&~0x1)/2,rect.bottom, - &bi,wd->black, - 0,0,bi.biWidth,bi.biHeight,0); - - wd->last_rect_w=rect.right; - wd->last_rect_h=rect.bottom; - } - - ret=DrawDibDraw(wd->ddh,hdc, - (rect.right-w)/2, - (rect.bottom-h)/2, - w, - h, - &bi,wd->rgb, - 0,0,bi.biWidth,bi.biHeight,0); - - - if (!ret) ms_error("DrawDibDraw failed."); - ReleaseDC(NULL,hdc); -} - -static void win_display_uninit(MSDisplay *obj){ - WinDisplay *wd=(WinDisplay*)obj->data; - if (wd==NULL) - return; - if (wd->window && !obj->use_external_window) DestroyWindow(wd->window); - if (wd->ddh) DrawDibClose(wd->ddh); - if (wd->fb.planes[0]) ms_free(wd->fb.planes[0]); - if (wd->rgb) ms_free(wd->rgb); - if (wd->black) ms_free(wd->black); - if (wd->sws) sws_freeContext(wd->sws); - ms_free(wd); -} - -bool_t win_display_pollevent(MSDisplay *d, MSDisplayEvent *ev){ - return FALSE; -} - -#ifdef _MSC_VER - -extern MSDisplayDesc ms_win_display_desc={ - win_display_init, - NULL, - NULL, - win_display_update, - win_display_uninit, - win_display_pollevent -}; - -#else - -MSDisplayDesc ms_win_display_desc={ - .init=win_display_init, - .update=win_display_update, - .uninit=win_display_uninit, - .pollevent=win_display_pollevent -}; - -#endif - -#endif - -MSDisplay *ms_display_new(MSDisplayDesc *desc){ - MSDisplay *obj=(MSDisplay *)ms_new0(MSDisplay,1); - obj->desc=desc; - obj->data=NULL; - return obj; -} - -void ms_display_set_window_id(MSDisplay *d, long id){ - d->window_id=id; - d->use_external_window=TRUE; -} - -void ms_display_destroy(MSDisplay *obj){ - obj->desc->uninit(obj); - ms_free(obj); -} - -#ifdef HAVE_SDL -static MSDisplayDesc *default_display_desc=&ms_sdl_display_desc; -#elif defined(WIN32) -static MSDisplayDesc *default_display_desc=&ms_win_display_desc; -#else -static MSDisplayDesc *default_display_desc=NULL; -#endif - -void ms_display_desc_set_default(MSDisplayDesc *desc){ - default_display_desc=desc; -} - -MSDisplayDesc * ms_display_desc_get_default(void){ - return default_display_desc; -} - -void ms_display_desc_set_default_window_id(MSDisplayDesc *desc, long id){ - desc->default_window_id=id; -} - -typedef struct VideoOut -{ - AVRational ratio; - MSPicture fbuf; - MSPicture local_pic; - MSRect local_rect; - mblk_t *local_msg; - MSVideoSize prevsize; - int corner; - struct SwsContext *sws1; - struct SwsContext *sws2; - MSDisplay *display; - bool_t own_display; - bool_t ready; - bool_t autofit; - bool_t mirror; -} VideoOut; - - -#define SCALE_FACTOR 6 - -static void set_corner(VideoOut *s, int corner) -{ - s->corner=corner; - s->local_pic.w=(s->fbuf.w/SCALE_FACTOR) & ~0x1; - s->local_pic.h=(s->fbuf.h/SCALE_FACTOR) & ~0x1; - if (corner==1) - { - /* top left corner */ - s->local_rect.x=0; - s->local_rect.y=0; - s->local_rect.w=s->local_pic.w; - s->local_rect.h=s->local_pic.h; - } - else if (corner==2) - { - /* top right corner */ - s->local_rect.x=s->fbuf.w-s->local_pic.w; - s->local_rect.y=0; - s->local_rect.w=s->local_pic.w; - s->local_rect.h=s->local_pic.h; - } - else if (corner==3) - { - /* bottom left corner */ - s->local_rect.x=0; - s->local_rect.y=s->fbuf.h-s->local_pic.h; - s->local_rect.w=s->local_pic.w; - s->local_rect.h=s->local_pic.h; - } - else - { - /* default: bottom right corner */ - /* corner can be set to -1: to disable the self view... */ - s->local_rect.x=s->fbuf.w-s->local_pic.w; - s->local_rect.y=s->fbuf.h-s->local_pic.h; - s->local_rect.w=s->local_pic.w; - s->local_rect.h=s->local_pic.h; - } -} - -static void set_vsize(VideoOut *s, MSVideoSize *sz){ - s->fbuf.w=sz->width & ~0x1; - s->fbuf.h=sz->height & ~0x1; - set_corner(s,s->corner); - ms_message("Video size set to %ix%i",s->fbuf.w,s->fbuf.h); -} - -static void video_out_init(MSFilter *f){ - VideoOut *obj=(VideoOut*)ms_new(VideoOut,1); - MSVideoSize def_size; - obj->ratio.num=11; - obj->ratio.den=9; - def_size.width=MS_VIDEO_SIZE_CIF_W; - def_size.height=MS_VIDEO_SIZE_CIF_H; - obj->prevsize.width=0; - obj->prevsize.height=0; - obj->local_msg=NULL; - obj->corner=0; - obj->sws1=NULL; - obj->sws2=NULL; - obj->display=NULL; - obj->own_display=FALSE; - obj->ready=FALSE; - obj->autofit=FALSE; - obj->mirror=FALSE; - set_vsize(obj,&def_size); - f->data=obj; -} - - -static void video_out_uninit(MSFilter *f){ - VideoOut *obj=(VideoOut*)f->data; - if (obj->display!=NULL && obj->own_display) - ms_display_destroy(obj->display); - if (obj->sws1!=NULL){ - sws_freeContext(obj->sws1); - obj->sws1=NULL; - } - if (obj->sws2!=NULL){ - sws_freeContext(obj->sws2); - obj->sws2=NULL; - } - if (obj->local_msg!=NULL) { - freemsg(obj->local_msg); - obj->local_msg=NULL; - } - ms_free(obj); -} - -static void video_out_prepare(MSFilter *f){ - VideoOut *obj=(VideoOut*)f->data; - if (obj->display==NULL){ - if (default_display_desc==NULL){ - ms_error("No default display built in !"); - return; - } - obj->display=ms_display_new(default_display_desc); - obj->own_display=TRUE; - } - if (!ms_display_init(obj->display,&obj->fbuf)){ - if (obj->own_display) ms_display_destroy(obj->display); - obj->display=NULL; - } - if (obj->sws1!=NULL){ - sws_freeContext(obj->sws1); - obj->sws1=NULL; - } - if (obj->sws2!=NULL){ - sws_freeContext(obj->sws2); - obj->sws2=NULL; - } - if (obj->local_msg!=NULL) { - freemsg(obj->local_msg); - obj->local_msg=NULL; - } - set_corner(obj,obj->corner); - obj->ready=TRUE; -} - -static int video_out_handle_resizing(MSFilter *f, void *data){ - VideoOut *s=(VideoOut*)f->data; - MSDisplay *disp=s->display; - if (disp!=NULL){ - MSDisplayEvent ev; - if (ms_display_poll_event(disp,&ev)){ - if (ev.evtype==MS_DISPLAY_RESIZE_EVENT){ - MSVideoSize sz; - sz.width=ev.w; - sz.height=ev.h; - ms_filter_lock(f); - if (s->ready){ - set_vsize(s,&sz); - s->ready=FALSE; - } - ms_filter_unlock(f); - } - } - } - return 0; -} - -static void video_out_preprocess(MSFilter *f){ - video_out_prepare(f); -} - - -static void video_out_process(MSFilter *f){ - VideoOut *obj=(VideoOut*)f->data; - mblk_t *inm; - - ms_filter_lock(f); - if (!obj->ready) video_out_prepare(f); - if (obj->display==NULL){ - ms_filter_unlock(f); - if (f->inputs[0]!=NULL) - ms_queue_flush(f->inputs[0]); - if (f->inputs[1]!=NULL) - ms_queue_flush(f->inputs[1]); - return; - } - /*get most recent message and draw it*/ - if (f->inputs[1]!=NULL && (inm=ms_queue_peek_last(f->inputs[1]))!=0) { - if (obj->corner==-1){ - if (obj->local_msg!=NULL) { - freemsg(obj->local_msg); - obj->local_msg=NULL; - } - }else{ - MSPicture src; - if (yuv_buf_init_from_mblk(&src,inm)==0){ - - if (obj->sws2==NULL){ - obj->sws2=sws_getContext(src.w,src.h,PIX_FMT_YUV420P, - obj->local_pic.w,obj->local_pic.h,PIX_FMT_YUV420P, - SWS_FAST_BILINEAR, NULL, NULL, NULL); - } - if (obj->local_msg==NULL){ - obj->local_msg=yuv_buf_alloc(&obj->local_pic, - obj->local_pic.w,obj->local_pic.h); - } - if (sws_scale(obj->sws2,src.planes,src.strides, 0, - src.h, obj->local_pic.planes, obj->local_pic.strides)<0){ - ms_error("Error in sws_scale()."); - } - if (!mblk_get_precious_flag(inm)) yuv_buf_mirror(&obj->local_pic); - } - } - ms_queue_flush(f->inputs[1]); - } - - if (f->inputs[0]!=NULL && (inm=ms_queue_peek_last(f->inputs[0]))!=0) { - MSPicture src; - if (yuv_buf_init_from_mblk(&src,inm)==0){ - MSVideoSize cur,newsize; - cur.width=obj->fbuf.w; - cur.height=obj->fbuf.h; - newsize.width=src.w; - newsize.height=src.h; - if (obj->autofit && !ms_video_size_equal(newsize,obj->prevsize) ) { - MSVideoSize qvga_size; - qvga_size.width=MS_VIDEO_SIZE_QVGA_W; - qvga_size.height=MS_VIDEO_SIZE_QVGA_H; - obj->prevsize=newsize; - ms_message("received size is %ix%i",newsize.width,newsize.height); - /*don't resize less than QVGA, it is too small*/ - if (ms_video_size_greater_than(qvga_size,newsize)){ - newsize.width=MS_VIDEO_SIZE_QVGA_W; - newsize.height=MS_VIDEO_SIZE_QVGA_H; - } - if (!ms_video_size_equal(newsize,cur)){ - set_vsize(obj,&newsize); - ms_message("autofit: new size is %ix%i",newsize.width,newsize.height); - video_out_prepare(f); - } - } - if (obj->sws1==NULL){ - obj->sws1=sws_getContext(src.w,src.h,PIX_FMT_YUV420P, - obj->fbuf.w,obj->fbuf.h,PIX_FMT_YUV420P, - SWS_FAST_BILINEAR, NULL, NULL, NULL); - } - ms_display_lock(obj->display); - if (sws_scale(obj->sws1,src.planes,src.strides, 0, - src.h, obj->fbuf.planes, obj->fbuf.strides)<0){ - ms_error("Error in sws_scale()."); - } - if (obj->mirror && !mblk_get_precious_flag(inm)) yuv_buf_mirror(&obj->fbuf); - ms_display_unlock(obj->display); - } - ms_queue_flush(f->inputs[0]); - } - /*copy resized local view into main buffer, at bottom left corner:*/ - if (obj->local_msg!=NULL){ - MSPicture corner=obj->fbuf; - MSVideoSize roi; - roi.width=obj->local_pic.w; - roi.height=obj->local_pic.h; - corner.w=obj->local_pic.w; - corner.h=obj->local_pic.h; - corner.planes[0]+=obj->local_rect.x+(obj->local_rect.y*corner.strides[0]); - corner.planes[1]+=(obj->local_rect.x/2)+((obj->local_rect.y/2)*corner.strides[1]); - corner.planes[2]+=(obj->local_rect.x/2)+((obj->local_rect.y/2)*corner.strides[2]); - corner.planes[3]=0; - ms_display_lock(obj->display); - yuv_buf_copy(obj->local_pic.planes,obj->local_pic.strides, - corner.planes,corner.strides,roi); - ms_display_unlock(obj->display); - } - ms_display_update(obj->display); - ms_filter_unlock(f); -} - -static int video_out_set_vsize(MSFilter *f,void *arg){ - VideoOut *s=(VideoOut*)f->data; - ms_filter_lock(f); - set_vsize(s,(MSVideoSize*)arg); - ms_filter_unlock(f); - return 0; -} - -static int video_out_set_display(MSFilter *f,void *arg){ - VideoOut *s=(VideoOut*)f->data; - s->display=(MSDisplay*)arg; - return 0; -} - -static int video_out_auto_fit(MSFilter *f, void *arg){ - VideoOut *s=(VideoOut*)f->data; - s->autofit=*(int*)arg; - return 0; -} - -static int video_out_set_corner(MSFilter *f,void *arg){ - VideoOut *s=(VideoOut*)f->data; - ms_filter_lock(f); - set_corner(s, *(int*)arg); - if (s->display){ - ms_display_lock(s->display); - { - int w=s->fbuf.w; - int h=s->fbuf.h; - int ysize=w*h; - int usize=ysize/4; - - memset(s->fbuf.planes[0], 0, ysize); - memset(s->fbuf.planes[1], 0, usize); - memset(s->fbuf.planes[2], 0, usize); - s->fbuf.planes[3]=NULL; - } - ms_display_unlock(s->display); - } - ms_filter_unlock(f); - return 0; -} - -static int video_out_enable_mirroring(MSFilter *f,void *arg){ - VideoOut *s=(VideoOut*)f->data; - s->mirror=*(int*)arg; - return 0; -} - -static int video_out_get_native_window_id(MSFilter *f, void*arg){ - VideoOut *s=(VideoOut*)f->data; - unsigned long *id=(unsigned long*)arg; - *id=0; - if (s->display){ - *id=s->display->window_id; - return 0; - } - return -1; -} - -static MSFilterMethod methods[]={ - { MS_FILTER_SET_VIDEO_SIZE , video_out_set_vsize }, - { MS_VIDEO_OUT_SET_DISPLAY , video_out_set_display}, - { MS_VIDEO_OUT_SET_CORNER , video_out_set_corner}, - { MS_VIDEO_OUT_AUTO_FIT , video_out_auto_fit}, - { MS_VIDEO_OUT_HANDLE_RESIZING , video_out_handle_resizing}, - { MS_VIDEO_OUT_ENABLE_MIRRORING , video_out_enable_mirroring}, - { MS_VIDEO_OUT_GET_NATIVE_WINDOW_ID, video_out_get_native_window_id}, - { 0 ,NULL} -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_video_out_desc={ - MS_VIDEO_OUT_ID, - "MSVideoOut", - N_("A generic video display"), - MS_FILTER_OTHER, - NULL, - 2, - 0, - video_out_init, - video_out_preprocess, - video_out_process, - NULL, - video_out_uninit, - methods -}; - -#else - -MSFilterDesc ms_video_out_desc={ - .id=MS_VIDEO_OUT_ID, - .name="MSVideoOut", - .text=N_("A generic video display"), - .category=MS_FILTER_OTHER, - .ninputs=2, - .noutputs=0, - .init=video_out_init, - .preprocess=video_out_preprocess, - .process=video_out_process, - .uninit=video_out_uninit, - .methods=methods -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_video_out_desc) diff --git a/linphone/mediastreamer2/src/videostream.c b/linphone/mediastreamer2/src/videostream.c deleted file mode 100644 index 65b800cea..000000000 --- a/linphone/mediastreamer2/src/videostream.c +++ /dev/null @@ -1,583 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/mediastream.h" -#include "mediastreamer2/msfilter.h" -#include "mediastreamer2/msvideo.h" -#include "mediastreamer2/msrtp.h" -#include "mediastreamer2/msvideoout.h" - - -#ifdef HAVE_CONFIG_H -#include "mediastreamer-config.h" -#endif - -extern RtpSession * create_duplex_rtpsession( int locport, bool_t ipv6); - -#define MAX_RTP_SIZE UDP_MAX_SIZE - -/* this code is not part of the library itself, it is part of the mediastream program */ -void video_stream_free (VideoStream * stream) -{ - if (stream->session!=NULL){ - rtp_session_unregister_event_queue(stream->session,stream->evq); - rtp_session_destroy(stream->session); - } - if (stream->rtprecv != NULL) - ms_filter_destroy (stream->rtprecv); - if (stream->rtpsend!=NULL) - ms_filter_destroy (stream->rtpsend); - if (stream->source != NULL) - ms_filter_destroy (stream->source); - if (stream->output != NULL) - ms_filter_destroy (stream->output); - if (stream->decoder != NULL) - ms_filter_destroy (stream->decoder); - if (stream->sizeconv != NULL) - ms_filter_destroy (stream->sizeconv); - if (stream->pixconv!=NULL) - ms_filter_destroy(stream->pixconv); - if (stream->tee!=NULL) - ms_filter_destroy(stream->tee); - if (stream->ticker != NULL) - ms_ticker_destroy (stream->ticker); - if (stream->evq!=NULL) - ortp_ev_queue_destroy(stream->evq); - ms_free (stream); -} - -/*this function must be called from the MSTicker thread: -it replaces one filter by another one. -This is a dirty hack that works anyway. -It would be interesting to have something that does the job -simplier within the MSTicker api -*/ -void video_stream_change_decoder(VideoStream *stream, int payload){ - RtpSession *session=stream->session; - RtpProfile *prof=rtp_session_get_profile(session); - PayloadType *pt=rtp_profile_get_payload(prof,payload); - if (pt!=NULL){ - MSFilter *dec=ms_filter_create_decoder(pt->mime_type); - if (dec!=NULL){ - ms_filter_unlink(stream->rtprecv, 0, stream->decoder, 0); - ms_filter_unlink(stream->decoder,0,stream->output,0); - ms_filter_postprocess(stream->decoder); - ms_filter_destroy(stream->decoder); - stream->decoder=dec; - if (pt->recv_fmtp!=NULL) - ms_filter_call_method(stream->decoder,MS_FILTER_ADD_FMTP,(void*)pt->recv_fmtp); - ms_filter_link (stream->rtprecv, 0, stream->decoder, 0); - ms_filter_link (stream->decoder,0 , stream->output, 0); - ms_filter_preprocess(stream->decoder,stream->ticker); - - }else{ - ms_warning("No decoder found for %s",pt->mime_type); - } - }else{ - ms_warning("No payload defined with number %i",payload); - } -} - -static void video_stream_adapt_bitrate(VideoStream *stream, int jitter, float lost){ - if (stream->encoder!=NULL){ - if (lost>10){ - int bitrate=0; - int new_bitrate; - ms_warning("Remote reports bad receiving experience, trying to reduce bitrate of video encoder."); - - ms_filter_call_method(stream->encoder,MS_FILTER_GET_BITRATE,&bitrate); - if (bitrate==0){ - ms_error("Video encoder does not implement MS_FILTER_GET_BITRATE."); - return; - } - if (bitrate>=20000){ - new_bitrate=bitrate-10000; - ms_warning("Encoder bitrate reduced from %i to %i b/s.",bitrate,new_bitrate); - ms_filter_call_method(stream->encoder,MS_FILTER_SET_BITRATE,&new_bitrate); - }else{ - ms_warning("Video encoder bitrate already at minimum."); - } - - } - } -} - -static void video_steam_process_rtcp(VideoStream *stream, mblk_t *m){ - do{ - if (rtcp_is_SR(m)){ - const report_block_t *rb; - ms_message("video_steam_process_rtcp: receiving RTCP SR"); - rb=rtcp_SR_get_report_block(m,0); - if (rb){ - unsigned int ij; - float flost; - ij=report_block_get_interarrival_jitter(rb); - flost=(float)(100.0*report_block_get_fraction_lost(rb)/256.0); - ms_message("interarrival jitter=%u , lost packets percentage since last report=%f ",ij,flost); - if (stream->adapt_bitrate) video_stream_adapt_bitrate(stream,ij,flost); - } - } - }while(rtcp_next_packet(m)); -} - -void video_stream_iterate(VideoStream *stream){ - - if (stream->output!=NULL) - ms_filter_call_method_noarg(stream->output, - MS_VIDEO_OUT_HANDLE_RESIZING); - - if (stream->evq){ - OrtpEvent *ev=ortp_ev_queue_get(stream->evq); - if (ev!=NULL){ - if (ortp_event_get_type(ev)==ORTP_EVENT_RTCP_PACKET_RECEIVED){ - OrtpEventData *evd=ortp_event_get_data(ev); - video_steam_process_rtcp(stream,evd->packet); - } - ortp_event_destroy(ev); - } - } -} - -static void payload_type_changed(RtpSession *session, unsigned long data){ - VideoStream *stream=(VideoStream*)data; - int pt=rtp_session_get_recv_payload_type(stream->session); - video_stream_change_decoder(stream,pt); -} - -VideoStream *video_stream_new(int locport, bool_t use_ipv6){ - VideoStream *stream = (VideoStream *)ms_new0 (VideoStream, 1); - stream->session=create_duplex_rtpsession(locport,use_ipv6); - stream->evq=ortp_ev_queue_new(); - stream->rtpsend=ms_filter_new(MS_RTP_SEND_ID); - rtp_session_register_event_queue(stream->session,stream->evq); - stream->sent_vsize.width=MS_VIDEO_SIZE_CIF_W; - stream->sent_vsize.height=MS_VIDEO_SIZE_CIF_H; - return stream; -} - -void video_stream_set_sent_video_size(VideoStream *stream, MSVideoSize vsize){ - ms_message("Setting vidoe size %dx%d", vsize.width, vsize.height); - stream->sent_vsize=vsize; -} - -void video_stream_set_relay_session_id(VideoStream *stream, const char *id){ - ms_filter_call_method(stream->rtpsend, MS_RTP_SEND_SET_RELAY_SESSION_ID,(void*)id); -} - -void video_stream_enable_self_view(VideoStream *stream, bool_t val){ - MSFilter *out=stream->output; - stream->corner=val ? 0 : -1; - if (out){ - ms_filter_call_method(out,MS_VIDEO_OUT_SET_CORNER,&stream->corner); - } -} - -void video_stream_enable_adaptive_bitrate_control(VideoStream *s, bool_t yesno){ - s->adapt_bitrate=yesno; -} - -int video_stream_start (VideoStream *stream, RtpProfile *profile, const char *remip, int remport, - int rem_rtcp_port, int payload, int jitt_comp, MSWebCam *cam){ - PayloadType *pt; - RtpSession *rtps=stream->session; - MSPixFmt format; - MSVideoSize vsize,cam_vsize,disp_size; - float fps=15; - int tmp; - JBParameters jbp; - const int socket_buf_size=2000000; - - ms_message("%s entry", __FUNCTION__); - - pt=rtp_profile_get_payload(profile,payload); - if (pt==NULL){ - ms_error("videostream.c: undefined payload type."); - return -1; - } - stream->encoder=ms_filter_create_encoder(pt->mime_type); - stream->decoder=ms_filter_create_decoder(pt->mime_type); - if ((stream->encoder==NULL) || (stream->decoder==NULL)){ - /* big problem: we have not a registered codec for this payload...*/ - ms_error("videostream.c: No codecs available for payload %i:%s.",payload,pt->mime_type); - return -1; - } - - rtp_session_set_profile(rtps,profile); - if (remport>0) rtp_session_set_remote_addr_full(rtps,remip,remport,rem_rtcp_port); - rtp_session_set_payload_type(rtps,payload); - rtp_session_set_jitter_compensation(rtps,jitt_comp); - - rtp_session_signal_connect(stream->session,"payload_type_changed", - (RtpCallback)payload_type_changed,(unsigned long)stream); - - rtp_session_set_recv_buf_size(stream->session,MAX_RTP_SIZE); - - rtp_session_get_jitter_buffer_params(stream->session,&jbp); - jbp.max_packets=1000;//needed for high resolution video - rtp_session_set_jitter_buffer_params(stream->session,&jbp); - - rtp_session_set_rtp_socket_recv_buffer_size(stream->session,socket_buf_size); - rtp_session_set_rtp_socket_send_buffer_size(stream->session,socket_buf_size); - - /* creates two rtp filters to recv send streams (remote part) */ - if (remport>0) ms_filter_call_method(stream->rtpsend,MS_RTP_SEND_SET_SESSION,stream->session); - - stream->rtprecv = ms_filter_new (MS_RTP_RECV_ID); - ms_filter_call_method(stream->rtprecv,MS_RTP_RECV_SET_SESSION,stream->session); - - /* creates the filters */ - stream->source = ms_web_cam_create_reader(cam); - stream->tee = ms_filter_new(MS_TEE_ID); - stream->output=ms_filter_new(MS_VIDEO_OUT_ID); - stream->sizeconv=ms_filter_new(MS_SIZE_CONV_ID); - - if (pt->normal_bitrate>0){ - ms_message("Limiting bitrate of video encoder to %i bits/s",pt->normal_bitrate); - ms_filter_call_method(stream->encoder,MS_FILTER_SET_BITRATE,&pt->normal_bitrate); - } - /* set parameters to the encoder and decoder*/ - if (pt->send_fmtp){ - ms_filter_call_method(stream->encoder,MS_FILTER_ADD_FMTP,pt->send_fmtp); - ms_filter_call_method(stream->decoder,MS_FILTER_ADD_FMTP,pt->send_fmtp); - } - ms_filter_call_method(stream->encoder,MS_FILTER_GET_VIDEO_SIZE,&vsize); - vsize=ms_video_size_min(vsize,stream->sent_vsize); - ms_filter_call_method(stream->encoder,MS_FILTER_SET_VIDEO_SIZE,&vsize); - ms_filter_call_method(stream->encoder,MS_FILTER_GET_FPS,&fps); - ms_message("Setting vsize=%ix%i, fps=%f",vsize.width,vsize.height,fps); - /* configure the filters */ - ms_filter_call_method(stream->source,MS_FILTER_SET_FPS,&fps); - ms_filter_call_method(stream->source,MS_FILTER_SET_VIDEO_SIZE,&vsize); - - /* get the output format for webcam reader */ - ms_filter_call_method(stream->source,MS_FILTER_GET_PIX_FMT,&format); - if (format==MS_MJPEG){ - stream->pixconv=ms_filter_new(MS_MJPEG_DEC_ID); - }else{ - stream->pixconv = ms_filter_new(MS_PIX_CONV_ID); - /*set it to the pixconv */ - ms_filter_call_method(stream->pixconv,MS_FILTER_SET_PIX_FMT,&format); - - ms_filter_call_method(stream->source,MS_FILTER_GET_VIDEO_SIZE,&cam_vsize); - - ms_filter_call_method(stream->pixconv,MS_FILTER_SET_VIDEO_SIZE,&cam_vsize); - } - - ms_filter_call_method(stream->sizeconv,MS_FILTER_SET_VIDEO_SIZE,&vsize); - - /*force the decoder to output YUV420P */ - format=MS_YUV420P; - ms_filter_call_method(stream->decoder,MS_FILTER_SET_PIX_FMT,&format); - - disp_size.width=MS_VIDEO_SIZE_CIF_W; - disp_size.height=MS_VIDEO_SIZE_CIF_H; - tmp=1; - ms_filter_call_method(stream->output,MS_FILTER_SET_VIDEO_SIZE,&disp_size); - ms_filter_call_method(stream->output,MS_VIDEO_OUT_AUTO_FIT,&tmp); - ms_filter_call_method(stream->output,MS_FILTER_SET_PIX_FMT,&format); - ms_filter_call_method(stream->output,MS_VIDEO_OUT_SET_CORNER,&stream->corner); - - if (pt->recv_fmtp!=NULL) - ms_filter_call_method(stream->decoder,MS_FILTER_ADD_FMTP,(void*)pt->recv_fmtp); - - /* and then connect all */ - ms_filter_link (stream->source, 0, stream->pixconv, 0); - ms_filter_link (stream->pixconv, 0, stream->sizeconv, 0); - ms_filter_link (stream->sizeconv, 0, stream->tee, 0); - ms_filter_link (stream->tee, 0 ,stream->encoder, 0 ); - ms_filter_link (stream->encoder,0, stream->rtpsend,0); - - ms_filter_link (stream->rtprecv, 0, stream->decoder, 0); - ms_filter_link (stream->decoder,0 , stream->output, 0); - /* the source video must be send for preview */ - ms_filter_link(stream->tee,1,stream->output,1); - - /* create the ticker */ - stream->ticker = ms_ticker_new(); - ms_ticker_set_name(stream->ticker,"Video MSTicker"); - /* attach it the graph */ - ms_ticker_attach (stream->ticker, stream->source); - return 0; -} - -void video_stream_send_vfu(VideoStream *stream){ - if (stream->encoder) - ms_filter_call_method_noarg(stream->encoder,MS_FILTER_REQ_VFU); -} - -void -video_stream_stop (VideoStream * stream) -{ - if (stream->ticker){ - ms_ticker_detach(stream->ticker,stream->source); - - rtp_stats_display(rtp_session_get_stats(stream->session),"Video session's RTP statistics"); - - ms_filter_unlink(stream->source,0,stream->pixconv,0); - ms_filter_unlink (stream->pixconv, 0, stream->sizeconv, 0); - ms_filter_unlink (stream->sizeconv, 0, stream->tee, 0); - ms_filter_unlink(stream->tee,0,stream->encoder,0); - ms_filter_unlink(stream->encoder, 0, stream->rtpsend,0); - ms_filter_unlink(stream->rtprecv, 0, stream->decoder, 0); - ms_filter_unlink(stream->decoder,0,stream->output,0); - ms_filter_unlink(stream->tee,1,stream->output,1); - } - video_stream_free (stream); -} - - -void video_stream_set_rtcp_information(VideoStream *st, const char *cname, const char *tool){ - if (st->session!=NULL){ - rtp_session_set_source_description(st->session,cname,NULL,NULL,NULL,NULL,tool, - "This is free software (GPL) !"); - } -} - -unsigned long video_stream_get_native_window_id(VideoStream *stream){ - unsigned long id; - if (stream->output){ - if (ms_filter_call_method(stream->output,MS_VIDEO_OUT_GET_NATIVE_WINDOW_ID,&id)==0) - return id; - } - return 0; -} - - -VideoStream * video_preview_start(MSWebCam *device, MSVideoSize disp_size){ - VideoStream *stream = (VideoStream *)ms_new0 (VideoStream, 1); - MSVideoSize vsize=disp_size; - MSPixFmt format; - float fps=(float)29.97; - int mirroring=1; - - /* creates the filters */ - stream->source = ms_web_cam_create_reader(device); - stream->output = ms_filter_new(MS_VIDEO_OUT_ID); - - - /* configure the filters */ - ms_filter_call_method(stream->source,MS_FILTER_SET_VIDEO_SIZE,&vsize); - ms_filter_call_method(stream->source,MS_FILTER_SET_FPS,&fps); - ms_filter_call_method(stream->source,MS_FILTER_GET_PIX_FMT,&format); - ms_filter_call_method(stream->source,MS_FILTER_GET_VIDEO_SIZE,&vsize); - if (format==MS_MJPEG){ - stream->pixconv=ms_filter_new(MS_MJPEG_DEC_ID); - }else{ - stream->pixconv=ms_filter_new(MS_PIX_CONV_ID); - ms_filter_call_method(stream->pixconv,MS_FILTER_SET_PIX_FMT,&format); - ms_filter_call_method(stream->pixconv,MS_FILTER_SET_VIDEO_SIZE,&vsize); - } - - format=MS_YUV420P; - ms_filter_call_method(stream->output,MS_FILTER_SET_PIX_FMT,&format); - ms_filter_call_method(stream->output,MS_FILTER_SET_VIDEO_SIZE,&disp_size); - ms_filter_call_method(stream->output,MS_VIDEO_OUT_ENABLE_MIRRORING,&mirroring); - /* and then connect all */ - - ms_filter_link(stream->source,0, stream->pixconv,0); - ms_filter_link(stream->pixconv, 0, stream->output, 0); - - /* create the ticker */ - stream->ticker = ms_ticker_new(); - ms_ticker_set_name(stream->ticker,"Video MSTicker"); - ms_ticker_attach (stream->ticker, stream->source); - return stream; -} - -void video_preview_stop(VideoStream *stream){ - ms_ticker_detach(stream->ticker, stream->source); - ms_filter_unlink(stream->source,0,stream->pixconv,0); - ms_filter_unlink(stream->pixconv,0,stream->output,0); - - video_stream_free(stream); -} - - -int video_stream_send_only_start(VideoStream* stream, RtpProfile *profile, const char *remip, int remport, - int rem_rtcp_port, int payload, int jitt_comp, MSWebCam *device){ - PayloadType *pt; - MSPixFmt format; - MSVideoSize vsize; - RtpSession *rtps=stream->session; - float fps=15; - - vsize.width=MS_VIDEO_SIZE_CIF_W; - vsize.height=MS_VIDEO_SIZE_CIF_H; - - rtp_session_set_profile(rtps,profile); - if (remport>0) rtp_session_set_remote_addr_full(rtps,remip,remport,rem_rtcp_port); - rtp_session_set_payload_type(rtps,payload); - rtp_session_set_jitter_compensation(rtps,jitt_comp); - - /* creates rtp filter to send streams (remote part) */ - rtp_session_set_recv_buf_size(rtps,MAX_RTP_SIZE); - stream->rtpsend =ms_filter_new(MS_RTP_SEND_ID); - if (remport>0) ms_filter_call_method(stream->rtpsend,MS_RTP_SEND_SET_SESSION,stream->session); - - /* creates the filters */ - pt=rtp_profile_get_payload(profile,payload); - if (pt==NULL){ - video_stream_free(stream); - ms_error("videostream.c: undefined payload type."); - return -1; - } - stream->encoder=ms_filter_create_encoder(pt->mime_type); - if ((stream->encoder==NULL)){ - /* big problem: we have not a registered codec for this payload...*/ - video_stream_free(stream); - ms_error("videostream.c: No codecs available for payload %i.",payload); - return -1; - } - - /* creates the filters */ - stream->source = ms_web_cam_create_reader(device); - stream->sizeconv=ms_filter_new(MS_SIZE_CONV_ID); - - /* configure the filters */ - if (pt->send_fmtp) - ms_filter_call_method(stream->encoder,MS_FILTER_ADD_FMTP,pt->send_fmtp); - - if (pt->normal_bitrate>0){ - ms_message("Limiting bitrate of video encoder to %i bits/s",pt->normal_bitrate); - ms_filter_call_method(stream->encoder,MS_FILTER_SET_BITRATE,&pt->normal_bitrate); - } - - ms_filter_call_method(stream->encoder,MS_FILTER_GET_FPS,&fps); - ms_filter_call_method(stream->encoder,MS_FILTER_GET_VIDEO_SIZE,&vsize); - vsize=ms_video_size_min(vsize,stream->sent_vsize); - ms_filter_call_method(stream->encoder,MS_FILTER_SET_VIDEO_SIZE,&vsize); - - ms_filter_call_method(stream->source,MS_FILTER_SET_FPS,&fps); - ms_filter_call_method(stream->source,MS_FILTER_SET_VIDEO_SIZE,&vsize); - - /* get the output format for webcam reader */ - ms_filter_call_method(stream->source,MS_FILTER_GET_PIX_FMT,&format); - /*set it to the pixconv */ - - /* bug fix from AMD: What about MJPEG mode???*/ - if (format==MS_MJPEG){ - stream->pixconv=ms_filter_new(MS_MJPEG_DEC_ID); - }else{ - stream->pixconv=ms_filter_new(MS_PIX_CONV_ID); - ms_filter_call_method(stream->pixconv,MS_FILTER_SET_PIX_FMT,&format); - - ms_filter_call_method(stream->source,MS_FILTER_GET_VIDEO_SIZE,&vsize); - ms_filter_call_method(stream->pixconv,MS_FILTER_SET_VIDEO_SIZE,&vsize); - } - - ms_filter_call_method(stream->encoder,MS_FILTER_GET_VIDEO_SIZE,&vsize); - ms_filter_call_method(stream->sizeconv,MS_FILTER_SET_VIDEO_SIZE,&vsize); - - ms_message("vsize=%ix%i, fps=%f, send format: %s, capture format: %d, bitrate: %d", - vsize.width,vsize.height,fps,pt->send_fmtp,format, pt->normal_bitrate); - - /* and then connect all */ - ms_filter_link (stream->source, 0, stream->pixconv, 0); - ms_filter_link (stream->pixconv, 0, stream->sizeconv, 0); - ms_filter_link (stream->sizeconv, 0, stream->encoder, 0); - ms_filter_link (stream->encoder,0, stream->rtpsend,0); - - /* create the ticker */ - stream->ticker = ms_ticker_new(); - /* attach it the graph */ - ms_ticker_attach (stream->ticker, stream->source); - return 0; -} - -void video_stream_send_only_stop(VideoStream *stream){ - if (stream->ticker){ - ms_ticker_detach (stream->ticker, stream->source); - ms_filter_unlink(stream->source,0,stream->pixconv,0); - ms_filter_unlink (stream->pixconv, 0, stream->sizeconv, 0); - ms_filter_unlink (stream->sizeconv, 0, stream->encoder, 0); - ms_filter_unlink(stream->encoder,0,stream->rtpsend,0); - } - video_stream_free(stream); -} - -int video_stream_recv_only_start (VideoStream *stream, RtpProfile *profile, const char *remip, int remport,int payload, int jitt_comp){ - PayloadType *pt; - MSPixFmt format; - MSVideoSize vsize; - RtpSession *rtps=stream->session; - - vsize.width=MS_VIDEO_SIZE_CIF_W; - vsize.height=MS_VIDEO_SIZE_CIF_H; - - rtp_session_set_profile(rtps,profile); - if (remport>0) rtp_session_set_remote_addr(rtps,remip,remport); - rtp_session_set_payload_type(rtps,payload); - rtp_session_set_jitter_compensation(rtps,jitt_comp); - - /* creates rtp filters to recv streams */ - rtp_session_set_recv_buf_size(rtps,MAX_RTP_SIZE); - stream->rtprecv = ms_filter_new (MS_RTP_RECV_ID); - ms_filter_call_method(stream->rtprecv,MS_RTP_RECV_SET_SESSION,rtps); - - /* creates the filters */ - pt=rtp_profile_get_payload(profile,payload); - if (pt==NULL){ - ms_error("videostream.c: undefined payload type."); - return -1; - } - stream->decoder=ms_filter_create_decoder(pt->mime_type); - if (stream->decoder==NULL){ - /* big problem: we have not a registered codec for this payload...*/ - ms_error("videostream.c: No codecs available for payload %i:%s.",payload,pt->mime_type); - return -1; - } - stream->output=ms_filter_new(MS_VIDEO_OUT_ID); - - /*force the decoder to output YUV420P */ - format=MS_YUV420P; - /*ask the size-converter to always output CIF */ - vsize.width=MS_VIDEO_SIZE_CIF_W; - vsize.height=MS_VIDEO_SIZE_CIF_H; - ms_message("Setting output vsize=%ix%i",vsize.width,vsize.height); - - ms_filter_call_method(stream->decoder,MS_FILTER_SET_PIX_FMT,&format); - ms_filter_call_method(stream->output,MS_FILTER_SET_PIX_FMT,&format); - ms_filter_call_method(stream->output,MS_FILTER_SET_VIDEO_SIZE,&vsize); - - if (pt->recv_fmtp!=NULL) { - ms_message("pt->recv_fmtp: %s", pt->recv_fmtp); - ms_filter_call_method(stream->decoder,MS_FILTER_ADD_FMTP,(void*)pt->recv_fmtp); - } - - /* and then connect all */ - ms_filter_link (stream->rtprecv, 0, stream->decoder, 0); - ms_filter_link (stream->decoder,0 , stream->output, 0); - - /* create the ticker */ - stream->ticker = ms_ticker_new(); - /* attach it the graph */ - ms_ticker_attach (stream->ticker, stream->rtprecv); - return 0; -} - -void video_stream_recv_only_stop (VideoStream * stream){ - if (stream->ticker!=NULL){ - ms_ticker_detach(stream->ticker, stream->rtprecv); - rtp_stats_display(rtp_session_get_stats(stream->session),"Video session's RTP statistics"); - ms_filter_unlink(stream->rtprecv, 0, stream->decoder, 0); - ms_filter_unlink(stream->decoder,0,stream->output,0); - } - video_stream_free (stream); -} - diff --git a/linphone/mediastreamer2/src/void.c b/linphone/mediastreamer2/src/void.c deleted file mode 100644 index 3a38fb776..000000000 --- a/linphone/mediastreamer2/src/void.c +++ /dev/null @@ -1,61 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/msfilter.h" - - -static void void_sink_process(MSFilter *f){ - mblk_t *im; - while((im=ms_queue_get(f->inputs[0]))!=NULL){ - freemsg(im); - } -} - -#ifdef _MSC_VER - -MSFilterDesc ms_void_sink_desc={ - MS_VOID_SINK_ID, - "MSVoidSink", - N_("A filter that trashes its input (useful for terminating some graphs)."), - MS_FILTER_OTHER, - NULL, - 1, - 0, - NULL, - NULL, - void_sink_process, - NULL, - NULL -}; - -#else - -MSFilterDesc ms_void_sink_desc={ - .id=MS_VOID_SINK_ID, - .name="MSVoidSink", - .text=N_("A filter that trashes its input (useful for terminating some graphs)."), - .category=MS_FILTER_OTHER, - .ninputs=1, - .noutputs=0, - .process=void_sink_process, -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_void_sink_desc) diff --git a/linphone/mediastreamer2/src/wincevideods.c b/linphone/mediastreamer2/src/wincevideods.c deleted file mode 100644 index 7160d601e..000000000 --- a/linphone/mediastreamer2/src/wincevideods.c +++ /dev/null @@ -1,1003 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifdef VIDEO_ENABLED - -/* need to link with "dmoguids.lib strmiids.lib strmbase.lib atls.lib" */ - -#define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA - -#include "mediastreamer2/msvideo.h" -#include "mediastreamer2/msticker.h" -#include "mediastreamer2/msv4l.h" - -#include -#include "nowebcam.h" -#if 0 -#include -#endif - -#include -#include -#include - -#include -//#include -#include "dxfilter.h" -#if 0 -#include -#endif -#include -#include - -typedef struct V4wState{ - - char dev[512]; - int devidx; - - CComPtr m_pGraph; - CComPtr m_pBuilder; - CComPtr m_pControl; - CDXFilter *m_pDXFilter; - CComPtr m_pIDXFilter; - CComPtr m_pNullRenderer; - CComPtr m_pDeviceFilter; - DWORD rotregvalue; - - MSVideoSize vsize; - int pix_fmt; - mblk_t *mire[10]; - queue_t rq; - ms_mutex_t mutex; - int frame_ind; - int frame_max; - float fps; - float start_time; - int frame_count; - bool_t running; - bool_t startwith_yuv_bug; /* avoid bug with USB vimicro cards. */ -}V4wState; - -static V4wState *s_callback=NULL; - -static void dummy(void*p){ -} - -HRESULT ( Callback)(IMediaSample* pSample, REFERENCE_TIME* sTime, REFERENCE_TIME* eTime, BOOL changed) -{ - BYTE *byte_buf=NULL; - mblk_t *buf; - - V4wState *s = s_callback; - if (s==NULL) - return S_OK; - - HRESULT hr = pSample->GetPointer(&byte_buf); - if (FAILED(hr)) - { - return S_OK; - } - - int size = pSample->GetActualDataLength(); - if (size>+1000) - { - buf=allocb(size,0); - memcpy(buf->b_wptr, byte_buf, size); - if (s->pix_fmt==MS_RGB24) - { - /* Conversion from top down bottom up (BGR to RGB and flip) */ - unsigned long Index,nPixels; - unsigned char *blue; - unsigned char tmp; - short iPixelSize; - - blue=buf->b_wptr; - - nPixels=s->vsize.width*s->vsize.height; - iPixelSize=24/8; - - for(Index=0;Index!=nPixels;Index++) // For each pixel - { - tmp=*blue; - *blue=*(blue+2); - *(blue+2)=tmp; - blue+=iPixelSize; - } - - unsigned char *pLine1, *pLine2; - int iLineLen,iIndex; - - iLineLen=s->vsize.width*iPixelSize; - pLine1=buf->b_wptr; - pLine2=&(buf->b_wptr)[iLineLen * (s->vsize.height - 1)]; - - for( ;pLine1b_wptr+=size; - - ms_mutex_lock(&s->mutex); - putq(&s->rq, buf); - ms_mutex_unlock(&s->mutex); - - } - return S_OK; -} - -HRESULT GetFirstCameraDriver( WCHAR *pwzName ) { - HRESULT hr = S_OK; - HANDLE handle = NULL; - DEVMGR_DEVICE_INFORMATION di; - GUID guidCamera = { 0xCB998A05, 0x122C, 0x4166, 0x84, 0x6A, - 0x93, 0x3E, 0x4D, 0x7E, 0x3C, 0x86 }; - - if( pwzName == NULL ) { - return E_POINTER; - } - - di.dwSize = sizeof(di); - - handle = FindFirstDevice( DeviceSearchByGuid, &guidCamera, &di ); - if(( handle == NULL ) || ( di.hDevice == NULL )) { - return S_FALSE; - } - - StringCchCopy( pwzName, MAX_PATH, di.szLegacyName ); - - FindClose( handle ); - return hr; -} - -struct VAR_LIST -{ - VARIANT var; - VAR_LIST *pNext; - BSTR pBSTRName; -}; - -class CPropertyBag : public IPropertyBag -{ -public: - CPropertyBag(); - ~CPropertyBag(); - - HRESULT STDMETHODCALLTYPE - Read( - LPCOLESTR pszPropName, - VARIANT *pVar, - IErrorLog *pErrorLog - ); - - - HRESULT STDMETHODCALLTYPE - Write( - LPCOLESTR pszPropName, - VARIANT *pVar - ); - - ULONG STDMETHODCALLTYPE AddRef(); - ULONG STDMETHODCALLTYPE Release(); - HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppv); - -private: - ULONG _refCount; - VAR_LIST *pVar; -}; - -CPropertyBag::CPropertyBag() : _refCount(1), pVar(0) -{ -} - -CPropertyBag::~CPropertyBag() -{ - VAR_LIST *pTemp = pVar; - HRESULT hr = S_OK; - - while(pTemp) - { - VAR_LIST *pDel = pTemp; - VariantClear(&pTemp->var); - SysFreeString(pTemp->pBSTRName); - pTemp = pTemp->pNext; - delete pDel; - } - -} - -HRESULT STDMETHODCALLTYPE -CPropertyBag::Read(LPCOLESTR pszPropName, - VARIANT *_pVar, - IErrorLog *pErrorLog) -{ - VAR_LIST *pTemp = pVar; - HRESULT hr = S_OK; - - while(pTemp) - { - if(0 == wcscmp(pszPropName, pTemp->pBSTRName)) - { - hr = VariantCopy(_pVar, &pTemp->var); - break; - } - pTemp = pTemp->pNext; - } - return hr; -} - - -HRESULT STDMETHODCALLTYPE -CPropertyBag::Write(LPCOLESTR pszPropName, - VARIANT *_pVar) -{ - HRESULT hr = S_OK; - VAR_LIST *pTemp = new VAR_LIST(); - ASSERT(pTemp); - - if( !pTemp ) - { - return E_OUTOFMEMORY; - } - - VariantInit(&pTemp->var); - pTemp->pBSTRName = SysAllocString(pszPropName); - pTemp->pNext = pVar; - pVar = pTemp; - return VariantCopy(&pTemp->var, _pVar); -} - -ULONG STDMETHODCALLTYPE -CPropertyBag::AddRef() -{ - return InterlockedIncrement((LONG *)&_refCount); -} - -ULONG STDMETHODCALLTYPE -CPropertyBag::Release() -{ - ASSERT(_refCount != 0xFFFFFFFF); - ULONG ret = InterlockedDecrement((LONG *)&_refCount); - if(!ret) - delete this; - return ret; -} - -HRESULT STDMETHODCALLTYPE -CPropertyBag::QueryInterface(REFIID riid, void** ppv) -{ - if(!ppv) - return E_POINTER; - if(riid == IID_IPropertyBag) - *ppv = static_cast(this); - else - return *ppv = 0, E_NOINTERFACE; - - return AddRef(), S_OK; -} - -static int v4w_open_videodevice(V4wState *s, int format, MSVideoSize *vsize) -{ - // Initialize COM - CoInitialize(NULL); - - // get a Graph - HRESULT hr=s->m_pGraph.CoCreateInstance(CLSID_FilterGraph); - if(FAILED(hr)) - { - return -1; - } - - // get a CaptureGraphBuilder2 -#if !defined(_WIN32_WCE) - hr=s->m_pBuilder.CoCreateInstance(CLSID_CaptureGraphBuilder2); -#else - hr=s->m_pBuilder.CoCreateInstance(CLSID_CaptureGraphBuilder); -#endif - if(FAILED(hr)) - { - return -2; - } - - // connect capture graph builder with the graph - s->m_pBuilder->SetFiltergraph(s->m_pGraph); - - // get mediacontrol so we can start and stop the filter graph - hr=s->m_pGraph.QueryInterface(&(s->m_pControl)); - if(FAILED(hr)) - { - return -3; - } - - // get DXFilter - s->m_pDXFilter = new CDXFilter(NULL, &hr, FALSE); - if(s->m_pDXFilter==NULL) - { - return -4; - } - s->m_pDXFilter->AddRef(); - if(FAILED(hr)) - { - return -4; - } - - CMediaType mt; - mt.SetType(&MEDIATYPE_Video); - - if (format==MS_YUV420P) - { - GUID m = (GUID)FOURCCMap(MAKEFOURCC('I','4','2','0')); - mt.SetSubtype(&m); - mt.SetSubtype(&MEDIASUBTYPE_YV12); - } - else //if (format==MS_RGB24) - { - mt.SetSubtype(&MEDIASUBTYPE_RGB24); - } - - //mt.SetSubtype(&MEDIASUBTYPE_IYUV); - //mt.SetSubtype(&MEDIASUBTYPE_YUYV); - //mt.SetSubtype(&MEDIASUBTYPE_RGB24); - //mt.SetSampleSize(); - mt.formattype = FORMAT_VideoInfo; - mt.SetTemporalCompression(FALSE); - - VIDEOINFO *pvi = (VIDEOINFO *) - mt.AllocFormatBuffer(sizeof(VIDEOINFO)); - if (NULL == pvi) - return E_OUTOFMEMORY; - ZeroMemory(pvi, sizeof(VIDEOINFO)); - if (format==MS_YUV420P) - { - pvi->bmiHeader.biCompression = MAKEFOURCC('I','4','2','0'); - pvi->bmiHeader.biCompression = MAKEFOURCC('Y','V','1','2'); - pvi->bmiHeader.biBitCount = 12; - } - else - { - pvi->bmiHeader.biCompression = BI_RGB; - pvi->bmiHeader.biBitCount = 24; - } - pvi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - pvi->bmiHeader.biWidth = vsize->width; - pvi->bmiHeader.biHeight = vsize->height; - pvi->bmiHeader.biPlanes = 1; - pvi->bmiHeader.biSizeImage = GetBitmapSize(&pvi->bmiHeader); - pvi->bmiHeader.biClrImportant = 0; - mt.SetSampleSize(pvi->bmiHeader.biSizeImage); - mt.SetFormat((BYTE*)pvi, sizeof(VIDEOINFO)); - - hr = s->m_pDXFilter->SetAcceptedMediaType(&mt); - if(FAILED(hr)) - { - return -5; - } - - hr = s->m_pDXFilter->SetCallback(Callback); - if(FAILED(hr)) - { - return -6; - } - - hr = s->m_pDXFilter->QueryInterface(IID_IBaseFilter, - (LPVOID *)&s->m_pIDXFilter); - if(FAILED(hr)) - { - return -7; - } - - hr = s->m_pGraph->AddFilter(s->m_pIDXFilter, L"DXFilter Filter"); - if(FAILED(hr)) - { - return -8; - } - -#ifdef WM6 - ICreateDevEnum *pCreateDevEnum = NULL; - IEnumMoniker *pEnumMoniker = NULL; - IMoniker *pMoniker = NULL; - - ULONG nFetched = 0; - - hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, - IID_ICreateDevEnum, (PVOID *)&pCreateDevEnum); - if(FAILED(hr)) - { - return -9; - } - - hr = pCreateDevEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, - &pEnumMoniker, 0); - if (FAILED(hr) || pEnumMoniker == NULL) { - //printf("no device\n"); - return -10; - } - - pEnumMoniker->Reset(); - - hr = pEnumMoniker->Next(1, &pMoniker, &nFetched); - if(FAILED(hr) || pMoniker==NULL) - { - return -11; - } - - hr = pMoniker->BindToObject(0, 0, IID_IBaseFilter, (void**)&s->m_pDeviceFilter ); - if(FAILED(hr)) - { - return -12; - } - - s->m_pGraph->AddFilter(s->m_pDeviceFilter, L"Device Filter"); - - pMoniker->Release(); - pEnumMoniker->Release(); - pCreateDevEnum->Release(); -#else - WCHAR wzDeviceName[ MAX_PATH + 1 ]; - CComVariant varCamName; - CPropertyBag PropBag; - CComPtr pPropertyBag; - GetFirstCameraDriver(wzDeviceName); - - hr = s->m_pDeviceFilter.CoCreateInstance( CLSID_VideoCapture ); - if (FAILED(hr)) - { - return -8; - } - - s->m_pDeviceFilter.QueryInterface( &pPropertyBag ); - varCamName = wzDeviceName; - if(( varCamName.vt == VT_BSTR ) == NULL ) { - return E_OUTOFMEMORY; - } - PropBag.Write( L"VCapName", &varCamName ); - pPropertyBag->Load( &PropBag, NULL ); - pPropertyBag.Release(); - - hr = s->m_pGraph->AddFilter( s->m_pDeviceFilter, L"Video capture source" ); -#endif - - if (FAILED(hr)) - { - return -8; - } - - // get null renderer - s->m_pNullRenderer = NULL; -#if 0 - hr=s->m_pNullRenderer.CoCreateInstance(CLSID_NullRenderer); - if(FAILED(hr)) - { - return -13; - } -#endif - if (s->m_pNullRenderer!=NULL) - { - s->m_pGraph->AddFilter(s->m_pNullRenderer, L"Null Renderer"); - } - - hr = s->m_pBuilder->RenderStream(&PIN_CATEGORY_PREVIEW, - &MEDIATYPE_Video, s->m_pDeviceFilter, s->m_pIDXFilter, s->m_pNullRenderer); - if (FAILED(hr)) - { - //hr = s->m_pBuilder->RenderStream(&PIN_CATEGORY_CAPTURE, - // &MEDIATYPE_Video, s->m_pDeviceFilter, s->m_pIDXFilter, s->m_pNullRenderer); - if (FAILED(hr)) - { - return -14; - } - } - - //m_pDXFilter->SetBufferSamples(TRUE); - - - // Create the System Device Enumerator. -IFilterMapper *pMapper = NULL; -//IEnumMoniker *pEnum = NULL; -IEnumRegFilters *pEnum = NULL; - -hr = CoCreateInstance(CLSID_FilterMapper, - NULL, CLSCTX_INPROC, IID_IFilterMapper, - (void **) &pMapper); - -if (FAILED(hr)) -{ - // Error handling omitted for clarity. -} - -GUID arrayInTypes[2]; -arrayInTypes[0] = MEDIATYPE_Video; -arrayInTypes[1] = MEDIASUBTYPE_dvsd; - -hr = pMapper->EnumMatchingFilters( - &pEnum, - MERIT_HW_COMPRESSOR, // Minimum merit. - FALSE, // At least one input pin? - MEDIATYPE_NULL, - MEDIASUBTYPE_NULL, - FALSE, // Must be a renderer? - FALSE, // At least one output pin? - MEDIATYPE_NULL, - MEDIASUBTYPE_NULL); - -// Enumerate the monikers. -//IMoniker *pMoniker; -REGFILTER *pMoniker; -ULONG cFetched; -while (pEnum->Next(1, &pMoniker, &cFetched) == S_OK) -{ - IPropertyBag *pPropBag = NULL; -#if 0 - hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag, - (void **)&pPropBag); - - if (SUCCEEDED(hr)) - { - // To retrieve the friendly name of the filter, do the following: - VARIANT varName; - VariantInit(&varName); - hr = pPropBag->Read(L"FriendlyName", &varName, 0); - if (SUCCEEDED(hr)) - { - // Display the name in your UI somehow. - } - VariantClear(&varName); - - // To create an instance of the filter, do the following: - IBaseFilter *pFilter; - hr = pMoniker->BindToObject(NULL, NULL, IID_IBaseFilter, (void**)&pFilter); - // Now add the filter to the graph. Remember to release pFilter later. - - // Clean up. - pPropBag->Release(); - } - pMoniker->Release(); -#endif - -} - -// Clean up. -pMapper->Release(); -pEnum->Release(); - - - - - s_callback = s; - hr = s->m_pControl->Run(); - if(FAILED(hr)) - { - return -15; - } - - s->rotregvalue=1; - s->pix_fmt = format; - s->vsize.height = vsize->height; - s->vsize.width = vsize->width; - return 0; -} - -static void v4w_init(MSFilter *f){ - V4wState *s=(V4wState *)ms_new0(V4wState,1); - int idx; - s->vsize.width=MS_VIDEO_SIZE_CIF_W; - s->vsize.height=MS_VIDEO_SIZE_CIF_H; - //s->pix_fmt=MS_RGB24; - s->pix_fmt=MS_YUV420P; - - s->rotregvalue = 0; - s->m_pGraph=NULL; - s->m_pBuilder=NULL; - s->m_pControl=NULL; - s->m_pDXFilter=NULL; - s->m_pIDXFilter=NULL; - s->m_pDeviceFilter=NULL; - - qinit(&s->rq); - for (idx=0;idx<10;idx++) - { - s->mire[idx]=NULL; - } - ms_mutex_init(&s->mutex,NULL); - s->start_time=0; - s->frame_count=-1; - s->fps=15; - - f->data=s; -} - -static int try_format(V4wState *s, int format, MSVideoSize *vsize) -{ - int i = v4w_open_videodevice(s, format, vsize); - if (i==-14) - { - if (s->m_pNullRenderer!=NULL) - s->m_pGraph->RemoveFilter(s->m_pNullRenderer); - if (s->m_pIDXFilter!=NULL) - s->m_pGraph->RemoveFilter(s->m_pIDXFilter); - if (s->m_pDeviceFilter!=NULL) - s->m_pGraph->RemoveFilter(s->m_pDeviceFilter); - s->m_pBuilder=NULL; - s->m_pControl=NULL; - s->m_pIDXFilter=NULL; - if (s->m_pDXFilter!=NULL) - s->m_pDXFilter->Release(); - s->m_pDXFilter=NULL; - s->m_pGraph=NULL; - s->m_pNullRenderer=NULL; - s->m_pDeviceFilter=NULL; - CoUninitialize(); - } - return i; -} - -static int _v4w_start(V4wState *s, void *arg) -{ - MSVideoSize try_vsize; - int tryformat; - int i; - s->frame_count=-1; - - if (s->pix_fmt==MS_YUV420P) - tryformat = MS_RGB24; - else if (s->pix_fmt==MS_RGB24) - tryformat = MS_YUV420P; - - try_vsize.height = s->vsize.height; - try_vsize.width = s->vsize.width; - i = try_format(s, s->pix_fmt, &try_vsize); - if (i==-14) - { - /* try second format with same size */ - i = try_format(s, tryformat, &try_vsize); - } - - /* try both format with CIF size */ - if (i==-14 && s->vsize.height!=MS_VIDEO_SIZE_CIF_H) - { - try_vsize.height = MS_VIDEO_SIZE_CIF_H; - try_vsize.width = MS_VIDEO_SIZE_CIF_W; - i = try_format(s, s->pix_fmt, &try_vsize); - if (i==-14) - { - i = try_format(s, tryformat, &try_vsize); - } - } - if (i==-14 && s->vsize.height!=MS_VIDEO_SIZE_QCIF_H) - { - try_vsize.height = MS_VIDEO_SIZE_QCIF_H; - try_vsize.width = MS_VIDEO_SIZE_QCIF_W; - i = try_format(s, s->pix_fmt, &try_vsize); - if (i==-14) - { - i = try_format(s, tryformat, &try_vsize); - } - } - if (i==-14 && s->vsize.height!=MS_VIDEO_SIZE_VGA_H) - { - try_vsize.height = MS_VIDEO_SIZE_VGA_H; - try_vsize.width = MS_VIDEO_SIZE_VGA_W; - i = try_format(s, s->pix_fmt, &try_vsize); - if (i==-14) - { - i = try_format(s, tryformat, &try_vsize); - } - } - - if (i==-14 && s->vsize.height!=MS_VIDEO_SIZE_QVGA_H) - { - try_vsize.height = MS_VIDEO_SIZE_QVGA_H; - try_vsize.width = MS_VIDEO_SIZE_QVGA_W; - i = try_format(s, s->pix_fmt, &try_vsize); - if (i==-14) - { - i = try_format(s, tryformat, &try_vsize); - } - } - - if (i==0) - { - if (s->pix_fmt==MS_YUV420P) - ms_message("Using YUV420P"); - else if (s->pix_fmt==MS_RGB24) - ms_message("Using RGB24"); - } - - if (s->rotregvalue==0){ - //RemoveGraphFromRot(s->rotregvalue); - if (s->m_pNullRenderer!=NULL) - s->m_pGraph->RemoveFilter(s->m_pNullRenderer); - if (s->m_pIDXFilter!=NULL) - s->m_pGraph->RemoveFilter(s->m_pIDXFilter); - if (s->m_pDeviceFilter!=NULL) - s->m_pGraph->RemoveFilter(s->m_pDeviceFilter); - s->m_pBuilder=NULL; - s->m_pControl=NULL; - s->m_pIDXFilter=NULL; - if (s->m_pDXFilter!=NULL) - s->m_pDXFilter->Release(); - s->m_pDXFilter=NULL; - s->m_pGraph=NULL; - s->m_pNullRenderer=NULL; - s->m_pDeviceFilter=NULL; - CoUninitialize(); - s_callback = NULL; - flushq(&s->rq,0); - ms_message("v4w: graph not started (err=%i)", i); - s->rotregvalue=0; - } - return i; -} - -static int _v4w_stop(V4wState *s, void *arg){ - s->frame_count=-1; - if (s->rotregvalue>0){ - HRESULT hr = s->m_pControl->Stop(); - if(FAILED(hr)) - { - ms_message("v4w: could not stop graph"); - } - if (s->m_pNullRenderer!=NULL) - s->m_pGraph->RemoveFilter(s->m_pNullRenderer); - if (s->m_pIDXFilter!=NULL) - s->m_pGraph->RemoveFilter(s->m_pIDXFilter); - if (s->m_pDeviceFilter!=NULL) - s->m_pGraph->RemoveFilter(s->m_pDeviceFilter); - //RemoveGraphFromRot(s->rotregvalue); - s->m_pBuilder=NULL; - s->m_pControl=NULL; - s->m_pIDXFilter=NULL; - if (s->m_pDXFilter!=NULL) - s->m_pDXFilter->Release(); - s->m_pDXFilter=NULL; - s->m_pGraph=NULL; - s->m_pNullRenderer=NULL; - s->m_pDeviceFilter=NULL; - CoUninitialize(); - s_callback = NULL; - flushq(&s->rq,0); - ms_message("v4w: graph destroyed"); - s->rotregvalue=0; - } - return 0; -} - - -static int v4w_start(MSFilter *f, void *arg){ - V4wState *s=(V4wState*)f->data; - _v4w_start(s, NULL); - return 0; -} - -static int v4w_stop(MSFilter *f, void *arg){ - V4wState *s=(V4wState*)f->data; - _v4w_stop(s, NULL); - return 0; -} - - -static void v4w_uninit(MSFilter *f){ - V4wState *s=(V4wState*)f->data; - int idx; - flushq(&s->rq,0); - ms_mutex_destroy(&s->mutex); - for (idx=0;idx<10;idx++) - { - if (s->mire[idx]==NULL) - break; - freemsg(s->mire[idx]); - } - if (s->rotregvalue>0){ - HRESULT hr = s->m_pControl->Stop(); - if(FAILED(hr)) - { - ms_message("v4w: could not stop graph"); - } - if (s->m_pNullRenderer!=NULL) - s->m_pGraph->RemoveFilter(s->m_pNullRenderer); - if (s->m_pIDXFilter!=NULL) - s->m_pGraph->RemoveFilter(s->m_pIDXFilter); - if (s->m_pDeviceFilter!=NULL) - s->m_pGraph->RemoveFilter(s->m_pDeviceFilter); - //RemoveGraphFromRot(s->rotregvalue); - s->m_pBuilder=NULL; - s->m_pControl=NULL; - s->m_pIDXFilter=NULL; - if (s->m_pDXFilter!=NULL) - s->m_pDXFilter->Release(); - s->m_pDXFilter=NULL; - s->m_pGraph=NULL; - s->m_pNullRenderer=NULL; - s->m_pDeviceFilter=NULL; - CoUninitialize(); - s_callback = NULL; - flushq(&s->rq,0); - ms_message("v4w: graph destroyed"); - s->rotregvalue=0; - } - ms_free(s); -} - -static mblk_t * v4w_make_nowebcam(V4wState *s){ -#if defined(_WIN32_WCE) - return NULL; -#else - int idx; - int count; - if (s->mire[0]==NULL && s->frame_ind==0){ - /* load several images to fake a movie */ - for (idx=0;idx<10;idx++) - { - s->mire[idx]=ms_load_nowebcam(&s->vsize, idx); - if (s->mire[idx]==NULL) - break; - } - if (idx==0) - s->mire[0]=ms_load_nowebcam(&s->vsize, -1); - } - for (count=0;count<10;count++) - { - if (s->mire[count]==NULL) - break; - } - - s->frame_ind++; - if (count==0) - return NULL; - - idx = s->frame_ind%count; - if (s->mire[idx]!=NULL) - return s->mire[idx]; - return s->mire[0]; -#endif -} - -static void v4w_preprocess(MSFilter * obj){ - V4wState *s=(V4wState*)obj->data; - s->running=TRUE; - if (s->rotregvalue==0) - s->fps=1; -} - -static void v4w_postprocess(MSFilter * obj){ - V4wState *s=(V4wState*)obj->data; - s->running=FALSE; -} - -static void v4w_process(MSFilter * obj){ - V4wState *s=(V4wState*)obj->data; - mblk_t *m; - uint32_t timestamp; - int cur_frame; - - if (s->frame_count==-1){ - s->start_time=obj->ticker->time; - s->frame_count=0; - } - - - cur_frame=((obj->ticker->time-s->start_time)*s->fps/1000.0); - if (cur_frame>s->frame_count){ - mblk_t *om=NULL; - ms_mutex_lock(&s->mutex); - /*keep the most recent frame if several frames have been captured */ - if (s->rotregvalue!=0){ - while((m=getq(&s->rq))!=NULL){ - if (om!=NULL) freemsg(om); - om=m; - } - }else { - mblk_t *nowebcam = v4w_make_nowebcam(s); - if (nowebcam!=NULL) - om=dupmsg(nowebcam); - } - ms_mutex_unlock(&s->mutex); - if (om!=NULL){ - timestamp=obj->ticker->time*90;/* rtp uses a 90000 Hz clockrate for video*/ - mblk_set_timestamp_info(om,timestamp); - ms_queue_put(obj->outputs[0],om); - /*ms_message("picture sent");*/ - } - s->frame_count++; - } -} - - - -static int v4w_set_fps(MSFilter *f, void *arg){ - V4wState *s=(V4wState*)f->data; - s->fps=*((float*)arg); - return 0; -} - -static int v4w_get_pix_fmt(MSFilter *f,void *arg){ - V4wState *s=(V4wState*)f->data; - *((MSPixFmt*)arg) = (MSPixFmt)s->pix_fmt; - return 0; -} - -static int v4w_set_vsize(MSFilter *f, void *arg){ - V4wState *s=(V4wState*)f->data; - s->vsize=*((MSVideoSize*)arg); - return 0; -} - -static int v4w_get_vsize(MSFilter *f, void *arg){ - V4wState *s=(V4wState*)f->data; - MSVideoSize *vs=(MSVideoSize*)arg; - vs->width=s->vsize.width; - vs->height=s->vsize.height; - return 0; -} - -static MSFilterMethod methods[]={ - { MS_FILTER_SET_FPS , v4w_set_fps }, - { MS_FILTER_GET_PIX_FMT , v4w_get_pix_fmt }, - { MS_FILTER_SET_VIDEO_SIZE, v4w_set_vsize }, - { MS_FILTER_GET_VIDEO_SIZE, v4w_get_vsize }, - { MS_V4L_START , v4w_start }, - { MS_V4L_STOP , v4w_stop }, - { 0 , NULL } -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_v4w_desc={ - MS_V4L_ID, - "MSV4w", - N_("A video4windows compatible source filter to stream pictures."), - MS_FILTER_OTHER, - NULL, - 0, - 1, - v4w_init, - v4w_preprocess, - v4w_process, - v4w_postprocess, - v4w_uninit, - methods -}; - -#else - -MSFilterDesc ms_v4w_desc={ - .id=MS_V4L_ID, - .name="MSV4w", - .text=N_("A video4windows compatible source filter to stream pictures."), - .ninputs=0, - .noutputs=1, - .category=MS_FILTER_OTHER, - .init=v4w_init, - .preprocess=v4w_preprocess, - .process=v4w_process, - .postprocess=v4w_postprocess, - .uninit=v4w_uninit, - .methods=methods -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_v4w_desc) - -#endif diff --git a/linphone/mediastreamer2/src/winsnd.c b/linphone/mediastreamer2/src/winsnd.c deleted file mode 100644 index 74f21d620..000000000 --- a/linphone/mediastreamer2/src/winsnd.c +++ /dev/null @@ -1,972 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#if defined(_WIN32_WCE) -#define DISABLE_SPEEX -#endif - -#ifndef WINSND_BUFLEN -#define WINSND_BUFLEN 320 -#endif - -#ifndef MAX_WAVEHDR -#define MAX_WAVEHDR 6 -#endif - -#ifndef DISABLE_SPEEX -#include -#endif - -#include "mediastreamer2/mssndcard.h" -#include "mediastreamer2/msfilter.h" -#include "mediastreamer2/msticker.h" - -#ifdef WIN32 -#include /* for alloca */ -#endif - -#include -#ifdef _MSC_VER -#include -#endif -#include - -MSFilter *ms_winsnd_read_new(MSSndCard *card); -MSFilter *ms_winsnd_write_new(MSSndCard *card); - -typedef struct WinSndData{ - char *pcmdev; - char *mixdev; - int devid; - - int sound_err; - WAVEFORMATEX wfx; -#ifdef CONTROLVOLUME - DWORD dwOldVolume; -#endif - WAVEHDR waveouthdr[30]; - char waveoutbuffer[30][3200]; - HWAVEOUT waveoutdev; - int buffer_playing; - int pos_whdr; - - WAVEHDR waveinhdr[30]; - HWAVEIN waveindev; - char waveinbuffer[30][3200]; - - int rate; - int bits; - ms_thread_t thread; - ms_mutex_t mutex; - queue_t rq; - MSBufferizer * bufferizer; - bool_t read_started; - bool_t write_started; - bool_t stereo; - -#ifndef DISABLE_SPEEX - SpeexPreprocessState *pst; -#endif - - uint64_t bytes_read; - int32_t stat_input; - int32_t stat_output; - int32_t stat_notplayed; -} WinSndData; - -static uint64_t winsnd_get_cur_time( void *data){ - WinSndData *d=(WinSndData*)data; - uint64_t curtime=(d->bytes_read*1000)/(d->rate*(d->bits/8)*((d->stereo==FALSE) ? 1 : 2)); - ms_debug("winsnd_get_cur_time: bytes_read=%lu, rate=%i, bits=%i, stereo=%i return %lu\n", - (unsigned long)d->bytes_read,d->rate,d->bits,d->stereo,(unsigned long)curtime); - return curtime; -} - -static void CALLBACK -SpeakerCallback (HWAVEOUT _waveoutdev, UINT uMsg, DWORD dwInstance, - DWORD dwParam1, DWORD dwParam2) -{ - WAVEHDR *wHdr; - WinSndData *device; - - switch (uMsg) - { - case WOM_OPEN: - ms_message("SpeakerCallback : WOM_OPEN"); - break; - case WOM_CLOSE: - ms_message("SpeakerCallback : WOM_CLOSE"); - break; - case WOM_DONE: - wHdr = (WAVEHDR *) dwParam1; - device = (WinSndData *)dwInstance; - device->buffer_playing--; - if (device->stat_output==0) - { - device->stat_input=1; /* reset */ - device->stat_notplayed=0; - } - device->stat_output++; - break; - default: - break; - } -} - -static void CALLBACK -WaveInCallback (HWAVEIN waveindev, UINT uMsg, DWORD dwInstance, DWORD dwParam1, - DWORD dwParam2) -{ - WAVEHDR *wHdr; - MMRESULT mr = NOERROR; - WinSndData *device; - - device = (WinSndData *)dwInstance; - - switch (uMsg) - { - case MM_WOM_DONE: - wHdr = (WAVEHDR *) dwParam1; - /* A waveform-audio data block has been played and - can now be freed. */ - ms_message("WaveInCallback : MM_WOM_DONE"); - waveInUnprepareHeader (waveindev, (LPWAVEHDR) wHdr, sizeof (WAVEHDR)); - break; - - case WIM_OPEN: - ms_message("WaveInCallback : WIM_OPEN"); - break; - case WIM_CLOSE: - ms_message("WaveInCallback : WIM_CLOSE"); - break; - case WIM_DATA: - wHdr = (WAVEHDR *) dwParam1; - - device->bytes_read+=wHdr->dwBytesRecorded; - - if (!device->read_started && !device->write_started) - { - mr = waveInUnprepareHeader (device->waveindev, (LPWAVEHDR) wHdr, sizeof (WAVEHDR)); - ms_warning("WaveInCallback : unprepare header (waveInUnprepareHeader:0x%i)", mr); - return; - } - - if (wHdr->dwBufferLength!=wHdr->dwBytesRecorded) - { - mr = waveInAddBuffer (device->waveindev, - wHdr, - sizeof (device->waveinhdr[wHdr->dwUser])); - if (mr != MMSYSERR_NOERROR) - { - ms_warning("WaveInCallback : error adding buffer to sound card (waveInAddBuffer:0x%i)", mr); - } - return; - } - ms_mutex_lock(&device->mutex); - if (device->read_started) - { - mblk_t *rm=NULL; - if (rm==NULL) rm=allocb(wHdr->dwBufferLength,0); - memcpy(rm->b_wptr,wHdr->lpData, wHdr->dwBufferLength); - -#ifndef DISABLE_SPEEX - if (device->pst!=NULL) - { - int vad; - //memset(rm->b_wptr,0, wHdr->dwBufferLength); - - vad = speex_preprocess(device->pst, (short*)rm->b_wptr, NULL); -#if 0 - if (vad!=1) - ms_message("WaveInCallback : %d", vad); -#endif - } - -#endif - rm->b_wptr+=wHdr->dwBufferLength; - putq(&device->rq,rm); - device->stat_input++; - rm=NULL; - } - ms_mutex_unlock(&device->mutex); - - mr = waveInAddBuffer (device->waveindev, - wHdr, - sizeof (device->waveinhdr[wHdr->dwUser])); - if (mr != MMSYSERR_NOERROR) - { - ms_warning("WaveInCallback : error adding buffer to sound card (waveInAddBuffer:0x%i)", mr); - return; - } - } -} - -static int winsnd_open(WinSndData *device, int devnumber, int bits,int stereo, int rate, int *minsz) -{ - MMRESULT mr = NOERROR; - DWORD dwFlag; - int i; - int channel = 1; - if (stereo>0) - channel = stereo; - device->wfx.wFormatTag = WAVE_FORMAT_PCM; - device->wfx.cbSize = 0; - device->wfx.nAvgBytesPerSec = 16000; - device->wfx.nBlockAlign = 2; - device->wfx.nChannels = channel; - device->wfx.nSamplesPerSec = rate; /* 8000; */ - device->wfx.wBitsPerSample = bits; - - - dwFlag = CALLBACK_FUNCTION; - if (devnumber != WAVE_MAPPER) - dwFlag = WAVE_MAPPED | CALLBACK_FUNCTION; - mr = waveOutOpen (&(device->waveoutdev), devnumber, &(device->wfx), (DWORD) SpeakerCallback, - (DWORD)device, dwFlag); - if (mr != NOERROR) - { - ms_warning("Failed to open device: trying default device. (waveOutOpen:0x%i)", mr); - dwFlag = CALLBACK_FUNCTION; - mr = waveOutOpen (&(device->waveoutdev), WAVE_MAPPER, &(device->wfx), (DWORD) SpeakerCallback, - (DWORD)device, dwFlag); - } - if (mr != NOERROR) - { - ms_warning("Failed to open windows sound device. (waveOutOpen:0x%i)", mr); - return -1; - } - -#if 0 -#define MM_WOM_SETSECONDARYGAINCLASS (WM_USER) -#define MM_WOM_SETSECONDARYGAINLIMIT (WM_USER+1) -#define MM_WOM_FORCESPEAKER (WM_USER+2) - - bool bSpeaker=TRUE; - mr = waveOutMessage(device->waveoutdev, MM_WOM_FORCESPEAKER, bSpeaker, 0); - if (mr != NOERROR) - { - ms_warning("Failed to use earphone. (waveOutMessage:0x%i)", mr); - return -1; - } - - typedef HRESULT (* _SetSpeakerMode)(DWORD mode); - _SetSpeakerMode pfnSetSpeakerMode; - - HINSTANCE hDll = LoadLibrary(L"\\windows\\ossvcs.dll"); - //_debug(L"ossvcs.dll h=%X",hDll); - pfnSetSpeakerMode = (_SetSpeakerMode)GetProcAddress(hDll,(LPCTSTR)218); - if (pfnSetSpeakerMode) - { - //_debug(L"SetSpeakerMode imported."); - DWORD sm = 0; - //_debug(L"SpeakerMode set to %d", sm); - pfnSetSpeakerMode(sm); - } - //else - //_debug(L"pfnSetSpeakerMode import failed."); - FreeLibrary(hDll); -#endif - -#ifdef CONTROLVOLUME - mr = waveOutGetVolume(device->waveoutdev, &device->dwOldVolume); - if (mr != NOERROR) - { - ms_warning("Failed to get volume device. (waveOutGetVolume:0x%i)", mr); - } - - mr = waveOutSetVolume(device->waveoutdev, 0xFFFFFFFF); - if (mr != NOERROR) - { - ms_warning("Failed to set volume device. (waveOutSetVolume:0x%i)", mr); - } -#endif - - /* prepare windows buffers */ - - for (i = 0; i < MAX_WAVEHDR; i++) - { - memset (&(device->waveouthdr[i]), 0, sizeof (device->waveouthdr[i])); - device->waveouthdr[i].lpData = device->waveoutbuffer[i]; - /* BUG: on ne connait pas la taille des frames a recevoir... - on utilise enc_frame_per_packet au lien de dec_frame_per_packet */ - - device->waveouthdr[i].dwBufferLength = device->rate/8000 * WINSND_BUFLEN; - /* 480 pour 98 (speex) */ - device->waveouthdr[i].dwFlags = 0; - device->waveouthdr[i].dwUser = i; - - mr = waveOutPrepareHeader (device->waveoutdev, &(device->waveouthdr[i]), - sizeof (device->waveouthdr[i])); - if (mr != MMSYSERR_NOERROR){ - ms_warning("Failed to prepare windows sound device. (waveOutPrepareHeader:0x%i)", mr); - } - else - { - ms_message("Sound Header prepared %i for windows sound device. (waveOutPrepareHeader)", i); - } - } - - - /* Init Microphone device */ - dwFlag = CALLBACK_FUNCTION; - if (devnumber != WAVE_MAPPER) - dwFlag = WAVE_MAPPED | CALLBACK_FUNCTION; - mr = waveInOpen (&(device->waveindev), devnumber, &(device->wfx), - (DWORD) WaveInCallback, (DWORD)device, dwFlag); - if (mr != NOERROR) - { - ms_warning("Failed to open device: trying default device. (waveInOpen:0x%i)", mr); - dwFlag = CALLBACK_FUNCTION; - mr = waveInOpen (&(device->waveindev), WAVE_MAPPER, &(device->wfx), - (DWORD) WaveInCallback, (DWORD)device, dwFlag); - } - - if (mr != NOERROR) - { - ms_warning("Failed to prepare windows sound device. (waveInOpen:0x%i)", mr); - return -1; - } - - - - for (i = 0; i < MAX_WAVEHDR; i++) - { - memset (&(device->waveinhdr[i]), 0, sizeof (device->waveinhdr[i])); - device->waveinhdr[i].lpData = device->waveinbuffer[i]; - /* frameSize */ - device->waveinhdr[i].dwBufferLength = device->rate/8000 * WINSND_BUFLEN; - device->waveinhdr[i].dwFlags = 0; - device->waveinhdr[i].dwUser = i; - mr = waveInPrepareHeader (device->waveindev, &(device->waveinhdr[i]), - sizeof (device->waveinhdr[i])); - if (mr == MMSYSERR_NOERROR){ - mr = waveInAddBuffer (device->waveindev, &(device->waveinhdr[i]), - sizeof (device->waveinhdr[i])); - if (mr == MMSYSERR_NOERROR) - { - ms_message("Sound Header prepared %i for windows sound device. (waveInAddBuffer)", i); - } - else - { - ms_warning("Failed to prepare windows sound device. (waveInAddBuffer:0x%i)", mr); - } - } - else - { - ms_warning("Failed to prepare windows sound device. (waveInPrepareHeader:0x%i)", mr); - } - } - -#ifndef DISABLE_SPEEX -#if 0 - device->pst = speex_preprocess_state_init((device->rate/8000 * 320)/2, device->rate); - if (device->pst!=NULL) { - float f; - i=1; - speex_preprocess_ctl(device->pst, SPEEX_PREPROCESS_SET_VAD, &i); - i=1; - speex_preprocess_ctl(device->pst, SPEEX_PREPROCESS_SET_DENOISE, &i); - i=0; - speex_preprocess_ctl(device->pst, SPEEX_PREPROCESS_SET_AGC, &i); - f=8000; - speex_preprocess_ctl(device->pst, SPEEX_PREPROCESS_SET_AGC_LEVEL, &f); - i=0; - speex_preprocess_ctl(device->pst, SPEEX_PREPROCESS_SET_DEREVERB, &i); - f=.4; - speex_preprocess_ctl(device->pst, SPEEX_PREPROCESS_SET_DEREVERB_DECAY, &f); - f=.3; - speex_preprocess_ctl(device->pst, SPEEX_PREPROCESS_SET_DEREVERB_LEVEL, &f); - } -#endif -#endif - - mr = waveInStart (device->waveindev); - if (mr != MMSYSERR_NOERROR) - { - ms_warning("Failed to start recording on windows sound device. (waveInStart:0x%i)", mr); - return -1; - } - - *minsz=device->rate/8000 * 320; - return 0; -} - -static void winsnd_set_level(MSSndCard *card, MSSndCardMixerElem e, int percent) -{ - WinSndData *d=(WinSndData*)card->data; - MMRESULT mr = NOERROR; - DWORD dwVolume = 0xFFFF; - dwVolume = ((0xFFFF) * percent) / 100; - - if (d->mixdev==NULL) return; - switch(e){ - case MS_SND_CARD_MASTER: - mr = waveOutSetVolume(d->waveoutdev, dwVolume); - if (mr != MMSYSERR_NOERROR) - { - ms_warning("Failed to set master volume. (waveOutSetVolume:0x%i)", mr); - return; - } - return; - break; -#if 0 - case MS_SND_CARD_CAPTURE: - wincmd=SOUND_MIXER_IGAIN; - break; - case MS_SND_CARD_PLAYBACK: - wincmd=SOUND_MIXER_PCM; - break; -#endif - default: - ms_warning("winsnd_card_set_level: unsupported command."); - return; - } -} - -static int winsnd_get_level(MSSndCard *card, MSSndCardMixerElem e) -{ - WinSndData *d=(WinSndData*)card->data; - MMRESULT mr = NOERROR; - DWORD dwVolume = 0x0000; - - if (d->mixdev==NULL) return -1; - switch(e){ - case MS_SND_CARD_MASTER: - mr=waveOutGetVolume(d->waveoutdev, &dwVolume); - // Transform to 0 to 100 scale - //dwVolume = (dwVolume *100) / (0xFFFF); - return 60; - break; -#if 0 - case MS_SND_CARD_CAPTURE: - osscmd=SOUND_MIXER_IGAIN; - break; - case MS_SND_CARD_PLAYBACK: - osscmd=SOUND_MIXER_PCM; - break; -#endif - default: - ms_warning("winsnd_card_get_level: unsupported command."); - return -1; - } - return -1; -} - -static void winsnd_set_source(MSSndCard *card, MSSndCardCapture source) -{ - WinSndData *d=(WinSndData*)card->data; - if (d->mixdev==NULL) return; - - switch(source){ - case MS_SND_CARD_MIC: - break; - case MS_SND_CARD_LINE: - break; - } -} - -static void winsnd_init(MSSndCard *card){ - WinSndData *d=(WinSndData*)ms_new(WinSndData,1); - memset(d, 0, sizeof(WinSndData)); - d->bytes_read=0; - d->pcmdev=NULL; - d->mixdev=NULL; - d->sound_err=-1; /* not opened */ - d->read_started=FALSE; - d->write_started=FALSE; - d->bits=16; - d->rate=8000; - d->stereo=FALSE; - qinit(&d->rq); - d->bufferizer=ms_bufferizer_new(); - ms_mutex_init(&d->mutex,NULL); - card->data=d; -#ifndef DISABLE_SPEEX - d->pst=0; -#endif - d->stat_input=0; - d->stat_output=0; - d->stat_notplayed=0; -} - -static void winsnd_uninit(MSSndCard *card){ - WinSndData *d=(WinSndData*)card->data; - if (d==NULL) - return; - if (d->pcmdev!=NULL) ms_free(d->pcmdev); - if (d->mixdev!=NULL) ms_free(d->mixdev); - ms_bufferizer_destroy(d->bufferizer); - flushq(&d->rq,0); - - ms_mutex_destroy(&d->mutex); - -#ifndef DISABLE_SPEEX - if (d->pst!=NULL) - speex_preprocess_state_destroy(d->pst); -#endif - - ms_free(d); -} - -#define DSP_NAME "/dev/dsp" -#define MIXER_NAME "/dev/mixer" - -static void winsnd_detect(MSSndCardManager *m); -static MSSndCard *winsnd_dup(MSSndCard *obj); - -MSSndCardDesc winsnd_card_desc={ - "WINSND", - winsnd_detect, - winsnd_init, - winsnd_set_level, - winsnd_get_level, - winsnd_set_source, - NULL, - NULL, - ms_winsnd_read_new, - ms_winsnd_write_new, - winsnd_uninit, - winsnd_dup -}; - -static MSSndCard *winsnd_dup(MSSndCard *obj){ - MSSndCard *card=ms_snd_card_new(&winsnd_card_desc); - WinSndData *dcard=(WinSndData*)card->data; - WinSndData *dobj=(WinSndData*)obj->data; - dcard->pcmdev=ms_strdup(dobj->pcmdev); - dcard->mixdev=ms_strdup(dobj->mixdev); - dcard->devid=dobj->devid; - card->name=ms_strdup(obj->name); - return card; -} - -static MSSndCard *winsnd_card_new(const char *pcmdev, const char *mixdev, int id){ - MSSndCard *card=ms_snd_card_new(&winsnd_card_desc); - WinSndData *d=(WinSndData*)card->data; - d->pcmdev=ms_strdup(pcmdev); - d->mixdev=ms_strdup(mixdev); - card->name=ms_strdup(pcmdev); - d->devid=id; - return card; -} - -static void winsnd_detect(MSSndCardManager *m){ - MMRESULT mr = NOERROR; - unsigned int nInDevices = waveInGetNumDevs (); - unsigned int item; - char pcmdev[1024]; - char mixdev[1024]; - - for (item = 0; item < nInDevices; item++) - { - WAVEINCAPS caps; - mr = waveInGetDevCaps (item, &caps, sizeof (WAVEINCAPS)); - if (mr == MMSYSERR_NOERROR) - { - MSSndCard *card; - snprintf(pcmdev,sizeof(pcmdev),"%s",caps.szPname); - snprintf(mixdev,sizeof(mixdev),"%s",caps.szPname); - if (item == 0) - { - card=winsnd_card_new(pcmdev,mixdev, item-1); - ms_snd_card_manager_add_card(m,card); - } - card=winsnd_card_new(pcmdev,mixdev, item); - ms_snd_card_manager_add_card(m,card); - } - } -#if 0 - nInDevices = mixerGetNumDevs (); - for (item = 0; item < nInDevices; item++) - { - MIXERCAPS caps; - mr = mixerGetDevCaps (item, &caps, sizeof (MIXERCAPS)); - if (mr == MMSYSERR_NOERROR) - { - snprintf(pcmdev,sizeof(pcmdev),"%s",caps.szPname); - snprintf(mixdev,sizeof(mixdev),"%s",caps.szPname); - } - } -#endif -} - -static void * winsnd_thread(void *p){ - MSSndCard *card=(MSSndCard*)p; - WinSndData *d=(WinSndData*)card->data; - int bsize=d->rate/8000 * 320; - uint8_t *rtmpbuff=NULL; - uint8_t *wtmpbuff=NULL; - int err; - - MMRESULT mr = NOERROR; - int pos_whdr=0; - - d->stat_input=0; - d->stat_output=0; - d->stat_notplayed=0; - d->sound_err=winsnd_open(d, d->devid, d->bits,d->stereo,d->rate,&bsize); - if (d->sound_err==0){ - rtmpbuff=(uint8_t*)alloca(bsize); - wtmpbuff=(uint8_t*)alloca(bsize); - } - while(d->read_started || d->write_started){ - if (d->sound_err==0){ - if (d->write_started){ -#if 0 - if (d->stat_output>0 && d->buffer_playing==0) - { - ms_error("No data currently playing in sound card" ); - } - if (d->stat_output>0 && (d->stat_input-d->stat_output>10 || d->stat_input-d->stat_output<-10)) - ms_error("Not perfectly synchronized (input-output=%i)", d->stat_input-d->stat_output); -#endif - - while (d->buffer_playing<6 && d->buffer_playingmutex); - err=ms_bufferizer_read(d->bufferizer,wtmpbuff,bsize); - ms_mutex_unlock(&d->mutex); - if (err!=bsize) - break; - - ms_mutex_lock(&d->mutex); - /* write to sound devide! */ - memcpy (d->waveouthdr[pos_whdr].lpData, wtmpbuff, bsize); - - mr = waveOutWrite (d->waveoutdev, - &(d->waveouthdr[pos_whdr]), - sizeof (d->waveouthdr[pos_whdr])); - - if (mr != MMSYSERR_NOERROR) - { - if (mr == WAVERR_STILLPLAYING) - { - /* retry later */ - /* data should go back to queue */ - /* TODO */ - ms_warning("sound device write STILL_PLAYING (waveOutWrite:0x%i)", mr); - } - else - { - ms_warning("sound device write returned (waveOutWrite:0x%i)", mr); - } - } - else - { - d->buffer_playing++; - pos_whdr++; - if (pos_whdr == MAX_WAVEHDR) - pos_whdr = 0; /* loop over the prepared blocks */ - } - ms_mutex_unlock(&d->mutex); - - - if (err<0){ -#if !defined(_WIN32_WCE) - ms_warning("Fail to write %i bytes from soundcard: %s", - bsize,strerror(errno)); -#else - ms_warning("Fail to write %i bytes from soundcard: %i", - bsize,WSAGetLastError()); -#endif - } - } - - if (d->buffer_playing==6 || d->buffer_playing==MAX_WAVEHDR) - { - int discarded=0; - ms_mutex_lock(&d->mutex); - while (d->bufferizer->size>=bsize){ - discarded++; - d->stat_notplayed++; - err=ms_bufferizer_read(d->bufferizer,wtmpbuff,bsize); - } - ms_mutex_unlock(&d->mutex); - if (discarded>0) - ms_error("Extra data for sound card removed (%ims), (playing: %i) (input-output: %i)", (discarded*20*320)/320, d->buffer_playing, d->stat_input - d->stat_output); - } -#if !defined(_WIN32_WCE) - Sleep(5); -#endif -#if defined(_WIN32_WCE) - Sleep(10); -#endif - }else { - int discarded=0; - /* don't think this is usefull, anyway... */ - ms_mutex_lock(&d->mutex); - while (d->bufferizer->size>=bsize){ - discarded++; - err=ms_bufferizer_read(d->bufferizer,wtmpbuff,bsize); - } - ms_mutex_unlock(&d->mutex); - if (discarded>0) - ms_error("Extra data for sound card removed (%ims), (playing: %i) (input-output: %i)", (discarded*20)/320, d->buffer_playing, d->stat_input - d->stat_output); - Sleep(10); - } - }else Sleep(10); - } - if (d->sound_err==0) { - int i; - int count=0; - /* close sound card */ - ms_error("Shutting down sound device (playing: %i) (input-output: %i) (notplayed: %i)", d->buffer_playing, d->stat_input - d->stat_output, d->stat_notplayed); - - /* unprepare buffer */ - for (i = 0; i < MAX_WAVEHDR; i++) - { - int counttry=0; - for (counttry=0;counttry<10;counttry++) - { - mr = waveInUnprepareHeader (d->waveindev, - &(d->waveinhdr[i]), - sizeof (d->waveinhdr[i])); - if (mr != MMSYSERR_NOERROR) - { - ms_error("Failed to unprepared %i buffer from sound card (waveInUnprepareHeader:0x%i", count, mr); - Sleep (20); - } else - { - count++; - ms_message("successfully unprepared %i buffer from sound card.", count); - break; - } - } - } - ms_warning("unprepared %i buffer from sound card.", count); - - mr = waveInStop (d->waveindev); - if (mr != MMSYSERR_NOERROR) - { - ms_error("failed to stop recording sound card (waveInStop:0x%i)", mr); - } else - { - ms_message("successfully stopped recording sound card"); - } - - mr = waveInReset (d->waveindev); - if (mr != MMSYSERR_NOERROR) - { - ms_warning("failed to reset recording sound card (waveInReset:0x%i)", mr); - } else - { - ms_message("successful reset of recording sound card"); - } - - mr = waveInClose (d->waveindev); - if (mr != MMSYSERR_NOERROR) - { - ms_warning("failed to close recording sound card (waveInClose:0x%i)", mr); - } else - { - ms_message("successfully closed recording sound card"); - } - d->sound_err=-1; - } - d->stat_input=0; - d->stat_output=0; - d->stat_notplayed=0; - return NULL; -} - -static void winsnd_start_r(MSSndCard *card){ - WinSndData *d=(WinSndData*)card->data; - if (d->read_started==FALSE && d->write_started==FALSE){ - d->read_started=TRUE; - ms_thread_create(&d->thread,NULL,winsnd_thread,card); - }else d->read_started=TRUE; -} - -static void winsnd_stop_r(MSSndCard *card){ - WinSndData *d=(WinSndData*)card->data; - d->read_started=FALSE; - if (d->write_started==FALSE){ - ms_thread_join(d->thread,NULL); - } -} - -static void winsnd_start_w(MSSndCard *card){ - WinSndData *d=(WinSndData*)card->data; - if (d->read_started==FALSE && d->write_started==FALSE){ - d->write_started=TRUE; - ms_thread_create(&d->thread,NULL,winsnd_thread,card); - }else{ - d->write_started=TRUE; - } -} - -static void winsnd_stop_w(MSSndCard *card){ - WinSndData *d=(WinSndData*)card->data; - d->write_started=FALSE; - if (d->read_started==FALSE){ - ms_thread_join(d->thread,NULL); - } -#ifdef CONTROLVOLUME - waveOutSetVolume(d->waveoutdev, d->dwOldVolume); -#endif -} - -static mblk_t *winsnd_get(MSSndCard *card){ - WinSndData *d=(WinSndData*)card->data; - mblk_t *m; - ms_mutex_lock(&d->mutex); - m=getq(&d->rq); - ms_mutex_unlock(&d->mutex); - return m; -} - -static void winsnd_put(MSSndCard *card, mblk_t *m){ - WinSndData *d=(WinSndData*)card->data; - ms_mutex_lock(&d->mutex); - ms_bufferizer_put(d->bufferizer,m); - ms_mutex_unlock(&d->mutex); -} - - -static void winsnd_read_preprocess(MSFilter *f){ - MSSndCard *card=(MSSndCard*)f->data; - winsnd_start_r(card); - ms_ticker_set_time_func(f->ticker,winsnd_get_cur_time,card->data); -} - -static void winsnd_read_postprocess(MSFilter *f){ - MSSndCard *card=(MSSndCard*)f->data; - ms_ticker_set_time_func(f->ticker,NULL,NULL); - winsnd_stop_r(card); -} - -static void winsnd_read_process(MSFilter *f){ - MSSndCard *card=(MSSndCard*)f->data; - mblk_t *m; - while((m=winsnd_get(card))!=NULL){ - ms_queue_put(f->outputs[0],m); - } -} - -static void winsnd_write_preprocess(MSFilter *f){ - MSSndCard *card=(MSSndCard*)f->data; - winsnd_start_w(card); -} - -static void winsnd_write_postprocess(MSFilter *f){ - MSSndCard *card=(MSSndCard*)f->data; - winsnd_stop_w(card); -} - -static void winsnd_write_process(MSFilter *f){ - MSSndCard *card=(MSSndCard*)f->data; - mblk_t *m; - - while((m=ms_queue_get(f->inputs[0]))!=NULL){ - winsnd_put(card,m); - } -} - -static int set_rate(MSFilter *f, void *arg){ - MSSndCard *card=(MSSndCard*)f->data; - WinSndData *d=(WinSndData*)card->data; - d->rate=*((int*)arg); - return 0; -} - -static int set_nchannels(MSFilter *f, void *arg){ - MSSndCard *card=(MSSndCard*)f->data; - WinSndData *d=(WinSndData*)card->data; - d->stereo=(*((int*)arg)==2); - return 0; -} - -static int winsnd_get_stat_input(MSFilter *f, void *arg){ - MSSndCard *card=(MSSndCard*)f->data; - WinSndData *d=(WinSndData*)card->data; - - return d->stat_input; -} - -static int winsnd_get_stat_ouptut(MSFilter *f, void *arg){ - MSSndCard *card=(MSSndCard*)f->data; - WinSndData *d=(WinSndData*)card->data; - - return d->stat_output; -} - -static int winsnd_get_stat_discarded(MSFilter *f, void *arg){ - MSSndCard *card=(MSSndCard*)f->data; - WinSndData *d=(WinSndData*)card->data; - - return d->stat_notplayed; -} - -static MSFilterMethod winsnd_methods[]={ - { MS_FILTER_SET_SAMPLE_RATE , set_rate }, - { MS_FILTER_SET_NCHANNELS , set_nchannels }, - { MS_FILTER_GET_STAT_INPUT, winsnd_get_stat_input }, - { MS_FILTER_GET_STAT_OUTPUT, winsnd_get_stat_ouptut }, - { MS_FILTER_GET_STAT_DISCARDED, winsnd_get_stat_discarded }, - { 0 , NULL } -}; - -MSFilterDesc winsnd_read_desc={ - MS_WINSND_READ_ID, - "MSWinSndRead", - "Sound capture filter for Windows Sound drivers", - MS_FILTER_OTHER, - NULL, - 0, - 1, - NULL, - winsnd_read_preprocess, - winsnd_read_process, - winsnd_read_postprocess, - NULL, - winsnd_methods -}; - - -MSFilterDesc winsnd_write_desc={ - MS_WINSND_WRITE_ID, - "MSWinSndWrite", - "Sound playback filter for Windows Sound drivers", - MS_FILTER_OTHER, - NULL, - 1, - 0, - NULL, - winsnd_write_preprocess, - winsnd_write_process, - winsnd_write_postprocess, - NULL, - winsnd_methods -}; - -MSFilter *ms_winsnd_read_new(MSSndCard *card){ - MSFilter *f=ms_filter_new_from_desc(&winsnd_read_desc); - f->data=card; - return f; -} - - -MSFilter *ms_winsnd_write_new(MSSndCard *card){ - MSFilter *f=ms_filter_new_from_desc(&winsnd_write_desc); - f->data=card; - return f; -} - -MS_FILTER_DESC_EXPORT(winsnd_read_desc) -MS_FILTER_DESC_EXPORT(winsnd_write_desc) diff --git a/linphone/mediastreamer2/src/winsnd2.c b/linphone/mediastreamer2/src/winsnd2.c deleted file mode 100755 index 56c8d404c..000000000 --- a/linphone/mediastreamer2/src/winsnd2.c +++ /dev/null @@ -1,1593 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef UNICODE -#define UNICODE -#endif - -#include "mediastreamer2/mssndcard.h" -#include "mediastreamer2/msfilter.h" -#include "mediastreamer2/msticker.h" - -#include -#ifdef _MSC_VER -#include -#endif -#include - -#if defined(_WIN32_WCE) -/*#define DISABLE_SPEEX */ -/*#define WCE_OPTICON_WORKAROUND 1000 */ -#endif -#ifndef DISABLE_SPEEX -#include -#endif - -#define WINSND_NBUFS 10 -#define WINSND_OUT_NBUFS 20 -#define WINSND_NSAMPLES 160 -#define WINSND_MINIMUMBUFFER 5 - -static MSFilter *ms_winsnd_read_new(MSSndCard *card); -static MSFilter *ms_winsnd_write_new(MSSndCard *card); - -typedef struct WinSndCard{ - int in_devid; - int out_devid; - int removed; -}WinSndCard; - -static void winsndcard_set_level(MSSndCard *card, MSSndCardMixerElem e, int percent){ - WinSndCard *d=(WinSndCard*)card->data; - - UINT uMixerID; - DWORD dwMixerHandle; - MIXERLINE MixerLine; - MIXERLINE Line; - UINT uLineIndex; - - MIXERLINECONTROLS mlc = {0}; - MIXERCONTROL mc = {0}; - MIXERCONTROLDETAILS mcd = {0}; - MIXERCONTROLDETAILS_UNSIGNED mcdu = {0}; - - MMRESULT mr = MMSYSERR_NOERROR; - DWORD dwVolume = ((0xFFFF) * percent) / 100; - - WORD wLeftVol, wRightVol; - DWORD dwNewVol; - wLeftVol = LOWORD(dwVolume); // get higher WORD - wRightVol = LOWORD(dwVolume); // get lower WORD - - dwNewVol = MAKELONG(wLeftVol, wRightVol); - - switch(e){ - case MS_SND_CARD_PLAYBACK: - case MS_SND_CARD_MASTER: - { - mr = mixerGetID( (HMIXEROBJ)d->out_devid, &uMixerID, MIXER_OBJECTF_WAVEOUT ); - if ( mr != MMSYSERR_NOERROR ) - { - ms_error("winsndcard_set_level: mixerGetID failed. (0x%x)", mr); - return; - } - mr = mixerOpen( (LPHMIXER)&dwMixerHandle, uMixerID, 0L, 0L, 0L ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_level: mixerOpen failed. (0x%x)", mr); - return; - } - memset( &MixerLine, 0, sizeof(MIXERLINE) ); - MixerLine.cbStruct = sizeof(MIXERLINE); - if (MS_SND_CARD_MASTER==e) - MixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS; - else - MixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &MixerLine, MIXER_GETLINEINFOF_COMPONENTTYPE ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_level: mixerGetLineInfo failed. (0x%x)", mr); - return; - } - - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - mlc.cbStruct = sizeof(MIXERLINECONTROLS); - mlc.dwLineID = MixerLine.dwLineID; - mlc.dwControlType = MIXERCONTROL_CONTROLTYPE_VOLUME; - mlc.cControls = 1; - mlc.pamxctrl = &mc; - mlc.cbmxctrl = sizeof(MIXERCONTROL); - mr = mixerGetLineControls((HMIXEROBJ)dwMixerHandle, - &mlc, MIXER_GETLINECONTROLSF_ONEBYTYPE); - - - mcdu.dwValue = 65535*percent/100; /* the volume is a number between 0 and 65535 */ - - mcd.cbStruct = sizeof(MIXERCONTROLDETAILS); - mcd.hwndOwner = 0; - mcd.dwControlID = mc.dwControlID; - mcd.paDetails = &mcdu; - mcd.cbDetails = sizeof(MIXERCONTROLDETAILS_UNSIGNED); - mcd.cChannels = 1; - mr = mixerSetControlDetails((HMIXEROBJ)dwMixerHandle, - &mcd, MIXER_SETCONTROLDETAILSF_VALUE); - - if (mr != MMSYSERR_NOERROR) - { - ms_error("winsndcard_set_level: mixerSetControlDetails failed. (0x%x)", mr); - return; - } - } - break; - case MS_SND_CARD_CAPTURE: - mr = mixerGetID( (HMIXEROBJ)d->in_devid, &uMixerID, MIXER_OBJECTF_WAVEIN ); - if ( mr != MMSYSERR_NOERROR ) - { - ms_error("winsndcard_set_level: mixerGetID failed. (0x%x)", mr); - return; - } - mr = mixerOpen( (LPHMIXER)&dwMixerHandle, uMixerID, 0L, 0L, 0L ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_level: mixerGetLineInfo failed. (0x%x)", mr); - return; - } - memset( &MixerLine, 0, sizeof(MIXERLINE) ); - MixerLine.cbStruct = sizeof(MIXERLINE); - MixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_WAVEIN; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &MixerLine, MIXER_GETLINEINFOF_COMPONENTTYPE ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_level: mixerGetLineInfo failed. (0x%x)", mr); - return; - } - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - mlc.cbStruct = sizeof(MIXERLINECONTROLS); - mlc.dwLineID = MixerLine.dwLineID; - mlc.dwControlType = MIXERCONTROL_CONTROLTYPE_VOLUME; - mlc.cControls = 1; - mlc.pamxctrl = &mc; - mlc.cbmxctrl = sizeof(MIXERCONTROL); - mr = mixerGetLineControls((HMIXEROBJ)dwMixerHandle, - &mlc, MIXER_GETLINECONTROLSF_ONEBYTYPE); - - if (mr == MMSYSERR_NOERROR) - { - mcdu.dwValue = 65535*percent/100; /* the volume is a number between 0 and 65535 */ - - mcd.cbStruct = sizeof(MIXERCONTROLDETAILS); - mcd.hwndOwner = 0; - mcd.dwControlID = mc.dwControlID; - mcd.paDetails = &mcdu; - mcd.cbDetails = sizeof(MIXERCONTROLDETAILS_UNSIGNED); - mcd.cChannels = 1; - mr = mixerSetControlDetails((HMIXEROBJ)dwMixerHandle, - &mcd, MIXER_SETCONTROLDETAILSF_VALUE); - - if (mr == MMSYSERR_NOERROR) - { - return; - } - ms_error("winsndcard_set_level: mixerSetControlDetails failed. (0x%x)", mr); - ms_warning("winsndcard_set_level: control the SRC_MICROPHONE instead"); - } - else - { - ms_error("winsndcard_set_level: mixerGetLineControls failed. (0x%x)", mr); - ms_warning("winsndcard_set_level: control the SRC_MICROPHONE instead"); - } - - /* In case capture doesn't work: use the SRC_MICROPHONE volume */ - - for (uLineIndex = 0; uLineIndex < MixerLine.cConnections; uLineIndex++) - { - memset( &Line, 0, sizeof(MIXERLINE) ); - Line.cbStruct = sizeof(MIXERLINE); - Line.dwDestination = MixerLine.dwDestination; - Line.dwSource = uLineIndex; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &Line, MIXER_GETLINEINFOF_LINEID); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_level: mixerGetLineInfo failed. (0x%x)", mr); - return; - } - - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("LineID: %d\n", MixerLine.dwLineID); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - memset( &Line, 0, sizeof(MIXERLINE) ); - Line.cbStruct = sizeof(MIXERLINE); - Line.dwDestination = MixerLine.dwDestination; - Line.dwSource = uLineIndex; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &Line, MIXER_GETLINEINFOF_SOURCE); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_level: mixerGetLineInfo failed. (0x%x)", mr); - return; - } - - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("LineID: %d\n", MixerLine.dwLineID); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - if (MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE == Line.dwComponentType) - { - LPMIXERCONTROL pmxctrl = (LPMIXERCONTROL)malloc(sizeof(MIXERCONTROL)); - MIXERLINECONTROLS mxlctrl = {sizeof(mxlctrl), Line.dwLineID, MIXERCONTROL_CONTROLTYPE_VOLUME, 1, sizeof(MIXERCONTROL), pmxctrl}; - if(!mixerGetLineControls((HMIXEROBJ)dwMixerHandle, &mxlctrl, - MIXER_GETLINECONTROLSF_ONEBYTYPE)){ - DWORD cChannels = Line.cChannels; - LPMIXERCONTROLDETAILS_UNSIGNED pUnsigned; - MIXERCONTROLDETAILS mxcd; - if (MIXERCONTROL_CONTROLF_UNIFORM & pmxctrl->fdwControl) - cChannels = 1; - pUnsigned = - (LPMIXERCONTROLDETAILS_UNSIGNED) - malloc(cChannels * sizeof(MIXERCONTROLDETAILS_UNSIGNED)); - - mxcd.cbStruct = sizeof(mxcd); - mxcd.dwControlID = pmxctrl->dwControlID; - mxcd.cChannels = cChannels; - mxcd.hwndOwner = (HWND)0; - mxcd.cbDetails = sizeof(MIXERCONTROLDETAILS_UNSIGNED); - mxcd.paDetails = (LPVOID) pUnsigned; - - mixerGetControlDetails((HMIXEROBJ)dwMixerHandle, &mxcd, - MIXER_SETCONTROLDETAILSF_VALUE); - pUnsigned[0].dwValue = pUnsigned[cChannels - 1].dwValue - = pmxctrl->Bounds.dwMaximum*percent/100; - mixerSetControlDetails((HMIXEROBJ)dwMixerHandle, &mxcd, - MIXER_SETCONTROLDETAILSF_VALUE); - free(pmxctrl); - free(pUnsigned); - } - else - free(pmxctrl); - } - } - mixerClose( (HMIXER)dwMixerHandle ); - if (mr != MMSYSERR_NOERROR) - { - ms_error("winsndcard_set_level: mixerClose failed. (0x%x)", mr); - return; - } - break; - default: - ms_warning("winsnd_card_set_level: unsupported command."); - } -} - -static int winsndcard_get_level(MSSndCard *card, MSSndCardMixerElem e){ - WinSndCard *d=(WinSndCard*)card->data; - - UINT uMixerID; - DWORD dwMixerHandle; - MIXERLINE MixerLine; - MIXERLINE Line; - UINT uLineIndex; - - MIXERLINECONTROLS mlc = {0}; - MIXERCONTROL mc = {0}; - MIXERCONTROLDETAILS mcd = {0}; - MIXERCONTROLDETAILS_UNSIGNED mcdu = {0}; - - MMRESULT mr = MMSYSERR_NOERROR; - int percent; - - switch(e){ - case MS_SND_CARD_MASTER: - case MS_SND_CARD_PLAYBACK: - { - mr = mixerGetID( (HMIXEROBJ)d->out_devid, &uMixerID, MIXER_OBJECTF_WAVEOUT ); - if ( mr != MMSYSERR_NOERROR ) - { - ms_error("winsndcard_get_level: mixerGetID failed. (0x%x)", mr); - return -1; - } - mr = mixerOpen( (LPHMIXER)&dwMixerHandle, uMixerID, 0L, 0L, 0L ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_get_level: mixerOpen failed. (0x%x)", mr); - return -1; - } - memset( &MixerLine, 0, sizeof(MIXERLINE) ); - MixerLine.cbStruct = sizeof(MIXERLINE); - if (MS_SND_CARD_MASTER==e) - MixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS; - else - MixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &MixerLine, MIXER_GETLINEINFOF_COMPONENTTYPE ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_get_level: mixerGetLineInfo failed. (0x%x)", mr); - return -1; - } - - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - mlc.cbStruct = sizeof(MIXERLINECONTROLS); - mlc.dwLineID = MixerLine.dwLineID; - mlc.dwControlType = MIXERCONTROL_CONTROLTYPE_VOLUME; - mlc.cControls = 1; - mlc.pamxctrl = &mc; - mlc.cbmxctrl = sizeof(MIXERCONTROL); - mr = mixerGetLineControls((HMIXEROBJ)dwMixerHandle, - &mlc, MIXER_GETLINECONTROLSF_ONEBYTYPE); - if (mr != MMSYSERR_NOERROR) - { - ms_error("winsndcard_get_level: mixerGetLineControls failed. (0x%x)", mr); - return -1; - } - - mcd.cbStruct = sizeof(MIXERCONTROLDETAILS); - mcd.hwndOwner = 0; - mcd.dwControlID = mc.dwControlID; - mcd.paDetails = &mcdu; - mcd.cbDetails = sizeof(MIXERCONTROLDETAILS_UNSIGNED); - mcd.cChannels = 1; - mr = mixerGetControlDetails((HMIXEROBJ)dwMixerHandle, &mcd, - MIXER_SETCONTROLDETAILSF_VALUE); - percent = (mcdu.dwValue *100) / (mc.Bounds.dwMaximum); - - if (mr != MMSYSERR_NOERROR) - { - ms_error("winsndcard_get_level: mixerGetControlDetails failed. (0x%x)", mr); - return -1; - } - return percent; - } - break; - case MS_SND_CARD_CAPTURE: - mr = mixerGetID( (HMIXEROBJ)d->in_devid, &uMixerID, MIXER_OBJECTF_WAVEIN ); - if ( mr != MMSYSERR_NOERROR ) - { - ms_error("winsndcard_get_level: mixerGetID failed. (0x%x)", mr); - return -1; - } - mr = mixerOpen( (LPHMIXER)&dwMixerHandle, uMixerID, 0L, 0L, 0L ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_get_level: mixerOpen failed. (0x%x)", mr); - return -1; - } - memset( &MixerLine, 0, sizeof(MIXERLINE) ); - MixerLine.cbStruct = sizeof(MIXERLINE); - MixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_WAVEIN; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &MixerLine, MIXER_GETLINEINFOF_COMPONENTTYPE ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_get_level: mixerGetLineInfo failed. (0x%x)", mr); - return -1; - } - - mlc.cbStruct = sizeof(MIXERLINECONTROLS); - mlc.dwLineID = MixerLine.dwLineID; - mlc.dwControlType = MIXERCONTROL_CONTROLTYPE_VOLUME; - mlc.cControls = 1; - mlc.pamxctrl = &mc; - mlc.cbmxctrl = sizeof(MIXERCONTROL); - mr = mixerGetLineControls((HMIXEROBJ)dwMixerHandle, - &mlc, MIXER_GETLINECONTROLSF_ONEBYTYPE); - if (mr == MMSYSERR_NOERROR) - { - mcd.cbStruct = sizeof(MIXERCONTROLDETAILS); - mcd.hwndOwner = 0; - mcd.dwControlID = mc.dwControlID; - mcd.paDetails = &mcdu; - mcd.cbDetails = sizeof(MIXERCONTROLDETAILS_UNSIGNED); - mcd.cChannels = 1; - mr = mixerGetControlDetails((HMIXEROBJ)dwMixerHandle, &mcd, - MIXER_SETCONTROLDETAILSF_VALUE); - percent = (mcdu.dwValue *100) / (mc.Bounds.dwMaximum); - - if (mr == MMSYSERR_NOERROR) - { - return percent; - } - ms_error("winsndcard_get_level: mixerGetControlDetails failed. (0x%x)", mr); - ms_warning("winsndcard_get_level: control the SRC_MICROPHONE instead"); - } - else - { - ms_error("winsndcard_get_level: mixerGetLineControls failed. (0x%x)", mr); - ms_warning("winsndcard_get_level: control the SRC_MICROPHONE instead"); - } - - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - for (uLineIndex = 0; uLineIndex < MixerLine.cConnections; uLineIndex++) - { - memset( &Line, 0, sizeof(MIXERLINE) ); - Line.cbStruct = sizeof(MIXERLINE); - Line.dwDestination = MixerLine.dwDestination; - Line.dwSource = uLineIndex; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &Line, MIXER_GETLINEINFOF_LINEID); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_get_level: mixerGetLineInfo failed. (0x%x)", mr); - return -1; - } - - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("LineID: %d\n", MixerLine.dwLineID); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - memset( &Line, 0, sizeof(MIXERLINE) ); - Line.cbStruct = sizeof(MIXERLINE); - Line.dwDestination = MixerLine.dwDestination; - Line.dwSource = uLineIndex; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &Line, MIXER_GETLINEINFOF_SOURCE); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_get_level: mixerGetLineInfo failed. (0x%x)", mr); - return -1; - } - - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("LineID: %d\n", MixerLine.dwLineID); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - if (MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE == Line.dwComponentType) - { - LPMIXERCONTROL pmxctrl = (LPMIXERCONTROL)malloc(sizeof(MIXERCONTROL)); - MIXERLINECONTROLS mxlctrl = {sizeof(mxlctrl), Line.dwLineID, MIXERCONTROL_CONTROLTYPE_VOLUME, 1, sizeof(MIXERCONTROL), pmxctrl}; - if(!mixerGetLineControls((HMIXEROBJ)dwMixerHandle, &mxlctrl, - MIXER_GETLINECONTROLSF_ONEBYTYPE)){ - DWORD cChannels = Line.cChannels; - LPMIXERCONTROLDETAILS_UNSIGNED pUnsigned; - MIXERCONTROLDETAILS mxcd; - if (MIXERCONTROL_CONTROLF_UNIFORM & pmxctrl->fdwControl) - cChannels = 1; - pUnsigned = - (LPMIXERCONTROLDETAILS_UNSIGNED) - malloc(cChannels * sizeof(MIXERCONTROLDETAILS_UNSIGNED)); - - mxcd.cbStruct = sizeof(mxcd); - mxcd.dwControlID = pmxctrl->dwControlID; - mxcd.cChannels = cChannels; - mxcd.hwndOwner = (HWND)0; - mxcd.cbDetails = sizeof(MIXERCONTROLDETAILS_UNSIGNED); - mxcd.paDetails = (LPVOID) pUnsigned; - - mixerGetControlDetails((HMIXEROBJ)dwMixerHandle, &mxcd, - MIXER_SETCONTROLDETAILSF_VALUE); - percent = (pUnsigned[0].dwValue *100) / (pmxctrl->Bounds.dwMaximum); - free(pmxctrl); - free(pUnsigned); - } - else - free(pmxctrl); - } - } - mixerClose( (HMIXER)dwMixerHandle ); - if (mr != MMSYSERR_NOERROR) - { - ms_error("winsndcard_get_level: mixerClose failed. (0x%x)", mr); - return -1; - } - return percent; - break; - default: - ms_warning("winsndcard_get_level: unsupported command."); - return -1; - } - return -1; -} - -static void winsndcard_set_source(MSSndCard *card, MSSndCardCapture source){ - - switch(source){ - case MS_SND_CARD_MIC: - break; - case MS_SND_CARD_LINE: - break; - } -} - -static int winsndcard_set_control(MSSndCard *card, MSSndCardControlElem e, int val){ - WinSndCard *d=(WinSndCard*)card->data; - - UINT uMixerID; - DWORD dwMixerHandle; - MIXERLINE MixerLine; - MIXERLINE Line; - UINT uLineIndex; - - MIXERLINECONTROLS mlc = {0}; - MIXERCONTROL mc = {0}; - MIXERCONTROLDETAILS mcd = {0}; - MIXERCONTROLDETAILS_BOOLEAN bMute; - - MMRESULT mr = MMSYSERR_NOERROR; - - switch(e){ - case MS_SND_CARD_CAPTURE_MUTE: - - bMute.fValue = (val>0); - - mr = mixerGetID( (HMIXEROBJ)d->in_devid, &uMixerID, MIXER_OBJECTF_WAVEIN ); - if ( mr != MMSYSERR_NOERROR ) - { - ms_error("winsndcard_set_control: mixerGetID failed. (0x%x)", mr); - return -1; - } - mr = mixerOpen( (LPHMIXER)&dwMixerHandle, uMixerID, 0L, 0L, 0L ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_control: mixerOpen failed. (0x%x)", mr); - return -1; - } - memset( &MixerLine, 0, sizeof(MIXERLINE) ); - MixerLine.cbStruct = sizeof(MIXERLINE); - MixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_WAVEIN; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &MixerLine, MIXER_GETLINEINFOF_COMPONENTTYPE ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_control: mixerGetLineInfo failed. (0x%x)", mr); - return -1; - } - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - for (uLineIndex = 0; uLineIndex < MixerLine.cConnections; uLineIndex++) - { - memset( &Line, 0, sizeof(MIXERLINE) ); - Line.cbStruct = sizeof(MIXERLINE); - Line.dwDestination = MixerLine.dwDestination; - Line.dwSource = uLineIndex; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &Line, MIXER_GETLINEINFOF_LINEID); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_control: mixerGetLineInfo failed. (0x%x)", mr); - return -1; - } - - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("LineID: %d\n", MixerLine.dwLineID); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - memset( &Line, 0, sizeof(MIXERLINE) ); - Line.cbStruct = sizeof(MIXERLINE); - Line.dwDestination = MixerLine.dwDestination; - Line.dwSource = uLineIndex; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &Line, MIXER_GETLINEINFOF_SOURCE); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_control: mixerGetLineInfo failed. (0x%x)", mr); - return -1; - } - - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("LineID: %d\n", MixerLine.dwLineID); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - if (MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE == Line.dwComponentType) - { - /* unmute */ - /* Find a mute control, if any, of the microphone line */ - - LPMIXERCONTROL pmxctrl = (LPMIXERCONTROL)malloc(sizeof(MIXERCONTROL)); - MIXERLINECONTROLS mxlctrl = {sizeof(mxlctrl), Line.dwLineID, MIXERCONTROL_CONTROLTYPE_MUTE, 1, sizeof(MIXERCONTROL), pmxctrl}; - if(!mixerGetLineControls((HMIXEROBJ)dwMixerHandle, &mxlctrl, MIXER_GETLINECONTROLSF_ONEBYTYPE)){ - DWORD cChannels = Line.cChannels; - LPMIXERCONTROLDETAILS_BOOLEAN pbool; - MIXERCONTROLDETAILS mxcd; - - if (MIXERCONTROL_CONTROLF_UNIFORM & pmxctrl->fdwControl) - cChannels = 1; - pbool = (LPMIXERCONTROLDETAILS_BOOLEAN) malloc(cChannels * sizeof( - MIXERCONTROLDETAILS_BOOLEAN)); - - mxcd.cbStruct = sizeof(mxcd); - mxcd.dwControlID = pmxctrl->dwControlID; - mxcd.cChannels = cChannels; - mxcd.hwndOwner = (HWND)0; - mxcd.cbDetails = sizeof(MIXERCONTROLDETAILS_BOOLEAN); - mxcd.paDetails = (LPVOID) pbool; - - mixerGetControlDetails((HMIXEROBJ)dwMixerHandle, &mxcd, - MIXER_SETCONTROLDETAILSF_VALUE); - /* Unmute the microphone line (for both channels) */ - pbool[0].fValue = pbool[cChannels - 1].fValue = val; /* 0 -> unmute; */ - mixerSetControlDetails((HMIXEROBJ)dwMixerHandle, &mxcd, - MIXER_SETCONTROLDETAILSF_VALUE); - free(pmxctrl); - free(pbool); - } - else - free(pmxctrl); - } - } - mixerClose( (HMIXER)dwMixerHandle ); - if (mr != MMSYSERR_NOERROR) - { - ms_error("winsndcard_set_control: mixerClose failed. (0x%x)", mr); - return -1; - } - return 0; - - case MS_SND_CARD_MASTER_MUTE: - case MS_SND_CARD_PLAYBACK_MUTE: - { - bMute.fValue = (val>0); - - mr = mixerGetID( (HMIXEROBJ)d->out_devid, &uMixerID, MIXER_OBJECTF_WAVEOUT ); - if ( mr != MMSYSERR_NOERROR ) - { - ms_error("winsndcard_set_control: mixerGetID failed. (0x%x)", mr); - return -1; - } - mr = mixerOpen( (LPHMIXER)&dwMixerHandle, uMixerID, 0L, 0L, 0L ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_control: mixerOpen failed. (0x%x)", mr); - return -1; - } - memset( &MixerLine, 0, sizeof(MIXERLINE) ); - MixerLine.cbStruct = sizeof(MIXERLINE); - if (MS_SND_CARD_MASTER_MUTE==e) - MixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS; - else - MixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &MixerLine, MIXER_GETLINEINFOF_COMPONENTTYPE ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_control: mixerSetControlDetails failed. (0x%x)", mr); - return -1; - } - - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - mlc.cbStruct = sizeof(MIXERLINECONTROLS); - mlc.dwLineID = MixerLine.dwLineID; - mlc.dwControlType = MIXERCONTROL_CONTROLTYPE_MUTE; //MIXERCONTROL_CONTROLTYPE_VOLUME; - mlc.cControls = 1; - mlc.pamxctrl = &mc; - mlc.cbmxctrl = sizeof(MIXERCONTROL); - mr = mixerGetLineControls((HMIXEROBJ)dwMixerHandle, - &mlc, MIXER_GETLINECONTROLSF_ONEBYTYPE); - - mcd.cbStruct = sizeof(MIXERCONTROLDETAILS); - mcd.hwndOwner = 0; - mcd.dwControlID = mc.dwControlID; - mcd.paDetails = &bMute; - mcd.cbDetails = sizeof(MIXERCONTROLDETAILS_BOOLEAN); - mcd.cChannels = 1; - mr = mixerSetControlDetails((HMIXEROBJ)dwMixerHandle, - &mcd, MIXER_SETCONTROLDETAILSF_VALUE); - - if (mr != MMSYSERR_NOERROR) - { - ms_error("winsndcard_set_control: mixerSetControlDetails failed. (0x%x)", mr); - return -1; - } - return 0; - } - break; - default: - ms_warning("winsndcard_set_control: unsupported command."); - } - return -1; -} - -static int winsndcard_get_control(MSSndCard *card, MSSndCardControlElem e){ - WinSndCard *d=(WinSndCard*)card->data; - return -1; -} - -static void winsndcard_init(MSSndCard *card){ - WinSndCard *c=(WinSndCard *)ms_new(WinSndCard,1); - c->removed=0; - card->data=c; -} - -static void winsndcard_uninit(MSSndCard *card){ - ms_free(card->data); -} - -static void winsndcard_detect(MSSndCardManager *m); -static MSSndCard *winsndcard_dup(MSSndCard *obj); -static void winsndcard_unload(MSSndCardManager *m); - -MSSndCardDesc winsnd_card_desc={ - "MME", - winsndcard_detect, - winsndcard_init, - winsndcard_set_level, - winsndcard_get_level, - winsndcard_set_source, - winsndcard_set_control, - winsndcard_get_control, - ms_winsnd_read_new, - ms_winsnd_write_new, - winsndcard_uninit, - winsndcard_dup, - winsndcard_unload -}; - -static MSSndCard *winsndcard_dup(MSSndCard *obj){ - MSSndCard *card=ms_snd_card_new(&winsnd_card_desc); - card->name=ms_strdup(obj->name); - card->data=ms_new(WinSndCard,1); - memcpy(card->data,obj->data,sizeof(WinSndCard)); - return card; -} - -static MSSndCard *winsndcard_new(const char *name, int in_dev, int out_dev, unsigned cap){ - MSSndCard *card=ms_snd_card_new(&winsnd_card_desc); - WinSndCard *d=(WinSndCard*)card->data; - card->name=ms_strdup(name); - d->in_devid=in_dev; - d->out_devid=out_dev; - card->capabilities=cap; - return card; -} - -static void add_or_update_card(MSSndCardManager *m, const char *name, int indev, int outdev, unsigned int capability){ - MSSndCard *card; - const MSList *elem=ms_snd_card_manager_get_list(m); - for(;elem!=NULL;elem=elem->next){ - card=(MSSndCard*)elem->data; - if (strcmp(card->desc->driver_type, winsnd_card_desc.driver_type)==0 - && strcmp(card->name,name)==0){ - /*update already entered card */ - WinSndCard *d=(WinSndCard*)card->data; - card->capabilities|=capability; - if (indev!=-1) - d->in_devid=indev; - if (outdev!=-1) - d->out_devid=outdev; - d->removed=0; - return; - } - } - /* add this new card:*/ - ms_snd_card_manager_add_card(m,winsndcard_new(name,indev,outdev,capability)); -} - - -static void _winsndcard_detect(MSSndCardManager *m){ - MMRESULT mr = NOERROR; - unsigned int nOutDevices = waveOutGetNumDevs (); - unsigned int nInDevices = waveInGetNumDevs (); - unsigned int item; - - if (nOutDevices>nInDevices) - nInDevices = nOutDevices; - - for (item = 0; item < nInDevices; item++){ - - WAVEINCAPS incaps; - WAVEOUTCAPS outcaps; - mr = waveInGetDevCaps (item, &incaps, sizeof (WAVEINCAPS)); - if (mr == MMSYSERR_NOERROR) - { -#if defined(_WIN32_WCE) - char card[256]; - snprintf(card, sizeof(card), "Input card %i", item); - add_or_update_card(m,card,item,-1,MS_SND_CARD_CAP_CAPTURE); - /* _tprintf(L"new card: %s", incaps.szPname); */ -#else - char szName[256]; - WideCharToMultiByte(CP_UTF8,0,incaps.szPname,-1,szName,256,0,0); - add_or_update_card(m,szName,item,-1,MS_SND_CARD_CAP_CAPTURE); -#endif - } - mr = waveOutGetDevCaps (item, &outcaps, sizeof (WAVEOUTCAPS)); - if (mr == MMSYSERR_NOERROR) - { -#if defined(_WIN32_WCE) - char card[256]; - snprintf(card, sizeof(card), "Output card %i", item); - add_or_update_card(m,card,-1,item,MS_SND_CARD_CAP_PLAYBACK); - /* _tprintf(L"new card: %s", outcaps.szPname); */ -#else - char szName[256]; - WideCharToMultiByte(CP_UTF8,0,outcaps.szPname,-1,szName,256,0,0); - add_or_update_card(m,szName,-1,item,MS_SND_CARD_CAP_PLAYBACK); -#endif - } - } -} - -static void deactivate_removed_cards(MSSndCardManager *m){ - MSSndCard *card; - const MSList *elem=ms_snd_card_manager_get_list(m); - for(;elem!=NULL;elem=elem->next){ - card=(MSSndCard*)elem->data; - if (strcmp(card->desc->driver_type, winsnd_card_desc.driver_type)==0){ - /*mark all cards as potentially removed, detect will check them immediately after */ - WinSndCard *d=(WinSndCard*)card->data; - if (d->removed) card->capabilities=0; - } - } -} - -static void mark_as_removed(MSSndCardManager *m){ - MSSndCard *card; - const MSList *elem=ms_snd_card_manager_get_list(m); - for(;elem!=NULL;elem=elem->next){ - card=(MSSndCard*)elem->data; - if (strcmp(card->desc->driver_type, winsnd_card_desc.driver_type)==0){ - /*mark all cards as potentially removed, detect will check them immediately after */ - WinSndCard *d=(WinSndCard*)card->data; - d->removed=1; - } - } -} - -static ms_thread_t poller_thread=NULL; -static bool_t poller_running=TRUE; - -static void * new_device_polling_thread(void *ignore){ - MSSndCardManager *m; - /*check for new devices every 5 seconds*/ - while(poller_running){ - ms_sleep(5); - if (poller_running){ - m=ms_snd_card_manager_get(); - if(!m) break; - mark_as_removed(m); - _winsndcard_detect(m); - deactivate_removed_cards(m); - } - } - return NULL; -} - -static void stop_poller(){ - poller_running=FALSE; - ms_thread_join(poller_thread,NULL); - poller_thread=NULL; -} - -static void winsndcard_unload(MSSndCardManager *m){ - stop_poller(); -} - -static void winsndcard_detect(MSSndCardManager *m){ - _winsndcard_detect(m); - if (poller_thread==NULL) - ms_thread_create(&poller_thread,NULL,new_device_polling_thread,NULL); -} - -typedef struct WinSnd{ - int dev_id; - HWAVEIN indev; - HWAVEOUT outdev; - WAVEFORMATEX wfx; - WAVEHDR hdrs_read[WINSND_NBUFS]; - WAVEHDR hdrs_write[WINSND_OUT_NBUFS]; - queue_t rq; - ms_mutex_t mutex; - uint64_t bytes_read; - unsigned int nbufs_playing; - bool_t running; - - int32_t stat_input; - int32_t stat_output; - int32_t stat_notplayed; - - int32_t stat_minimumbuffer; - - queue_t write_rq; -#ifndef DISABLE_SPEEX - SpeexPreprocessState *pst; - int pst_frame_size; -#endif - int ready; - int workaround; /* workaround for opticon audio device */ -}WinSnd; - -static void winsnd_apply_settings(WinSnd *d){ - d->wfx.nBlockAlign=d->wfx.nChannels*d->wfx.wBitsPerSample/8; - d->wfx.nAvgBytesPerSec=d->wfx.nSamplesPerSec*d->wfx.nBlockAlign; -} - - -/*#define _TRUE_TIME*/ -#ifndef _TRUE_TIME -static uint64_t winsnd_get_cur_time( void *data){ - WinSnd *d=(WinSnd*)data; - uint64_t curtime=(d->bytes_read*1000)/(uint64_t)d->wfx.nAvgBytesPerSec; - /* ms_debug("winsnd_get_cur_time: bytes_read=%u return %lu\n",d->bytes_read,(unsigned long)curtime); */ - return curtime; -} -#endif - - -static void winsnd_init(MSFilter *f){ - WinSnd *d=(WinSnd *)ms_new0(WinSnd,1); - d->wfx.wFormatTag = WAVE_FORMAT_PCM; - d->wfx.cbSize = 0; - d->wfx.nAvgBytesPerSec = 16000; - d->wfx.nBlockAlign = 2; - d->wfx.nChannels = 1; - d->wfx.nSamplesPerSec = 8000; - d->wfx.wBitsPerSample = 16; - qinit(&d->rq); - qinit(&d->write_rq); -#ifndef DISABLE_SPEEX - d->pst=NULL; - d->pst_frame_size=0; -#endif - d->ready=0; - d->workaround=0; - ms_mutex_init(&d->mutex,NULL); - f->data=d; - - d->stat_input=0; - d->stat_output=0; - d->stat_notplayed=0; - d->stat_minimumbuffer=WINSND_MINIMUMBUFFER; -} - -static void winsnd_uninit(MSFilter *f){ - WinSnd *d=(WinSnd*)f->data; - flushq(&d->rq,0); - flushq(&d->write_rq,0); -#ifndef DISABLE_SPEEX - if (d->pst!=NULL) - speex_preprocess_state_destroy(d->pst); - d->pst=NULL; - d->pst_frame_size=0; -#endif - d->ready=0; - d->workaround=0; - ms_mutex_destroy(&d->mutex); - ms_free(f->data); -} - -static void add_input_buffer(WinSnd *d, WAVEHDR *hdr, int buflen){ - mblk_t *m=allocb(buflen,0); - MMRESULT mr; - memset(hdr,0,sizeof(*hdr)); - if (buflen==0) ms_error("add_input_buffer: buflen=0 !"); - hdr->lpData=(LPSTR)m->b_wptr; - hdr->dwBufferLength=buflen; - hdr->dwFlags = 0; - hdr->dwUser = (DWORD)m; - mr = waveInPrepareHeader (d->indev,hdr,sizeof(*hdr)); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveInPrepareHeader() error"); - return ; - } - mr=waveInAddBuffer(d->indev,hdr,sizeof(*hdr)); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveInAddBuffer() error"); - return ; - } -} - -static void CALLBACK -read_callback (HWAVEIN waveindev, UINT uMsg, DWORD dwInstance, DWORD dwParam1, - DWORD dwParam2) -{ - WAVEHDR *wHdr=(WAVEHDR *) dwParam1; - MSFilter *f=(MSFilter *)dwInstance; - WinSnd *d=(WinSnd*)f->data; - mblk_t *m; - int bsize; - switch (uMsg){ - case WIM_OPEN: - ms_debug("read_callback : WIM_OPEN"); - break; - case WIM_CLOSE: - ms_debug("read_callback : WIM_CLOSE"); - break; - case WIM_DATA: - bsize=wHdr->dwBytesRecorded; - if (bsize<=0) { -#if 0 - if (d->running==TRUE) /* avoid adding buffer back when calling waveInReset */ - { - MMRESULT mr; - mr=waveInAddBuffer(d->indev,wHdr,sizeof(*wHdr)); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveInAddBuffer() error"); - return ; - } - ms_warning("read_callback : EMPTY DATA, WIM_DATA (%p,%i)",wHdr,bsize); - } - m=(mblk_t*)wHdr->dwUser; - wHdr->dwUser=0; - freemsg(m); - return; -#endif - } - - /* ms_warning("read_callback : WIM_DATA (%p,%i)",wHdr,bsize); */ - m=(mblk_t*)wHdr->dwUser; - m->b_wptr+=bsize; - wHdr->dwUser=0; - ms_mutex_lock(&d->mutex); - putq(&d->rq,m); - ms_mutex_unlock(&d->mutex); - d->bytes_read+=wHdr->dwBufferLength; - d->stat_input++; - d->stat_input++; -#ifdef WIN32_TIMERS - if (f->ticker->TimeEvent!=NULL) - SetEvent(f->ticker->TimeEvent); -#endif - break; - } -} - - -static void winsnd_read_preprocess(MSFilter *f){ - WinSnd *d=(WinSnd*)f->data; - MMRESULT mr; - int i; - int bsize; - DWORD dwFlag; - - d->stat_input=0; - d->stat_output=0; - d->stat_notplayed=0; - d->stat_minimumbuffer=WINSND_MINIMUMBUFFER; - - winsnd_apply_settings(d); - /* Init Microphone device */ - dwFlag = CALLBACK_FUNCTION | WAVE_FORMAT_DIRECT; - mr = waveInOpen (&d->indev, d->dev_id, &d->wfx, - (DWORD) read_callback, (DWORD)f, dwFlag); - if (mr != MMSYSERR_NOERROR) - { - ms_error("Failed to prepare windows sound device. (waveInOpen:0x%i)", mr); - if (d->dev_id != WAVE_MAPPER) - dwFlag = WAVE_MAPPED | CALLBACK_FUNCTION; - mr = waveInOpen (&d->indev, d->dev_id, &d->wfx, - (DWORD) read_callback, (DWORD)f, dwFlag); - } - if (mr != MMSYSERR_NOERROR) - { - ms_error("Failed to prepare windows sound device. (waveInOpen:0x%i)", mr); - mr = waveInOpen (&d->indev, WAVE_MAPPER, &d->wfx, - (DWORD) read_callback, (DWORD)f, CALLBACK_FUNCTION); - if (mr != MMSYSERR_NOERROR) - { - d->indev=NULL; - ms_error("Failed to prepare windows sound device. (waveInOpen:0x%i)", mr); - return ; - } - } -#ifndef _TRUE_TIME - ms_mutex_lock(&f->ticker->lock); - ms_ticker_set_time_func(f->ticker,winsnd_get_cur_time,d); - ms_mutex_unlock(&f->ticker->lock); -#endif - - bsize=WINSND_NSAMPLES*d->wfx.nAvgBytesPerSec/8000; - ms_debug("Using input buffers of %i bytes",bsize); - for(i=0;ihdrs_read[i]; - add_input_buffer(d,hdr,bsize); - } - d->running=TRUE; - mr=waveInStart(d->indev); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveInStart() error"); -#ifndef _TRUE_TIME - ms_mutex_lock(&f->ticker->lock); - ms_ticker_set_time_func(f->ticker,NULL,NULL); - ms_mutex_unlock(&f->ticker->lock); -#endif - return ; - } -} - -static void winsnd_read_postprocess(MSFilter *f){ - WinSnd *d=(WinSnd*)f->data; - MMRESULT mr; - int i; -#ifndef _TRUE_TIME - ms_mutex_lock(&f->ticker->lock); - ms_ticker_set_time_func(f->ticker,NULL,NULL); - ms_mutex_unlock(&f->ticker->lock); -#endif - d->running=FALSE; - mr=waveInStop(d->indev); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveInStop() error"); - return ; - } - mr=waveInReset(d->indev); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveInReset() error"); - return ; - } - for(i=0;ihdrs_read[i]; - if (hdr->dwFlags & WHDR_PREPARED) - { - mr = waveInUnprepareHeader(d->indev,hdr,sizeof (*hdr)); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveInUnPrepareHeader() error"); - } - } - } - mr = waveInClose(d->indev); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveInClose() error"); - return ; - } - - ms_message("Shutting down sound device (playing: %i) (input-output: %i) (notplayed: %i)", d->nbufs_playing, d->stat_input - d->stat_output, d->stat_notplayed); - flushq(&d->rq,0); -} - -static void winsnd_read_process(MSFilter *f){ - WinSnd *d=(WinSnd*)f->data; - mblk_t *m; - int i; - ms_mutex_lock(&d->mutex); - while((m=getq(&d->rq))!=NULL){ - ms_queue_put(f->outputs[0],m); - } - ms_mutex_unlock(&d->mutex); - for(i=0;ihdrs_read[i]; - if (hdr->dwUser==0) { - MMRESULT mr; - mr=waveInUnprepareHeader(d->indev,hdr,sizeof(*hdr)); - if (mr!=MMSYSERR_NOERROR) - ms_warning("winsnd_read_process: Fail to unprepare header!"); - add_input_buffer(d,hdr,hdr->dwBufferLength); - } - } -} - -static void CALLBACK -write_callback(HWAVEOUT outdev, UINT uMsg, DWORD dwInstance, - DWORD dwParam1, DWORD dwParam2) -{ - WAVEHDR *hdr=(WAVEHDR *) dwParam1; - WinSnd *d=(WinSnd*)dwInstance; - - switch (uMsg){ - case WOM_OPEN: - break; - case WOM_CLOSE: - case WOM_DONE: - if (hdr){ - d->nbufs_playing--; - } - if (d->stat_output==0) - { - d->stat_input=1; /* reset */ - d->stat_notplayed=0; - } - d->stat_output++; - break; - } -} - -static void winsnd_write_preprocess(MSFilter *f){ - WinSnd *d=(WinSnd*)f->data; - MMRESULT mr; - DWORD dwFlag; - int i; - - d->stat_input=0; - d->stat_output=0; - d->stat_notplayed=0; - d->stat_minimumbuffer=WINSND_MINIMUMBUFFER; - - winsnd_apply_settings(d); - /* Init Microphone device */ - dwFlag = CALLBACK_FUNCTION | WAVE_FORMAT_DIRECT; - mr = waveOutOpen (&d->outdev, d->dev_id, &d->wfx, - (DWORD) write_callback, (DWORD)d, dwFlag); - if (mr != MMSYSERR_NOERROR) - { - ms_error("Failed to open windows sound device %i. (waveOutOpen:0x%i)",d->dev_id, mr); - if (d->dev_id != WAVE_MAPPER) - dwFlag = WAVE_MAPPED | CALLBACK_FUNCTION; - mr = waveOutOpen (&d->outdev, d->dev_id, &d->wfx, - (DWORD) write_callback, (DWORD)d, dwFlag); - } - if (mr != MMSYSERR_NOERROR) - { - ms_error("Failed to open windows sound device %i. (waveOutOpen:0x%i)",d->dev_id, mr); - mr = waveOutOpen (&d->outdev, WAVE_MAPPER, &d->wfx, - (DWORD) write_callback, (DWORD)d, CALLBACK_FUNCTION); - if (mr != MMSYSERR_NOERROR) - { - ms_error("Failed to open windows sound device %i. (waveOutOpen:0x%i)",d->dev_id, mr); - d->outdev=NULL; - return ; - } - } - for(i=0;ihdrs_write[i]; - hdr->dwFlags=0; - hdr->dwUser=0; - } -} - -static void winsnd_write_postprocess(MSFilter *f){ - WinSnd *d=(WinSnd*)f->data; - MMRESULT mr; - int i; - if (d->outdev==NULL) return; - mr=waveOutReset(d->outdev); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveOutReset() error"); - return ; - } - for(i=0;ihdrs_write[i]; - mblk_t *old; - if (hdr->dwFlags & WHDR_DONE){ - mr=waveOutUnprepareHeader(d->outdev,hdr,sizeof(*hdr)); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveOutUnprepareHeader error"); - } - old=(mblk_t*)hdr->dwUser; - if (old) freemsg(old); - hdr->dwUser=0; - } - } - mr=waveOutClose(d->outdev); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveOutClose() error"); - return ; - } - ms_message("Shutting down sound device (playing: %i) (d->write_rq.q_mcount=%i) (input-output: %i) (notplayed: %i)", d->nbufs_playing, d->write_rq.q_mcount, d->stat_input - d->stat_output, d->stat_notplayed); - flushq(&d->write_rq,0); - d->ready=0; - d->workaround=0; - -#ifndef DISABLE_SPEEX - if (d->pst!=NULL) - speex_preprocess_state_destroy(d->pst); - d->pst=NULL; - d->pst_frame_size=0; -#endif -} - -static void winsnd_write_process(MSFilter *f){ - WinSnd *d=(WinSnd*)f->data; - mblk_t *m,*old; - MMRESULT mr; - int i; - int discarded=0; - int possible_size=0; - - if (d->outdev==NULL) { - ms_queue_flush(f->inputs[0]); - return; - } - - while((m=ms_queue_get(f->inputs[0]))!=NULL){ - possible_size = msgdsize(m); -#ifndef DISABLE_SPEEX - if (d->pst_frame_size==0) - { - d->pst_frame_size=possible_size; - - d->pst = speex_preprocess_state_init(d->pst_frame_size/2, d->wfx.nSamplesPerSec); - if (d->pst!=NULL) { - float f; - i=1; - speex_preprocess_ctl(d->pst, SPEEX_PREPROCESS_SET_VAD, &i); - i=0; - speex_preprocess_ctl(d->pst, SPEEX_PREPROCESS_SET_DENOISE, &i); - i=0; - speex_preprocess_ctl(d->pst, SPEEX_PREPROCESS_SET_AGC, &i); - f=8000; - speex_preprocess_ctl(d->pst, SPEEX_PREPROCESS_SET_AGC_LEVEL, &f); - i=0; - speex_preprocess_ctl(d->pst, SPEEX_PREPROCESS_SET_DEREVERB, &i); - } - } -#endif - - putq(&d->write_rq,m); - } - -#ifdef AMD_HACK - /* too many sound card are crappy on windows... */ - d->stat_minimumbuffer=15; - if (d->wfx.nSamplesPerSec>=32000) /* better results for high rates */ - d->stat_minimumbuffer=8; -#endif - - if (d->wfx.nSamplesPerSec>=32000) /* better results for high rates */ - { - if (d->nbufs_playing+d->write_rq.q_mcount<4) - { - d->ready=0; - } - } - else - { - if (d->nbufs_playing+d->write_rq.q_mcount<7) - { - d->ready=0; - } - } -#if defined(WCE_OPTICON_WORKAROUND) - if (d->workaround==0) - { - d->workaround=1; - Sleep(WCE_OPTICON_WORKAROUND); - } -#endif - - while((m=peekq(&d->write_rq))!=NULL){ - -#ifndef DISABLE_SPEEX - int vad=1; - if (d->pst!=NULL && msgdsize(m)==d->pst_frame_size && d->pst_frame_size<=4096) - { - char tmp[4096]; - memcpy(tmp, m->b_rptr, msgdsize(m)); - vad = speex_preprocess(d->pst, (short*)tmp, NULL); - - if (d->ready==0) - { - if (vad==0) - { - int missing; - missing = 10 - d->write_rq.q_mcount - d->nbufs_playing; - if (d->wfx.nSamplesPerSec>=32000) /* better results for high rates */ - missing = 6 - d->write_rq.q_mcount - d->nbufs_playing; - - ms_message("WINSND trouble: inserting %i silence", missing); - while(missing>0) - { - old=dupb(m); - putq(&d->write_rq,old); - missing--; - } - } - d->ready=1; - } - } -#else - if (d->ready==0) - { - int missing; - missing = 10 - d->write_rq.q_mcount - d->nbufs_playing; - if (d->wfx.nSamplesPerSec>=32000) /* better results for high rates */ - missing = 6 - d->write_rq.q_mcount - d->nbufs_playing; - ms_message("WINSND trouble: inserting %i silence", missing); - while(missing>0) - { - old=dupb(m); - putq(&d->write_rq,old); - missing--; - } - d->ready=1; - } -#endif - - for(i=0;istat_minimumbuffer;++i){ - WAVEHDR *hdr=&d->hdrs_write[i]; - if (hdr->dwFlags & WHDR_DONE){ - old=(mblk_t*)hdr->dwUser; - mr=waveOutUnprepareHeader(d->outdev,hdr,sizeof(*hdr)); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveOutUnprepareHeader error"); - } - freemsg(old); - hdr->dwUser=0; - } - if (hdr->dwUser==0){ - hdr->lpData=(LPSTR)m->b_rptr; - hdr->dwBufferLength=msgdsize(m); - hdr->dwFlags = 0; - hdr->dwUser = (DWORD)m; - mr = waveOutPrepareHeader(d->outdev,hdr,sizeof(*hdr)); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveOutPrepareHeader() error"); - getq(&d->write_rq); - freemsg(m); - discarded++; - d->stat_notplayed++; - break; - } - mr=waveOutWrite(d->outdev,hdr,sizeof(*hdr)); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveOutWrite() error"); - getq(&d->write_rq); - freemsg(m); - discarded++; - d->stat_notplayed++; - break; - }else { - getq(&d->write_rq); - d->nbufs_playing++; - /* ms_debug("waveOutWrite() done"); */ - } - break; - } - } - if (i==d->stat_minimumbuffer){ - /* ms_error("winsnd_write_process: All buffers are busy."); */ -#ifndef DISABLE_SPEEX - if (d->pst==NULL) - { - /* initial behavior (detection in process?) */ - getq(&d->write_rq); - freemsg(m); - discarded++; - d->stat_notplayed++; - } - else - { - if (vad==0) - { - getq(&d->write_rq); - freemsg(m); - ms_message("WINSND trouble: silence removed"); - discarded++; - d->stat_notplayed++; - } - } -#else - getq(&d->write_rq); - freemsg(m); - discarded++; - d->stat_notplayed++; -#endif - - break; - } - } -} - -static int get_rate(MSFilter *f, void *arg){ - WinSnd *d=(WinSnd*)f->data; - *((int*)arg)=d->wfx.nSamplesPerSec; - return 0; -} - -static int set_rate(MSFilter *f, void *arg){ - WinSnd *d=(WinSnd*)f->data; - d->wfx.nSamplesPerSec=*((int*)arg); - d->wfx.nSamplesPerSec=44100; - return 0; -} - -static int set_nchannels(MSFilter *f, void *arg){ - WinSnd *d=(WinSnd*)f->data; - d->wfx.nChannels=*((int*)arg); - return 0; -} - -static int winsnd_get_stat_input(MSFilter *f, void *arg){ - WinSnd *d=(WinSnd*)f->data; - return d->stat_input; -} - -static int winsnd_get_stat_ouptut(MSFilter *f, void *arg){ - WinSnd *d=(WinSnd*)f->data; - - return d->stat_output; -} - -static int winsnd_get_stat_discarded(MSFilter *f, void *arg){ - WinSnd *d=(WinSnd*)f->data; - - return d->stat_notplayed; -} - -static MSFilterMethod winsnd_methods[]={ - { MS_FILTER_GET_SAMPLE_RATE , get_rate }, - { MS_FILTER_SET_SAMPLE_RATE , set_rate }, - { MS_FILTER_SET_NCHANNELS , set_nchannels }, - { MS_FILTER_GET_STAT_INPUT, winsnd_get_stat_input }, - { MS_FILTER_GET_STAT_OUTPUT, winsnd_get_stat_ouptut }, - { MS_FILTER_GET_STAT_DISCARDED, winsnd_get_stat_discarded }, - { 0 , NULL } -}; - -MSFilterDesc winsnd_read_desc={ - MS_WINSND_READ_ID, - "MMERead", - "MME capture filter for Windows", - MS_FILTER_OTHER, - NULL, - 0, - 1, - winsnd_init, - winsnd_read_preprocess, - winsnd_read_process, - winsnd_read_postprocess, - winsnd_uninit, - winsnd_methods -}; - - -MSFilterDesc winsnd_write_desc={ - MS_WINSND_WRITE_ID, - "MMEWrite", - "MME playback filter for Windows", - MS_FILTER_OTHER, - NULL, - 1, - 0, - winsnd_init, - winsnd_write_preprocess, - winsnd_write_process, - winsnd_write_postprocess, - winsnd_uninit, - winsnd_methods -}; - -MSFilter *ms_winsnd_read_new(MSSndCard *card){ - MSFilter *f=ms_filter_new_from_desc(&winsnd_read_desc); - WinSndCard *wc=(WinSndCard*)card->data; - WinSnd *d=(WinSnd*)f->data; - d->dev_id=wc->in_devid; - return f; -} - - -MSFilter *ms_winsnd_write_new(MSSndCard *card){ - MSFilter *f=ms_filter_new_from_desc(&winsnd_write_desc); - WinSndCard *wc=(WinSndCard*)card->data; - WinSnd *d=(WinSnd*)f->data; - d->dev_id=wc->out_devid; - return f; -} - -MS_FILTER_DESC_EXPORT(winsnd_read_desc) -MS_FILTER_DESC_EXPORT(winsnd_write_desc) diff --git a/linphone/mediastreamer2/src/winsnd3.c b/linphone/mediastreamer2/src/winsnd3.c deleted file mode 100755 index a554a159f..000000000 --- a/linphone/mediastreamer2/src/winsnd3.c +++ /dev/null @@ -1,713 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/mssndcard.h" -#include "mediastreamer2/msfilter.h" -#include "mediastreamer2/msticker.h" - -#include -#ifdef _MSC_VER -#include -#endif -#include - -#if defined(_WIN32_WCE) -//#define DISABLE_SPEEX -//#define WCE_OPTICON_WORKAROUND 1000 -#endif - - -#define WINSND_NBUFS 10 -#define WINSND_OUT_DELAY 0.100 -#define WINSND_OUT_NBUFS 20 -#define WINSND_NSAMPLES 320 -#define WINSND_MINIMUMBUFFER 5 - -static MSFilter *ms_winsnd_read_new(MSSndCard *card); -static MSFilter *ms_winsnd_write_new(MSSndCard *card); - -typedef struct WinSndCard{ - int in_devid; - int out_devid; -}WinSndCard; - -static void winsndcard_set_level(MSSndCard *card, MSSndCardMixerElem e, int percent){ - MMRESULT mr = MMSYSERR_NOERROR; - DWORD dwVolume = 0xFFFF; - dwVolume = ((0xFFFF) * percent) / 100; - - switch(e){ - case MS_SND_CARD_MASTER: - /*mr = waveOutSetVolume(d->waveoutdev, dwVolume); */ - if (mr != MMSYSERR_NOERROR) - { - ms_warning("Failed to set master volume. (waveOutSetVolume:0x%i)", mr); - return; - } - break; - case MS_SND_CARD_CAPTURE: - break; - case MS_SND_CARD_PLAYBACK: - break; - default: - ms_warning("winsnd_card_set_level: unsupported command."); - } -} - -static int winsndcard_get_level(MSSndCard *card, MSSndCardMixerElem e){ - switch(e){ - case MS_SND_CARD_MASTER: - /*mr=waveOutGetVolume(d->waveoutdev, &dwVolume);*/ - /* Transform to 0 to 100 scale*/ - /*dwVolume = (dwVolume *100) / (0xFFFF);*/ - return 60; - break; - case MS_SND_CARD_CAPTURE: - break; - case MS_SND_CARD_PLAYBACK: - break; - default: - ms_warning("winsnd_card_get_level: unsupported command."); - return -1; - } - return -1; -} - -static void winsndcard_set_source(MSSndCard *card, MSSndCardCapture source){ - - switch(source){ - case MS_SND_CARD_MIC: - break; - case MS_SND_CARD_LINE: - break; - } -} - -static void winsndcard_init(MSSndCard *card){ - WinSndCard *c=(WinSndCard *)ms_new(WinSndCard,1); - card->data=c; -} - -static void winsndcard_uninit(MSSndCard *card){ - ms_free(card->data); -} - -static void winsndcard_detect(MSSndCardManager *m); -static MSSndCard *winsndcard_dup(MSSndCard *obj); - -MSSndCardDesc winsnd_card_desc={ - "WINSND", - winsndcard_detect, - winsndcard_init, - winsndcard_set_level, - winsndcard_get_level, - winsndcard_set_source, - NULL, - NULL, - ms_winsnd_read_new, - ms_winsnd_write_new, - winsndcard_uninit, - winsndcard_dup -}; - -static MSSndCard *winsndcard_dup(MSSndCard *obj){ - MSSndCard *card=ms_snd_card_new(&winsnd_card_desc); - card->name=ms_strdup(obj->name); - card->data=ms_new(WinSndCard,1); - memcpy(card->data,obj->data,sizeof(WinSndCard)); - return card; -} - -static MSSndCard *winsndcard_new(const char *name, int in_dev, int out_dev, unsigned cap){ - MSSndCard *card=ms_snd_card_new(&winsnd_card_desc); - WinSndCard *d=(WinSndCard*)card->data; - card->name=ms_strdup(name); - d->in_devid=in_dev; - d->out_devid=out_dev; - card->capabilities=cap; - return card; -} - -static void add_or_update_card(MSSndCardManager *m, const char *name, int indev, int outdev, unsigned int capability){ - MSSndCard *card; - const MSList *elem=ms_snd_card_manager_get_list(m); - for(;elem!=NULL;elem=elem->next){ - card=(MSSndCard*)elem->data; - if (strcmp(card->name,name)==0){ - /*update already entered card */ - WinSndCard *d=(WinSndCard*)card->data; - card->capabilities|=capability; - if (indev!=-1) - d->in_devid=indev; - if (outdev!=-1) - d->out_devid=outdev; - - return; - } - } - /* add this new card:*/ - ms_snd_card_manager_add_card(m,winsndcard_new(name,indev,outdev,capability)); -} - -static void winsndcard_detect(MSSndCardManager *m){ - MMRESULT mr = NOERROR; - unsigned int nOutDevices = waveOutGetNumDevs (); - unsigned int nInDevices = waveInGetNumDevs (); - unsigned int item; - - if (nOutDevices>nInDevices) - nInDevices = nOutDevices; - - for (item = 0; item < nInDevices; item++){ - - WAVEINCAPS incaps; - WAVEOUTCAPS outcaps; - mr = waveInGetDevCaps (item, &incaps, sizeof (WAVEINCAPS)); - if (mr == MMSYSERR_NOERROR) - { -#if defined(_WIN32_WCE) - char card[256]; - snprintf(card, sizeof(card), "Input card %i", item); - add_or_update_card(m,card,item,-1,MS_SND_CARD_CAP_CAPTURE); - /* _tprintf(L"new card: %s", incaps.szPname); */ -#else - add_or_update_card(m,incaps.szPname,item,-1,MS_SND_CARD_CAP_CAPTURE); -#endif - } - mr = waveOutGetDevCaps (item, &outcaps, sizeof (WAVEOUTCAPS)); - if (mr == MMSYSERR_NOERROR) - { -#if defined(_WIN32_WCE) - char card[256]; - snprintf(card, sizeof(card), "Output card %i", item); - add_or_update_card(m,card,-1,item,MS_SND_CARD_CAP_PLAYBACK); - /* _tprintf(L"new card: %s", outcaps.szPname); */ -#else - add_or_update_card(m,outcaps.szPname,-1,item,MS_SND_CARD_CAP_PLAYBACK); -#endif - } - } -} - - -typedef struct WinSnd{ - int dev_id; - HWAVEIN indev; - HWAVEOUT outdev; - WAVEFORMATEX wfx; - WAVEHDR hdrs_read[WINSND_NBUFS]; - WAVEHDR hdrs_write[WINSND_OUT_NBUFS]; - queue_t rq; - ms_mutex_t mutex; - unsigned int bytes_read; - unsigned int nbufs_playing; - bool_t running; - int outcurbuf; - int nsamples; - queue_t wq; - int32_t stat_input; - int32_t stat_output; - int32_t stat_notplayed; - - int32_t stat_minimumbuffer; - int ready; - int workaround; /* workaround for opticon audio device */ - bool_t overrun; -}WinSnd; - -static void winsnd_apply_settings(WinSnd *d){ - d->wfx.nBlockAlign=d->wfx.nChannels*d->wfx.wBitsPerSample/8; - d->wfx.nAvgBytesPerSec=d->wfx.nSamplesPerSec*d->wfx.nBlockAlign; -} - - -#ifndef _TRUE_TIME -static uint64_t winsnd_get_cur_time( void *data){ - WinSnd *d=(WinSnd*)data; - uint64_t curtime=((uint64_t)d->bytes_read*1000)/(uint64_t)d->wfx.nAvgBytesPerSec; - /* ms_debug("winsnd_get_cur_time: bytes_read=%u return %lu\n",d->bytes_read,(unsigned long)curtime); */ - return curtime; -} -#endif - - -static void winsnd_init(MSFilter *f){ - WinSnd *d=(WinSnd *)ms_new0(WinSnd,1); - d->wfx.wFormatTag = WAVE_FORMAT_PCM; - d->wfx.cbSize = 0; - d->wfx.nAvgBytesPerSec = 16000; - d->wfx.nBlockAlign = 2; - d->wfx.nChannels = 1; - d->wfx.nSamplesPerSec = 8000; - d->wfx.wBitsPerSample = 16; - qinit(&d->rq); - qinit(&d->wq); - d->ready=0; - d->workaround=0; - ms_mutex_init(&d->mutex,NULL); - f->data=d; - - d->stat_input=0; - d->stat_output=0; - d->stat_notplayed=0; - d->stat_minimumbuffer=WINSND_MINIMUMBUFFER; -} - -static void winsnd_uninit(MSFilter *f){ - WinSnd *d=(WinSnd*)f->data; - flushq(&d->rq,0); - flushq(&d->wq,0); - d->ready=0; - d->workaround=0; - ms_mutex_destroy(&d->mutex); - ms_free(f->data); -} - -static void add_input_buffer(WinSnd *d, WAVEHDR *hdr, int buflen){ - mblk_t *m=allocb(buflen,0); - MMRESULT mr; - memset(hdr,0,sizeof(*hdr)); - if (buflen==0) ms_error("add_input_buffer: buflen=0 !"); - hdr->lpData=(LPSTR)m->b_wptr; - hdr->dwBufferLength=buflen; - hdr->dwFlags = 0; - hdr->dwUser = (DWORD)m; - mr = waveInPrepareHeader (d->indev,hdr,sizeof(*hdr)); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveInPrepareHeader() error"); - return ; - } - mr=waveInAddBuffer(d->indev,hdr,sizeof(*hdr)); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveInAddBuffer() error"); - return ; - } -} - -static void CALLBACK -read_callback (HWAVEIN waveindev, UINT uMsg, DWORD dwInstance, DWORD dwParam1, - DWORD dwParam2) -{ - WAVEHDR *wHdr=(WAVEHDR *) dwParam1; - MSFilter *f=(MSFilter *)dwInstance; - WinSnd *d=(WinSnd*)f->data; - mblk_t *m; - int bsize; - switch (uMsg){ - case WIM_OPEN: - ms_debug("read_callback : WIM_OPEN"); - break; - case WIM_CLOSE: - ms_debug("read_callback : WIM_CLOSE"); - break; - case WIM_DATA: - bsize=wHdr->dwBytesRecorded; - - /* ms_warning("read_callback : WIM_DATA (%p,%i)",wHdr,bsize); */ - m=(mblk_t*)wHdr->dwUser; - m->b_wptr+=bsize; - wHdr->dwUser=0; - ms_mutex_lock(&d->mutex); - putq(&d->rq,m); - ms_mutex_unlock(&d->mutex); - d->bytes_read+=wHdr->dwBufferLength; - d->stat_input++; - d->stat_input++; -#ifdef WIN32_TIMERS - if (f->ticker->TimeEvent!=NULL) - SetEvent(f->ticker->TimeEvent); -#endif - break; - } -} - - -static void winsnd_read_preprocess(MSFilter *f){ - WinSnd *d=(WinSnd*)f->data; - MMRESULT mr; - int i; - int bsize; - DWORD dwFlag; - - d->stat_input=0; - d->stat_output=0; - d->stat_notplayed=0; - d->stat_minimumbuffer=WINSND_MINIMUMBUFFER; - - winsnd_apply_settings(d); - /* Init Microphone device */ - dwFlag = CALLBACK_FUNCTION; - if (d->dev_id != WAVE_MAPPER) - dwFlag = WAVE_MAPPED | CALLBACK_FUNCTION; - mr = waveInOpen (&d->indev, d->dev_id, &d->wfx, - (DWORD) read_callback, (DWORD)f, dwFlag); - if (mr != MMSYSERR_NOERROR) - { - ms_error("Failed to prepare windows sound device. (waveInOpen:0x%i)", mr); - mr = waveInOpen (&d->indev, WAVE_MAPPER, &d->wfx, - (DWORD) read_callback, (DWORD)f, CALLBACK_FUNCTION); - if (mr != MMSYSERR_NOERROR) - { - d->indev=NULL; - ms_error("Failed to prepare windows sound device. (waveInOpen:0x%i)", mr); - return ; - } - } - bsize=WINSND_NSAMPLES*d->wfx.nAvgBytesPerSec/8000; - ms_debug("Using input buffers of %i bytes",bsize); - for(i=0;ihdrs_read[i]; - add_input_buffer(d,hdr,bsize); - } - d->running=TRUE; - mr=waveInStart(d->indev); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveInStart() error"); - return ; - } -#ifndef _TRUE_TIME - ms_ticker_set_time_func(f->ticker,winsnd_get_cur_time,d); -#endif -} - -static void winsnd_read_postprocess(MSFilter *f){ - WinSnd *d=(WinSnd*)f->data; - MMRESULT mr; - int i; -#ifndef _TRUE_TIME - ms_ticker_set_time_func(f->ticker,NULL,NULL); -#endif - d->running=FALSE; - mr=waveInStop(d->indev); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveInStop() error"); - return ; - } - mr=waveInReset(d->indev); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveInReset() error"); - return ; - } - for(i=0;ihdrs_read[i]; - if (hdr->dwFlags & WHDR_PREPARED) - { - mr = waveInUnprepareHeader(d->indev,hdr,sizeof (*hdr)); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveInUnPrepareHeader() error"); - } - } - } - mr = waveInClose(d->indev); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveInClose() error"); - return ; - } - - ms_message("Shutting down sound device (playing: %i) (input-output: %i) (notplayed: %i)", d->nbufs_playing, d->stat_input - d->stat_output, d->stat_notplayed); - flushq(&d->rq,0); -} - -static void winsnd_read_process(MSFilter *f){ - WinSnd *d=(WinSnd*)f->data; - mblk_t *m; - int i; - ms_mutex_lock(&d->mutex); - while((m=getq(&d->rq))!=NULL){ - ms_queue_put(f->outputs[0],m); - } - ms_mutex_unlock(&d->mutex); - for(i=0;ihdrs_read[i]; - if (hdr->dwUser==0) { - MMRESULT mr; - mr=waveInUnprepareHeader(d->indev,hdr,sizeof(*hdr)); - if (mr!=MMSYSERR_NOERROR) - ms_warning("winsnd_read_process: Fail to unprepare header!"); - add_input_buffer(d,hdr,hdr->dwBufferLength); - } - } -} - -static void CALLBACK -write_callback(HWAVEOUT outdev, UINT uMsg, DWORD dwInstance, - DWORD dwParam1, DWORD dwParam2) -{ - WAVEHDR *hdr=(WAVEHDR *) dwParam1; - WinSnd *d=(WinSnd*)dwInstance; - - switch (uMsg){ - case WOM_OPEN: - break; - case WOM_CLOSE: - case WOM_DONE: - if (hdr){ - d->nbufs_playing--; - } - if (d->stat_output==0) - { - d->stat_input=1; /* reset */ - d->stat_notplayed=0; - } - d->stat_output++; - break; - } -} - -static void winsnd_write_preprocess(MSFilter *f){ - WinSnd *d=(WinSnd*)f->data; - MMRESULT mr; - DWORD dwFlag; - int i; - - d->stat_input=0; - d->stat_output=0; - d->stat_notplayed=0; - d->stat_minimumbuffer=WINSND_MINIMUMBUFFER; - - winsnd_apply_settings(d); - /* Init Microphone device */ - dwFlag = CALLBACK_FUNCTION; - if (d->dev_id != WAVE_MAPPER) - dwFlag = WAVE_MAPPED | CALLBACK_FUNCTION; - mr = waveOutOpen (&d->outdev, d->dev_id, &d->wfx, - (DWORD) write_callback, (DWORD)d, dwFlag); - if (mr != MMSYSERR_NOERROR) - { - ms_error("Failed to open windows sound device %i. (waveOutOpen:0x%i)",d->dev_id, mr); - mr = waveOutOpen (&d->outdev, WAVE_MAPPER, &d->wfx, - (DWORD) write_callback, (DWORD)d, CALLBACK_FUNCTION); - if (mr != MMSYSERR_NOERROR) - { - ms_error("Failed to open windows sound device %i. (waveOutOpen:0x%i)",d->dev_id, mr); - d->outdev=NULL; - return ; - } - } - for(i=0;ihdrs_write[i]; - hdr->dwFlags=0; - hdr->dwUser=0; - } - d->outcurbuf=0; - d->overrun=FALSE; - d->nsamples=0; -} - -static void winsnd_write_postprocess(MSFilter *f){ - WinSnd *d=(WinSnd*)f->data; - MMRESULT mr; - int i; - if (d->outdev==NULL) return; - mr=waveOutReset(d->outdev); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveOutReset() error"); - return ; - } - for(i=0;ihdrs_write[i]; - mblk_t *old; - if (hdr->dwFlags & WHDR_DONE){ - mr=waveOutUnprepareHeader(d->outdev,hdr,sizeof(*hdr)); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveOutUnprepareHeader error"); - } - old=(mblk_t*)hdr->dwUser; - if (old) freemsg(old); - hdr->dwUser=0; - } - } - mr=waveOutClose(d->outdev); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveOutClose() error"); - return ; - } - d->ready=0; - d->workaround=0; -} - -static void playout_buf(WinSnd *d, WAVEHDR *hdr, mblk_t *m){ - MMRESULT mr; - hdr->dwUser=(DWORD)m; - hdr->lpData=(LPSTR)m->b_rptr; - hdr->dwBufferLength=msgdsize(m); - hdr->dwFlags = 0; - mr = waveOutPrepareHeader(d->outdev,hdr,sizeof(*hdr)); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveOutPrepareHeader() error"); - d->stat_notplayed++; - } - mr=waveOutWrite(d->outdev,hdr,sizeof(*hdr)); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveOutWrite() error"); - d->stat_notplayed++; - }else { - d->nbufs_playing++; - } -} - -static void winsnd_write_process(MSFilter *f){ - WinSnd *d=(WinSnd*)f->data; - mblk_t *m; - MMRESULT mr; - mblk_t *old; - if (d->outdev==NULL) { - ms_queue_flush(f->inputs[0]); - return; - } - if (d->overrun){ - ms_warning("nbufs_playing=%i",d->nbufs_playing); - if (d->nbufs_playing>0){ - ms_queue_flush(f->inputs[0]); - return; - } - else d->overrun=FALSE; - } - while(1){ - int outcurbuf=d->outcurbuf % WINSND_OUT_NBUFS; - WAVEHDR *hdr=&d->hdrs_write[outcurbuf]; - old=(mblk_t*)hdr->dwUser; - if (d->nsamples==0){ - int tmpsize=WINSND_OUT_DELAY*d->wfx.nAvgBytesPerSec; - mblk_t *tmp=allocb(tmpsize,0); - memset(tmp->b_wptr,0,tmpsize); - tmp->b_wptr+=tmpsize; - playout_buf(d,hdr,tmp); - d->outcurbuf++; - d->nsamples+=WINSND_OUT_DELAY*d->wfx.nSamplesPerSec; - continue; - } - m=ms_queue_get(f->inputs[0]); - if (!m) break; - d->nsamples+=msgdsize(m)/d->wfx.nBlockAlign; - /*if the output buffer has finished to play, unprepare it*/ - if (hdr->dwFlags & WHDR_DONE){ - mr=waveOutUnprepareHeader(d->outdev,hdr,sizeof(*hdr)); - if (mr != MMSYSERR_NOERROR){ - ms_error("waveOutUnprepareHeader error"); - } - freemsg(old); - old=NULL; - hdr->dwFlags=0; - hdr->dwUser=0; - } - if (old==NULL){ - /* a free wavheader */ - playout_buf(d,hdr,m); - }else{ - /* no more free wavheader, overrun !*/ - ms_warning("WINSND overrun, restarting"); - d->overrun=TRUE; - d->nsamples=0; - waveOutReset(d->outdev); - } - d->outcurbuf++; - } -} - -static int set_rate(MSFilter *f, void *arg){ - WinSnd *d=(WinSnd*)f->data; - d->wfx.nSamplesPerSec=*((int*)arg); - return 0; -} - -static int set_nchannels(MSFilter *f, void *arg){ - WinSnd *d=(WinSnd*)f->data; - d->wfx.nChannels=*((int*)arg); - return 0; -} - -static int winsnd_get_stat_input(MSFilter *f, void *arg){ - WinSnd *d=(WinSnd*)f->data; - return d->stat_input; -} - -static int winsnd_get_stat_ouptut(MSFilter *f, void *arg){ - WinSnd *d=(WinSnd*)f->data; - - return d->stat_output; -} - -static int winsnd_get_stat_discarded(MSFilter *f, void *arg){ - WinSnd *d=(WinSnd*)f->data; - - return d->stat_notplayed; -} - -static MSFilterMethod winsnd_methods[]={ - { MS_FILTER_SET_SAMPLE_RATE , set_rate }, - { MS_FILTER_SET_NCHANNELS , set_nchannels }, - { MS_FILTER_GET_STAT_INPUT, winsnd_get_stat_input }, - { MS_FILTER_GET_STAT_OUTPUT, winsnd_get_stat_ouptut }, - { MS_FILTER_GET_STAT_DISCARDED, winsnd_get_stat_discarded }, - { 0 , NULL } -}; - -MSFilterDesc winsnd_read_desc={ - MS_WINSND_READ_ID, - "MSWinSndRead", - "Sound capture filter for Windows Sound drivers", - MS_FILTER_OTHER, - NULL, - 0, - 1, - winsnd_init, - winsnd_read_preprocess, - winsnd_read_process, - winsnd_read_postprocess, - winsnd_uninit, - winsnd_methods -}; - - -MSFilterDesc winsnd_write_desc={ - MS_WINSND_WRITE_ID, - "MSWinSndWrite", - "Sound playback filter for Windows Sound drivers", - MS_FILTER_OTHER, - NULL, - 1, - 0, - winsnd_init, - winsnd_write_preprocess, - winsnd_write_process, - winsnd_write_postprocess, - winsnd_uninit, - winsnd_methods -}; - -MSFilter *ms_winsnd_read_new(MSSndCard *card){ - MSFilter *f=ms_filter_new_from_desc(&winsnd_read_desc); - WinSndCard *wc=(WinSndCard*)card->data; - WinSnd *d=(WinSnd*)f->data; - d->dev_id=wc->in_devid; - return f; -} - - -MSFilter *ms_winsnd_write_new(MSSndCard *card){ - MSFilter *f=ms_filter_new_from_desc(&winsnd_write_desc); - WinSndCard *wc=(WinSndCard*)card->data; - WinSnd *d=(WinSnd*)f->data; - d->dev_id=wc->out_devid; - return f; -} - -MS_FILTER_DESC_EXPORT(winsnd_read_desc) -MS_FILTER_DESC_EXPORT(winsnd_write_desc) diff --git a/linphone/mediastreamer2/src/winsndds.cpp b/linphone/mediastreamer2/src/winsndds.cpp deleted file mode 100644 index fe539fe8e..000000000 --- a/linphone/mediastreamer2/src/winsndds.cpp +++ /dev/null @@ -1,1864 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifdef __DIRECTSOUND_ENABLED__ - -#define UNICODE - -#include "mediastreamer2/mssndcard.h" -#include "mediastreamer2/msfilter.h" -#include "mediastreamer2/msticker.h" - -#include -#ifdef _MSC_VER -#include -#endif -#include - -#include -#include - -const GUID GUID_DSCFX_MS_AEC = {0xcdebb919, 0x379a, 0x488a, {0x87, 0x65, 0xf5, 0x3c, 0xfd, 0x36, 0xde, 0x40}}; -const GUID GUID_DSCFX_CLASS_AEC = {0xBF963D80L, 0xC559, 0x11D0, {0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1}}; - -const GUID CLSID_DirectSoundPrivate= { 0x11ab3ec0, 0x25ec, 0x11d1, {0xa4, 0xd8, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca}}; -const GUID DSPROPSETID_DirectSoundDevice = {0x84624f82, 0x25ec, 0x11d1, {0xa4, 0xd8, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca}}; - -#define WINSNDDS_MINIMUMBUFFER 5 - -static MSFilter *ms_winsndds_read_new(MSSndCard *card); -static MSFilter *ms_winsndds_write_new(MSSndCard *card); - -static HMODULE ms_lib_instance=NULL; -static HRESULT (WINAPI *ms_DllGetClassObject)(REFCLSID , REFIID , LPVOID *); - -static HRESULT (WINAPI *ms_DirectSoundCreate)(LPGUID, LPDIRECTSOUND *, LPUNKNOWN); -static HRESULT (WINAPI *ms_DirectSoundEnumerate)(LPDSENUMCALLBACKW, LPVOID); - -static HRESULT (WINAPI *ms_DirectSoundCaptureCreate)(LPGUID, LPDIRECTSOUNDCAPTURE *, LPUNKNOWN); -static HRESULT (WINAPI *ms_DirectSoundCaptureEnumerate)(LPDSENUMCALLBACKW, LPVOID); - -static HRESULT (WINAPI *ms_DirectSoundFullDuplexCreate)(LPCGUID , LPCGUID , - LPCDSCBUFFERDESC , LPCDSBUFFERDESC , HWND , - DWORD , LPDIRECTSOUNDFULLDUPLEX* , LPDIRECTSOUNDCAPTUREBUFFER8 *, - LPDIRECTSOUNDBUFFER8 *, LPUNKNOWN ); - -typedef struct WinSndDsCard{ - int in_devid; - int out_devid; - GUID in_guid; - GUID out_guid; - int removed; -}WinSndDsCard; - -static BOOL GetWaveIdFromDSoundGUID( GUID i_sGUID, DWORD *dwWaveID) -{ - LPKSPROPERTYSET pKsPropertySet = NULL; - LPCLASSFACTORY pClassFactory = NULL; - HRESULT hr; - BOOL retval = FALSE; - - PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA psDirectSoundDeviceDescription = NULL; - DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA sDirectSoundDeviceDescription; - - memset(&sDirectSoundDeviceDescription,0,sizeof(sDirectSoundDeviceDescription)); - - hr = ms_DllGetClassObject (CLSID_DirectSoundPrivate, IID_IClassFactory, (LPVOID *)&pClassFactory ); - - if(SUCCEEDED(hr)) - { - hr = pClassFactory->CreateInstance ( NULL, IID_IKsPropertySet, (LPVOID *)&pKsPropertySet ); - } - - // Release the class factory - if(pClassFactory) - { - pClassFactory->Release(); - } - - if(SUCCEEDED(hr)) - { - ULONG ulBytesReturned = 0; - sDirectSoundDeviceDescription.DeviceId = i_sGUID; - - // On the first call the final size is unknown so pass the size of the struct in order to receive - // "Type" and "DataFlow" values, ulBytesReturned will be populated with bytes required for struct+strings. - hr = pKsPropertySet->Get(DSPROPSETID_DirectSoundDevice, - DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION, - NULL, - 0, - &sDirectSoundDeviceDescription, - sizeof(sDirectSoundDeviceDescription), - &ulBytesReturned - ); - - if (ulBytesReturned) - { - // On the first call it notifies us of the required amount of memory in order to receive the strings. - // Allocate the required memory, the strings will be pointed to the memory space directly after the struct. - psDirectSoundDeviceDescription = (PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA)new BYTE[ulBytesReturned]; - *psDirectSoundDeviceDescription = sDirectSoundDeviceDescription; - - hr = pKsPropertySet->Get(DSPROPSETID_DirectSoundDevice, - DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION, - NULL, - 0, - psDirectSoundDeviceDescription, - ulBytesReturned, - &ulBytesReturned - ); - - *dwWaveID = psDirectSoundDeviceDescription->WaveDeviceId; - delete [] psDirectSoundDeviceDescription; - retval = TRUE; - } - - pKsPropertySet->Release(); - } - - return retval; -} - -static void winsnddscard_set_level(MSSndCard *card, MSSndCardMixerElem e, int percent){ - WinSndDsCard *d=(WinSndDsCard*)card->data; - DWORD waveout_devid = WAVE_MAPPER; - DWORD wavein_devid = WAVE_MAPPER; - - UINT uMixerID; - DWORD dwMixerHandle; - MIXERLINE MixerLine; - MIXERLINE Line; - UINT uLineIndex; - - MIXERLINECONTROLS mlc = {0}; - MIXERCONTROL mc = {0}; - MIXERCONTROLDETAILS mcd = {0}; - MIXERCONTROLDETAILS_UNSIGNED mcdu = {0}; - - MMRESULT mr = MMSYSERR_NOERROR; - DWORD dwVolume = ((0xFFFF) * percent) / 100; - - WORD wLeftVol, wRightVol; - DWORD dwNewVol; - wLeftVol = LOWORD(dwVolume); // get higher WORD - wRightVol = LOWORD(dwVolume); // get lower WORD - - dwNewVol = MAKELONG(wLeftVol, wRightVol); - - GetWaveIdFromDSoundGUID(d->in_guid, &wavein_devid); - GetWaveIdFromDSoundGUID(d->out_guid, &waveout_devid); - - switch(e){ - case MS_SND_CARD_PLAYBACK: - case MS_SND_CARD_MASTER: - { - - mr = mixerGetID( (HMIXEROBJ)waveout_devid, &uMixerID, MIXER_OBJECTF_WAVEOUT ); - if ( mr != MMSYSERR_NOERROR ) - { - ms_error("winsndcard_set_level: mixerGetID failed. (0x%x)", mr); - return; - } - mr = mixerOpen( (LPHMIXER)&dwMixerHandle, uMixerID, 0L, 0L, 0L ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_level: mixerOpen failed. (0x%x)", mr); - return; - } - memset( &MixerLine, 0, sizeof(MIXERLINE) ); - MixerLine.cbStruct = sizeof(MIXERLINE); - if (MS_SND_CARD_MASTER==e) - MixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS; - else - MixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &MixerLine, MIXER_GETLINEINFOF_COMPONENTTYPE ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_level: mixerGetLineInfo failed. (0x%x)", mr); - return; - } - - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - mlc.cbStruct = sizeof(MIXERLINECONTROLS); - mlc.dwLineID = MixerLine.dwLineID; - mlc.dwControlType = MIXERCONTROL_CONTROLTYPE_VOLUME; - mlc.cControls = 1; - mlc.pamxctrl = &mc; - mlc.cbmxctrl = sizeof(MIXERCONTROL); - mr = mixerGetLineControls((HMIXEROBJ)dwMixerHandle, - &mlc, MIXER_GETLINECONTROLSF_ONEBYTYPE); - - if (mr != MMSYSERR_NOERROR) - { - ms_error("winsndcard_set_level: mixerGetLineControls failed. (0x%x)", mr); - return; - } - - mcdu.dwValue = 65535*percent/100; /* the volume is a number between 0 and 65535 */ - - mcd.cbStruct = sizeof(MIXERCONTROLDETAILS); - mcd.hwndOwner = 0; - mcd.dwControlID = mc.dwControlID; - mcd.paDetails = &mcdu; - mcd.cbDetails = sizeof(MIXERCONTROLDETAILS_UNSIGNED); - mcd.cChannels = 1; - mr = mixerSetControlDetails((HMIXEROBJ)dwMixerHandle, - &mcd, MIXER_SETCONTROLDETAILSF_VALUE); - - if (mr != MMSYSERR_NOERROR) - { - ms_error("winsndcard_set_level: mixerSetControlDetails failed. (0x%x)", mr); - return; - } - } - break; - case MS_SND_CARD_CAPTURE: - mr = mixerGetID( (HMIXEROBJ)wavein_devid, &uMixerID, MIXER_OBJECTF_WAVEIN ); - if ( mr != MMSYSERR_NOERROR ) - { - ms_error("winsndcard_set_level: mixerGetID failed. (0x%x)", mr); - return; - } - mr = mixerOpen( (LPHMIXER)&dwMixerHandle, uMixerID, 0L, 0L, 0L ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_level: mixerGetLineInfo failed. (0x%x)", mr); - return; - } - memset( &MixerLine, 0, sizeof(MIXERLINE) ); - MixerLine.cbStruct = sizeof(MIXERLINE); - MixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_WAVEIN; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &MixerLine, MIXER_GETLINEINFOF_COMPONENTTYPE ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_level: mixerGetLineInfo failed. (0x%x)", mr); - return; - } - - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - mlc.cbStruct = sizeof(MIXERLINECONTROLS); - mlc.dwLineID = MixerLine.dwLineID; - mlc.dwControlType = MIXERCONTROL_CONTROLTYPE_VOLUME; - mlc.cControls = 1; - mlc.pamxctrl = &mc; - mlc.cbmxctrl = sizeof(MIXERCONTROL); - mr = mixerGetLineControls((HMIXEROBJ)dwMixerHandle, - &mlc, MIXER_GETLINECONTROLSF_ONEBYTYPE); - - if (mr == MMSYSERR_NOERROR) - { - mcdu.dwValue = 65535*percent/100; /* the volume is a number between 0 and 65535 */ - - mcd.cbStruct = sizeof(MIXERCONTROLDETAILS); - mcd.hwndOwner = 0; - mcd.dwControlID = mc.dwControlID; - mcd.paDetails = &mcdu; - mcd.cbDetails = sizeof(MIXERCONTROLDETAILS_UNSIGNED); - mcd.cChannels = 1; - mr = mixerSetControlDetails((HMIXEROBJ)dwMixerHandle, - &mcd, MIXER_SETCONTROLDETAILSF_VALUE); - - if (mr == MMSYSERR_NOERROR) - { - return; - } - ms_error("winsndcard_set_level: mixerSetControlDetails failed. (0x%x)", mr); - ms_warning("winsndcard_set_level: control the SRC_MICROPHONE instead"); - } - else - { - ms_error("winsndcard_set_level: mixerGetLineControls failed. (0x%x)", mr); - ms_warning("winsndcard_set_level: control the SRC_MICROPHONE instead"); - } - - /* In case capture doesn't work: use the SRC_MICROPHONE volume */ - - for (uLineIndex = 0; uLineIndex < MixerLine.cConnections; uLineIndex++) - { - memset( &Line, 0, sizeof(MIXERLINE) ); - Line.cbStruct = sizeof(MIXERLINE); - Line.dwDestination = MixerLine.dwDestination; - Line.dwSource = uLineIndex; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &Line, MIXER_GETLINEINFOF_LINEID); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_level: mixerGetLineInfo failed. (0x%x)", mr); - return; - } - - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("LineID: %d\n", MixerLine.dwLineID); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - memset( &Line, 0, sizeof(MIXERLINE) ); - Line.cbStruct = sizeof(MIXERLINE); - Line.dwDestination = MixerLine.dwDestination; - Line.dwSource = uLineIndex; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &Line, MIXER_GETLINEINFOF_SOURCE); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_level: mixerGetLineInfo failed. (0x%x)", mr); - return; - } - - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("LineID: %d\n", MixerLine.dwLineID); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - if (MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE == Line.dwComponentType) - { - LPMIXERCONTROL pmxctrl = (LPMIXERCONTROL)malloc(sizeof(MIXERCONTROL)); - MIXERLINECONTROLS mxlctrl = {sizeof(mxlctrl), Line.dwLineID, MIXERCONTROL_CONTROLTYPE_VOLUME, 1, sizeof(MIXERCONTROL), pmxctrl}; - mr = mixerGetLineControls((HMIXEROBJ)dwMixerHandle, &mxlctrl, MIXER_GETLINECONTROLSF_ONEBYTYPE); - if(!mr){ - DWORD cChannels = Line.cChannels; - LPMIXERCONTROLDETAILS_UNSIGNED pUnsigned; - MIXERCONTROLDETAILS mxcd; - if (MIXERCONTROL_CONTROLF_UNIFORM & pmxctrl->fdwControl) - cChannels = 1; - pUnsigned = - (LPMIXERCONTROLDETAILS_UNSIGNED) - malloc(cChannels * sizeof(MIXERCONTROLDETAILS_UNSIGNED)); - - mxcd.cbStruct = sizeof(mxcd); - mxcd.dwControlID = pmxctrl->dwControlID; - mxcd.cChannels = cChannels; - mxcd.hwndOwner = (HWND)0; - mxcd.cbDetails = sizeof(MIXERCONTROLDETAILS_UNSIGNED); - mxcd.paDetails = (LPVOID) pUnsigned; - - mr = mixerGetControlDetails((HMIXEROBJ)dwMixerHandle, &mxcd, - MIXER_SETCONTROLDETAILSF_VALUE); - if(!mr){ - pUnsigned[0].dwValue = pUnsigned[cChannels - 1].dwValue - = pmxctrl->Bounds.dwMaximum*percent/100; - mr = mixerSetControlDetails((HMIXEROBJ)dwMixerHandle, &mxcd, - MIXER_SETCONTROLDETAILSF_VALUE); - if(mr){ - ms_error("winsndcard_set_level: mixerSetControlDetails failed. (0x%x)", mr); - } - } - else - { - ms_error("winsndcard_set_level: mixerGetControlDetails failed. (0x%x)", mr); - } - free(pmxctrl); - free(pUnsigned); - } - else - { - ms_error("winsndcard_set_level: mixerGetLineControls failed. (0x%x)", mr); - free(pmxctrl); - } - } - } - mixerClose( (HMIXER)dwMixerHandle ); - if (mr != MMSYSERR_NOERROR) - { - ms_error("winsndcard_set_level: mixerClose failed. (0x%x)", mr); - return; - } - break; - default: - ms_warning("winsnd_card_set_level: unsupported command."); - } -} - -static int winsnddscard_get_level(MSSndCard *card, MSSndCardMixerElem e){ - WinSndDsCard *d=(WinSndDsCard*)card->data; - DWORD waveout_devid = WAVE_MAPPER; - DWORD wavein_devid = WAVE_MAPPER; - - UINT uMixerID; - DWORD dwMixerHandle; - MIXERLINE MixerLine; - MIXERLINE Line; - UINT uLineIndex; - - MIXERLINECONTROLS mlc = {0}; - MIXERCONTROL mc = {0}; - MIXERCONTROLDETAILS mcd = {0}; - MIXERCONTROLDETAILS_UNSIGNED mcdu = {0}; - - MMRESULT mr = MMSYSERR_NOERROR; - int percent; - - GetWaveIdFromDSoundGUID(d->in_guid, &wavein_devid); - GetWaveIdFromDSoundGUID(d->out_guid, &waveout_devid); - - switch(e){ - case MS_SND_CARD_MASTER: - case MS_SND_CARD_PLAYBACK: - { - mr = mixerGetID( (HMIXEROBJ)waveout_devid, &uMixerID, MIXER_OBJECTF_WAVEOUT ); - if ( mr != MMSYSERR_NOERROR ) - { - ms_error("winsndcard_get_level: mixerGetID failed. (0x%x)", mr); - return -1; - } - mr = mixerOpen( (LPHMIXER)&dwMixerHandle, uMixerID, 0L, 0L, 0L ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_get_level: mixerOpen failed. (0x%x)", mr); - return -1; - } - memset( &MixerLine, 0, sizeof(MIXERLINE) ); - MixerLine.cbStruct = sizeof(MIXERLINE); - if (MS_SND_CARD_MASTER==e) - MixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS; - else - MixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &MixerLine, MIXER_GETLINEINFOF_COMPONENTTYPE ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_get_level: mixerGetLineInfo failed. (0x%x)", mr); - return -1; - } - - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - mlc.cbStruct = sizeof(MIXERLINECONTROLS); - mlc.dwLineID = MixerLine.dwLineID; - mlc.dwControlType = MIXERCONTROL_CONTROLTYPE_VOLUME; - mlc.cControls = 1; - mlc.pamxctrl = &mc; - mlc.cbmxctrl = sizeof(MIXERCONTROL); - mr = mixerGetLineControls((HMIXEROBJ)dwMixerHandle, - &mlc, MIXER_GETLINECONTROLSF_ONEBYTYPE); - if (mr != MMSYSERR_NOERROR) - { - ms_error("winsndcard_get_level: mixerGetLineControls failed. (0x%x)", mr); - return -1; - } - - mcd.cbStruct = sizeof(MIXERCONTROLDETAILS); - mcd.hwndOwner = 0; - mcd.dwControlID = mc.dwControlID; - mcd.paDetails = &mcdu; - mcd.cbDetails = sizeof(MIXERCONTROLDETAILS_UNSIGNED); - mcd.cChannels = 1; - mr = mixerGetControlDetails((HMIXEROBJ)dwMixerHandle, &mcd, - MIXER_SETCONTROLDETAILSF_VALUE); - percent = (mcdu.dwValue *100) / (mc.Bounds.dwMaximum); - - if (mr != MMSYSERR_NOERROR) - { - ms_error("winsndcard_get_level: mixerGetControlDetails failed. (0x%x)", mr); - return -1; - } - return percent; - } - break; - case MS_SND_CARD_CAPTURE: - mr = mixerGetID( (HMIXEROBJ)wavein_devid, &uMixerID, MIXER_OBJECTF_WAVEIN ); - if ( mr != MMSYSERR_NOERROR ) - { - ms_error("winsndcard_get_level: mixerGetID failed. (0x%x)", mr); - return -1; - } - mr = mixerOpen( (LPHMIXER)&dwMixerHandle, uMixerID, 0L, 0L, 0L ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_get_level: mixerOpen failed. (0x%x)", mr); - return -1; - } - memset( &MixerLine, 0, sizeof(MIXERLINE) ); - MixerLine.cbStruct = sizeof(MIXERLINE); - MixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_WAVEIN; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &MixerLine, MIXER_GETLINEINFOF_COMPONENTTYPE ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_get_level: mixerGetLineInfo failed. (0x%x)", mr); - return -1; - } - - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - mlc.cbStruct = sizeof(MIXERLINECONTROLS); - mlc.dwLineID = MixerLine.dwLineID; - mlc.dwControlType = MIXERCONTROL_CONTROLTYPE_VOLUME; - mlc.cControls = 1; - mlc.pamxctrl = &mc; - mlc.cbmxctrl = sizeof(MIXERCONTROL); - mr = mixerGetLineControls((HMIXEROBJ)dwMixerHandle, - &mlc, MIXER_GETLINECONTROLSF_ONEBYTYPE); - if (mr == MMSYSERR_NOERROR) - { - mcd.cbStruct = sizeof(MIXERCONTROLDETAILS); - mcd.hwndOwner = 0; - mcd.dwControlID = mc.dwControlID; - mcd.paDetails = &mcdu; - mcd.cbDetails = sizeof(MIXERCONTROLDETAILS_UNSIGNED); - mcd.cChannels = 1; - mr = mixerGetControlDetails((HMIXEROBJ)dwMixerHandle, &mcd, - MIXER_SETCONTROLDETAILSF_VALUE); - percent = (mcdu.dwValue *100) / (mc.Bounds.dwMaximum); - - if (mr == MMSYSERR_NOERROR) - { - return percent; - } - ms_error("winsndcard_get_level: mixerGetControlDetails failed. (0x%x)", mr); - ms_warning("winsndcard_get_level: control the SRC_MICROPHONE instead"); - } - else - { - ms_error("winsndcard_get_level: mixerGetLineControls failed. (0x%x)", mr); - ms_warning("winsndcard_get_level: control the SRC_MICROPHONE instead"); - } - - for (uLineIndex = 0; uLineIndex < MixerLine.cConnections; uLineIndex++) - { - memset( &Line, 0, sizeof(MIXERLINE) ); - Line.cbStruct = sizeof(MIXERLINE); - Line.dwDestination = MixerLine.dwDestination; - Line.dwSource = uLineIndex; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &Line, MIXER_GETLINEINFOF_LINEID); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_get_level: mixerGetLineInfo failed. (0x%x)", mr); - return -1; - } - - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("LineID: %d\n", MixerLine.dwLineID); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - memset( &Line, 0, sizeof(MIXERLINE) ); - Line.cbStruct = sizeof(MIXERLINE); - Line.dwDestination = MixerLine.dwDestination; - Line.dwSource = uLineIndex; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &Line, MIXER_GETLINEINFOF_SOURCE); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_get_level: mixerGetLineInfo failed. (0x%x)", mr); - return -1; - } - - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("LineID: %d\n", MixerLine.dwLineID); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - if (MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE == Line.dwComponentType) - { - LPMIXERCONTROL pmxctrl = (LPMIXERCONTROL)malloc(sizeof(MIXERCONTROL)); - MIXERLINECONTROLS mxlctrl = {sizeof(mxlctrl), Line.dwLineID, MIXERCONTROL_CONTROLTYPE_VOLUME, 1, sizeof(MIXERCONTROL), pmxctrl}; - if(!mixerGetLineControls((HMIXEROBJ)dwMixerHandle, &mxlctrl, - MIXER_GETLINECONTROLSF_ONEBYTYPE)){ - DWORD cChannels = Line.cChannels; - LPMIXERCONTROLDETAILS_UNSIGNED pUnsigned; - MIXERCONTROLDETAILS mxcd; - if (MIXERCONTROL_CONTROLF_UNIFORM & pmxctrl->fdwControl) - cChannels = 1; - pUnsigned = - (LPMIXERCONTROLDETAILS_UNSIGNED) - malloc(cChannels * sizeof(MIXERCONTROLDETAILS_UNSIGNED)); - - mxcd.cbStruct = sizeof(mxcd); - mxcd.dwControlID = pmxctrl->dwControlID; - mxcd.cChannels = cChannels; - mxcd.hwndOwner = (HWND)0; - mxcd.cbDetails = sizeof(MIXERCONTROLDETAILS_UNSIGNED); - mxcd.paDetails = (LPVOID) pUnsigned; - - mixerGetControlDetails((HMIXEROBJ)dwMixerHandle, &mxcd, - MIXER_SETCONTROLDETAILSF_VALUE); - percent = (pUnsigned[0].dwValue *100) / (pmxctrl->Bounds.dwMaximum); - free(pmxctrl); - free(pUnsigned); - } - else - free(pmxctrl); - } - } - mixerClose( (HMIXER)dwMixerHandle ); - if (mr != MMSYSERR_NOERROR) - { - ms_error("winsndcard_get_level: mixerClose failed. (0x%x)", mr); - return -1; - } - return percent; - break; - default: - ms_warning("winsndcard_get_level: unsupported command."); - return -1; - } - return -1; -} - -static void winsnddscard_set_source(MSSndCard *card, MSSndCardCapture source){ - - switch(source){ - case MS_SND_CARD_MIC: - break; - case MS_SND_CARD_LINE: - break; - } -} - -static int winsnddscard_set_control(MSSndCard *card, MSSndCardControlElem e, int val){ - WinSndDsCard *d=(WinSndDsCard*)card->data; - DWORD waveout_devid = WAVE_MAPPER; - DWORD wavein_devid = WAVE_MAPPER; - - UINT uMixerID; - DWORD dwMixerHandle; - MIXERLINE MixerLine; - MIXERLINE Line; - UINT uLineIndex; - - MIXERLINECONTROLS mlc = {0}; - MIXERCONTROL mc = {0}; - MIXERCONTROLDETAILS mcd = {0}; - MIXERCONTROLDETAILS_BOOLEAN bMute; - - MMRESULT mr = MMSYSERR_NOERROR; - - GetWaveIdFromDSoundGUID(d->in_guid, &wavein_devid); - GetWaveIdFromDSoundGUID(d->out_guid, &waveout_devid); - - switch(e){ - case MS_SND_CARD_CAPTURE_MUTE: - bMute.fValue = (val>0); - - mr = mixerGetID( (HMIXEROBJ)wavein_devid, &uMixerID, MIXER_OBJECTF_WAVEIN ); - if ( mr != MMSYSERR_NOERROR ) - { - ms_error("winsndcard_set_control: mixerGetID failed. (0x%x)", mr); - return -1; - } - mr = mixerOpen( (LPHMIXER)&dwMixerHandle, uMixerID, 0L, 0L, 0L ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_control: mixerOpen failed. (0x%x)", mr); - return -1; - } - memset( &MixerLine, 0, sizeof(MIXERLINE) ); - MixerLine.cbStruct = sizeof(MIXERLINE); - MixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_WAVEIN; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &MixerLine, MIXER_GETLINEINFOF_COMPONENTTYPE ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_control: mixerGetLineInfo failed. (0x%x)", mr); - return -1; - } - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - mlc.cbStruct = sizeof(MIXERLINECONTROLS); - mlc.dwLineID = MixerLine.dwLineID; - mlc.dwControlType = MIXERCONTROL_CONTROLTYPE_MUTE; //MIXERCONTROL_CONTROLTYPE_VOLUME; - mlc.cControls = 1; - mlc.pamxctrl = &mc; - mlc.cbmxctrl = sizeof(MIXERCONTROL); - mr = mixerGetLineControls((HMIXEROBJ)dwMixerHandle, - &mlc, MIXER_GETLINECONTROLSF_ONEBYTYPE); - if (mr == MMSYSERR_NOERROR) - { - mcd.cbStruct = sizeof(MIXERCONTROLDETAILS); - mcd.hwndOwner = 0; - mcd.dwControlID = mc.dwControlID; - mcd.paDetails = &bMute; - mcd.cbDetails = sizeof(MIXERCONTROLDETAILS_BOOLEAN); - mcd.cChannels = 1; - mr = mixerSetControlDetails((HMIXEROBJ)dwMixerHandle, - &mcd, MIXER_SETCONTROLDETAILSF_VALUE); - - if (mr == MMSYSERR_NOERROR) - { - return 0; - } - ms_error("winsndcard_set_control: mixerSetControlDetails failed. (0x%x)", mr); - ms_warning("winsndcard_get_level: control the SRC_MICROPHONE instead"); - } - else - { - ms_error("winsndcard_set_control: mixerGetLineControls failed. (0x%x)", mr); - ms_warning("winsndcard_get_level: control the SRC_MICROPHONE instead"); - } - - - for (uLineIndex = 0; uLineIndex < MixerLine.cConnections; uLineIndex++) - { - memset( &Line, 0, sizeof(MIXERLINE) ); - Line.cbStruct = sizeof(MIXERLINE); - Line.dwDestination = MixerLine.dwDestination; - Line.dwSource = uLineIndex; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &Line, MIXER_GETLINEINFOF_LINEID); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_control: mixerGetLineInfo failed. (0x%x)", mr); - return -1; - } - - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("LineID: %d\n", MixerLine.dwLineID); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - memset( &Line, 0, sizeof(MIXERLINE) ); - Line.cbStruct = sizeof(MIXERLINE); - Line.dwDestination = MixerLine.dwDestination; - Line.dwSource = uLineIndex; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &Line, MIXER_GETLINEINFOF_SOURCE); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_control: mixerGetLineInfo failed. (0x%x)", mr); - return -1; - } - - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("LineID: %d\n", MixerLine.dwLineID); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - if (MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE == Line.dwComponentType) - { - /* unmute */ - /* Find a mute control, if any, of the microphone line */ - - LPMIXERCONTROL pmxctrl = (LPMIXERCONTROL)malloc(sizeof(MIXERCONTROL)); - MIXERLINECONTROLS mxlctrl = {sizeof(mxlctrl), Line.dwLineID, MIXERCONTROL_CONTROLTYPE_MUTE, 1, sizeof(MIXERCONTROL), pmxctrl}; - if(!mixerGetLineControls((HMIXEROBJ)dwMixerHandle, &mxlctrl, MIXER_GETLINECONTROLSF_ONEBYTYPE)){ - DWORD cChannels = Line.cChannels; - LPMIXERCONTROLDETAILS_BOOLEAN pbool; - MIXERCONTROLDETAILS mxcd; - - if (MIXERCONTROL_CONTROLF_UNIFORM & pmxctrl->fdwControl) - cChannels = 1; - pbool = (LPMIXERCONTROLDETAILS_BOOLEAN) malloc(cChannels * sizeof( - MIXERCONTROLDETAILS_BOOLEAN)); - - mxcd.cbStruct = sizeof(mxcd); - mxcd.dwControlID = pmxctrl->dwControlID; - mxcd.cChannels = cChannels; - mxcd.hwndOwner = (HWND)0; - mxcd.cbDetails = sizeof(MIXERCONTROLDETAILS_BOOLEAN); - mxcd.paDetails = (LPVOID) pbool; - - mixerGetControlDetails((HMIXEROBJ)dwMixerHandle, &mxcd, - MIXER_SETCONTROLDETAILSF_VALUE); - /* Unmute the microphone line (for both channels) */ - pbool[0].fValue = pbool[cChannels - 1].fValue = val; /* 0 -> unmute; */ - mixerSetControlDetails((HMIXEROBJ)dwMixerHandle, &mxcd, - MIXER_SETCONTROLDETAILSF_VALUE); - free(pmxctrl); - free(pbool); - } - else - free(pmxctrl); - } - } - mixerClose( (HMIXER)dwMixerHandle ); - if (mr != MMSYSERR_NOERROR) - { - ms_error("winsndcard_set_control: mixerClose failed. (0x%x)", mr); - return -1; - } - return 0; - - case MS_SND_CARD_MASTER_MUTE: - case MS_SND_CARD_PLAYBACK_MUTE: - { - bMute.fValue = (val>0); - - mr = mixerGetID( (HMIXEROBJ)waveout_devid, &uMixerID, MIXER_OBJECTF_WAVEOUT ); - if ( mr != MMSYSERR_NOERROR ) - { - ms_error("winsndcard_set_control: mixerGetID failed. (0x%x)", mr); - return -1; - } - mr = mixerOpen( (LPHMIXER)&dwMixerHandle, uMixerID, 0L, 0L, 0L ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_control: mixerOpen failed. (0x%x)", mr); - return -1; - } - memset( &MixerLine, 0, sizeof(MIXERLINE) ); - MixerLine.cbStruct = sizeof(MIXERLINE); - if (MS_SND_CARD_MASTER_MUTE==e) - MixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS; - else - MixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT; - mr = mixerGetLineInfo( (HMIXEROBJ)dwMixerHandle, &MixerLine, MIXER_GETLINEINFOF_COMPONENTTYPE ); - if ( mr != MMSYSERR_NOERROR ) - { - mixerClose( (HMIXER)dwMixerHandle ); - ms_error("winsndcard_set_control: mixerSetControlDetails failed. (0x%x)", mr); - return -1; - } - - /* ms_message("Name: %s\n", MixerLine.szName); */ - /* ms_message("Source Line: %d\n", MixerLine.dwSource); */ - /* ms_message("ComponentType: %d\n", MixerLine.dwComponentType); */ - - mlc.cbStruct = sizeof(MIXERLINECONTROLS); - mlc.dwLineID = MixerLine.dwLineID; - mlc.dwControlType = MIXERCONTROL_CONTROLTYPE_MUTE; //MIXERCONTROL_CONTROLTYPE_VOLUME; - mlc.cControls = 1; - mlc.pamxctrl = &mc; - mlc.cbmxctrl = sizeof(MIXERCONTROL); - mr = mixerGetLineControls((HMIXEROBJ)dwMixerHandle, - &mlc, MIXER_GETLINECONTROLSF_ONEBYTYPE); - - mcd.cbStruct = sizeof(MIXERCONTROLDETAILS); - mcd.hwndOwner = 0; - mcd.dwControlID = mc.dwControlID; - mcd.paDetails = &bMute; - mcd.cbDetails = sizeof(MIXERCONTROLDETAILS_BOOLEAN); - mcd.cChannels = 1; - mr = mixerSetControlDetails((HMIXEROBJ)dwMixerHandle, - &mcd, MIXER_SETCONTROLDETAILSF_VALUE); - - if (mr != MMSYSERR_NOERROR) - { - ms_error("winsndcard_set_control: mixerSetControlDetails failed. (0x%x)", mr); - return -1; - } - return 0; - } - break; - default: - ms_warning("winsndcard_set_control: unsupported command."); - } - return -1; -} - -static int winsnddscard_get_control(MSSndCard *card, MSSndCardControlElem e){ - WinSndDsCard *d=(WinSndDsCard*)card->data; - return -1; -} - -static void winsnddscard_init(MSSndCard *card){ - WinSndDsCard *c=(WinSndDsCard *)ms_new(WinSndDsCard,1); - c->removed=0; - card->data=c; -} - -static void winsnddscard_uninit(MSSndCard *card){ - ms_free(card->data); -} - -static void winsnddscard_detect(MSSndCardManager *m); -static MSSndCard *winsnddscard_dup(MSSndCard *obj); -static void winsnddscard_unload(MSSndCardManager *m); - -MSSndCardDesc winsndds_card_desc={ - "DirectSound", - winsnddscard_detect, - winsnddscard_init, - winsnddscard_set_level, - winsnddscard_get_level, - winsnddscard_set_source, - winsnddscard_set_control, - NULL, - ms_winsndds_read_new, - ms_winsndds_write_new, - winsnddscard_uninit, - winsnddscard_dup, - winsnddscard_unload -}; - -static MSSndCard *winsnddscard_dup(MSSndCard *obj){ - MSSndCard *card=ms_snd_card_new(&winsndds_card_desc); - card->name=ms_strdup(obj->name); - card->data=ms_new(WinSndDsCard,1); - memcpy(card->data,obj->data,sizeof(WinSndDsCard)); - return card; -} - -static MSSndCard *winsnddscard_new(const char *name, LPGUID lpguid, int in_dev, int out_dev, unsigned cap){ - MSSndCard *card=ms_snd_card_new(&winsndds_card_desc); - WinSndDsCard *d=(WinSndDsCard*)card->data; - card->name=ms_strdup(name); - d->in_devid=in_dev; - d->out_devid=out_dev; - card->capabilities=cap; - memset(&d->out_guid, 0, sizeof(GUID)); - memset(&d->in_guid, 0, sizeof(GUID)); - if (out_dev!=-1) - { - if (lpguid!=NULL) - memcpy(&d->out_guid, lpguid, sizeof(GUID)); - } - else - { - if (lpguid!=NULL) - memcpy(&d->in_guid, lpguid, sizeof(GUID)); - } - return card; -} - -static void add_or_update_card(MSSndCardManager *m, const char *name, LPGUID lpguid, int indev, int outdev, unsigned int capability){ - MSSndCard *card; - const MSList *elem=ms_snd_card_manager_get_list(m); - for(;elem!=NULL;elem=elem->next){ - card=(MSSndCard*)elem->data; - if (strcmp(card->desc->driver_type, winsndds_card_desc.driver_type)==0 - && strcmp(card->name,name)==0){ - /*update already entered card */ - WinSndDsCard *d=(WinSndDsCard*)card->data; - card->capabilities|=capability; - if (indev!=-1) - d->in_devid=indev; - if (outdev!=-1) - d->out_devid=outdev; - - if (outdev!=-1) - { - if (lpguid!=NULL) - memcpy(&d->out_guid, lpguid, sizeof(GUID)); - else - memset(&d->out_guid, 0, sizeof(GUID)); - } - if (indev!=-1) - { - if (lpguid!=NULL) - memcpy(&d->in_guid, lpguid, sizeof(GUID)); - else - memset(&d->in_guid, 0, sizeof(GUID)); - } - /* if (d->in_devid!=-1 && d->out_devid!=-1) */ - /* ms_message("DS: new full duplex card %s", name); */ - d->removed=0; - return; - } - } - /* add this new card:*/ - ms_snd_card_manager_add_card(m,winsnddscard_new(name,lpguid, indev,outdev,capability)); -} - -static BOOL CALLBACK enumerate_capture_devices_callback(LPGUID lpGUID, - LPCWSTR lpszDesc, - LPCWSTR lpszDrvName, - LPVOID lpContext ) -{ - MSSndCardManager *m = (MSSndCardManager*)lpContext; - static int dev_index=0; - - if ( lpGUID == NULL ) /* primary device */ - { - char szName[256]; - wchar_t snd_card_name[256]; - swprintf(snd_card_name, 256, L"%s", lpszDesc); - WideCharToMultiByte(CP_UTF8,0,snd_card_name,-1,szName,256,0,0); - - add_or_update_card(m,szName,lpGUID,dev_index,-1,MS_SND_CARD_CAP_CAPTURE); - dev_index++; - } - else - { - char szName[256]; - wchar_t snd_card_name[256]; - swprintf(snd_card_name, 256, L"%s", lpszDesc); - WideCharToMultiByte(CP_UTF8,0,snd_card_name,-1,szName,256,0,0); - - add_or_update_card(m,szName,lpGUID,dev_index,-1,MS_SND_CARD_CAP_CAPTURE); - dev_index++; - } - - return true; -} - -static BOOL CALLBACK enumerate_playback_devices_callback(LPGUID lpGUID, - LPCWSTR lpszDesc, - LPCWSTR lpszDrvName, - LPVOID lpContext ) -{ - MSSndCardManager *m = (MSSndCardManager*)lpContext; - static int dev_index=0; - - if ( lpGUID == NULL ) /* primary device */ - { - char szName[256]; - wchar_t snd_card_name[256]; - swprintf(snd_card_name, 256, L"%s", lpszDesc); - WideCharToMultiByte(CP_UTF8,0,snd_card_name,-1,szName,256,0,0); - - add_or_update_card(m,szName,lpGUID,-1,dev_index,MS_SND_CARD_CAP_PLAYBACK); - dev_index++; - } - else - { - char szName[256]; - wchar_t snd_card_name[256]; - swprintf(snd_card_name, 256, L"%s", lpszDesc); - WideCharToMultiByte(CP_UTF8,0,snd_card_name,-1,szName,256,0,0); - - add_or_update_card(m,szName,lpGUID,-1,dev_index,MS_SND_CARD_CAP_PLAYBACK); - dev_index++; - } - - return true; -} - -static void _winsnddscard_detect(MSSndCardManager *m){ - MMRESULT mr = NOERROR; - - if (ms_lib_instance==NULL) - { - ms_lib_instance = LoadLibrary(L"dsound.dll"); - if( ms_lib_instance == NULL ) - { - /* error */ - ms_debug("winsnddscard_detect: no support for dsound (missing dsound.dll)\n"); - return; - } - - ms_DllGetClassObject =(HRESULT (WINAPI *)(REFCLSID, REFIID , LPVOID *)) - GetProcAddress( ms_lib_instance, "DllGetClassObject" ); - - ms_DirectSoundCreate =(HRESULT (WINAPI *)(LPGUID, LPDIRECTSOUND *, LPUNKNOWN)) - GetProcAddress( ms_lib_instance, "DirectSoundCreate" ); - - ms_DirectSoundEnumerate =(HRESULT (WINAPI *)(LPDSENUMCALLBACKW, LPVOID)) - GetProcAddress( ms_lib_instance, "DirectSoundEnumerateW" ); - - ms_DirectSoundCaptureCreate =(HRESULT (WINAPI *)(LPGUID, LPDIRECTSOUNDCAPTURE *, LPUNKNOWN)) - GetProcAddress( ms_lib_instance, "DirectSoundCaptureCreate" ); - - ms_DirectSoundCaptureEnumerate =(HRESULT (WINAPI *)(LPDSENUMCALLBACKW, LPVOID)) - GetProcAddress( ms_lib_instance, "DirectSoundCaptureEnumerateW" ); - - ms_DirectSoundFullDuplexCreate =(HRESULT (WINAPI *)(LPCGUID , LPCGUID , - LPCDSCBUFFERDESC , LPCDSBUFFERDESC , HWND , - DWORD , LPDIRECTSOUNDFULLDUPLEX* , LPDIRECTSOUNDCAPTUREBUFFER8 *, - LPDIRECTSOUNDBUFFER8 *, LPUNKNOWN)) - GetProcAddress( ms_lib_instance, "DirectSoundFullDuplexCreate" ); - - if( ms_DllGetClassObject == NULL || - ms_DirectSoundCreate == NULL || - ms_DirectSoundEnumerate == NULL || - ms_DirectSoundCaptureEnumerate == NULL || - ms_DirectSoundCaptureCreate == NULL ) - { - /* error */ - ms_debug("winsnddscard_detect: no support for dsound\n"); - return; - } - } - - ms_DirectSoundCaptureEnumerate( (LPDSENUMCALLBACK)enumerate_capture_devices_callback, (void *)m ); - ms_DirectSoundEnumerate( (LPDSENUMCALLBACK)enumerate_playback_devices_callback, (void *)m ); -} - -static void deactivate_removed_cards(MSSndCardManager *m){ - MSSndCard *card; - const MSList *elem=ms_snd_card_manager_get_list(m); - for(;elem!=NULL;elem=elem->next){ - card=(MSSndCard*)elem->data; - if (strcmp(card->desc->driver_type, winsndds_card_desc.driver_type)==0){ - /*mark all cards as potentially removed, detect will check them immediately after */ - WinSndDsCard *d=(WinSndDsCard*)card->data; - if (d->removed) card->capabilities=0; - } - } -} - -static void mark_as_removed(MSSndCardManager *m){ - MSSndCard *card; - const MSList *elem=ms_snd_card_manager_get_list(m); - for(;elem!=NULL;elem=elem->next){ - card=(MSSndCard*)elem->data; - if (strcmp(card->desc->driver_type, winsndds_card_desc.driver_type)==0){ - /*mark all cards as potentially removed, detect will check them immediately after */ - WinSndDsCard *d=(WinSndDsCard*)card->data; - d->removed=1; - } - } -} - -static ms_thread_t poller_thread=NULL; -static bool_t poller_running=TRUE; - -static void * new_device_polling_thread(void *ignore){ - MSSndCardManager *m; - /*check for new devices every 2 seconds*/ - while(poller_running){ - ms_sleep(5); - if (poller_running){ - m=ms_snd_card_manager_get(); - if(!m) break; - mark_as_removed(m); - _winsnddscard_detect(m); - deactivate_removed_cards(m); - } - } - return NULL; -} - -static void stop_poller(){ - poller_running=FALSE; - ms_thread_join(poller_thread,NULL); - poller_thread=NULL; -} - -static void winsnddscard_unload(MSSndCardManager *m){ - stop_poller(); -} - -static void winsnddscard_detect(MSSndCardManager *m){ - _winsnddscard_detect(m); - if (poller_thread==NULL) - ms_thread_create(&poller_thread,NULL,new_device_polling_thread,NULL); -} - -typedef struct WinSndDs{ - int dev_id; - GUID in_guid; - GUID out_guid; - - ms_thread_t thread; - ms_mutex_t thread_lock; - ms_cond_t thread_cond; - bool_t thread_running; - - MSBufferizer output_buff; - LPDIRECTSOUNDFULLDUPLEX lpDirectSoundFullDuplex; - LPDIRECTSOUND lpDirectSound; - LPDIRECTSOUNDBUFFER lpDirectSoundOutputBuffer; - double dsw_framesWritten; - UINT writeOffset; /* last read position */ - - LPDIRECTSOUNDCAPTURE lpDirectSoundCapture; - LPDIRECTSOUNDCAPTUREBUFFER lpDirectSoundInputBuffer; - UINT readOffset; /* last read position */ - - int framesPerDSBuffer; - - WAVEFORMATEX wfx; - queue_t rq; - ms_mutex_t mutex; - uint64_t bytes_read; - unsigned int nbufs_playing; - - int32_t stat_input; - int32_t stat_output; - int32_t stat_notplayed; - -}WinSndDs; - -void * -winsndds_read_thread(void *arg) -{ - WinSndDs *d=(WinSndDs*)arg; - - ms_mutex_lock(&d->thread_lock); - ms_cond_signal(&d->thread_cond); - ms_mutex_unlock(&d->thread_lock); - - while(d->thread_running) - { - HRESULT hr; - DWORD capturePos; - DWORD readPos; - long filled = 0; - long bytesFilled = 0; - LPBYTE lpInBuf1 = NULL; - LPBYTE lpInBuf2 = NULL; - DWORD dwInSize1 = 0; - DWORD dwInSize2 = 0; - - hr = IDirectSoundCaptureBuffer_GetCurrentPosition( d->lpDirectSoundInputBuffer, - &capturePos, &readPos ); - if( hr != DS_OK ) - { - continue; - } - - filled = readPos - d->readOffset; - if( filled < 0 ) filled += d->framesPerDSBuffer; - bytesFilled = filled; - - hr = IDirectSoundCaptureBuffer_Lock ( d->lpDirectSoundInputBuffer, - d->readOffset, bytesFilled, - (void **) &lpInBuf1, &dwInSize1, - (void **) &lpInBuf2, &dwInSize2, 0); - if (hr != DS_OK) - { - Sleep(10); - continue; - } - - if (dwInSize1==0) - { - Sleep(10); - } - else if (dwInSize1>=bytesFilled) - { - mblk_t *m=allocb(bytesFilled,0); - memcpy(m->b_rptr, lpInBuf1, bytesFilled); - m->b_wptr+=bytesFilled; - ms_mutex_lock(&d->mutex); - putq(&d->rq,m); - ms_mutex_unlock(&d->mutex); - d->bytes_read+=bytesFilled; - /* ms_message("bytesFilled=%i\n",bytesFilled); */ - } - else - { - mblk_t *m=allocb(bytesFilled,0); - memcpy(m->b_rptr, lpInBuf1, dwInSize1); - memcpy(m->b_rptr+dwInSize1, lpInBuf2, dwInSize2); - m->b_wptr+=bytesFilled; - ms_mutex_lock(&d->mutex); - putq(&d->rq,m); - ms_mutex_unlock(&d->mutex); - d->bytes_read+=bytesFilled; - /* ms_message("bytesFilled=%i\n",bytesFilled); */ - } - - d->readOffset = (d->readOffset + bytesFilled) % d->framesPerDSBuffer; - - IDirectSoundCaptureBuffer_Unlock( d->lpDirectSoundInputBuffer, - lpInBuf1, dwInSize1, lpInBuf2, dwInSize2); - } - - ms_mutex_lock(&d->thread_lock); - ms_cond_signal(&d->thread_cond); - ms_mutex_unlock(&d->thread_lock); - ms_thread_exit(NULL); - return NULL; -} - -static void winsndds_apply_settings(WinSndDs *d){ - d->wfx.nBlockAlign=d->wfx.nChannels*d->wfx.wBitsPerSample/8; - d->wfx.nAvgBytesPerSec=d->wfx.nSamplesPerSec*d->wfx.nBlockAlign; -} - -static uint64_t winsndds_get_cur_time( void *data){ - WinSndDs *d=(WinSndDs*)data; - uint64_t curtime=(d->bytes_read*1000)/(uint64_t)d->wfx.nAvgBytesPerSec; - return curtime; -} - - -static void winsndds_init(MSFilter *f){ - WinSndDs *d=(WinSndDs *)ms_new0(WinSndDs,1); - d->wfx.wFormatTag = WAVE_FORMAT_PCM; - d->wfx.cbSize = 0; - d->wfx.nAvgBytesPerSec = 16000; - d->wfx.nBlockAlign = 2; - d->wfx.nChannels = 1; - d->wfx.nSamplesPerSec = 8000; - d->wfx.wBitsPerSample = 16; - qinit(&d->rq); - ms_mutex_init(&d->mutex,NULL); - f->data=d; - - d->stat_input=0; - d->stat_output=0; - d->stat_notplayed=0; - - d->framesPerDSBuffer = 320 * (8000 / 1000); - - d->thread = NULL; - ms_mutex_init(&d->thread_lock,NULL); - ms_cond_init(&d->thread_cond,NULL); - d->thread_running = FALSE; - - ms_bufferizer_init(&d->output_buff); -} - -static void winsndds_uninit(MSFilter *f){ - WinSndDs *d=(WinSndDs*)f->data; - - d->thread = NULL; - d->thread_running = FALSE; - ms_cond_destroy(&d->thread_cond); - ms_mutex_destroy(&d->thread_lock); - ms_bufferizer_uninit(&d->output_buff); - - flushq(&d->rq,0); - ms_mutex_destroy(&d->mutex); - ms_free(f->data); -} - -static void winsndds_read_preprocess(MSFilter *f){ - WinSndDs *d=(WinSndDs*)f->data; - DSCBUFFERDESC captureDesc; - HRESULT hr; - - d->stat_input=0; - d->stat_output=0; - d->stat_notplayed=0; - - d->framesPerDSBuffer = d->wfx.nAvgBytesPerSec/4; - winsndds_apply_settings(d); - ms_message("full duplex and echo canceller! (%x)" ,d->lpDirectSound); - ms_DirectSoundCaptureCreate( &d->in_guid, &d->lpDirectSoundCapture, NULL ); - - ZeroMemory(&captureDesc, sizeof(DSCBUFFERDESC)); - captureDesc.dwSize = sizeof(DSCBUFFERDESC); - captureDesc.dwFlags = 0; - captureDesc.dwBufferBytes = d->framesPerDSBuffer; - captureDesc.lpwfxFormat = &d->wfx; - - if ((hr = IDirectSoundCapture_CreateCaptureBuffer( d->lpDirectSoundCapture, - &captureDesc, &d->lpDirectSoundInputBuffer, NULL)) != DS_OK) - { - return; - } - d->readOffset = 0; - - hr = IDirectSoundCaptureBuffer_Start( d->lpDirectSoundInputBuffer, DSCBSTART_LOOPING ); - - ms_mutex_lock(&f->ticker->lock); - ms_ticker_set_time_func(f->ticker,winsndds_get_cur_time,d); - ms_mutex_unlock(&f->ticker->lock); - - d->thread_running=TRUE; - ms_thread_create(&d->thread,NULL,winsndds_read_thread,d); - ms_mutex_lock(&d->thread_lock); - ms_cond_wait(&d->thread_cond,&d->thread_lock); - ms_mutex_unlock(&d->thread_lock); - - return; -} - -static void winsndds_read_postprocess(MSFilter *f){ - WinSndDs *d=(WinSndDs*)f->data; - - ms_mutex_lock(&d->thread_lock); - d->thread_running=FALSE; - ms_cond_wait(&d->thread_cond,&d->thread_lock); - ms_mutex_unlock(&d->thread_lock); - ms_thread_join(d->thread,NULL); - - ms_mutex_lock(&f->ticker->lock); - ms_ticker_set_time_func(f->ticker,NULL,NULL); - ms_mutex_unlock(&f->ticker->lock); - - if( d->lpDirectSoundInputBuffer ) - { - IDirectSoundCaptureBuffer_Stop( d->lpDirectSoundInputBuffer ); - IDirectSoundCaptureBuffer_Release( d->lpDirectSoundInputBuffer ); - d->lpDirectSoundInputBuffer = NULL; - } - - if( d->lpDirectSoundCapture ) - { - IDirectSoundCapture_Release( d->lpDirectSoundCapture ); - d->lpDirectSoundCapture = NULL; - } - - ms_message("Shutting down sound device (playing: %i) (input-output: %i) (notplayed: %i)", d->nbufs_playing, d->stat_input - d->stat_output, d->stat_notplayed); - flushq(&d->rq,0); -} - -static void winsndds_read_process(MSFilter *f){ - WinSndDs *d=(WinSndDs*)f->data; - mblk_t *m; - - ms_mutex_lock(&d->mutex); - while((m=getq(&d->rq))!=NULL){ - ms_queue_put(f->outputs[0],m); - } - ms_mutex_unlock(&d->mutex); -} - -static void winsndds_write_preprocess(MSFilter *f){ - WinSndDs *d=(WinSndDs*)f->data; - - DWORD dwDataLen; - DWORD playCursor; - HWND hWnd; - HRESULT hr; - LPDIRECTSOUNDBUFFER pPrimaryBuffer; - DSBUFFERDESC primaryDesc; - DSBUFFERDESC secondaryDesc; - unsigned char* pDSBuffData; - DWORD outputBufferWriteOffsetBytes; - - MSList *filters=NULL; - MSFilter *f_capture_filter=NULL; - WinSndDs *d_capture_filter=NULL; - - filters=ms_filter_find_neighbours(f); - if (filters!=NULL) - { - MSList *it; - /* search for another winsndds filter */ - for(it=filters;it!=NULL;it=it->next) - { - f_capture_filter = (MSFilter*)it->data; - if (f_capture_filter->desc->id == MS_WINSNDDS_READ_ID) - { - /* found */ - d_capture_filter=(WinSndDs*)f_capture_filter->data; - break; - } - f_capture_filter=NULL; - } - ms_list_free(filters); - } - - d->stat_input=0; - d->stat_output=0; - d->stat_notplayed=0; - - d->framesPerDSBuffer = d->wfx.nAvgBytesPerSec/4; - winsndds_apply_settings(d); - - if (d_capture_filter!=NULL - && d_capture_filter->lpDirectSoundCapture!=NULL - && IsEqualIID(d_capture_filter->in_guid, d->in_guid)) - { - DSCBUFFERDESC captureDesc; - - winsndds_read_postprocess(f_capture_filter); - - DSCEFFECTDESC dscfx[1]; - ZeroMemory( &dscfx[0], sizeof( DSCEFFECTDESC ) ); - dscfx[0].dwSize = sizeof( DSCEFFECTDESC ); - dscfx[0].dwFlags = DSCFX_LOCSOFTWARE ; - dscfx[0].guidDSCFXClass = GUID_DSCFX_CLASS_AEC; - dscfx[0].guidDSCFXInstance = GUID_DSCFX_MS_AEC; - dscfx[0].dwReserved1 = 0; - dscfx[0].dwReserved2 = 0; - - d_capture_filter->framesPerDSBuffer = d_capture_filter->wfx.nAvgBytesPerSec/4; - winsndds_apply_settings(d_capture_filter); - - ZeroMemory(&captureDesc, sizeof(DSCBUFFERDESC)); - captureDesc.dwSize = sizeof(DSCBUFFERDESC); - captureDesc.dwFlags = DSCBCAPS_CTRLFX; - captureDesc.dwBufferBytes = d_capture_filter->framesPerDSBuffer; - captureDesc.lpwfxFormat = &d_capture_filter->wfx; - captureDesc.dwFXCount = 1; - captureDesc.lpDSCFXDesc = dscfx; - - ZeroMemory(&secondaryDesc, sizeof(DSBUFFERDESC)); - secondaryDesc.dwSize = sizeof(DSBUFFERDESC); - secondaryDesc.dwFlags = DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2 - | DSBCAPS_LOCSOFTWARE; - secondaryDesc.dwBufferBytes = d->framesPerDSBuffer; - secondaryDesc.lpwfxFormat = &d->wfx; - - hWnd = GetDesktopWindow(); - hr = ms_DirectSoundFullDuplexCreate(&d_capture_filter->in_guid, - &d->out_guid, - &captureDesc, - &secondaryDesc, - hWnd, - DSSCL_NORMAL, - &d->lpDirectSoundFullDuplex, - (LPDIRECTSOUNDCAPTUREBUFFER8*)&d_capture_filter->lpDirectSoundInputBuffer, - (LPDIRECTSOUNDBUFFER8*)&d->lpDirectSoundOutputBuffer, - NULL); - - if (hr!=DS_OK) - { - ms_message("full duplex and echo canceller: disabled!"); - captureDesc.dwFlags = 0; - captureDesc.dwFXCount = 0; - captureDesc.lpDSCFXDesc = NULL; - - hr = ms_DirectSoundFullDuplexCreate(&d_capture_filter->in_guid, - &d->out_guid, - &captureDesc, - &secondaryDesc, - hWnd, - DSSCL_NORMAL, - &d->lpDirectSoundFullDuplex, - (LPDIRECTSOUNDCAPTUREBUFFER8*)&d_capture_filter->lpDirectSoundInputBuffer, - (LPDIRECTSOUNDBUFFER8*)&d->lpDirectSoundOutputBuffer, - NULL); - } - if (hr!=DS_OK) - { - ms_message("full duplex and echo canceller: disabled!"); - return; - } - ms_message("full duplex and echo canceller: activated!"); - - d_capture_filter->readOffset = 0; - - hr = IDirectSoundCaptureBuffer_Start( d_capture_filter->lpDirectSoundInputBuffer, DSCBSTART_LOOPING ); - - ms_mutex_lock(&f->ticker->lock); - ms_ticker_set_time_func(f_capture_filter->ticker,winsndds_get_cur_time,d_capture_filter); - ms_mutex_unlock(&f->ticker->lock); - - d_capture_filter->thread_running=TRUE; - ms_thread_create(&d_capture_filter->thread,NULL,winsndds_read_thread,d_capture_filter); - ms_mutex_lock(&d_capture_filter->thread_lock); - ms_cond_wait(&d_capture_filter->thread_cond,&d_capture_filter->thread_lock); - ms_mutex_unlock(&d_capture_filter->thread_lock); - } - else - { - ms_DirectSoundCreate( &d->out_guid, &d->lpDirectSound, NULL ); - - - hWnd = GetDesktopWindow(); - if ((hr = IDirectSound_SetCooperativeLevel( d->lpDirectSound, - hWnd, DSSCL_PRIORITY)) != DS_OK) //DSSCL_EXCLUSIVE)) != DS_OK) - { - return ; - } - - ZeroMemory(&primaryDesc, sizeof(DSBUFFERDESC)); - primaryDesc.dwSize = sizeof(DSBUFFERDESC); - primaryDesc.dwFlags = DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_PRIMARYBUFFER; - primaryDesc.dwBufferBytes = 0; - primaryDesc.lpwfxFormat = NULL; - if ((hr = IDirectSound_CreateSoundBuffer( d->lpDirectSound, - &primaryDesc, &pPrimaryBuffer, NULL)) != DS_OK) - { - return ; - } - - if ((hr = IDirectSoundBuffer_SetFormat( pPrimaryBuffer, &d->wfx)) != DS_OK) - { - return ; - } - IDirectSoundBuffer_Release(pPrimaryBuffer); - - ZeroMemory(&secondaryDesc, sizeof(DSBUFFERDESC)); - secondaryDesc.dwSize = sizeof(DSBUFFERDESC); - secondaryDesc.dwFlags = DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2; - secondaryDesc.dwBufferBytes = d->framesPerDSBuffer; - secondaryDesc.lpwfxFormat = &d->wfx; - if ((hr = IDirectSound_CreateSoundBuffer( d->lpDirectSound, - &secondaryDesc, &d->lpDirectSoundOutputBuffer, NULL)) != DS_OK) - { - return ; - } - } - - if ((hr = IDirectSoundBuffer_Lock( d->lpDirectSoundOutputBuffer, 0, - d->framesPerDSBuffer, - (LPVOID*)&pDSBuffData, - &dwDataLen, NULL, 0, 0)) != DS_OK) - { - return ; - } - - ZeroMemory(pDSBuffData, dwDataLen); - if ((hr = IDirectSoundBuffer_Unlock( d->lpDirectSoundOutputBuffer, - pDSBuffData, dwDataLen, NULL, 0)) != DS_OK) - { - return ; - } - - hr = IDirectSoundBuffer_GetCurrentPosition( d->lpDirectSoundOutputBuffer, - &playCursor, &outputBufferWriteOffsetBytes ); - if( hr != DS_OK ) - { - return ; - } - - hr = IDirectSoundBuffer_SetCurrentPosition( d->lpDirectSoundOutputBuffer, 0 ); - if( hr != DS_OK ) - { - return ; - } - - hr = IDirectSoundBuffer_Play( d->lpDirectSoundOutputBuffer, 0, 0, DSBPLAY_LOOPING); - if( hr != DS_OK ) - { - return ; - } - d->writeOffset=-1; - - return ; -} - -static void winsndds_write_postprocess(MSFilter *f){ - WinSndDs *d=(WinSndDs*)f->data; - - if( d->lpDirectSoundOutputBuffer ) - { - IDirectSoundBuffer_Stop( d->lpDirectSoundOutputBuffer ); - IDirectSoundBuffer_Release( d->lpDirectSoundOutputBuffer ); - d->lpDirectSoundOutputBuffer = NULL; - } - - if( d->lpDirectSound ) - { - IDirectSound_Release( d->lpDirectSound ); - d->lpDirectSound = NULL; - } - - if( d->lpDirectSoundFullDuplex ) - { - IDirectSoundFullDuplex_Release( d->lpDirectSoundFullDuplex ); - d->lpDirectSoundFullDuplex = NULL; - } - - ms_message("Shutting down sound device (playing: %i) (input-output: %i) (notplayed: %i)", d->nbufs_playing, d->stat_input - d->stat_output, d->stat_notplayed); - d->writeOffset=-1; -} - -static void winsndds_write_process(MSFilter *f){ - WinSndDs *d=(WinSndDs*)f->data; - int discarded=0; - DWORD dwStatus; - HRESULT hr; - - if (d->lpDirectSoundOutputBuffer==NULL) { - ms_queue_flush(f->inputs[0]); - return; - } - - ms_bufferizer_put_from_queue(&d->output_buff,f->inputs[0]); - - if (d->writeOffset==-1) - { - if (ms_bufferizer_get_avail(&d->output_buff)>=d->framesPerDSBuffer) - { - DWORD playCursor; - DWORD outputBufferWriteOffsetBytes; - IDirectSoundBuffer_GetCurrentPosition( d->lpDirectSoundOutputBuffer, - &playCursor, &outputBufferWriteOffsetBytes ); - d->writeOffset = outputBufferWriteOffsetBytes; - } - else - return; - } - - DWORD current_playOffset; - long msize_max = 0; - DWORD currentWriteOffset; - IDirectSoundBuffer_GetCurrentPosition( d->lpDirectSoundOutputBuffer, - ¤t_playOffset, ¤tWriteOffset ); - - msize_max = current_playOffset - currentWriteOffset; - if( msize_max < 0 ) msize_max += d->framesPerDSBuffer; - - /* write from d->writeOffset up to current_playOffset */ - msize_max=current_playOffset-d->writeOffset; - if( msize_max < 0 ) msize_max += d->framesPerDSBuffer; - - //ms_message("DS information: last_writeOffset=%i current_playOffset=%i current_writeOffset=%i max_writable=%i", - // d->writeOffset, current_playOffset, currentWriteOffset, msize_max); - - hr = IDirectSoundBuffer_GetStatus (d->lpDirectSoundOutputBuffer, &dwStatus); - if (dwStatus & DSBSTATUS_BUFFERLOST) { - hr = IDirectSoundBuffer_Restore (d->lpDirectSoundOutputBuffer); - d->writeOffset = 0; - ms_message("DSBSTATUS_BUFFERLOST: restoring buffer"); - } - - if (msize_max==0) - return; - int msize=d->framesPerDSBuffer/4; - if (msize>msize_max) - msize = msize_max; - while (ms_bufferizer_get_avail(&d->output_buff)>=msize) - { - LPBYTE lpOutBuf1 = NULL; - LPBYTE lpOutBuf2 = NULL; - DWORD dwOutSize1 = 0; - DWORD dwOutSize2 = 0; - char input[15360]; - - hr = IDirectSoundBuffer_Lock ( d->lpDirectSoundOutputBuffer, - d->writeOffset, msize, - (void **) &lpOutBuf1, &dwOutSize1, - (void **) &lpOutBuf2, &dwOutSize2, 0); /* DSBLOCK_FROMWRITECURSOR); */ - if (hr != DS_OK) - { - ms_error("DirectSound IDirectSoundBuffer_Lock failed, hresult = 0x%x\n", hr); - break; - } - - if (dwOutSize1==0) - { - ms_error("no free room to play sample\n"); - } - else if (dwOutSize1+dwOutSize2!=msize) - { - ms_bufferizer_read(&d->output_buff,(uint8_t*)input,dwOutSize1+dwOutSize2); - memcpy(lpOutBuf1, input, dwOutSize1); - memcpy(lpOutBuf2, input+dwOutSize1, dwOutSize2); - } - else if (dwOutSize1>=msize) - { - ms_bufferizer_read(&d->output_buff,(uint8_t*)input,msize); - memcpy(lpOutBuf1, input, msize); - } - else - { - ms_bufferizer_read(&d->output_buff,(uint8_t*)input,msize); - memcpy(lpOutBuf1, input, dwOutSize1); - memcpy(lpOutBuf2, input+dwOutSize1, dwOutSize2); - } - - d->writeOffset=(d->writeOffset+dwOutSize1+dwOutSize2) % d->framesPerDSBuffer; - msize_max = msize_max - (dwOutSize1+dwOutSize2); - if (msize>msize_max) - msize = msize_max; - IDirectSoundBuffer_Unlock( d->lpDirectSoundOutputBuffer, - lpOutBuf1, dwOutSize1, lpOutBuf2, dwOutSize2); - if (dwOutSize1==0) - break; - if (dwOutSize1+dwOutSize2!=msize) - break; - } - if (msize==0) - { - if (ms_bufferizer_get_avail(&d->output_buff)>=3*d->wfx.nSamplesPerSec/50) - { - ms_warning("Removing extra data for sound card %i", ms_bufferizer_get_avail(&d->output_buff)); - ms_bufferizer_uninit(&d->output_buff); - ms_bufferizer_init(&d->output_buff); - } - } - - if (discarded>0) - ms_warning("Extra data for sound card removed (%i buf), (playing: %i) (input-output: %i)", discarded, d->nbufs_playing, d->stat_input - d->stat_output); -} - -static int get_rate(MSFilter *f, void *arg){ - WinSndDs *d=(WinSndDs*)f->data; - *((int*)arg)=d->wfx.nSamplesPerSec; - return 0; -} - -static int set_rate(MSFilter *f, void *arg){ - WinSndDs *d=(WinSndDs*)f->data; - d->wfx.nSamplesPerSec=*((int*)arg); - return 0; -} - -static int set_nchannels(MSFilter *f, void *arg){ - WinSndDs *d=(WinSndDs*)f->data; - d->wfx.nChannels=*((int*)arg); - return 0; -} - -static int winsndds_get_stat_input(MSFilter *f, void *arg){ - WinSndDs *d=(WinSndDs*)f->data; - return d->stat_input; -} - -static int winsndds_get_stat_ouptut(MSFilter *f, void *arg){ - WinSndDs *d=(WinSndDs*)f->data; - - return d->stat_output; -} - -static int winsndds_get_stat_discarded(MSFilter *f, void *arg){ - WinSndDs *d=(WinSndDs*)f->data; - - return d->stat_notplayed; -} - -static MSFilterMethod winsndds_methods[]={ - { MS_FILTER_GET_SAMPLE_RATE , get_rate }, - { MS_FILTER_SET_SAMPLE_RATE , set_rate }, - { MS_FILTER_SET_NCHANNELS , set_nchannels }, - { MS_FILTER_GET_STAT_INPUT, winsndds_get_stat_input }, - { MS_FILTER_GET_STAT_OUTPUT, winsndds_get_stat_ouptut }, - { MS_FILTER_GET_STAT_DISCARDED, winsndds_get_stat_discarded }, - { 0 , NULL } -}; - -MSFilterDesc winsndds_read_desc={ - MS_WINSNDDS_READ_ID, - "DirecSoundRead", - "DirectSound capture filter for Windows", - MS_FILTER_OTHER, - NULL, - 0, - 1, - winsndds_init, - winsndds_read_preprocess, - winsndds_read_process, - winsndds_read_postprocess, - winsndds_uninit, - winsndds_methods -}; - - -MSFilterDesc winsndds_write_desc={ - MS_WINSNDDS_WRITE_ID, - "DirecSoundWrite", - "DirectSound playback filter for Windows", - MS_FILTER_OTHER, - NULL, - 1, - 0, - winsndds_init, - winsndds_write_preprocess, - winsndds_write_process, - winsndds_write_postprocess, - winsndds_uninit, - winsndds_methods -}; - -MSFilter *ms_winsndds_read_new(MSSndCard *card){ - MSFilter *f=ms_filter_new_from_desc(&winsndds_read_desc); - WinSndDsCard *wc=(WinSndDsCard*)card->data; - WinSndDs *d=(WinSndDs*)f->data; - d->dev_id=wc->in_devid; - memcpy(&d->in_guid, &wc->in_guid, sizeof(GUID)); - memcpy(&d->out_guid, &wc->out_guid, sizeof(GUID)); - return f; -} - - -MSFilter *ms_winsndds_write_new(MSSndCard *card){ - MSFilter *f=ms_filter_new_from_desc(&winsndds_write_desc); - WinSndDsCard *wc=(WinSndDsCard*)card->data; - WinSndDs *d=(WinSndDs*)f->data; - d->dev_id=wc->out_devid; - memcpy(&d->in_guid, &wc->in_guid, sizeof(GUID)); - memcpy(&d->out_guid, &wc->out_guid, sizeof(GUID)); - return f; -} - -MS_FILTER_DESC_EXPORT(winsndds_read_desc) -MS_FILTER_DESC_EXPORT(winsndds_write_desc) - -#endif diff --git a/linphone/mediastreamer2/src/winvideo.c b/linphone/mediastreamer2/src/winvideo.c deleted file mode 100644 index 91c123ba4..000000000 --- a/linphone/mediastreamer2/src/winvideo.c +++ /dev/null @@ -1,682 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/msvideo.h" -#include "mediastreamer2/msticker.h" -#include "mediastreamer2/msv4l.h" -#include "Vfw.h" -#include -#include - -#include "nowebcam.h" -#include "mediastreamer2/mswebcam.h" - -#ifndef AVSTREAMMASTER_NONE -#define AVSTREAMMASTER_NONE 1 -#endif - -#define AMD_HACK2 - -typedef struct V4wState{ -#ifdef AMD_HACK2 - ms_thread_t thread; - ms_mutex_t thread_lock; - ms_cond_t thread_cond; - bool_t thread_running; -#endif - char dev[512]; - int devidx; - HWND capvideo; - MSVideoSize vsize; - int pix_fmt; - mblk_t *mire[10]; - mblk_t *reverted; - queue_t rq; - ms_mutex_t mutex; - int frame_ind; - int frame_max; - float fps; - float start_time; - int frame_count; - bool_t running; - bool_t startwith_yuv_bug; /* avoid bug with USB vimicro cards. */ - bool_t started; - bool_t autostarted; - bool_t invert_rgb; -}V4wState; - -static void dummy(void*p){ -} - -LRESULT CALLBACK VideoStreamCallback(HWND hWnd, LPVIDEOHDR lpVHdr) -{ - V4wState *s; - mblk_t *buf; - int size; - - s = (V4wState *)capGetUserData(hWnd); - if (s==NULL) - return FALSE; - - size = lpVHdr->dwBufferLength; - if (size>0 && s->running){ - buf = esballoc(lpVHdr->lpData,size,0,dummy); - buf->b_wptr+=size; - - ms_mutex_lock(&s->mutex); - putq(&s->rq, buf); - ms_mutex_unlock(&s->mutex); - } - return TRUE ; -} - -static bool_t try_format(V4wState *s, BITMAPINFO *videoformat, MSPixFmt pixfmt){ - bool_t ret; - capGetVideoFormat(s->capvideo, videoformat, sizeof(BITMAPINFO)); - videoformat->bmiHeader.biSizeImage = 0; - videoformat->bmiHeader.biWidth = s->vsize.width; - videoformat->bmiHeader.biHeight = s->vsize.height; - switch(pixfmt){ - case MS_YUV420P: - videoformat->bmiHeader.biBitCount = 12; - videoformat->bmiHeader.biCompression=MAKEFOURCC('I','4','2','0'); - break; - case MS_YUY2: - videoformat->bmiHeader.biBitCount = 16; - videoformat->bmiHeader.biCompression=MAKEFOURCC('Y','U','Y','2'); - break; - case MS_RGB24: - videoformat->bmiHeader.biBitCount = 24; - videoformat->bmiHeader.biCompression=BI_RGB; - break; - default: - return FALSE; - } - ret=capSetVideoFormat(s->capvideo, videoformat, sizeof(BITMAPINFO)); - if (ret) { - /*recheck video format */ - capGetVideoFormat(s->capvideo, videoformat, sizeof(BITMAPINFO)); - } - return ret; -} - -static int v4w_open_videodevice(V4wState *s) -{ - CAPTUREPARMS capparam ; - BITMAPINFO videoformat; - char compname[5]; - int i; - MSPixFmt driver_last; - char dev[80]; - char ver[80]; - compname[4]='\0'; - - for (i = 0; i < 9; i++){ - if (capGetDriverDescription(i, dev, sizeof (dev), - ver, sizeof (ver))) - { - snprintf(s->dev, sizeof(s->dev), "%s/%s",dev,ver); - ms_message("v4w: detected %s",s->dev); - s->devidx=i; - break; - } - } - if (s->capvideo==NULL) - { - s->capvideo = capCreateCaptureWindow("Capture Window",WS_CHILD /* WS_OVERLAPPED */ - ,0,0,s->vsize.width,s->vsize.height,HWND_MESSAGE, 0) ; - if (s->capvideo==NULL) - { - ms_warning("v4w: could not create capture windows"); - return -1; - } - } - - if(!capDriverConnect(s->capvideo,s->devidx )) - { - ms_warning("v4w: could not connect to capture driver"); - DestroyWindow(s->capvideo); - s->capvideo=NULL; - s->pix_fmt=MS_YUV420P; /* no webcam stuff */ - return -1; - } - /* - capPreviewRate(s->capvideo,s->fps) ; - if(!capPreview (s->capvideo, 1)) - { - ms_warning("v4w: cannot start video preview"); - capDriverDisconnect(s->capvideo); - DestroyWindow(s->capvideo); - s->capvideo=NULL; - return -1; - } - */ - capCaptureGetSetup(s->capvideo,&capparam,sizeof(capparam)) ; - capparam.dwRequestMicroSecPerFrame = 100000 ; - // detach capture from application - capparam.fYield = TRUE ; - capparam.fMakeUserHitOKToCapture = FALSE; - capparam.fAbortLeftMouse = FALSE; - capparam.fAbortRightMouse = FALSE; - capparam.wPercentDropForError = 90 ; - capparam.fCaptureAudio = FALSE ; - capparam.fAbortRightMouse = FALSE; - capparam.fAbortLeftMouse = FALSE; - capparam.AVStreamMaster = AVSTREAMMASTER_NONE ; - - if (!capCaptureSetSetup(s->capvideo,&capparam,sizeof(capparam))){ - ms_error("capCaptureSetSetup failed."); - } - capSetUserData(s->capvideo, s); - capGetVideoFormat(s->capvideo, &videoformat, sizeof(BITMAPINFO)); - /* "orig planes = " disp->videoformat.bmiHeader.biPlanes */ - /* "orig bitcount = " disp->videoformat.bmiHeader.biBitCount */ - /* "orig compression = " disp->videoformat.bmiHeader.biCompression */ - memcpy(compname,&videoformat.bmiHeader.biCompression,4); - ms_message("v4w: camera's current format is %s", compname); - - driver_last=ms_fourcc_to_pix_fmt(videoformat.bmiHeader.biCompression); - if (s->startwith_yuv_bug==TRUE && try_format(s,&videoformat,MS_RGB24)){ - s->pix_fmt=MS_RGB24; - ms_message("Using RGB24"); - }else if (driver_last!=MS_PIX_FMT_UNKNOWN && try_format(s,&videoformat,driver_last)){ - ms_message("Using driver last setting"); - s->pix_fmt=driver_last; - }else if (try_format(s,&videoformat,MS_YUV420P)){ - s->pix_fmt=MS_YUV420P; - ms_message("Using YUV420P"); - }else if (try_format(s,&videoformat,MS_RGB24)){ - s->pix_fmt=MS_RGB24; - ms_message("Using RGB24"); - s->startwith_yuv_bug=TRUE; - }else if (try_format(s,&videoformat,MS_YUY2)){ - s->pix_fmt=MS_YUY2; - ms_message("Using YUY2"); - }else{ - ms_error("v4w: Failed to set any video format."); - capDriverDisconnect (s->capvideo); - DestroyWindow(s->capvideo); - s->capvideo=NULL; - return -1; - } - if (s->pix_fmt==MS_RGB24){ - s->invert_rgb=(videoformat.bmiHeader.biHeight>0); - }else s->invert_rgb=FALSE; - - if (!capSetCallbackOnVideoStream(s->capvideo, VideoStreamCallback)) - { - ms_error("v4w: fail to set capture callback"); - capDriverDisconnect (s->capvideo); - DestroyWindow(s->capvideo); - s->capvideo=NULL; - return -1; - } - if (!capCaptureSequenceNoFile(s->capvideo)){ - ms_error("v4w: fail to start capture"); - capDriverDisconnect (s->capvideo); - capSetCallbackOnVideoStream(s->capvideo, NULL); - DestroyWindow(s->capvideo); - s->capvideo=NULL; - } - return 0; -} - -static void v4w_init(MSFilter *f){ - V4wState *s=(V4wState *)ms_new0(V4wState,1); - int idx; - s->vsize.width=MS_VIDEO_SIZE_CIF_W; - s->vsize.height=MS_VIDEO_SIZE_CIF_H; - s->pix_fmt=MS_RGB24; - - s->capvideo=NULL; - qinit(&s->rq); - for (idx=0;idx<10;idx++) - { - s->mire[idx]=NULL; - } - ms_mutex_init(&s->mutex,NULL); - s->start_time=0; - s->frame_count=-1; - s->fps=15; - s->started=FALSE; - s->autostarted=FALSE; - s->invert_rgb=FALSE; - s->reverted=NULL; -#ifdef AMD_HACK2 - /* avoid bug with USB vimicro cards: - How can I detect that this problem exist? - */ - s->startwith_yuv_bug=FALSE; -#endif - -#ifdef AMD_HACK2 - s->thread = NULL; - ms_mutex_init(&s->thread_lock,NULL); - ms_cond_init(&s->thread_cond,NULL); - s->thread_running = FALSE; -#endif - - f->data=s; -} - -static int _v4w_start(V4wState *s, void *arg) -{ - int i; - s->frame_count=-1; - i = v4w_open_videodevice(s); - if (i==0 && s->startwith_yuv_bug==TRUE) - { - /* reopen device directly with MS_RGB24 */ - if (s->capvideo){ - capSetUserData(s->capvideo, (long) 0); - capCaptureStop(s->capvideo); - capCaptureAbort(s->capvideo); - capDriverDisconnect(s->capvideo); - capSetCallbackOnVideoStream(s->capvideo, NULL); - flushq(&s->rq,0); - ms_message("v4w: destroying capture window"); - DestroyWindow(s->capvideo); - ms_message("v4w: capture window destroyed"); - s->capvideo=NULL; - } - i = v4w_open_videodevice(s); - } - return i; -} - -static int _v4w_stop(V4wState *s, void *arg){ - s->frame_count=-1; - if (s->capvideo){ - capCaptureStop(s->capvideo); - Sleep(1000); - //capCaptureAbort(s->capvideo); - capSetCallbackOnVideoStream(s->capvideo, NULL); - //SendMessage(s->capvideo, WM_CLOSE, 0, 0); - capDriverDisconnect(s->capvideo); - capSetUserData(s->capvideo, (long) 0); - flushq(&s->rq,0); - ms_message("v4w: destroying capture window"); - DestroyWindow(s->capvideo); - ms_message("v4w: capture window destroyed"); - s->capvideo=NULL; - } -#if 0 - if (s->capvideo){ - CAPSTATUS status; - capCaptureStop(s->capvideo); - capDriverDisconnect(s->capvideo); - capCaptureAbort(s->capvideo); - - capSetCallbackOnVideoStream(s->capvideo, NULL); - while (1) - { - if (capGetStatus(s->capvideo, &status, sizeof(status))) - { - if (status.fCapturingNow==FALSE) - break; - Sleep(10); - ms_message("still capturing"); - } - } - DestroyWindow(s->capvideo); - s->capvideo=NULL; - } -#endif - return 0; -} - -#ifdef AMD_HACK2 - -void * -v4w_thread(void *arg) -{ - V4wState *s=(V4wState*)arg; - MSG msg; - - ms_mutex_lock(&s->thread_lock); - _v4w_start(s, NULL); - ms_cond_signal(&s->thread_cond); - ms_mutex_unlock(&s->thread_lock); - - while(s->thread_running) - { - BOOL fGotMessage; - if((fGotMessage = PeekMessage(&msg, (HWND) s->capvideo, 0, 0, PM_REMOVE)) != 0) - { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - else - Sleep(10); - } - - ms_mutex_lock(&s->thread_lock); - _v4w_stop(s, NULL); - ms_cond_signal(&s->thread_cond); - ms_mutex_unlock(&s->thread_lock); - ms_thread_exit(NULL); - return NULL; -} - - -static int v4w_start(MSFilter *f, void *arg){ - V4wState *s=(V4wState*)f->data; - s->thread_running=TRUE; - ms_thread_create(&s->thread,NULL,v4w_thread,s); - ms_mutex_lock(&s->thread_lock); - ms_cond_wait(&s->thread_cond,&s->thread_lock); - ms_mutex_unlock(&s->thread_lock); - s->started=TRUE; - return 0; -} - -static int v4w_stop(MSFilter *f, void *arg){ - V4wState *s=(V4wState*)f->data; - ms_mutex_lock(&s->thread_lock); - s->thread_running=FALSE; - //SendMessage(s->capvideo, WM_CLOSE, 0, 0); - ms_cond_wait(&s->thread_cond,&s->thread_lock); - ms_mutex_unlock(&s->thread_lock); - ms_thread_join(s->thread,NULL); - s->started=FALSE; - return 0; -} - -#else - -static int v4w_start(MSFilter *f, void *arg){ - V4wState *s=(V4wState*)f->data; - _v4w_start(s, NULL); - s->started=TRUE; - return 0; -} - -static int v4w_stop(MSFilter *f, void *arg){ - V4wState *s=(V4wState*)f->data; - _v4w_stop(s, NULL); - s->started=FALSE; - return 0; -} - -#endif - -static void v4w_uninit(MSFilter *f){ - V4wState *s=(V4wState*)f->data; - int idx; - flushq(&s->rq,0); - ms_mutex_destroy(&s->mutex); - for (idx=0;idx<10;idx++) - { - if (s->mire[idx]==NULL) - break; - freemsg(s->mire[idx]); - } - if (s->capvideo!=NULL) - { - ms_message("v4w: destroying capture window"); - DestroyWindow(s->capvideo); - ms_message("v4w: capture window destroyed"); - s->capvideo=NULL; - } - if (s->reverted){ - freemsg(s->reverted); - } -#ifdef AMD_HACK2 - ms_cond_destroy(&s->thread_cond); - ms_mutex_destroy(&s->thread_lock); -#endif - ms_free(s); -} - -static mblk_t * v4w_make_nowebcam(V4wState *s){ - int idx; - int count; - if (s->mire[0]==NULL && s->frame_ind==0){ - /* load several images to fake a movie */ - for (idx=0;idx<10;idx++) - { - s->mire[idx]=ms_load_nowebcam(&s->vsize, idx); - if (s->mire[idx]==NULL) - break; - } - if (idx==0) - s->mire[0]=ms_load_nowebcam(&s->vsize, -1); - } - for (count=0;count<10;count++) - { - if (s->mire[count]==NULL) - break; - } - - s->frame_ind++; - if (count==0) - return NULL; - - idx = s->frame_ind%count; - if (s->mire[idx]!=NULL) - return s->mire[idx]; - return s->mire[0]; -} - -static void v4w_preprocess(MSFilter * obj){ - V4wState *s=(V4wState*)obj->data; - if (!s->started) { - ms_message("V4W auto-started."); - v4w_start(obj,NULL); - s->autostarted=TRUE; - } - s->running=TRUE; - if (s->capvideo==NULL) - s->fps=1; -} - -static void v4w_postprocess(MSFilter * obj){ - V4wState *s=(V4wState*)obj->data; - s->running=FALSE; - if (s->autostarted){ - v4w_stop(obj,NULL); - } -} - -static void v4w_process(MSFilter * obj){ - V4wState *s=(V4wState*)obj->data; - mblk_t *m; - uint32_t timestamp; - int cur_frame; - - if (s->frame_count==-1){ - s->start_time=obj->ticker->time; - s->frame_count=0; - } - - - cur_frame=((obj->ticker->time-s->start_time)*s->fps/1000.0); - if (cur_frame>s->frame_count){ - mblk_t *om=NULL; - ms_mutex_lock(&s->mutex); - /*keep the most recent frame if several frames have been captured */ - if (s->capvideo!=NULL){ - while((m=getq(&s->rq))!=NULL){ - if (om!=NULL) freemsg(om); - om=m; - } - if (om!=NULL){ - if (s->invert_rgb){ - MSVideoSize roi; - if (s->reverted==NULL){ - s->reverted=allocb(om->b_wptr-om->b_rptr,0); - s->reverted->b_wptr=s->reverted->b_datap->db_lim; - } - roi=s->vsize; - rgb24_copy_revert(s->reverted->b_rptr,roi.width*3, - om->b_rptr,roi.width*3,roi); - freemsg(om); - om=dupb(s->reverted); - } - } - }else { - mblk_t *nowebcam = v4w_make_nowebcam(s); - if (nowebcam!=NULL){ - om=dupmsg(nowebcam); - mblk_set_precious_flag(om,1); - } - } - ms_mutex_unlock(&s->mutex); - if (om!=NULL){ - timestamp=obj->ticker->time*90;/* rtp uses a 90000 Hz clockrate for video*/ - mblk_set_timestamp_info(om,timestamp); - ms_queue_put(obj->outputs[0],om); - } - s->frame_count++; - } -} - -static int v4w_set_fps(MSFilter *f, void *arg){ - V4wState *s=(V4wState*)f->data; - s->fps=*((float*)arg); - return 0; -} - -static int v4w_get_pix_fmt(MSFilter *f,void *arg){ - V4wState *s=(V4wState*)f->data; - if (!s->started) { - ms_message("V4W auto-started in v4w_get_pix_fmt()"); - v4w_start(f,NULL); - s->autostarted=TRUE; - } - *((MSPixFmt*)arg) = (MSPixFmt)s->pix_fmt; - return 0; -} - -static int v4w_set_vsize(MSFilter *f, void *arg){ - V4wState *s=(V4wState*)f->data; - s->vsize=*((MSVideoSize*)arg); - return 0; -} - -static int v4w_get_vsize(MSFilter *f, void *arg){ - V4wState *s=(V4wState*)f->data; - MSVideoSize *vs=(MSVideoSize*)arg; - vs->width=s->vsize.width; - vs->height=s->vsize.height; - return 0; -} - -static MSFilterMethod methods[]={ - { MS_FILTER_SET_FPS , v4w_set_fps }, - { MS_FILTER_GET_PIX_FMT , v4w_get_pix_fmt }, - { MS_FILTER_SET_VIDEO_SIZE, v4w_set_vsize }, - { MS_FILTER_GET_VIDEO_SIZE, v4w_get_vsize }, - { MS_V4L_START , v4w_start }, - { MS_V4L_STOP , v4w_stop }, - { 0 , NULL } -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_v4w_desc={ - MS_V4L_ID, - "MSV4w", - N_("A video4windows compatible source filter to stream pictures."), - MS_FILTER_OTHER, - NULL, - 0, - 1, - v4w_init, - v4w_preprocess, - v4w_process, - v4w_postprocess, - v4w_uninit, - methods -}; - -#else - -MSFilterDesc ms_v4w_desc={ - .id=MS_V4L_ID, - .name="MSV4w", - .text=N_("A video4windows compatible source filter to stream pictures."), - .ninputs=0, - .noutputs=1, - .category=MS_FILTER_OTHER, - .init=v4w_init, - .preprocess=v4w_preprocess, - .process=v4w_process, - .postprocess=v4w_postprocess, - .uninit=v4w_uninit, - .methods=methods -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_v4w_desc) - -#if 0 -static void ms_v4w_detect(MSWebCamManager *obj); - -static void ms_v4w_cam_init(MSWebCam *cam){ -} - - -static MSFilter *ms_v4w_create_reader(MSWebCam *obj){ - MSFilter *f= ms_filter_new_from_desc(&ms_v4w_desc); - V4wState *s=(V4wState*)f->data; - s->devidx=(int)obj->data; - return f; -} - -MSWebCamDesc ms_v4w_cam_desc={ - "VideoForWindows grabber", - &ms_v4w_detect, - &ms_v4w_cam_init, - &ms_v4w_create_reader, - NULL -}; - -static void ms_v4w_detect(MSWebCamManager *obj){ - int i; - char dev[80]; - char ver[80]; - char name[160]; - MSWebCam *cam; - for (i = 0; i < 9; i++){ - if (capGetDriverDescription(i, dev, sizeof (dev), - ver, sizeof (ver))){ - HWND hwnd=capCreateCaptureWindow("Capture Window",WS_CHILD /* WS_OVERLAPPED */ - ,0,0,352,288,HWND_MESSAGE, 0) ; - if (hwnd==NULL) break; - if(!capDriverConnect(hwnd,i )){ - ms_warning("v4w: could not connect to capture driver, no webcam connected."); - DestroyWindow(hwnd); - break; - }else{ - capGetDriverDescription(i, dev, sizeof (dev),ver, sizeof (ver)); - capDriverDisconnect(hwnd); - DestroyWindow(hwnd); - } - snprintf(name, sizeof(name), "%s/%s",dev,ver); - cam=ms_web_cam_new(&ms_v4w_cam_desc); - cam->data=(void*)i;/*store the device index */ - cam->name=ms_strdup(name); - ms_web_cam_manager_add_cam(obj,cam); - } - } -} - -#endif diff --git a/linphone/mediastreamer2/src/winvideo2.c b/linphone/mediastreamer2/src/winvideo2.c deleted file mode 100755 index eb64ae2ae..000000000 --- a/linphone/mediastreamer2/src/winvideo2.c +++ /dev/null @@ -1,505 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/msvideo.h" -#include "mediastreamer2/msticker.h" -#include "mediastreamer2/msv4l.h" -#include "Vfw.h" -#include -#include - -#include "mediastreamer2/mswebcam.h" - -#ifndef AVSTREAMMASTER_NONE -#define AVSTREAMMASTER_NONE 1 -#endif - -typedef void (*queue_msg_t)(void *, mblk_t *); - -typedef struct VfwEngine{ - ms_thread_t thread; - char dev[512]; - int devidx; - HWND capvideo; - MSVideoSize vsize; - MSPixFmt pix_fmt; - queue_msg_t cb; - void *cb_data; - bool_t started; - bool_t configured; - bool_t thread_running; -}VfwEngine; - -#define VFW_ENGINE_MAX_INSTANCES 9 - -static VfwEngine *engines[VFW_ENGINE_MAX_INSTANCES]={0}; - -static bool_t try_format(VfwEngine *s, BITMAPINFO *videoformat, MSPixFmt pixfmt){ - MSVideoSize tried_size=s->vsize; - bool_t ret; - do{ - capGetVideoFormat(s->capvideo, videoformat, sizeof(BITMAPINFO)); - videoformat->bmiHeader.biSizeImage = 0; - videoformat->bmiHeader.biWidth = tried_size.width; - videoformat->bmiHeader.biHeight = tried_size.height; - switch(pixfmt){ - case MS_YUV420P: - videoformat->bmiHeader.biBitCount = 12; - videoformat->bmiHeader.biCompression=MAKEFOURCC('I','4','2','0'); - break; - case MS_YUY2: - videoformat->bmiHeader.biBitCount = 16; - videoformat->bmiHeader.biCompression=MAKEFOURCC('Y','U','Y','2'); - break; - case MS_RGB24: - videoformat->bmiHeader.biBitCount = 24; - videoformat->bmiHeader.biCompression=BI_RGB; - break; - default: - return FALSE; - } - ms_message("Trying video size %ix%i",tried_size.width,tried_size.height); - ret=capSetVideoFormat(s->capvideo, videoformat, sizeof(BITMAPINFO)); - tried_size=ms_video_size_get_just_lower_than(tried_size); - }while(ret==FALSE && tried_size.width!=0); - if (ret) { - /*recheck video format */ - capGetVideoFormat(s->capvideo, videoformat, sizeof(BITMAPINFO)); - s->vsize.width=videoformat->bmiHeader.biWidth; - s->vsize.height=videoformat->bmiHeader.biHeight; - } - return ret; -} - -static int _vfw_engine_select_format(VfwEngine *obj){ - BITMAPINFO videoformat; - MSPixFmt driver_last; - char compname[5]; - - capGetVideoFormat(obj->capvideo, &videoformat, sizeof(BITMAPINFO)); - memcpy(compname,&videoformat.bmiHeader.biCompression,4); - compname[4]='\0'; - ms_message("vfw: camera's current format is '%s' at %ix%i", compname, - videoformat.bmiHeader.biWidth,videoformat.bmiHeader.biHeight); - driver_last=ms_fourcc_to_pix_fmt(videoformat.bmiHeader.biCompression); - if (driver_last!=MS_PIX_FMT_UNKNOWN && try_format(obj,&videoformat,driver_last)){ - ms_message("Using driver last setting"); - obj->pix_fmt=driver_last; - }else if (try_format(obj,&videoformat,MS_YUV420P)){ - obj->pix_fmt=MS_YUV420P; - ms_message("Using YUV420P"); - }else if (try_format(obj,&videoformat,MS_RGB24)){ - obj->pix_fmt=MS_RGB24; - ms_message("Using RGB24"); - }else if (try_format(obj,&videoformat,MS_YUY2)){ - obj->pix_fmt=MS_YUY2; - ms_message("Using YUY2"); - }else{ - ms_error("v4w: Failed to set any video format."); - return -1; - } - if (obj->pix_fmt==MS_RGB24){ - if (videoformat.bmiHeader.biHeight>0){ - obj->pix_fmt=MS_RGB24_REV; - } - } - return 0; -} - -static void dummy(void*p){ -} - -LRESULT CALLBACK vfw_engine_stream_callback(HWND hWnd, LPVIDEOHDR lpVHdr) -{ - VfwEngine *s; - mblk_t *buf; - int size; - - s = (VfwEngine *)capGetUserData(hWnd); - if (s==NULL) - return FALSE; - - size = lpVHdr->dwBufferLength; - if (size>0 && s->cb!=NULL && s->started){ - buf = esballoc(lpVHdr->lpData,size,0,dummy); - buf->b_wptr+=size; - s->cb(s->cb_data,buf); - } - return TRUE ; -} - -static void * -vfw_engine_thread(void *arg) -{ - VfwEngine *s=(VfwEngine*)arg; - MSG msg; - - while(s->thread_running) - { - BOOL fGotMessage; - while((fGotMessage = PeekMessage(&msg, (HWND) s->capvideo, 0, 0, PM_REMOVE)) != 0) - { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - Sleep(10); - } - ms_thread_exit(NULL); - return NULL; -} - -static void _vfw_engine_unconfigure(VfwEngine *obj){ - if (!capCaptureStop(obj->capvideo)){ - ms_error("vfw: fail to stop capture !"); - } - obj->thread_running=FALSE; - ms_thread_join(obj->thread,NULL); - obj->configured=FALSE; -} - -static void _vfw_engine_disconnect(VfwEngine *obj){ - capDriverDisconnect(obj->capvideo); - DestroyWindow(obj->capvideo); - obj->capvideo=NULL; -} - -static void vfw_engine_destroy(VfwEngine *obj){ - if (obj->configured){ - _vfw_engine_unconfigure(obj); - } - _vfw_engine_disconnect(obj); - ms_free(obj); -} - -static int _vfw_engine_setup(VfwEngine *obj){ - CAPTUREPARMS capparam ; - capCaptureGetSetup(obj->capvideo,&capparam,sizeof(capparam)) ; - capparam.dwRequestMicroSecPerFrame = 33000 ; /*makes around 30fps*/ - // detach capture from application - capparam.fYield = TRUE ; - capparam.fMakeUserHitOKToCapture = FALSE; - capparam.fAbortLeftMouse = FALSE; - capparam.fAbortRightMouse = FALSE; - capparam.wPercentDropForError = 90 ; - capparam.fCaptureAudio = FALSE ; - capparam.fAbortRightMouse = FALSE; - capparam.fAbortLeftMouse = FALSE; - capparam.AVStreamMaster = AVSTREAMMASTER_NONE ; - if (!capCaptureSetSetup(obj->capvideo,&capparam,sizeof(capparam))){ - ms_error("capCaptureSetSetup failed."); - return -1; - } - capSetUserData(obj->capvideo, obj); - return 0; -} - -static int _vfw_engine_connect(VfwEngine *obj){ - MSVideoSize sz; - sz.width=MS_VIDEO_SIZE_CIF_W; - sz.height=MS_VIDEO_SIZE_CIF_H; - HWND hwnd=capCreateCaptureWindow("Capture Window",WS_CHILD /* WS_OVERLAPPED */ - ,0,0,sz.width,sz.height,HWND_MESSAGE, 0) ; - - if (hwnd==NULL) return -1; - if(!capDriverConnect(hwnd,obj->devidx)){ - ms_warning("vfw: could not connect to capture driver, no webcam connected."); - DestroyWindow(hwnd); - return -1; - } - obj->capvideo=hwnd; - obj->vsize=sz; - return 0; -} - -static VfwEngine * vfw_engine_new(int i){ - char dev[512]; - char ver[512]; - VfwEngine *obj=(VfwEngine*)ms_new0(VfwEngine,1); - if (capGetDriverDescription(i, dev, sizeof (dev), - ver, sizeof (ver))){ - obj->devidx=i; - if (_vfw_engine_connect(obj)==-1){ - ms_free(obj); - return NULL; - } - strcpy(obj->dev,dev); - engines[i]=obj; - return obj; - } - return NULL; -} - -static void _vfw_engine_configure(VfwEngine *obj){ - if (_vfw_engine_setup(obj)==-1){ - return; - } - if (_vfw_engine_select_format(obj)==-1){ - return ; - } - capSetCallbackOnVideoStream(obj->capvideo, vfw_engine_stream_callback); - if (!capCaptureSequenceNoFile(obj->capvideo)){ - ms_error("vfw: fail to start capture !"); - } - ms_thread_create(&obj->thread,NULL,vfw_engine_thread,obj); - obj->configured=TRUE; -} - -static MSPixFmt vfw_engine_get_pix_fmt(VfwEngine *obj){ - if (!obj->configured) - _vfw_engine_configure(obj); - return obj->pix_fmt; -} - -static MSVideoSize vfw_engine_get_video_size(VfwEngine *obj){ - return obj->vsize; -} - -static void vfw_engine_set_video_size(VfwEngine *obj, MSVideoSize vsize){ - if (!obj->configured) - obj->vsize=vsize; - else if (ms_video_size_greater_than(vsize,obj->vsize) && !ms_video_size_equal(vsize,obj->vsize) ){ - _vfw_engine_unconfigure(obj); - _vfw_engine_disconnect(obj); - _vfw_engine_connect(obj); - obj->vsize=vsize; - _vfw_engine_configure(obj); - } -} - -static void vfw_engine_set_callback(VfwEngine* obj, queue_msg_t cb, void *cb_data){ - obj->cb=cb; - obj->cb_data=cb_data; -} - -static void vfw_engine_start_capture(VfwEngine *obj){ - if (!obj->configured) _vfw_engine_configure(obj); - obj->started=TRUE; -} - -static void vfw_engine_stop_capture(VfwEngine *obj){ - obj->started=FALSE; -} - -static void vfw_engines_free(void){ - int i; - for(i=0;ivsize.width=MS_VIDEO_SIZE_CIF_W; - s->vsize.height=MS_VIDEO_SIZE_CIF_H; - qinit(&s->rq); - ms_mutex_init(&s->mutex,NULL); - s->start_time=0; - s->frame_count=-1; - s->fps=15; - f->data=s; -} - - - -static void vfw_uninit(MSFilter *f){ - VfwState *s=(VfwState*)f->data; - flushq(&s->rq,0); - ms_mutex_destroy(&s->mutex); - ms_free(s); -} - -static void vfw_callback(void *data, mblk_t *m){ - VfwState *s=(VfwState*)data; - ms_mutex_lock(&s->mutex); - putq(&s->rq,m); - ms_mutex_unlock(&s->mutex); -} - -static void vfw_preprocess(MSFilter * obj){ - VfwState *s=(VfwState*)obj->data; - if (s->eng==NULL) s->eng=engines[0]; - vfw_engine_set_callback(s->eng,vfw_callback,s); - vfw_engine_start_capture(s->eng); -} - -static void vfw_postprocess(MSFilter * obj){ - VfwState *s=(VfwState*)obj->data; - vfw_engine_stop_capture(s->eng); - flushq(&s->rq,0); -} - -static void vfw_process(MSFilter * obj){ - VfwState *s=(VfwState*)obj->data; - mblk_t *m; - uint32_t timestamp; - int cur_frame; - - if (s->frame_count==-1){ - s->start_time=(float)obj->ticker->time; - s->frame_count=0; - } - - cur_frame=(int)((obj->ticker->time-s->start_time)*s->fps/1000.0); - if (cur_frame>s->frame_count){ - mblk_t *om=NULL; - /*keep the most recent frame if several frames have been captured */ - if (s->eng!=NULL){ - ms_mutex_lock(&s->mutex); - while((m=getq(&s->rq))!=NULL){ - ms_mutex_unlock(&s->mutex); - if (om!=NULL) freemsg(om); - om=m; - ms_mutex_lock(&s->mutex); - } - ms_mutex_unlock(&s->mutex); - } - if (om!=NULL){ - timestamp=(uint32_t)(obj->ticker->time*90);/* rtp uses a 90000 Hz clockrate for video*/ - mblk_set_timestamp_info(om,timestamp); - ms_queue_put(obj->outputs[0],om); - } - s->frame_count++; - } -} - -static int vfw_set_fps(MSFilter *f, void *arg){ - VfwState *s=(VfwState*)f->data; - s->fps=*((float*)arg); - return 0; -} - -static int vfw_get_pix_fmt(MSFilter *f,void *arg){ - VfwState *s=(VfwState*)f->data; - MSPixFmt fmt=vfw_engine_get_pix_fmt(s->eng); - *((MSPixFmt*)arg)=fmt; - return 0; -} - -static int vfw_set_vsize(MSFilter *f, void *arg){ - VfwState *s=(VfwState*)f->data; - s->vsize=*((MSVideoSize*)arg); - vfw_engine_set_video_size(s->eng,s->vsize); - return 0; -} - -static int vfw_get_vsize(MSFilter *f, void *arg){ - VfwState *s=(VfwState*)f->data; - MSVideoSize *vs=(MSVideoSize*)arg; - *vs=vfw_engine_get_video_size(s->eng); - return 0; -} - -static MSFilterMethod methods[]={ - { MS_FILTER_SET_FPS , vfw_set_fps }, - { MS_FILTER_GET_PIX_FMT , vfw_get_pix_fmt }, - { MS_FILTER_SET_VIDEO_SIZE, vfw_set_vsize }, - { MS_FILTER_GET_VIDEO_SIZE, vfw_get_vsize }, - { 0 , NULL } -}; - -#ifdef _MSC_VER - -MSFilterDesc ms_vfw_desc={ - MS_VFW_ID, - "MSVfw", - N_("A video for windows (vfw.h) based source filter to grab pictures."), - MS_FILTER_OTHER, - NULL, - 0, - 1, - vfw_init, - vfw_preprocess, - vfw_process, - vfw_postprocess, - vfw_uninit, - methods -}; - -#else - -MSFilterDesc ms_vfw_desc={ - .id=MS_VFW_ID, - .name="MSVfw", - .text=N_("A video for windows (vfw.h) based source filter to grab pictures."), - .ninputs=0, - .noutputs=1, - .category=MS_FILTER_OTHER, - .init=vfw_init, - .preprocess=vfw_preprocess, - .process=vfw_process, - .postprocess=vfw_postprocess, - .uninit=vfw_uninit, - .methods=methods -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_vfw_desc) - -static void ms_vfw_detect(MSWebCamManager *obj); - -static void ms_vfw_cam_init(MSWebCam *cam){ -} - - -static MSFilter *ms_vfw_create_reader(MSWebCam *obj){ - MSFilter *f= ms_filter_new_from_desc(&ms_vfw_desc); - VfwState *s=(VfwState*)f->data; - s->eng=(VfwEngine*)obj->data; - return f; -} - -MSWebCamDesc ms_vfw_cam_desc={ - "VideoForWindows grabber", - &ms_vfw_detect, - &ms_vfw_cam_init, - &ms_vfw_create_reader, - NULL -}; - -static void ms_vfw_detect(MSWebCamManager *obj){ - int i; - MSWebCam *cam; - for (i = 0; i < VFW_ENGINE_MAX_INSTANCES; i++){ - VfwEngine *eng; - if ((eng=vfw_engine_new(i))!=NULL){ - cam=ms_web_cam_new(&ms_vfw_cam_desc); - cam->data=(void*)eng;/*store the engine */ - cam->name=ms_strdup(eng->dev); - ms_web_cam_manager_add_cam(obj,cam); - } - } - atexit(vfw_engines_free); -} - diff --git a/linphone/mediastreamer2/src/winvideods.c b/linphone/mediastreamer2/src/winvideods.c deleted file mode 100644 index bd442e3d1..000000000 --- a/linphone/mediastreamer2/src/winvideods.c +++ /dev/null @@ -1,1493 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#define UNICODE -#define AYMERIC_TEST -#define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA - -#include "mediastreamer2/msvideo.h" -#include "mediastreamer2/msticker.h" -#include "mediastreamer2/msv4l.h" -#include "mediastreamer2/mswebcam.h" - -#include "nowebcam.h" - -#ifdef HAVE_LIBAVCODEC_AVCODEC_H -#include -#else -#include -#endif - -#include -#include -#include - -#include -#include - -#include "dxfilter.h" -EXTERN_C const CLSID CLSID_NullRenderer; - -typedef struct V4wState{ - - char dev[512]; - int devidx; - - IGraphBuilder *m_pGraph; - ICaptureGraphBuilder2 *m_pBuilder; - IMediaControl *m_pControl; - CDXFilter *m_pDXFilter; - IBaseFilter *m_pIDXFilter; - IBaseFilter *m_pNullRenderer; - IBaseFilter *m_pDeviceFilter; - DWORD rotregvalue; - - MSVideoSize vsize; - int pix_fmt; - mblk_t *mire[10]; - char nowebcamimage[256]; - queue_t rq; - ms_mutex_t mutex; - int frame_ind; - int frame_max; - float fps; - uint64_t start_time; - int frame_count; -}V4wState; - -static V4wState *s_callback=NULL; - -static void dummy(void*p){ -} - -HRESULT ( Callback)(IMediaSample* pSample, REFERENCE_TIME* sTime, REFERENCE_TIME* eTime, BOOL changed) -{ - BYTE *byte_buf=NULL; - mblk_t *buf; - - V4wState *s = s_callback; - if (s==NULL) - return S_OK; - - HRESULT hr = pSample->GetPointer(&byte_buf); - if (FAILED(hr)) - { - return S_OK; - } - - int size = pSample->GetActualDataLength(); - if (size>+1000) - { - buf=allocb(size,0); - memcpy(buf->b_wptr, byte_buf, size); - if (s->pix_fmt==MS_RGB24) - { - /* Conversion from top down bottom up (BGR to RGB and flip) */ - unsigned long Index,nPixels; - unsigned char *blue; - unsigned char tmp; - short iPixelSize; - - blue=buf->b_wptr; - - nPixels=s->vsize.width*s->vsize.height; - iPixelSize=24/8; - - for(Index=0;Index!=nPixels;Index++) // For each pixel - { - tmp=*blue; - *blue=*(blue+2); - *(blue+2)=tmp; - blue+=iPixelSize; - } - - unsigned char *pLine1, *pLine2; - int iLineLen,iIndex; - - iLineLen=s->vsize.width*iPixelSize; - pLine1=buf->b_wptr; - pLine2=&(buf->b_wptr)[iLineLen * (s->vsize.height - 1)]; - - for( ;pLine1b_wptr+=size; - - ms_mutex_lock(&s->mutex); - putq(&s->rq, buf); - ms_mutex_unlock(&s->mutex); - - } - return S_OK; -} - -HRESULT GetPinCategory(IPin *pPin, GUID *pPinCategory) -{ - HRESULT hr; - IKsPropertySet *pKs; - hr = pPin->QueryInterface(IID_IKsPropertySet, (void **)&pKs); - if (FAILED(hr)) - { - // The pin does not support IKsPropertySet. - return hr; - } - // Try to retrieve the pin category. - DWORD cbReturned; - hr = pKs->Get(AMPROPSETID_Pin, AMPROPERTY_PIN_CATEGORY, NULL, 0, - pPinCategory, sizeof(GUID), &cbReturned); - - // If this succeeded, pPinCategory now contains the category GUID. - - pKs->Release(); - return hr; -} - -int try_format(IBaseFilter *m_pDeviceFilter, int format, GUID *pPinCategory) -{ - HRESULT hr=S_OK; - IEnumPins *pEnum=0; - ULONG ulFound; - IPin *pPin; - - GUID guid_format; - DWORD biCompression; - DWORD biBitCount; - - // Verify input - if (!m_pDeviceFilter) - return -1; - - if (format == MS_YUV420P) - guid_format = (GUID)FOURCCMap(MAKEFOURCC('I','4','2','0')); - else if (format == MS_YUYV) - guid_format = MEDIASUBTYPE_YUYV; - else if (format == MS_UYVY) - guid_format = MEDIASUBTYPE_UYVY; - else if (format == MS_RGB24) - guid_format = MEDIASUBTYPE_RGB24; - else if (format == MS_YUY2) - guid_format = MEDIASUBTYPE_YUY2; - - if (format == MS_YUV420P) - biCompression = MAKEFOURCC('I','4','2','0'); - else if (format == MS_YUYV) - biCompression = MAKEFOURCC('Y','U','Y','V'); - else if (format == MS_UYVY) - biCompression = MAKEFOURCC('U','Y','V','Y'); - else if (format == MS_RGB24) - biCompression = BI_RGB; - else if (format == MS_YUY2) - biCompression = MAKEFOURCC('Y','U','Y','2'); - - if (format == MS_YUV420P) - biBitCount = 12; - else if (format == MS_YUYV) - biBitCount = 16; - else if (format == MS_UYVY) - biBitCount = 16; - else if (format == MS_RGB24) - biBitCount = 24; - else if (format == MS_YUY2) - biBitCount = 16; - - // Get pin enumerator - hr = m_pDeviceFilter->EnumPins(&pEnum); - if(FAILED(hr)) - return -1; - - pEnum->Reset(); - - // Count every pin on the filter - while(S_OK == pEnum->Next(1, &pPin, &ulFound)) - { - PIN_DIRECTION pindir = (PIN_DIRECTION) 3; - - hr = pPin->QueryDirection(&pindir); - - if(pindir != PINDIR_INPUT) - { - IEnumMediaTypes *ppEnum; - ULONG ulFound2; - - GetPinCategory(pPin, pPinCategory); - if (*pPinCategory!=PIN_CATEGORY_CAPTURE - && *pPinCategory!=PIN_CATEGORY_PREVIEW) - continue; - - hr = pPin->EnumMediaTypes(&ppEnum); - if(FAILED(hr)) - continue; - - AM_MEDIA_TYPE *ppMediaTypes; - while(S_OK == ppEnum->Next(1, &ppMediaTypes, &ulFound2)) - { - if (ppMediaTypes->formattype != FORMAT_VideoInfo) - continue; - if (ppMediaTypes->majortype != MEDIATYPE_Video) - continue; - if (ppMediaTypes->subtype != guid_format) - continue; - VIDEOINFO *pvi = (VIDEOINFO *)ppMediaTypes->pbFormat; - if (pvi->bmiHeader.biCompression!=biCompression) - continue; - if (pvi->bmiHeader.biBitCount!=biBitCount) - continue; - - pPin->Release(); - pEnum->Release(); - return 0; - } - } - - pPin->Release(); - } - - pEnum->Release(); - return -1; -} - -int try_format_size(V4wState *s, int format, int width, int height, GUID *pPinCategory) -{ - HRESULT hr=S_OK; - IEnumPins *pEnum=0; - ULONG ulFound; - IPin *pPin; - - GUID guid_format; - DWORD biCompression; - DWORD biBitCount; - - // Verify input - if (!s->m_pDeviceFilter) - return -1; - - if (format == MS_YUV420P) - guid_format = (GUID)FOURCCMap(MAKEFOURCC('I','4','2','0')); - else if (format == MS_YUYV) - guid_format = MEDIASUBTYPE_YUYV; - else if (format == MS_UYVY) - guid_format = MEDIASUBTYPE_UYVY; - else if (format == MS_RGB24) - guid_format = MEDIASUBTYPE_RGB24; - else if (format == MS_YUY2) - guid_format = MEDIASUBTYPE_YUY2; - - if (format == MS_YUV420P) - biCompression = MAKEFOURCC('I','4','2','0'); - else if (format == MS_YUYV) - biCompression = MAKEFOURCC('Y','U','Y','V'); - else if (format == MS_UYVY) - biCompression = MAKEFOURCC('U','Y','V','Y'); - else if (format == MS_RGB24) - biCompression = BI_RGB; - else if (format == MS_YUY2) - biCompression = MAKEFOURCC('Y','U','Y','2'); - - if (format == MS_YUV420P) - biBitCount = 12; - else if (format == MS_YUYV) - biBitCount = 16; - else if (format == MS_UYVY) - biBitCount = 16; - else if (format == MS_RGB24) - biBitCount = 24; - else if (format == MS_YUY2) - biBitCount = 16; - - // Get pin enumerator - hr = s->m_pDeviceFilter->EnumPins(&pEnum); - if(FAILED(hr)) - return -1; - - pEnum->Reset(); - - // Count every pin on the filter - while(S_OK == pEnum->Next(1, &pPin, &ulFound)) - { - PIN_DIRECTION pindir = (PIN_DIRECTION) 3; - - hr = pPin->QueryDirection(&pindir); - - if(pindir != PINDIR_INPUT) - { - IEnumMediaTypes *ppEnum; - ULONG ulFound2; - hr = pPin->EnumMediaTypes(&ppEnum); - if(FAILED(hr)) - continue; - - GUID pCurrentPinCategory; - GetPinCategory(pPin, &pCurrentPinCategory); - if (*pPinCategory!=pCurrentPinCategory) - continue; - - AM_MEDIA_TYPE *ppMediaTypes; - while(S_OK == ppEnum->Next(1, &ppMediaTypes, &ulFound2)) - { - if (ppMediaTypes->formattype != FORMAT_VideoInfo) - continue; - if (ppMediaTypes->majortype != MEDIATYPE_Video) - continue; - if (ppMediaTypes->subtype != guid_format) - continue; - VIDEOINFO *pvi = (VIDEOINFO *)ppMediaTypes->pbFormat; - if (pvi->bmiHeader.biCompression!=biCompression) - continue; - if (pvi->bmiHeader.biBitCount!=biBitCount) - continue; - if (pvi->bmiHeader.biHeight!=height) - continue; - if (pvi->bmiHeader.biWidth!=width) - continue; - - s->vsize.width = width; - s->vsize.height = height; - - pPin->Release(); - pEnum->Release(); - return 0; - } - } - - pPin->Release(); - } - - pEnum->Release(); - return -1; -} - -static int v4w_configure_videodevice(V4wState *s) -{ - // Initialize COM - CoInitialize(NULL); - - // get a Graph - HRESULT hr= CoCreateInstance (CLSID_FilterGraph, - NULL, - CLSCTX_INPROC_SERVER, - IID_IGraphBuilder, //IID_IBaseFilter, - (void **)&s->m_pGraph); - if(FAILED(hr)) - { - return -1; - } - - // get a CaptureGraphBuilder2 - hr= CoCreateInstance (CLSID_CaptureGraphBuilder2, - NULL, - CLSCTX_INPROC_SERVER, - IID_ICaptureGraphBuilder2, //IID_IBaseFilter, - (void **)&s->m_pBuilder); - if(FAILED(hr)) - { - return -2; - } - - // connect capture graph builder with the graph - s->m_pBuilder->SetFiltergraph(s->m_pGraph); - - // get mediacontrol so we can start and stop the filter graph - hr=s->m_pGraph->QueryInterface (IID_IMediaControl, (void **)&s->m_pControl); - if(FAILED(hr)) - { - return -3; - } - - - ICreateDevEnum *pCreateDevEnum = NULL; - IEnumMoniker *pEnumMoniker = NULL; - IMoniker *pMoniker = NULL; - - ULONG nFetched = 0; - - hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, - IID_ICreateDevEnum, (PVOID *)&pCreateDevEnum); - if(FAILED(hr)) - { - return -4; - } - - hr = pCreateDevEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, - &pEnumMoniker, 0); - if (FAILED(hr) || pEnumMoniker == NULL) { - //printf("no device\n"); - return -5; - } - - pEnumMoniker->Reset(); - - int pos=0; - while(S_OK == pEnumMoniker->Next(1, &pMoniker, &nFetched) ) - { - IPropertyBag *pBag; - hr = pMoniker->BindToStorage( 0, 0, IID_IPropertyBag, (void**) &pBag ); - if( hr != S_OK ) - continue; - - if (s->dev[0]=='\0') - break; - - VARIANT var; - VariantInit(&var); - hr = pBag->Read( L"FriendlyName", &var, NULL ); - if( hr != S_OK ) - { - pMoniker->Release(); - continue; - } - //USES_CONVERSION; - char szName[256]; - - WideCharToMultiByte(CP_UTF8,0,var.bstrVal,-1,szName,256,0,0); - VariantClear(&var); - - if (strcmp(szName, s->dev)==0) - break; - - pMoniker->Release(); - pBag->Release(); - pMoniker=NULL; - pBag=NULL; - } - - if(pMoniker==NULL) - { - int pos=0; - while(S_OK == pEnumMoniker->Next(1, &pMoniker, &nFetched) ) - { - IPropertyBag *pBag; - hr = pMoniker->BindToStorage( 0, 0, IID_IPropertyBag, (void**) &pBag ); - if( hr != S_OK ) - continue; - } - - } - - if(pMoniker==NULL) - { - return -6; - } - - hr = pMoniker->BindToObject(0, 0, IID_IBaseFilter, (void**)&s->m_pDeviceFilter ); - if(FAILED(hr)) - { - return -7; - } - - s->m_pGraph->AddFilter(s->m_pDeviceFilter, L"Device Filter"); - - pMoniker->Release(); - pEnumMoniker->Release(); - pCreateDevEnum->Release(); - - - GUID pPinCategory; - - if (try_format(s->m_pDeviceFilter, s->pix_fmt, &pPinCategory)==0) - s->pix_fmt = s->pix_fmt; - else if (try_format(s->m_pDeviceFilter,MS_YUV420P, &pPinCategory)==0) - s->pix_fmt = MS_YUV420P; - else if (try_format(s->m_pDeviceFilter,MS_YUY2, &pPinCategory)==0) - s->pix_fmt = MS_YUY2; - else if (try_format(s->m_pDeviceFilter,MS_YUYV, &pPinCategory)==0) - s->pix_fmt = MS_YUYV; - else if (try_format(s->m_pDeviceFilter,MS_UYVY, &pPinCategory)==0) - s->pix_fmt = MS_UYVY; - else if (try_format(s->m_pDeviceFilter,MS_RGB24, &pPinCategory)==0) - s->pix_fmt = MS_RGB24; - else - { - ms_error("Unsupported video pixel format."); - return -8; - } - - if (s->pix_fmt == MS_YUV420P) - ms_message("Driver supports YUV420P, using that format."); - else if (s->pix_fmt == MS_YUY2) - ms_message("Driver supports YUY2 (UYVY), using that format."); - else if (s->pix_fmt == MS_YUYV) - ms_message("Driver supports YUV422, using that format."); - else if (s->pix_fmt == MS_UYVY) - ms_message("Driver supports UYVY, using that format."); - else if (s->pix_fmt == MS_RGB24) - ms_message("Driver supports RGB24, using that format."); - - if (try_format_size(s, s->pix_fmt, s->vsize.width, s->vsize.height, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", s->vsize.width, s->vsize.height); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_QCIF_W, MS_VIDEO_SIZE_QCIF_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_QCIF_W, MS_VIDEO_SIZE_QCIF_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_CIF_W, MS_VIDEO_SIZE_CIF_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_CIF_W, MS_VIDEO_SIZE_CIF_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_4CIF_W, MS_VIDEO_SIZE_4CIF_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_4CIF_W, MS_VIDEO_SIZE_4CIF_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_QVGA_W, MS_VIDEO_SIZE_QVGA_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_QVGA_W, MS_VIDEO_SIZE_QVGA_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_QQVGA_W, MS_VIDEO_SIZE_QQVGA_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_QQVGA_W, MS_VIDEO_SIZE_QQVGA_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_NS1_W, MS_VIDEO_SIZE_NS1_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_NS1_W, MS_VIDEO_SIZE_NS1_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_QSIF_W, MS_VIDEO_SIZE_QSIF_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_QSIF_W, MS_VIDEO_SIZE_QSIF_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_SIF_W, MS_VIDEO_SIZE_SIF_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_SIF_W, MS_VIDEO_SIZE_SIF_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_VGA_W, MS_VIDEO_SIZE_VGA_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_VGA_W, MS_VIDEO_SIZE_VGA_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_SDTV_W, MS_VIDEO_SIZE_SDTV_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_SDTV_W, MS_VIDEO_SIZE_SDTV_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_288P_W, MS_VIDEO_SIZE_288P_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_288P_W, MS_VIDEO_SIZE_288P_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_448P_W, MS_VIDEO_SIZE_448P_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_448P_W, MS_VIDEO_SIZE_448P_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_576P_W, MS_VIDEO_SIZE_576P_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_576P_W, MS_VIDEO_SIZE_576P_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_720P_W, MS_VIDEO_SIZE_720P_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_720P_W, MS_VIDEO_SIZE_720P_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_1080P_W, MS_VIDEO_SIZE_1080P_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_1080P_W, MS_VIDEO_SIZE_1080P_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_4SIF_W, MS_VIDEO_SIZE_4SIF_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_4SIF_W, MS_VIDEO_SIZE_4SIF_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_SVGA_W, MS_VIDEO_SIZE_SVGA_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_SVGA_W, MS_VIDEO_SIZE_SVGA_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_XGA_W, MS_VIDEO_SIZE_XGA_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_XGA_W, MS_VIDEO_SIZE_XGA_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_WXGA_W, MS_VIDEO_SIZE_WXGA_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_WXGA_W, MS_VIDEO_SIZE_WXGA_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_HDTVP_W, MS_VIDEO_SIZE_HDTVP_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_HDTVP_W, MS_VIDEO_SIZE_HDTVP_H); - else - { - ms_error("No supported size found for format."); - /* size not supported? */ - return -9; - } - - return 0; -} - -static int v4w_open_videodevice(V4wState *s) -{ - // Initialize COM - CoInitialize(NULL); - - // get a Graph - HRESULT hr= CoCreateInstance (CLSID_FilterGraph, - NULL, - CLSCTX_INPROC_SERVER, - IID_IGraphBuilder, //IID_IBaseFilter, - (void **)&s->m_pGraph); - if(FAILED(hr)) - { - return -1; - } - - // get a CaptureGraphBuilder2 - hr= CoCreateInstance (CLSID_CaptureGraphBuilder2, - NULL, - CLSCTX_INPROC_SERVER, - IID_ICaptureGraphBuilder2, //IID_IBaseFilter, - (void **)&s->m_pBuilder); - if(FAILED(hr)) - { - return -2; - } - - // connect capture graph builder with the graph - s->m_pBuilder->SetFiltergraph(s->m_pGraph); - - // get mediacontrol so we can start and stop the filter graph - hr=s->m_pGraph->QueryInterface (IID_IMediaControl, (void **)&s->m_pControl); - if(FAILED(hr)) - { - return -3; - } - - - ICreateDevEnum *pCreateDevEnum = NULL; - IEnumMoniker *pEnumMoniker = NULL; - IMoniker *pMoniker = NULL; - - ULONG nFetched = 0; - - hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, - IID_ICreateDevEnum, (PVOID *)&pCreateDevEnum); - if(FAILED(hr)) - { - return -4; - } - - hr = pCreateDevEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, - &pEnumMoniker, 0); - if (FAILED(hr) || pEnumMoniker == NULL) { - //printf("no device\n"); - return -5; - } - - pEnumMoniker->Reset(); - - int pos=0; - while(S_OK == pEnumMoniker->Next(1, &pMoniker, &nFetched) ) - { - IPropertyBag *pBag; - hr = pMoniker->BindToStorage( 0, 0, IID_IPropertyBag, (void**) &pBag ); - if( hr != S_OK ) - continue; - - if (s->dev[0]=='\0') - break; - - VARIANT var; - VariantInit(&var); - hr = pBag->Read( L"FriendlyName", &var, NULL ); - if( hr != S_OK ) - { - pMoniker->Release(); - continue; - } - //USES_CONVERSION; - char szName[256]; - - WideCharToMultiByte(CP_UTF8,0,var.bstrVal,-1,szName,256,0,0); - VariantClear(&var); - - if (strcmp(szName, s->dev)==0) - break; - - pMoniker->Release(); - pBag->Release(); - pMoniker=NULL; - pBag=NULL; - } - - if(pMoniker==NULL) - { - return -6; - } - - hr = pMoniker->BindToObject(0, 0, IID_IBaseFilter, (void**)&s->m_pDeviceFilter ); - if(FAILED(hr)) - { - return -7; - } - - s->m_pGraph->AddFilter(s->m_pDeviceFilter, L"Device Filter"); - - pMoniker->Release(); - pEnumMoniker->Release(); - pCreateDevEnum->Release(); - - - GUID pPinCategory; - - if (try_format(s->m_pDeviceFilter, s->pix_fmt, &pPinCategory)==0) - s->pix_fmt = s->pix_fmt; - else if (try_format(s->m_pDeviceFilter,MS_YUV420P, &pPinCategory)==0) - s->pix_fmt = MS_YUV420P; - else if (try_format(s->m_pDeviceFilter,MS_YUY2, &pPinCategory)==0) - s->pix_fmt = MS_YUY2; - else if (try_format(s->m_pDeviceFilter,MS_YUYV, &pPinCategory)==0) - s->pix_fmt = MS_YUYV; - else if (try_format(s->m_pDeviceFilter,MS_UYVY, &pPinCategory)==0) - s->pix_fmt = MS_UYVY; - else if (try_format(s->m_pDeviceFilter,MS_RGB24, &pPinCategory)==0) - s->pix_fmt = MS_RGB24; - else - { - ms_error("Unsupported video pixel format."); - return -8; - } - - if (s->pix_fmt == MS_YUV420P) - ms_message("Driver supports YUV420P, using that format."); - else if (s->pix_fmt == MS_YUY2) - ms_message("Driver supports YUY2 (UYVY), using that format."); - else if (s->pix_fmt == MS_YUYV) - ms_message("Driver supports YUV422, using that format."); - else if (s->pix_fmt == MS_UYVY) - ms_message("Driver supports UYVY, using that format."); - else if (s->pix_fmt == MS_RGB24) - ms_message("Driver supports RGB24, using that format."); - - if (try_format_size(s, s->pix_fmt, s->vsize.width, s->vsize.height, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", s->vsize.width, s->vsize.height); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_QCIF_W, MS_VIDEO_SIZE_QCIF_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_QCIF_W, MS_VIDEO_SIZE_QCIF_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_CIF_W, MS_VIDEO_SIZE_CIF_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_CIF_W, MS_VIDEO_SIZE_CIF_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_4CIF_W, MS_VIDEO_SIZE_4CIF_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_4CIF_W, MS_VIDEO_SIZE_4CIF_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_QVGA_W, MS_VIDEO_SIZE_QVGA_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_QVGA_W, MS_VIDEO_SIZE_QVGA_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_QQVGA_W, MS_VIDEO_SIZE_QQVGA_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_QQVGA_W, MS_VIDEO_SIZE_QQVGA_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_NS1_W, MS_VIDEO_SIZE_NS1_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_NS1_W, MS_VIDEO_SIZE_NS1_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_QSIF_W, MS_VIDEO_SIZE_QSIF_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_QSIF_W, MS_VIDEO_SIZE_QSIF_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_SIF_W, MS_VIDEO_SIZE_SIF_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_SIF_W, MS_VIDEO_SIZE_SIF_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_VGA_W, MS_VIDEO_SIZE_VGA_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_VGA_W, MS_VIDEO_SIZE_VGA_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_SDTV_W, MS_VIDEO_SIZE_SDTV_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_SDTV_W, MS_VIDEO_SIZE_SDTV_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_288P_W, MS_VIDEO_SIZE_288P_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_288P_W, MS_VIDEO_SIZE_288P_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_448P_W, MS_VIDEO_SIZE_448P_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_448P_W, MS_VIDEO_SIZE_448P_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_576P_W, MS_VIDEO_SIZE_576P_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_576P_W, MS_VIDEO_SIZE_576P_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_720P_W, MS_VIDEO_SIZE_720P_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_720P_W, MS_VIDEO_SIZE_720P_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_1080P_W, MS_VIDEO_SIZE_1080P_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_1080P_W, MS_VIDEO_SIZE_1080P_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_4SIF_W, MS_VIDEO_SIZE_4SIF_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_4SIF_W, MS_VIDEO_SIZE_4SIF_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_SVGA_W, MS_VIDEO_SIZE_SVGA_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_SVGA_W, MS_VIDEO_SIZE_SVGA_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_XGA_W, MS_VIDEO_SIZE_XGA_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_XGA_W, MS_VIDEO_SIZE_XGA_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_WXGA_W, MS_VIDEO_SIZE_WXGA_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_WXGA_W, MS_VIDEO_SIZE_WXGA_H); - else if (try_format_size(s, s->pix_fmt, MS_VIDEO_SIZE_HDTVP_W, MS_VIDEO_SIZE_HDTVP_H, &pPinCategory)==0) - ms_message("Selected Size: %ix%i.", MS_VIDEO_SIZE_HDTVP_W, MS_VIDEO_SIZE_HDTVP_H); - else - { - ms_error("No supported size found for format."); - /* size not supported? */ - return -9; - } - - // get DXFilter - s->m_pDXFilter = new CDXFilter(NULL, &hr, FALSE); - if(s->m_pDXFilter==NULL) - { - return -10; - } - s->m_pDXFilter->AddRef(); - - CMediaType mt; - mt.SetType(&MEDIATYPE_Video); - - GUID m = MEDIASUBTYPE_RGB24; - if (s->pix_fmt == MS_YUV420P) - m = (GUID)FOURCCMap(MAKEFOURCC('I','4','2','0')); - else if (s->pix_fmt == MS_YUY2) - m = MEDIASUBTYPE_YUY2; - else if (s->pix_fmt == MS_YUYV) - m = MEDIASUBTYPE_YUYV; - else if (s->pix_fmt == MS_UYVY) - m = MEDIASUBTYPE_UYVY; - else if (s->pix_fmt == MS_RGB24) - m = MEDIASUBTYPE_RGB24; - mt.SetSubtype(&m); - - mt.formattype = FORMAT_VideoInfo; - mt.SetTemporalCompression(FALSE); - - VIDEOINFO *pvi = (VIDEOINFO *) - mt.AllocFormatBuffer(sizeof(VIDEOINFO)); - if (NULL == pvi) - return -11; - ZeroMemory(pvi, sizeof(VIDEOINFO)); - - if (s->pix_fmt == MS_YUV420P) - pvi->bmiHeader.biCompression = MAKEFOURCC('I','4','2','0'); - else if (s->pix_fmt == MS_YUY2) - pvi->bmiHeader.biCompression = MAKEFOURCC('Y','U','Y','2'); - else if (s->pix_fmt == MS_YUYV) - pvi->bmiHeader.biCompression = MAKEFOURCC('Y','U','Y','V'); - else if (s->pix_fmt == MS_UYVY) - pvi->bmiHeader.biCompression = MAKEFOURCC('U','Y','V','Y'); - else if (s->pix_fmt == MS_RGB24) - pvi->bmiHeader.biCompression = BI_RGB; - - if (s->pix_fmt == MS_YUV420P) - pvi->bmiHeader.biBitCount = 12; - else if (s->pix_fmt == MS_YUY2) - pvi->bmiHeader.biBitCount = 16; - else if (s->pix_fmt == MS_YUYV) - pvi->bmiHeader.biBitCount = 16; - else if (s->pix_fmt == MS_UYVY) - pvi->bmiHeader.biBitCount = 16; - else if (s->pix_fmt == MS_RGB24) - pvi->bmiHeader.biBitCount = 24; - - pvi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - pvi->bmiHeader.biWidth = s->vsize.width; - pvi->bmiHeader.biHeight = s->vsize.height; - pvi->bmiHeader.biPlanes = 1; - pvi->bmiHeader.biSizeImage = GetBitmapSize(&pvi->bmiHeader); - pvi->bmiHeader.biClrImportant = 0; - mt.SetSampleSize(pvi->bmiHeader.biSizeImage); - - mt.SetFormat((BYTE*)pvi, sizeof(VIDEOINFO)); - - hr = s->m_pDXFilter->SetAcceptedMediaType(&mt); - if(FAILED(hr)) - { - return -12; - } - - hr = s->m_pDXFilter->SetCallback(Callback); - if(FAILED(hr)) - { - return -13; - } - - hr = s->m_pDXFilter->QueryInterface(IID_IBaseFilter, - (LPVOID *)&s->m_pIDXFilter); - if(FAILED(hr)) - { - return -14; - } - - hr = s->m_pGraph->AddFilter(s->m_pIDXFilter, L"DXFilter Filter"); - if(FAILED(hr)) - { - return -15; - } - - - // get null renderer - hr=CoCreateInstance (CLSID_NullRenderer, - NULL, - CLSCTX_INPROC_SERVER, - IID_IBaseFilter, - (void **)&s->m_pNullRenderer); - if(FAILED(hr)) - { - return -16; - } - if (s->m_pNullRenderer!=NULL) - { - s->m_pGraph->AddFilter(s->m_pNullRenderer, L"Null Renderer"); - } - - hr = s->m_pBuilder->RenderStream(&pPinCategory, - &MEDIATYPE_Video, s->m_pDeviceFilter, s->m_pIDXFilter, s->m_pNullRenderer); - if (FAILED(hr)) - { - return -17; - } - - IAMStreamConfig *pConfig = NULL; - hr = s->m_pBuilder->FindInterface( - &pPinCategory, // Preview pin. - &MEDIATYPE_Video, // Any media type. - s->m_pDeviceFilter, // Pointer to the capture filter. - IID_IAMStreamConfig, (void**)&pConfig); - if (pConfig!=NULL) - { - AM_MEDIA_TYPE *pType = NULL; - int iCount, iSize; - pConfig->GetNumberOfCapabilities(&iCount, &iSize); - - for (int i = 0; i < iCount; i++) { - VIDEO_STREAM_CONFIG_CAPS scc; - pType = NULL; - pConfig->GetStreamCaps(i, &pType, (BYTE *)&scc); - - if (!((pType->formattype == FORMAT_VideoInfo) && - (pType->cbFormat >= sizeof(VIDEOINFOHEADER)) && - (pType->pbFormat != NULL))) - continue; - - VIDEOINFOHEADER & videoInfo = *(VIDEOINFOHEADER *)pType->pbFormat; - - if (m != pType->subtype) - continue; - - if (videoInfo.bmiHeader.biWidth != s->vsize.width) - continue; - - if (videoInfo.bmiHeader.biHeight != s->vsize.height) - continue; - - if (videoInfo.bmiHeader.biBitCount != pvi->bmiHeader.biBitCount) - continue; - - if (videoInfo.bmiHeader.biCompression != pvi->bmiHeader.biCompression) - continue; - - videoInfo.AvgTimePerFrame = UNITS / (LONGLONG)s->fps; - pConfig->SetFormat(pType); - } - - pConfig->GetFormat(&pType); - if (pType!=NULL) - { - VIDEOINFO *pvi; - pvi = (VIDEOINFO *)pType->pbFormat; - ms_message("v4w: camera asked fps=%i // real fps=%i", (int)(UNITS / (LONGLONG)s->fps), pvi->AvgTimePerFrame); - } - - pConfig->Release(); - } - - //m_pDXFilter->SetBufferSamples(TRUE); - - s_callback = s; - hr = s->m_pControl->Run(); - if(FAILED(hr)) - { - return -18; - } - - - s->rotregvalue=1; - return 0; -} - -static void v4w_init(MSFilter *f){ - V4wState *s=(V4wState *)ms_new0(V4wState,1); - int idx; - s->devidx=0; - s->vsize.width=MS_VIDEO_SIZE_CIF_W; - s->vsize.height=MS_VIDEO_SIZE_CIF_H; - s->pix_fmt=MS_YUV420P; - - s->rotregvalue = 0; - s->m_pGraph=NULL; - s->m_pBuilder=NULL; - s->m_pControl=NULL; - s->m_pDXFilter=NULL; - s->m_pIDXFilter=NULL; - s->m_pDeviceFilter=NULL; - - qinit(&s->rq); - for (idx=0;idx<10;idx++) - { - s->mire[idx]=NULL; - } - memset(s->nowebcamimage, 0, sizeof(s->nowebcamimage)); - ms_mutex_init(&s->mutex,NULL); - s->start_time=0; - s->frame_count=-1; - s->fps=15; - memset(s->dev, 0, sizeof(s->dev)); - - f->data=s; -} - -static int _v4w_test(V4wState *s, void *arg) -{ - int i; - i = v4w_configure_videodevice(s); - - if (i!=0) - { - s->pix_fmt = MS_YUV420P; - s->vsize.width = MS_VIDEO_SIZE_CIF_W; - s->vsize.height = MS_VIDEO_SIZE_CIF_H; - } - - if (s->m_pGraph!=NULL) - { - if (s->m_pNullRenderer!=NULL) - s->m_pGraph->RemoveFilter(s->m_pNullRenderer); - if (s->m_pIDXFilter!=NULL) - s->m_pGraph->RemoveFilter(s->m_pIDXFilter); - if (s->m_pDeviceFilter!=NULL) - s->m_pGraph->RemoveFilter(s->m_pDeviceFilter); - } - - if (s->m_pNullRenderer) - s->m_pNullRenderer->Release(); - if (s->m_pIDXFilter) - s->m_pIDXFilter->Release(); - if (s->m_pDeviceFilter) - s->m_pDeviceFilter->Release(); - - if (s->m_pBuilder) - s->m_pBuilder->Release(); - if (s->m_pControl) - s->m_pControl->Release(); - if (s->m_pGraph) - s->m_pGraph->Release(); - - if (s->m_pDXFilter!=NULL) - s->m_pDXFilter->Release(); - - s->m_pNullRenderer=NULL; - s->m_pIDXFilter=NULL; - s->m_pDeviceFilter=NULL; - s->m_pBuilder=NULL; - s->m_pControl=NULL; - s->m_pGraph=NULL; - s->m_pDXFilter=NULL; - - CoUninitialize(); - s_callback = NULL; - flushq(&s->rq,0); - ms_message("v4w: checked device size=%ix%i format=%i (err=%i)", s->vsize.width, s->vsize.height, s->pix_fmt, i); - - return i; -} - -static int _v4w_start(V4wState *s, void *arg) -{ - int i; - s->frame_count=-1; - - i = v4w_open_videodevice(s); - - if (s->rotregvalue==0){ - if (s->m_pGraph!=NULL) - { - if (s->m_pNullRenderer!=NULL) - s->m_pGraph->RemoveFilter(s->m_pNullRenderer); - if (s->m_pIDXFilter!=NULL) - s->m_pGraph->RemoveFilter(s->m_pIDXFilter); - if (s->m_pDeviceFilter!=NULL) - s->m_pGraph->RemoveFilter(s->m_pDeviceFilter); - } - - if (s->m_pNullRenderer) - s->m_pNullRenderer->Release(); - if (s->m_pIDXFilter) - s->m_pIDXFilter->Release(); - if (s->m_pDeviceFilter) - s->m_pDeviceFilter->Release(); - - if (s->m_pBuilder) - s->m_pBuilder->Release(); - if (s->m_pControl) - s->m_pControl->Release(); - if (s->m_pGraph) - s->m_pGraph->Release(); - - if (s->m_pDXFilter!=NULL) - s->m_pDXFilter->Release(); - - s->m_pNullRenderer=NULL; - s->m_pIDXFilter=NULL; - s->m_pDeviceFilter=NULL; - s->m_pBuilder=NULL; - s->m_pControl=NULL; - s->m_pGraph=NULL; - s->m_pDXFilter=NULL; - - CoUninitialize(); - s_callback = NULL; - flushq(&s->rq,0); - ms_message("v4w: graph not started (err=%i)", i); - s->rotregvalue=0; - s->pix_fmt = MS_YUV420P; - } - return i; -} - -static void v4w_uninit(MSFilter *f){ - V4wState *s=(V4wState*)f->data; - int idx; - flushq(&s->rq,0); - ms_mutex_destroy(&s->mutex); - for (idx=0;idx<10;idx++) - { - if (s->mire[idx]==NULL) - break; - freemsg(s->mire[idx]); - } - if (s->rotregvalue>0){ - HRESULT hr = s->m_pControl->Stop(); - if(FAILED(hr)) - { - ms_message("v4w: could not stop graph"); - } - - if (s->m_pGraph!=NULL) - { - if (s->m_pNullRenderer!=NULL) - s->m_pGraph->RemoveFilter(s->m_pNullRenderer); - if (s->m_pIDXFilter!=NULL) - s->m_pGraph->RemoveFilter(s->m_pIDXFilter); - if (s->m_pDeviceFilter!=NULL) - s->m_pGraph->RemoveFilter(s->m_pDeviceFilter); - } - - if (s->m_pNullRenderer) - s->m_pNullRenderer->Release(); - if (s->m_pIDXFilter) - s->m_pIDXFilter->Release(); - if (s->m_pDeviceFilter) - s->m_pDeviceFilter->Release(); - - if (s->m_pBuilder) - s->m_pBuilder->Release(); - if (s->m_pControl) - s->m_pControl->Release(); - if (s->m_pGraph) - s->m_pGraph->Release(); - - if (s->m_pDXFilter!=NULL) - s->m_pDXFilter->Release(); - - s->m_pNullRenderer=NULL; - s->m_pIDXFilter=NULL; - s->m_pDeviceFilter=NULL; - s->m_pBuilder=NULL; - s->m_pControl=NULL; - s->m_pGraph=NULL; - s->m_pDXFilter=NULL; - - CoUninitialize(); - s_callback = NULL; - flushq(&s->rq,0); - ms_message("v4w: graph destroyed"); - s->rotregvalue=0; - } - ms_free(s); -} - -static mblk_t * v4w_make_nowebcam(V4wState *s){ -#if defined(_WIN32_WCE) - return NULL; -#else - int idx; - int count; - if(s->mire[0]==NULL && s->frame_ind==0 && s->nowebcamimage[0] != '\0') - { - s->mire[0] = ms_load_jpeg_as_yuv(s->nowebcamimage,&s->vsize); - } - if (s->mire[0]==NULL && s->frame_ind==0){ - /* load several images to fake a movie */ - for (idx=0;idx<10;idx++) - { - s->mire[idx]=ms_load_nowebcam(&s->vsize, idx); - if (s->mire[idx]==NULL) - break; - } - if (idx==0) - s->mire[0]=ms_load_nowebcam(&s->vsize, -1); - } - for (count=0;count<10;count++) - { - if (s->mire[count]==NULL) - break; - } - - s->frame_ind++; - if (count==0) - return NULL; - - idx = s->frame_ind%count; - if (s->mire[idx]!=NULL) - return s->mire[idx]; - return s->mire[0]; -#endif -} - -static void v4w_preprocess(MSFilter * obj){ - V4wState *s=(V4wState*)obj->data; - if (s->rotregvalue==0) - _v4w_start(s, NULL); - if (s->rotregvalue==0) - s->fps=1; -} - -static void v4w_postprocess(MSFilter * obj){ - V4wState *s=(V4wState*)obj->data; - s->start_time=0; - s->frame_count=-1; - flushq(&s->rq,0); -} - -static void v4w_process(MSFilter * obj){ - V4wState *s=(V4wState*)obj->data; - mblk_t *m; - uint32_t timestamp; - int cur_frame; - - if (s->frame_count==-1){ - s->start_time=obj->ticker->time; - s->frame_count=0; - } - - cur_frame=(int)((obj->ticker->time-s->start_time)*s->fps/1000.0); - if (cur_frame>s->frame_count){ - mblk_t *om=NULL; - ms_mutex_lock(&s->mutex); - /*keep the most recent frame if several frames have been captured */ - if (s->rotregvalue!=0){ - while((m=getq(&s->rq))!=NULL){ - if (om!=NULL) freemsg(om); - om=m; - } - }else { - mblk_t *nowebcam = v4w_make_nowebcam(s); - if (nowebcam!=NULL){ - om=dupmsg(nowebcam); - mblk_set_precious_flag(om,1); - } - } - ms_mutex_unlock(&s->mutex); - if (om!=NULL){ - timestamp=(uint32_t)obj->ticker->time*90;/* rtp uses a 90000 Hz clockrate for video*/ - mblk_set_timestamp_info(om,timestamp); - ms_queue_put(obj->outputs[0],om); - /*ms_message("picture sent");*/ - } - s->frame_count++; - } -} - - - -static int v4w_set_fps(MSFilter *f, void *arg){ - V4wState *s=(V4wState*)f->data; - s->fps=*((float*)arg); - s->frame_count=-1; /* reset counter used for fps */ - return 0; -} - - -static int v4w_set_pix_fmt(MSFilter *f,void *arg){ - V4wState *s=(V4wState*)f->data; - s->pix_fmt=*((MSPixFmt*)arg); - return 0; -} - -static int v4w_get_pix_fmt(MSFilter *f,void *arg){ - V4wState *s=(V4wState*)f->data; - if (s->rotregvalue==0){ - _v4w_test(s, NULL); /* check supported format */ - *((MSPixFmt*)arg) = (MSPixFmt)s->pix_fmt; - return 0; - } - *((MSPixFmt*)arg) = (MSPixFmt)s->pix_fmt; - return 0; -} - -static int v4w_set_vsize(MSFilter *f, void *arg){ - V4wState *s=(V4wState*)f->data; - s->vsize=*((MSVideoSize*)arg); - return 0; -} - -static int v4w_get_vsize(MSFilter *f, void *arg){ - V4wState *s=(V4wState*)f->data; - MSVideoSize *vs=(MSVideoSize*)arg; - vs->width=s->vsize.width; - vs->height=s->vsize.height; - return 0; -} - -static int v4w_set_device(MSFilter *f, void *arg){ - V4wState *s=(V4wState*)f->data; - s->devidx=*((int*)arg); - return 0; -} - -static int v4w_set_image(MSFilter *f, void *arg){ - int idx; - V4wState *s=(V4wState*)f->data; - char *image = (char *)arg; - ms_mutex_lock(&s->mutex); - if (image!=NULL && image[0]!='\0') - snprintf(s->nowebcamimage, sizeof(s->nowebcamimage), "%s", image); - else - s->nowebcamimage[0] = '\0'; - for (idx=0;idx<10;idx++) - { - if (s->mire[idx]==NULL) - break; - freemsg(s->mire[idx]); - s->mire[idx]=NULL; - } - s->frame_ind=0; - ms_mutex_unlock(&s->mutex); - return 0; -} - -static int v4w_set_name(MSFilter *f, void *arg){ - V4wState *s=(V4wState*)f->data; - snprintf(s->dev, sizeof(s->dev), (char*)arg); - return 0; -} - -static MSFilterMethod methods[]={ - { MS_FILTER_SET_FPS , v4w_set_fps }, - { MS_FILTER_SET_PIX_FMT , v4w_set_pix_fmt }, - { MS_FILTER_GET_PIX_FMT , v4w_get_pix_fmt }, - { MS_FILTER_SET_VIDEO_SIZE, v4w_set_vsize }, - { MS_FILTER_GET_VIDEO_SIZE, v4w_get_vsize }, - { MS_V4L_SET_DEVICE, v4w_set_device }, - { MS_FILTER_SET_IMAGE, v4w_set_image }, - { 0, NULL } -}; - -#if defined(_MSC_VER) || defined(__cplusplus) - -MSFilterDesc ms_v4w_desc={ - MS_V4L_ID, - "MSV4w", - N_("A video4windows compatible source filter to stream pictures."), - MS_FILTER_OTHER, - NULL, - 0, - 1, - v4w_init, - v4w_preprocess, - v4w_process, - v4w_postprocess, - v4w_uninit, - methods -}; - -#else - -MSFilterDesc ms_v4w_desc={ - .id=MS_V4L_ID, - .name="MSV4w", - .text=N_("A video4windows compatible source filter to stream pictures."), - .ninputs=0, - .noutputs=1, - .category=MS_FILTER_OTHER, - .init=v4w_init, - .preprocess=v4w_preprocess, - .process=v4w_process, - .postprocess=v4w_postprocess, - .uninit=v4w_uninit, - .methods=methods -}; - -#endif - -MS_FILTER_DESC_EXPORT(ms_v4w_desc) - -static MSFilter *vfw_create_reader(MSWebCam *obj){ - MSFilter *f=ms_filter_new_from_desc(&ms_v4w_desc); - v4w_set_name(f,obj->name); - return f; -} - -static void vfw_detect(MSWebCamManager *obj); - -static void vfw_cam_init(MSWebCam *cam){ -} - -MSWebCamDesc ms_directx_cam_desc={ - "DirectX Video Grabber", - &vfw_detect, - &vfw_cam_init, - &vfw_create_reader, - NULL -}; - -static void vfw_detect(MSWebCamManager *obj){ - ICreateDevEnum *pCreateDevEnum = NULL; - IEnumMoniker *pEnumMoniker = NULL; - IMoniker *pMoniker = NULL; - HRESULT hr; - - ULONG nFetched = 0; - - // Initialize COM - CoInitialize(NULL); - - hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, - IID_ICreateDevEnum, (PVOID *)&pCreateDevEnum); - if(FAILED(hr)) - { - CoUninitialize(); - return ; - } - - hr = pCreateDevEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, - &pEnumMoniker, 0); - if (FAILED(hr) || pEnumMoniker == NULL) { - //printf("no device\n"); - CoUninitialize(); - return ; - } - - pEnumMoniker->Reset(); - - int pos=0; - while(S_OK == pEnumMoniker->Next(1, &pMoniker, &nFetched) ) - { - IPropertyBag *pBag; - hr = pMoniker->BindToStorage( 0, 0, IID_IPropertyBag, (void**) &pBag ); - if( hr != S_OK ) - continue; - - VARIANT var; - VariantInit(&var); - hr = pBag->Read( L"FriendlyName", &var, NULL ); - if( hr != S_OK ) - { - pMoniker->Release(); - continue; - } - //USES_CONVERSION; - char szName[256]; - - WideCharToMultiByte(CP_UTF8,0,var.bstrVal,-1,szName,256,0,0); - VariantClear(&var); - - IBaseFilter *m_pDeviceFilter; - hr = pMoniker->BindToObject(0, 0, IID_IBaseFilter, (void**)&m_pDeviceFilter ); - if(SUCCEEDED(hr)) - { - GUID pPinCategory; - int fmt_supported = 0; - - //basic testing for the device. - if (try_format(m_pDeviceFilter,MS_YUV420P, &pPinCategory)==0) - fmt_supported = 1; - else if (try_format(m_pDeviceFilter,MS_YUY2, &pPinCategory)==0) - fmt_supported = 1; - else if (try_format(m_pDeviceFilter,MS_YUYV, &pPinCategory)==0) - fmt_supported = 1; - else if (try_format(m_pDeviceFilter,MS_UYVY, &pPinCategory)==0) - fmt_supported = 1; - else if (try_format(m_pDeviceFilter,MS_RGB24, &pPinCategory)==0) - fmt_supported = 1; - else - { - ms_warning("Unsupported video pixel format/refuse camera (%s).", szName); - } - - if (fmt_supported==1) - { - MSWebCam *cam=ms_web_cam_new(&ms_directx_cam_desc); - cam->name=ms_strdup(szName); - ms_web_cam_manager_add_cam(obj,cam); - } - m_pDeviceFilter->Release(); - m_pDeviceFilter=NULL; - } - - - pMoniker->Release(); - pBag->Release(); - pMoniker=NULL; - pBag=NULL; - } - - pEnumMoniker->Release(); - pCreateDevEnum->Release(); - CoUninitialize(); -} diff --git a/linphone/mediastreamer2/tests/.gitignore b/linphone/mediastreamer2/tests/.gitignore deleted file mode 100644 index eeece4336..000000000 --- a/linphone/mediastreamer2/tests/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -Makefile.in -Makefile -.deps -.libs -echo -mediastream -ring -videodisplay -bench -mtudiscover - diff --git a/linphone/mediastreamer2/tests/Makefile.am b/linphone/mediastreamer2/tests/Makefile.am deleted file mode 100644 index 443b0edf1..000000000 --- a/linphone/mediastreamer2/tests/Makefile.am +++ /dev/null @@ -1,37 +0,0 @@ -if BUILD_TESTS - -noinst_PROGRAMS=echo ring mtudiscover bench - -if BUILD_VIDEO -noinst_PROGRAMS+=videodisplay -endif - -echo_SOURCES=echo.c -ring_SOURCES=ring.c -videodisplay_SOURCES=videodisplay.c -mtudiscover_SOURCES=mtudiscover.c -bench_SOURCES=bench.c - -libexec_PROGRAMS=mediastream - -mediastream_SOURCES=mediastream.c - -#libquickstream.la would be enough, but to workaround a bug of libtool when -#cross compiling we need to add all the dependencies. -LDADD= $(top_builddir)/src/libmediastreamer.la \ - $(ORTP_LIBS) \ - $(ALSA_LIBS) \ - $(ARTS_LIBS) \ - $(SPEEX_LIBS) \ - $(GSM_LIBS) \ - $(THEORA_LIBS) \ - $(VIDEO_LIBS) - - - -INCLUDES=-I$(top_srcdir)/include/ - -AM_CFLAGS=-I$(top_srcdir) $(ORTP_CFLAGS) $(STRICT_OPTIONS) $(VIDEO_CFLAGS) -AM_LDFLAGS=-rdynamic - -endif diff --git a/linphone/mediastreamer2/tests/bench.c b/linphone/mediastreamer2/tests/bench.c deleted file mode 100644 index a7c12721e..000000000 --- a/linphone/mediastreamer2/tests/bench.c +++ /dev/null @@ -1,365 +0,0 @@ - -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -#include "mediastreamer2/msticker.h" - -#include "mediastreamer2/msrtp.h" -#include "mediastreamer2/msfileplayer.h" -#include "mediastreamer2/msfilerec.h" - -#include - -#define MAX_RTP_SIZE 1500 - -static int run=1; - -static void stop(int signum){ - run=0; -} - -struct test_session { - RtpSession *rtps; - - MSFilter *fplayer; - MSFilter *encoder; - MSFilter *rtpsend; - - MSFilter *rtprecv; - MSFilter *decoder; - MSFilter *frecorder; -}; - -struct bench_config { - int num_session; - int num_session_record; - - int port_origin; - char *ip_destination; - int port_destination; - - int payload; - int rate; - int ptime; - char *wavfile; - - MSTicker *ticker; - MSList *tsessions; /* list of struct test_session */ -}; - -#define NUM_SESSION 50 /* num of session to start per block */ -#define NUM_SESSION_RECORD 1 - -struct bench_config cfg[] = { - { NUM_SESSION,NUM_SESSION_RECORD, - 8000,"127.0.0.1",9000,8,8000,20,"test1.wav",NULL,NULL }, - { NUM_SESSION,NUM_SESSION_RECORD, - 9000,"127.0.0.1",8000,8,8000,20,"test1.wav",NULL,NULL }, - - { NUM_SESSION,NUM_SESSION_RECORD, - 10000,"127.0.0.1",11000,8,8000,20,"test1.wav",NULL,NULL }, - { NUM_SESSION,NUM_SESSION_RECORD, - 11000,"127.0.0.1",10000,8,8000,20,"test1.wav",NULL,NULL }, - - { 0,0,0,'\0',0,0,0,0,NULL,NULL,NULL }, -}; - -RtpSession *create_duplex_rtpsession(int locport){ - RtpSession *rtpr; - rtpr=rtp_session_new(RTP_SESSION_SENDRECV); - rtp_session_set_recv_buf_size(rtpr,MAX_RTP_SIZE); - rtp_session_set_scheduling_mode(rtpr,0); - rtp_session_set_blocking_mode(rtpr,0); - rtp_session_enable_adaptive_jitter_compensation(rtpr,FALSE); - rtp_session_set_symmetric_rtp(rtpr,TRUE); - rtp_session_set_local_addr(rtpr,"0.0.0.0",locport); - rtp_session_signal_connect(rtpr,"timestamp_jump",(RtpCallback)rtp_session_resync,(long)NULL); - rtp_session_signal_connect(rtpr,"ssrc_changed",(RtpCallback)rtp_session_resync,(long)NULL); - return rtpr; -} - -int init_bench(struct bench_config *bench) -{ - PayloadType *pt; - int pos; - int val; - int count; - bench->ticker=ms_ticker_new(); - - count = 0; - /* creates the couple of encoder/decoder */ - pt=rtp_profile_get_payload(&av_profile,bench->payload); - if (pt==NULL){ - ms_error("audiostream.c: undefined payload type."); - return count; - } - if (pt->clock_rate!=8000 && pt->clock_rate!=16000 && pt->clock_rate!=32000){ - ms_error("audiostream.c: wrong rate."); - return count; - } - for (pos=0;posnum_session;pos++) - { - struct test_session *ts = (struct test_session *)ortp_malloc(sizeof(struct test_session)); - memset(ts, 0, sizeof(struct test_session)); - - ts->rtps = create_duplex_rtpsession(bench->port_origin+pos*2); - if (ts->rtps==NULL) - { - ms_error("bench.c: cannot create rtp_session!"); - ortp_free(ts); - return count; - } - - rtp_session_set_payload_type(ts->rtps,bench->payload); - rtp_session_set_remote_addr_full(ts->rtps, - bench->ip_destination, - bench->port_destination+pos*2, - bench->port_destination+1+pos*2); - - ts->fplayer = ms_filter_new(MS_FILE_PLAYER_ID); - if (strstr(bench->wavfile, ".au")==NULL) - ts->encoder = ms_filter_create_encoder(pt->mime_type); - ts->rtpsend = ms_filter_new(MS_RTP_SEND_ID); - - ts->rtprecv = ms_filter_new(MS_RTP_RECV_ID); - ts->decoder = ms_filter_create_decoder(pt->mime_type); - ts->frecorder = ms_filter_new(MS_FILE_REC_ID); - - if ((ts->encoder==NULL && strstr(bench->wavfile, ".au")==NULL) - || (ts->decoder==NULL )){ - ms_error("bench.c: No decoder available for payload %i.",bench->payload); - if (ts->fplayer) ms_filter_destroy(ts->fplayer); - if (ts->encoder) ms_filter_destroy(ts->encoder); - if (ts->rtpsend) ms_filter_destroy(ts->rtpsend); - if (ts->rtprecv) ms_filter_destroy(ts->rtprecv); - if (ts->decoder) ms_filter_destroy(ts->decoder); - if (ts->frecorder) ms_filter_destroy(ts->frecorder); - ortp_free(ts); - return count; - } - if (ts->fplayer==NULL){ - ms_error("bench.c: missing player filter."); - if (ts->fplayer) ms_filter_destroy(ts->fplayer); - if (ts->encoder) ms_filter_destroy(ts->encoder); - if (ts->rtpsend) ms_filter_destroy(ts->rtpsend); - if (ts->rtprecv) ms_filter_destroy(ts->rtprecv); - if (ts->decoder) ms_filter_destroy(ts->decoder); - if (ts->frecorder) ms_filter_destroy(ts->frecorder); - ortp_free(ts); - return count; - } - if (ts->frecorder==NULL){ - ms_error("bench.c: missing recorder filter."); - if (ts->fplayer) ms_filter_destroy(ts->fplayer); - if (ts->encoder) ms_filter_destroy(ts->encoder); - if (ts->rtpsend) ms_filter_destroy(ts->rtpsend); - if (ts->rtprecv) ms_filter_destroy(ts->rtprecv); - if (ts->decoder) ms_filter_destroy(ts->decoder); - if (ts->frecorder) ms_filter_destroy(ts->frecorder); - ortp_free(ts); - return count; - } - if (ts->rtpsend==NULL){ - ms_error("bench.c: missing rtpsend filter."); - if (ts->fplayer) ms_filter_destroy(ts->fplayer); - if (ts->encoder) ms_filter_destroy(ts->encoder); - if (ts->rtpsend) ms_filter_destroy(ts->rtpsend); - if (ts->rtprecv) ms_filter_destroy(ts->rtprecv); - if (ts->decoder) ms_filter_destroy(ts->decoder); - if (ts->frecorder) ms_filter_destroy(ts->frecorder); - ortp_free(ts); - return count; - } - if (ts->rtprecv==NULL){ - ms_error("bench.c: missing rtprecv filter."); - if (ts->fplayer) ms_filter_destroy(ts->fplayer); - if (ts->encoder) ms_filter_destroy(ts->encoder); - if (ts->rtpsend) ms_filter_destroy(ts->rtpsend); - if (ts->rtprecv) ms_filter_destroy(ts->rtprecv); - if (ts->decoder) ms_filter_destroy(ts->decoder); - if (ts->frecorder) ms_filter_destroy(ts->frecorder); - ortp_free(ts); - return count; - } - - ms_filter_call_method(ts->rtpsend,MS_RTP_SEND_SET_SESSION,ts->rtps); - ms_filter_call_method(ts->rtprecv,MS_RTP_RECV_SET_SESSION,ts->rtps); - - ms_filter_call_method (ts->rtprecv, MS_FILTER_SET_SAMPLE_RATE, - &pt->clock_rate); - - ms_filter_call_method (ts->frecorder, MS_FILTER_SET_SAMPLE_RATE, - &pt->clock_rate); - - val = ms_filter_call_method(ts->fplayer,MS_FILE_PLAYER_OPEN,(void*)bench->wavfile); - if (val!=0) - { - ms_error("bench.c: Cannot open wav file (%s)", bench->wavfile); - if (ts->fplayer) ms_filter_destroy(ts->fplayer); - if (ts->encoder) ms_filter_destroy(ts->encoder); - if (ts->rtpsend) ms_filter_destroy(ts->rtpsend); - if (ts->rtprecv) ms_filter_destroy(ts->rtprecv); - if (ts->decoder) ms_filter_destroy(ts->decoder); - if (ts->frecorder) ms_filter_destroy(ts->frecorder); - ortp_free(ts); - return count; - } - - val=0; - ms_filter_call_method (ts->fplayer, MS_FILTER_GET_SAMPLE_RATE, - &val); - if (val!=pt->clock_rate) - { - ms_error("bench.c: unsupported rate for wav file: codec=%i / file=%i", - pt->clock_rate, val); - if (ts->fplayer) ms_filter_destroy(ts->fplayer); - if (ts->encoder) ms_filter_destroy(ts->encoder); - if (ts->rtpsend) ms_filter_destroy(ts->rtpsend); - if (ts->rtprecv) ms_filter_destroy(ts->rtprecv); - if (ts->decoder) ms_filter_destroy(ts->decoder); - if (ts->frecorder) ms_filter_destroy(ts->frecorder); - ortp_free(ts); - return count; - } - ms_filter_call_method (ts->fplayer, MS_FILTER_GET_NCHANNELS, - &val); - - if (val!=1) - { - ms_error("bench.c: unsupported number of channel for wav file: codec=1 / file=%i", - val); - if (ts->fplayer) ms_filter_destroy(ts->fplayer); - if (ts->encoder) ms_filter_destroy(ts->encoder); - if (ts->rtpsend) ms_filter_destroy(ts->rtpsend); - if (ts->rtprecv) ms_filter_destroy(ts->rtprecv); - if (ts->decoder) ms_filter_destroy(ts->decoder); - if (ts->frecorder) ms_filter_destroy(ts->frecorder); - ortp_free(ts); - return count; - } - ms_filter_call_method_noarg(ts->fplayer,MS_FILE_PLAYER_START); - - if (strstr(bench->wavfile, ".au")==NULL) - { - ms_filter_link(ts->fplayer,0,ts->encoder,0); - ms_filter_link(ts->encoder,0,ts->rtpsend,0); - } - else - { - ms_filter_link(ts->fplayer,0,ts->rtpsend,0); - } - - ms_filter_link(ts->rtprecv,0,ts->decoder,0); - ms_filter_link(ts->decoder,0,ts->frecorder,0); - - ms_ticker_attach(bench->ticker,ts->fplayer); - ms_ticker_attach(bench->ticker,ts->rtprecv); - - if (pos < bench->num_session_record) - { - char rec_file[128]; - snprintf(rec_file, sizeof(rec_file), "rec_%s_%i.wav", - bench->ip_destination, - bench->port_destination+pos*2); - ms_filter_call_method(ts->frecorder,MS_FILE_REC_OPEN,(void*)rec_file); - ms_filter_call_method_noarg(ts->frecorder,MS_FILE_REC_START); - } - - bench->tsessions = ms_list_append(bench->tsessions, (void*)ts); - count++; - } - - return count; -} - -static int uninit_bench(struct bench_config *bench) -{ - MSList *it; - for(it=bench->tsessions;it!=NULL;it=bench->tsessions){ - struct test_session *ts = (struct test_session *)it->data; - bench->tsessions = ms_list_remove_link(bench->tsessions, it); - - ms_ticker_detach(bench->ticker,ts->fplayer); - ms_ticker_detach(bench->ticker,ts->rtprecv); - - ms_filter_call_method_noarg(ts->frecorder,MS_FILE_REC_CLOSE); - - if (strstr(bench->wavfile, ".au")==NULL) - { - ms_filter_unlink(ts->fplayer,0,ts->encoder,0); - ms_filter_unlink(ts->encoder,0,ts->rtpsend,0); - } - else - { - ms_filter_unlink(ts->fplayer,0,ts->rtpsend,0); - } - - ms_filter_unlink(ts->rtprecv,0,ts->decoder,0); - ms_filter_unlink(ts->decoder,0,ts->frecorder,0); - - if (ts->fplayer) ms_filter_destroy(ts->fplayer); - if (ts->encoder) ms_filter_destroy(ts->encoder); - if (ts->rtpsend) ms_filter_destroy(ts->rtpsend); - - if (ts->rtprecv) ms_filter_destroy(ts->rtprecv); - if (ts->decoder) ms_filter_destroy(ts->decoder); - if (ts->frecorder) ms_filter_destroy(ts->frecorder); - - ortp_free(ts); - } - - ms_ticker_destroy(bench->ticker); - return 0; -} - - -int main(int argc, char *argv[]){ - int pos; - int count; - ortp_init(); - ortp_set_log_level_mask(ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL); - ms_init(); - rtp_profile_set_payload(&av_profile,115,&payload_type_lpc1015); - rtp_profile_set_payload(&av_profile,110,&payload_type_speex_nb); - rtp_profile_set_payload(&av_profile,111,&payload_type_speex_wb); - rtp_profile_set_payload(&av_profile,112,&payload_type_ilbc); - - signal(SIGINT,stop); - - count=0; - for (pos=0;cfg[pos].num_session!=0;pos++) - { - count = count + init_bench(&cfg[pos]); - ms_sleep(10); - } - - ms_message("Number of session started: %i.", count); - - while(run) - ms_sleep(1); - - for (pos=0;cfg[pos].num_session!=0;pos++) - { - uninit_bench(&cfg[pos]); - } - - return 0; -} - diff --git a/linphone/mediastreamer2/tests/echo.c b/linphone/mediastreamer2/tests/echo.c deleted file mode 100644 index ca2ddbfc2..000000000 --- a/linphone/mediastreamer2/tests/echo.c +++ /dev/null @@ -1,99 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -#include "mediastreamer2/msfilter.h" -#include "mediastreamer2/mssndcard.h" -#include "mediastreamer2/msticker.h" - -#ifndef _WIN32_WCE -#include -#elif defined(_MSC_VER) -#define main _tmain -#endif - -static int run=1; - -static void stop(int signum){ - run=0; -} - -int main(int argc, char *argv[]){ - MSFilter *f1,*f2; - MSSndCard *card_capture; - MSSndCard *card_playback; - MSTicker *ticker; - char *card_id=NULL; - int rate = 16000; - - ortp_init(); - ortp_set_log_level_mask(ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL); - ms_init(); - -#ifndef _WIN32_WCE - signal(SIGINT,stop); -#endif - - if (argc>1) - card_id=argv[1]; - - if (card_id!=NULL) - { - card_capture = ms_snd_card_manager_get_card(ms_snd_card_manager_get(),card_id); - card_playback = ms_snd_card_manager_get_card(ms_snd_card_manager_get(),card_id); -#ifdef __linux - if (card_playback==NULL) - card_playback = ms_alsa_card_new_custom(card_id, card_id); - if (card_capture==NULL) - card_capture = ms_alsa_card_new_custom(card_id, card_id); -#endif - } - else - { - card_capture = ms_snd_card_manager_get_default_capture_card(ms_snd_card_manager_get()); - card_playback = ms_snd_card_manager_get_default_playback_card(ms_snd_card_manager_get()); - } - if (card_playback==NULL || card_capture==NULL){ - ms_error("No card."); - return -1; - } - f1=ms_snd_card_create_reader(card_capture); - f2=ms_snd_card_create_writer(card_playback); - - ms_filter_call_method (f1, MS_FILTER_SET_SAMPLE_RATE, - &rate); - ms_filter_call_method (f2, MS_FILTER_SET_SAMPLE_RATE, - &rate); - - ticker=ms_ticker_new(); - ms_filter_link(f1,0,f2,0); - ms_ticker_attach(ticker,f1); -#ifndef _WIN32_WCE - while(run) - ms_sleep(1); -#else - ms_sleep(5); -#endif - ms_ticker_detach(ticker,f1); - ms_ticker_destroy(ticker); - ms_filter_unlink(f1,0,f2,0); - ms_filter_destroy(f1); - ms_filter_destroy(f2); - return 0; -} diff --git a/linphone/mediastreamer2/tests/mediastream.c b/linphone/mediastreamer2/tests/mediastream.c deleted file mode 100644 index c15362f12..000000000 --- a/linphone/mediastreamer2/tests/mediastream.c +++ /dev/null @@ -1,381 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifdef HAVE_CONFIG_H -#include "mediastreamer-config.h" -#endif - -#include - -#include "mediastreamer2/mediastream.h" -#include "mediastreamer2/msequalizer.h" -#include "mediastreamer2/msvolume.h" -#ifdef VIDEO_ENABLED -#include "mediastreamer2/msv4l.h" -#endif - -#include -#include -#ifndef WIN32 -#include -#endif -#include -#include -#include - -static int cond=1; - -static const char * capture_card=NULL; -static float ng_threshold=-1; -static bool_t use_ng=FALSE; - -/* starting values echo canceller */ -static int ec_len_ms=0, ec_delay_ms=250, ec_framesize; - - -static void stop_handler(int signum) -{ - cond--; - if (cond<0) exit(-1); -} - -static bool_t parse_addr(const char *addr, char *ip, int len, int *port) -{ - const char *semicolon=NULL; - int iplen; - int slen; - const char *p; - - *port=0; - semicolon=strchr(addr,':'); - for (p=addr+strlen(addr)-1;p>addr;p--){ - if (*p==':') { - semicolon=p; - break; - } - } - if (semicolon==NULL) return FALSE; - iplen=semicolon-addr; - slen=MIN(iplen,len-1); - strncpy(ip,addr,slen); - ip[slen]='\0'; - *port=atoi(semicolon+1); - return TRUE; -} - -static void display_items(void *user_data, uint32_t csrc, rtcp_sdes_type_t t, const char *content, uint8_t content_len){ - char str[256]; - int len=MIN(sizeof(str)-1,content_len); - strncpy(str,content,len); - str[len]='\0'; - switch(t){ - case RTCP_SDES_CNAME: - ms_message("Found CNAME=%s",str); - break; - case RTCP_SDES_TOOL: - ms_message("Found TOOL=%s",str); - break; - case RTCP_SDES_NOTE: - ms_message("Found NOTE=%s",str); - break; - default: - ms_message("Unhandled SDES item (%s)",str); - } -} - -static void parse_rtcp(mblk_t *m){ - do{ - if (rtcp_is_RR(m)){ - ms_message("Receiving RTCP RR"); - }else if (rtcp_is_SR(m)){ - ms_message("Receiving RTCP SR"); - }else if (rtcp_is_SDES(m)){ - ms_message("Receiving RTCP SDES"); - rtcp_sdes_parse(m,display_items,NULL); - }else { - ms_message("Receiving unhandled RTCP message"); - } - }while(rtcp_next_packet(m)); -} - -static void parse_events(OrtpEvQueue *q){ - OrtpEvent *ev; - while((ev=ortp_ev_queue_get(q))!=NULL){ - OrtpEventData *d=ortp_event_get_data(ev); - switch(ortp_event_get_type(ev)){ - case ORTP_EVENT_RTCP_PACKET_RECEIVED: - parse_rtcp(d->packet); - break; - default: - ms_warning("Unhandled ortp event."); - } - ortp_event_destroy(ev); - } -} - -const char *usage="mediastream --local --remote --payload \n" - "[ --fmtp ]\n" - "[ --jitter ]\n" - "[ --width ]\n" - "[ --height ]\n" - "[ --bitrate ]\n" - "[ --ec (enable echo canceller)]\n" - "[ --agc (enable automatic gain control)]\n" - "[ --ng (enable noise gate)]\n" - "[ --ng-threshold <(float) [0-1]> (noise gate threshold)]\n" - "[ --capture-card ] \n"; - -static void run_media_streams(int localport, const char *remote_ip, int remoteport, int payload, const char *fmtp, - int jitter, int bitrate, MSVideoSize vs, bool_t ec, bool_t agc, bool_t eq); - -int main(int argc, char * argv[]) -{ - int i; - int localport=0,remoteport=0,payload=0; - char ip[50]; - const char *fmtp=NULL; - int jitter=50; - int bitrate=0; - MSVideoSize vs; - bool_t ec=FALSE; - bool_t agc=FALSE; - bool_t eq=FALSE; - /*create the rtp session */ - ortp_init(); - ortp_set_log_level_mask(ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL); - rtp_profile_set_payload(&av_profile,115,&payload_type_lpc1015); - rtp_profile_set_payload(&av_profile,110,&payload_type_speex_nb); - rtp_profile_set_payload(&av_profile,111,&payload_type_speex_wb); - rtp_profile_set_payload(&av_profile,112,&payload_type_ilbc); -#ifdef VIDEO_ENABLED - rtp_profile_set_payload(&av_profile,26,&payload_type_jpeg); - rtp_profile_set_payload(&av_profile,98,&payload_type_h263_1998); - rtp_profile_set_payload(&av_profile,97,&payload_type_theora); - rtp_profile_set_payload(&av_profile,99,&payload_type_mp4v); - rtp_profile_set_payload(&av_profile,100,&payload_type_x_snow); - rtp_profile_set_payload(&av_profile,102,&payload_type_h264); -#endif - - vs.width=MS_VIDEO_SIZE_CIF_W; - vs.height=MS_VIDEO_SIZE_CIF_H; - if (argc<4) { - printf(usage); - return -1; - } - for (i=1;i0) pt->normal_bitrate=bitrate; - - if (pt->type!=PAYLOAD_VIDEO){ - MSSndCardManager *manager=ms_snd_card_manager_get(); - MSSndCard *capt= capture_card==NULL ? ms_snd_card_manager_get_default_capture_card(manager) : - ms_snd_card_manager_get_card(manager,capture_card); - audio=audio_stream_new(localport,ms_is_ipv6(remote_ip)); - audio_stream_enable_automatic_gain_control(audio,agc); - audio_stream_enable_noise_gate(audio,use_ng); - audio_stream_set_echo_canceller_params(audio,ec_len_ms,ec_delay_ms,ec_framesize); - printf("Starting audio stream.\n"); - audio_stream_start_now(audio,profile,remote_ip,remoteport,remoteport+1,payload,jitter, - ms_snd_card_manager_get_default_playback_card(manager), - capt, - ec); - if (audio) { - if (use_ng && ng_threshold!=-1) - ms_filter_call_method(audio->volsend,MS_VOLUME_SET_NOISE_GATE_THRESHOLD,&ng_threshold); - session=audio->session; - } - }else{ -#ifdef VIDEO_ENABLED - if (eq){ - ms_fatal("Cannot put an audio equalizer in a video stream !"); - exit(-1); - } - printf("Starting video stream.\n"); - video=video_stream_new(localport, ms_is_ipv6(remote_ip)); - video_stream_set_sent_video_size(video,vs); - video_stream_start(video,profile, - remote_ip, - remoteport,remoteport+1, - payload, - jitter, - ms_web_cam_manager_get_default_cam(ms_web_cam_manager_get())); - session=video->session; -#else - printf("Error: video support not compiled.\n"); -#endif - } - if (eq || ec){ /*read from stdin interactive commands */ - char commands[128]; - commands[127]='\0'; - ms_sleep(1); /* ensure following text be printed after ortp messages */ - if (eq) - printf("\nPlease enter equalizer requests, such as 'eq active 1', 'eq active 0', 'eq 1200 0.1 200'\n"); - if (ec) - printf("\nPlease enter echo canceller requests: ec reset; ec equalizer,MS_EQUALIZER_GET_NUM_FREQUENCIES,&n); - t=(float*)alloca(sizeof(float)*n); - ms_filter_call_method(audio->equalizer,MS_EQUALIZER_DUMP_STATE,t); - for(i=0;i0.01){ - printf("%i:%f:0 ",(i*pt->clock_rate)/(2*n),t[i]); - } - } - printf("\nOK\n"); - }else if (sscanf(commands,"ec reset %i",&active)==1){ - //audio_stream_enable_equalizer(audio,active); - //printf("OK\n"); - }else if (sscanf(commands,"ec active %i",&active)==1){ - //audio_stream_enable_equalizer(audio,active); - //printf("OK\n"); - }else if (sscanf(commands,"ec %i %i",&delay_ms,&tail_ms)==2){ - audio_stream_set_echo_canceller_params(audio,tail_ms,delay_ms,128); - // revisit: workaround with old method call to force echo reset - delay_ms*=8; - ms_filter_call_method(audio->ec,MS_FILTER_SET_PLAYBACKDELAY,&delay_ms); - printf("OK\n"); - }else if (strstr(commands,"quit")){ - break; - }else printf("Cannot understand this.\n"); - } - }else{ /* no interactive stuff - continuous debug output */ - rtp_session_register_event_queue(session,q); - while(cond) - { - int n; - for(n=0;n<100;++n){ - #ifdef WIN32 - MSG msg; - Sleep(10); - while (PeekMessage(&msg, NULL, 0, 0,1)){ - TranslateMessage(&msg); - DispatchMessage(&msg); - } - #else - struct timespec ts; - ts.tv_sec=0; - ts.tv_nsec=10000000; - nanosleep(&ts,NULL); - #endif - #if defined(VIDEO_ENABLED) - if (video) video_stream_iterate(video); - #endif - } - ortp_global_stats_display(); - if (session){ - printf("Bandwidth usage: download=%f kbits/sec, upload=%f kbits/sec\n", - rtp_session_compute_recv_bandwidth(session)*1e-3, - rtp_session_compute_send_bandwidth(session)*1e-3); - parse_events(q); - } - } - } - - printf("stopping all...\n"); - - if (audio) audio_stream_stop(audio); -#ifdef VIDEO_ENABLED - if (video) video_stream_stop(video); -#endif - ortp_ev_queue_destroy(q); - rtp_profile_destroy(profile); -} diff --git a/linphone/mediastreamer2/tests/mtudiscover.c b/linphone/mediastreamer2/tests/mtudiscover.c deleted file mode 100644 index 92f2285ea..000000000 --- a/linphone/mediastreamer2/tests/mtudiscover.c +++ /dev/null @@ -1,33 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -#include "mediastreamer2/mscommon.h" - -int main(int argc, char *argv[]){ - - ms_init(); - if (argc<2){ - ms_error("Usage: mtudiscover [host]"); - return -1; - } - ortp_set_log_level_mask(ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL); - printf("result: %i \n",ms_discover_mtu(argv[1])); - return 0; -} diff --git a/linphone/mediastreamer2/tests/ring.c b/linphone/mediastreamer2/tests/ring.c deleted file mode 100644 index 8751eff98..000000000 --- a/linphone/mediastreamer2/tests/ring.c +++ /dev/null @@ -1,52 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifdef HAVE_CONFIG_H -#include "mediastreamer-config.h" -#endif - -#include "mediastreamer2/mediastream.h" - -int main(int argc, char *argv[]){ - RingStream *r; - const char *file; - MSSndCard *sc; - const char * card_id=NULL; - - ortp_init(); - ortp_set_log_level_mask(ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL); - ms_init(); - if (argc>1){ - file=argv[1]; - }else file="/usr/share/sounds/linphone/rings/oldphone.wav"; - if (argc>2){ - card_id=argv[2]; - } - - sc=ms_snd_card_manager_get_card(ms_snd_card_manager_get(),card_id); -#ifdef __linux - if (sc==NULL) - sc = ms_alsa_card_new_custom(card_id, card_id); -#endif - - r=ring_start(file,2000,sc); - ms_sleep(10); - ring_stop(r); - return 0; -} diff --git a/linphone/mediastreamer2/tests/videodisplay.c b/linphone/mediastreamer2/tests/videodisplay.c deleted file mode 100644 index 843b4e097..000000000 --- a/linphone/mediastreamer2/tests/videodisplay.c +++ /dev/null @@ -1,115 +0,0 @@ -/* -mediastreamer2 library - modular sound and video processing and streaming -Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "mediastreamer2/mediastream.h" -#include "mediastreamer2/msvideoout.h" -#include "mediastreamer2/msv4l.h" - -int main(int argc, char *argv[]){ - VideoStream *vs; - MSWebCam *cam; - MSVideoSize vsize; - int i; - - vsize.width=MS_VIDEO_SIZE_CIF_W; - vsize.height=MS_VIDEO_SIZE_CIF_H; - - ortp_init(); - ortp_set_log_level_mask(ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL); - ms_init(); - cam=ms_web_cam_manager_get_default_cam(ms_web_cam_manager_get()); - /* this is to test the sequence start/stop */ - for(i=0;i<1;++i){ - int n; - vs=video_preview_start(cam,vsize); - - for(n=0;n<1000;++n){ -#ifdef WIN32 - MSG msg; - Sleep(100); - while (PeekMessage(&msg, NULL, 0, 0,1)){ - TranslateMessage(&msg); - DispatchMessage(&msg); - } -#else - struct timespec ts; - ts.tv_sec=0; - ts.tv_nsec=10000000; - nanosleep(&ts,NULL); - - if (vs) video_stream_iterate(vs); -#endif - -/* test code */ - if (n==400) - { - ms_ticker_detach (vs->ticker, vs->source); - - vs->tee = ms_filter_new(MS_TEE_ID); - - ms_filter_unlink(vs->pixconv,0, vs->output,0); - - ms_filter_link(vs->pixconv,0,vs->tee,0); - ms_filter_link(vs->tee,0,vs->output,0); - ms_filter_link(vs->tee,1,vs->output,1); - - //ms_filter_unlink(vs->tee,0,vs->output,0); - ms_ticker_attach (vs->ticker, vs->source); - - } - if (n==500) - { - int corner=1; - ms_filter_call_method(vs->output,MS_VIDEO_OUT_SET_CORNER,&corner); - } - if (n==600) - { - int corner=2; - ms_filter_call_method(vs->output,MS_VIDEO_OUT_SET_CORNER,&corner); - } - if (n==700) - { - int corner=3; - ms_filter_call_method(vs->output,MS_VIDEO_OUT_SET_CORNER,&corner); - } - if (n==800) - { - int corner=-1; - ms_filter_call_method(vs->output,MS_VIDEO_OUT_SET_CORNER,&corner); - } - if (n==900) - { - ms_ticker_detach (vs->ticker, vs->source); - - ms_filter_unlink(vs->pixconv,0,vs->tee,0); - ms_filter_unlink(vs->tee,0,vs->output,0); - ms_filter_unlink(vs->tee,1,vs->output,1); - ms_filter_destroy(vs->tee); - vs->tee=NULL; - - ms_filter_link(vs->pixconv,0, vs->output,0); - - - ms_ticker_attach (vs->ticker, vs->source); - } - } - video_preview_stop(vs); - } - return 0; -} From 999d216d7c76f1e3b50a6326ba5c48a9e6e36f8c Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 20 Jan 2010 15:44:30 +0100 Subject: [PATCH 3/6] purge out p2pproxy --- .gitmodules | 4 +- linphone/ABOUT-NLS => ABOUT-NLS | 0 linphone/AUTHORS => AUTHORS | 0 linphone/BUGS => BUGS | 0 linphone/COPYING => COPYING | 0 linphone/ChangeLog => ChangeLog | 0 linphone/Makefile.am => Makefile.am | 0 linphone/NEWS => NEWS | 0 linphone/README => README | 0 linphone/README.M68k.txt => README.M68k.txt | 0 linphone/README.arm => README.arm | 0 linphone/README.macos => README.macos | 0 linphone/README.mingw => README.mingw | 0 linphone/TODO => TODO | 0 linphone/autogen.sh => autogen.sh | 0 .../build => build}/wince/liblinphone.sln | 0 .../build => build}/wince/liblinphone.vcproj | 0 .../wince/linphonec/linphonec.vcproj | 0 linphone/config.rpath => config.rpath | 0 linphone/configure.in => configure.in | 0 {linphone/console => console}/.gitignore | 0 {linphone/console => console}/Makefile.am | 0 {linphone/console => console}/TODO | 0 {linphone/console => console}/commands.c | 0 .../console => console}/example/linphonec | 0 {linphone/console => console}/linphonec.c | 0 {linphone/console => console}/linphonec.h | 0 {linphone/console => console}/shell.c | 0 {linphone/console => console}/sipomatic.c | 0 {linphone/console => console}/sipomatic.h | 0 {linphone/console => console}/wav2raw.c | 0 {linphone/coreapi => coreapi}/.gitignore | 0 {linphone/coreapi => coreapi}/Makefile.am | 0 {linphone/coreapi => coreapi}/address.c | 0 .../coreapi => coreapi}/authentication.c | 0 {linphone/coreapi => coreapi}/chat.c | 0 {linphone/coreapi => coreapi}/enum.c | 0 {linphone/coreapi => coreapi}/enum.h | 0 {linphone/coreapi => coreapi}/exevents.c | 0 {linphone/coreapi => coreapi}/exevents.h | 0 {linphone/coreapi => coreapi}/fonis.c | 0 {linphone/coreapi => coreapi}/friend.c | 0 {linphone/coreapi => coreapi}/general_state.c | 0 .../coreapi => coreapi}/help/Doxyfile.in | 0 .../coreapi => coreapi}/help/Makefile.am | 0 .../coreapi => coreapi}/help/doxygen.dox.in | 0 {linphone/coreapi => coreapi}/linphonecore.c | 0 {linphone/coreapi => coreapi}/linphonecore.h | 0 {linphone/coreapi => coreapi}/lpconfig.c | 0 {linphone/coreapi => coreapi}/lpconfig.h | 0 {linphone/coreapi => coreapi}/misc.c | 0 .../plugins/buddylookup/AUTHORS | 0 .../plugins/buddylookup/COPYING | 0 .../plugins/buddylookup/ChangeLog | 0 .../plugins/buddylookup/INSTALL | 0 .../plugins/buddylookup/Makefile.am | 0 .../plugins/buddylookup/NEWS | 0 .../plugins/buddylookup/README | 0 .../plugins/buddylookup/autogen.sh | 0 .../plugins/buddylookup/configure.ac | 0 .../plugins/buddylookup/src/Makefile.am | 0 .../plugins/buddylookup/src/lookup.c | 0 {linphone/coreapi => coreapi}/presence.c | 0 {linphone/coreapi => coreapi}/private.h | 0 {linphone/coreapi => coreapi}/proxy.c | 0 {linphone/coreapi => coreapi}/sdphandler.c | 0 {linphone/coreapi => coreapi}/sdphandler.h | 0 {linphone/coreapi => coreapi}/siplogin.c | 0 {linphone/coreapi => coreapi}/sipsetup.c | 0 {linphone/coreapi => coreapi}/sipsetup.h | 0 .../gen-gtkfilelist.sh => gen-gtkfilelist.sh | 0 ...k+-2.16.2.filelist => gtk+-2.16.2.filelist | 0 ...k+-2.16.6.filelist => gtk+-2.16.6.filelist | 0 ...k+-2.18.5.filelist => gtk+-2.18.5.filelist | 0 {linphone/gtk-glade => gtk-glade}/.gitignore | 0 {linphone/gtk-glade => gtk-glade}/Makefile.am | 0 {linphone/gtk-glade => gtk-glade}/about.glade | 0 .../gtk-glade => gtk-glade}/buddylookup.c | 0 .../gtk-glade => gtk-glade}/buddylookup.glade | 0 .../gtk-glade => gtk-glade}/call_logs.glade | 0 {linphone/gtk-glade => gtk-glade}/calllogs.c | 0 {linphone/gtk-glade => gtk-glade}/chat.c | 0 .../gtk-glade => gtk-glade}/chatroom.glade | 0 .../gtk-glade => gtk-glade}/contact.glade | 0 {linphone/gtk-glade => gtk-glade}/fonis.c | 0 .../gtk-glade => gtk-glade}/friendlist.c | 0 {linphone/gtk-glade => gtk-glade}/gtkrc | 0 .../gtk-glade => gtk-glade}/incall_view.c | 0 .../incoming_call.glade | 0 {linphone/gtk-glade => gtk-glade}/linphone.h | 0 .../gtk-glade => gtk-glade}/linphone.ico | Bin .../gtk-glade => gtk-glade}/linphone.iss | 0 .../gtk-glade => gtk-glade}/linphone.png | Bin {linphone/gtk-glade => gtk-glade}/linphone.rc | 0 .../gtk-glade => gtk-glade}/linphone2.png | Bin {linphone/gtk-glade => gtk-glade}/log.glade | 0 {linphone/gtk-glade => gtk-glade}/logging.c | 0 .../gtk-glade => gtk-glade}/loginframe.c | 0 {linphone/gtk-glade => gtk-glade}/main.c | 0 {linphone/gtk-glade => gtk-glade}/main.glade | 0 .../gtk-glade => gtk-glade}/p2pwizard.glade | 0 .../gtk-glade => gtk-glade}/parameters.glade | 0 .../gtk-glade => gtk-glade}/password.glade | 0 .../gtk-glade => gtk-glade}/propertybox.c | 0 .../gtk-glade => gtk-glade}/setupwizard.c | 0 .../gtk-glade => gtk-glade}/sip_account.glade | 0 .../gtk-glade => gtk-glade}/stock_people.png | Bin {linphone/gtk-glade => gtk-glade}/support.c | 0 {linphone/gtk-glade => gtk-glade}/update.c | 0 {linphone/gtk-glade => gtk-glade}/utils.c | 0 .../gtk-glade => gtk-glade}/waiting.glade | 0 {linphone/intl => intl}/ChangeLog | 0 {linphone/intl => intl}/Makefile.in | 0 {linphone/intl => intl}/VERSION | 0 {linphone/intl => intl}/bindtextdom.c | 0 {linphone/intl => intl}/cat-compat.c | 0 {linphone/intl => intl}/dcgettext.c | 0 {linphone/intl => intl}/dgettext.c | 0 {linphone/intl => intl}/explodename.c | 0 {linphone/intl => intl}/finddomain.c | 0 {linphone/intl => intl}/gettext.c | 0 {linphone/intl => intl}/gettext.h | 0 {linphone/intl => intl}/gettextP.h | 0 {linphone/intl => intl}/hash-string.h | 0 {linphone/intl => intl}/intl-compat.c | 0 {linphone/intl => intl}/l10nflist.c | 0 {linphone/intl => intl}/libgettext.h | 0 {linphone/intl => intl}/linux-msg.sed | 0 {linphone/intl => intl}/loadinfo.h | 0 {linphone/intl => intl}/loadmsgcat.c | 0 {linphone/intl => intl}/localealias.c | 0 {linphone/intl => intl}/po2tbl.sed.in | 0 {linphone/intl => intl}/textdomain.c | 0 {linphone/intl => intl}/xopen-msg.sed | 0 ...intltool-extract.in => intltool-extract.in | 0 .../intltool-merge.in => intltool-merge.in | 0 .../intltool-update.in => intltool-update.in | 0 ...ne-deps.filelist => linphone-deps.filelist | 0 linphone/linphone.iss.in => linphone.iss.in | 0 .../linphone.kdevelop => linphone.kdevelop | 0 linphone/linphone.spec.in => linphone.spec.in | 0 linphone/mingw-envsetup.sh | 5 - {linphone/m4 => m4}/.gitignore | 0 {linphone/m4 => m4}/Makefile.am | 0 {linphone/m4 => m4}/codeset.m4 | 0 {linphone/m4 => m4}/exosip.m4 | 0 {linphone/m4 => m4}/gettext.m4 | 0 {linphone/m4 => m4}/glibc2.m4 | 0 {linphone/m4 => m4}/glibc21.m4 | 0 {linphone/m4 => m4}/iconv.m4 | 0 {linphone/m4 => m4}/ilbc.m4 | 0 {linphone/m4 => m4}/intdiv0.m4 | 0 {linphone/m4 => m4}/intl.m4 | 0 {linphone/m4 => m4}/intldir.m4 | 0 {linphone/m4 => m4}/intmax.m4 | 0 {linphone/m4 => m4}/inttypes-pri.m4 | 0 {linphone/m4 => m4}/inttypes.m4 | 0 {linphone/m4 => m4}/inttypes_h.m4 | 0 {linphone/m4 => m4}/isc-posix.m4 | 0 {linphone/m4 => m4}/lcmessage.m4 | 0 {linphone/m4 => m4}/lib-ld.m4 | 0 {linphone/m4 => m4}/lib-link.m4 | 0 {linphone/m4 => m4}/lib-prefix.m4 | 0 {linphone/m4 => m4}/lock.m4 | 0 {linphone/m4 => m4}/longdouble.m4 | 0 {linphone/m4 => m4}/longlong.m4 | 0 {linphone/m4 => m4}/nls.m4 | 0 {linphone/m4 => m4}/ortp.m4 | 0 {linphone/m4 => m4}/osip.m4 | 0 {linphone/m4 => m4}/po.m4 | 0 {linphone/m4 => m4}/printf-posix.m4 | 0 {linphone/m4 => m4}/progtest.m4 | 0 {linphone/m4 => m4}/readline.m4 | 0 {linphone/m4 => m4}/signed.m4 | 0 {linphone/m4 => m4}/size_max.m4 | 0 {linphone/m4 => m4}/stdint_h.m4 | 0 {linphone/m4 => m4}/uintmax_t.m4 | 0 {linphone/m4 => m4}/ulonglong.m4 | 0 {linphone/m4 => m4}/video.m4 | 0 {linphone/m4 => m4}/visibility.m4 | 0 {linphone/m4 => m4}/wchar_t.m4 | 0 {linphone/m4 => m4}/wint_t.m4 | 0 {linphone/m4 => m4}/xsize.m4 | 0 {linphone/media_api => media_api}/.gitignore | 0 {linphone/media_api => media_api}/DESIGN.txt | 0 {linphone/media_api => media_api}/Makefile.am | 0 {linphone/media_api => media_api}/apitest.c | 0 {linphone/media_api => media_api}/apitest.h | 0 {linphone/media_api => media_api}/basiccall.c | 0 {linphone/media_api => media_api}/basiccall.h | 0 .../media_api => media_api}/callmember.c | 0 .../media_api => media_api}/callmember.h | 0 {linphone/media_api => media_api}/ccl | 0 {linphone/media_api => media_api}/common.h | 0 {linphone/media_api => media_api}/media_api.c | 0 {linphone/media_api => media_api}/media_api.h | 0 {linphone/media_api => media_api}/mediaflow.c | 0 {linphone/media_api => media_api}/mediaflow.h | 0 p2pproxy/.classpath | 18 - p2pproxy/.cvsignore | 5 - p2pproxy/.gcjbuilder | 21 - p2pproxy/.project | 24 - p2pproxy/AUTHORS | 0 p2pproxy/COPYING | 674 ---- p2pproxy/ChangeLog | 0 p2pproxy/INSTALL | 291 -- p2pproxy/Makefile.am | 19 - p2pproxy/NEWS | 0 p2pproxy/README | 0 p2pproxy/autogen.sh | 20 - p2pproxy/bin/p2pproxy-cmd.bat | 2 - p2pproxy/bin/p2pproxy-cmd.sh | 2 - p2pproxy/bin/p2pproxy.bat | 2 - p2pproxy/bin/p2pproxy.sh | 9 - p2pproxy/build.xml | 195 -- p2pproxy/configure.ac | 134 - .../javawi/jstun/attribute/ChangeRequest.java | 81 - .../jstun/attribute/ChangedAddress.java | 30 - .../de/javawi/jstun/attribute/Data.java | 20 - .../de/javawi/jstun/attribute/Dummy.java | 42 - .../de/javawi/jstun/attribute/ErrorCode.java | 104 - .../javawi/jstun/attribute/MappedAddress.java | 29 - ...onseChangedSourceAddressReflectedFrom.java | 107 - .../jstun/attribute/MessageAttribute.java | 135 - .../attribute/MessageAttributeException.java | 20 - .../attribute/MessageAttributeInterface.java | 68 - .../MessageAttributeParsingException.java | 20 - .../jstun/attribute/MessageIntegrity.java | 27 - .../de/javawi/jstun/attribute/Password.java | 64 - .../javawi/jstun/attribute/ReflectedFrom.java | 31 - .../jstun/attribute/ResponseAddress.java | 29 - .../javawi/jstun/attribute/SourceAddress.java | 29 - .../jstun/attribute/UnknownAttribute.java | 82 - .../UnknownMessageAttributeException.java | 18 - .../de/javawi/jstun/attribute/Username.java | 64 - .../de/javawi/jstun/header/MessageHeader.java | 202 -- .../jstun/header/MessageHeaderException.java | 20 - .../jstun/header/MessageHeaderInterface.java | 61 - .../header/MessageHeaderParsingException.java | 20 - .../jstun/test/BindingLifetimeTest.java | 192 -- .../de/javawi/jstun/test/DiscoveryInfo.java | 153 - .../de/javawi/jstun/test/DiscoveryTest.java | 351 --- .../test/demo/BindingLifetimeTestDemo.java | 47 - .../jstun/test/demo/DiscoveryTestDemo.java | 75 - .../de/javawi/jstun/test/demo/StunServer.java | 263 -- .../javawi/jstun/test/demo/ice/Candidate.java | 115 - .../jstun/test/demo/ice/ICENegociator.java | 146 - .../de/javawi/jstun/util/Address.java | 102 - .../de/javawi/jstun/util/Utility.java | 68 - .../javawi/jstun/util/UtilityException.java | 21 - .../dependencies-src/jxse-src-2.5/api/pom.xml | 15 - .../api/src/net/jxta/Version.java | 149 - .../src/net/jxta/access/AccessService.java | 146 - .../api/src/net/jxta/access/package.html | 23 - .../api/src/net/jxta/codat/Codat.java | 168 - .../api/src/net/jxta/codat/CodatID.java | 128 - .../api/src/net/jxta/codat/Metadata.java | 105 - .../api/src/net/jxta/codat/package.html | 15 - .../credential/AuthenticationCredential.java | 386 --- .../src/net/jxta/credential/Credential.java | 166 - .../jxta/credential/CredentialPCLSupport.java | 112 - .../jxta/credential/CredentialValidator.java | 71 - .../jxta/credential/PrivilegedOperation.java | 81 - .../api/src/net/jxta/credential/package.html | 13 - .../net/jxta/discovery/DiscoveryEvent.java | 123 - .../net/jxta/discovery/DiscoveryListener.java | 112 - .../net/jxta/discovery/DiscoveryService.java | 506 --- .../api/src/net/jxta/discovery/package.html | 15 - .../src/net/jxta/document/Advertisement.java | 231 -- .../jxta/document/AdvertisementFactory.java | 401 --- .../src/net/jxta/document/Attributable.java | 118 - .../api/src/net/jxta/document/Attribute.java | 189 -- .../src/net/jxta/document/BinaryDocument.java | 153 - .../api/src/net/jxta/document/Document.java | 96 - .../jxta/document/DocumentByteArrayIO.java | 75 - .../jxta/document/DocumentByteBufferIO.java | 76 - .../net/jxta/document/DocumentStreamIO.java | 91 - .../api/src/net/jxta/document/Element.java | 142 - .../document/ExtendableAdvertisement.java | 197 -- .../src/net/jxta/document/FileDocument.java | 166 - .../src/net/jxta/document/MimeMediaType.java | 835 ----- .../net/jxta/document/StructuredDocument.java | 93 - .../document/StructuredDocumentFactory.java | 582 ---- .../document/StructuredDocumentUtils.java | 228 -- .../jxta/document/StructuredTextDocument.java | 89 - .../src/net/jxta/document/TextDocument.java | 71 - .../document/TextDocumentCharArrayIO.java | 80 - .../document/TextDocumentCharBufferIO.java | 80 - .../document/TextDocumentCharSequenceIO.java | 77 - .../jxta/document/TextDocumentReaderIO.java | 91 - .../src/net/jxta/document/TextElement.java | 111 - .../src/net/jxta/document/XMLDocument.java | 76 - .../api/src/net/jxta/document/XMLElement.java | 73 - .../api/src/net/jxta/document/package.html | 13 - .../net/jxta/endpoint/AbstractMessenger.java | 324 -- .../jxta/endpoint/AsyncChannelMessenger.java | 665 ---- .../endpoint/ByteArrayMessageElement.java | 383 --- .../net/jxta/endpoint/ChannelMessenger.java | 214 -- .../net/jxta/endpoint/EndpointAddress.java | 637 ---- .../net/jxta/endpoint/EndpointListener.java | 79 - .../net/jxta/endpoint/EndpointService.java | 552 ---- .../endpoint/InputStreamMessageElement.java | 325 -- .../net/jxta/endpoint/ListenerAdaptor.java | 481 --- .../api/src/net/jxta/endpoint/Message.java | 1444 --------- .../src/net/jxta/endpoint/MessageElement.java | 567 ---- .../jxta/endpoint/MessageFilterListener.java | 86 - .../net/jxta/endpoint/MessagePropagater.java | 100 - .../net/jxta/endpoint/MessageReceiver.java | 85 - .../src/net/jxta/endpoint/MessageSender.java | 150 - .../net/jxta/endpoint/MessageTransport.java | 105 - .../api/src/net/jxta/endpoint/Messenger.java | 696 ----- .../src/net/jxta/endpoint/MessengerEvent.java | 110 - .../jxta/endpoint/MessengerEventListener.java | 73 - .../src/net/jxta/endpoint/MessengerState.java | 443 --- .../jxta/endpoint/OutgoingMessageEvent.java | 110 - .../OutgoingMessageEventListener.java | 95 - .../jxta/endpoint/StringMessageElement.java | 546 ---- .../endpoint/TextDocumentMessageElement.java | 358 --- .../net/jxta/endpoint/TextMessageElement.java | 316 -- .../net/jxta/endpoint/ThreadedMessenger.java | 800 ----- .../net/jxta/endpoint/WireFormatMessage.java | 87 - .../endpoint/WireFormatMessageFactory.java | 361 --- .../api/src/net/jxta/endpoint/package.html | 12 - .../jxta/exception/ConfiguratorException.java | 237 -- .../api/src/net/jxta/exception/JxtaError.java | 84 - .../src/net/jxta/exception/JxtaException.java | 108 - .../jxta/exception/PeerGroupException.java | 108 - .../ProtocolNotSupportedException.java | 108 - .../exception/ServiceNotFoundException.java | 106 - .../exception/UnknownServiceException.java | 108 - .../api/src/net/jxta/exception/package.html | 9 - .../jxse-src-2.5/api/src/net/jxta/id/ID.java | 325 -- .../api/src/net/jxta/id/IDFactory.java | 1210 -------- .../api/src/net/jxta/id/jxta/IDFormat.java | 107 - .../src/net/jxta/id/jxta/Instantiator.java | 320 -- .../api/src/net/jxta/id/jxta/package.html | 29 - .../api/src/net/jxta/id/package.html | 12 - .../api/src/net/jxta/logging/Logging.java | 210 -- .../api/src/net/jxta/logging/package.html | 39 - .../net/jxta/membership/Authenticator.java | 125 - .../membership/InteractiveAuthenticator.java | 81 - .../jxta/membership/MembershipService.java | 238 -- .../membership/doc-files/memberAndAccess.png | Bin 22731 -> 0 bytes .../api/src/net/jxta/membership/package.html | 30 - .../api/src/net/jxta/meter/MonitorEvent.java | 203 -- .../src/net/jxta/meter/MonitorException.java | 108 - .../api/src/net/jxta/meter/MonitorFilter.java | 242 -- .../jxta/meter/MonitorFilterException.java | 113 - .../src/net/jxta/meter/MonitorListener.java | 85 - .../api/src/net/jxta/meter/MonitorReport.java | 241 -- .../src/net/jxta/meter/MonitorResources.java | 548 ---- .../src/net/jxta/meter/PeerMonitorInfo.java | 212 -- .../net/jxta/meter/PeerMonitorInfoEvent.java | 100 - .../jxta/meter/PeerMonitorInfoListener.java | 78 - .../api/src/net/jxta/meter/ServiceMetric.java | 96 - .../src/net/jxta/meter/ServiceMonitor.java | 155 - .../net/jxta/meter/ServiceMonitorFilter.java | 81 - .../api/src/net/jxta/meter/package.html | 10 - .../api/src/net/jxta/overview.html | 26 - .../api/src/net/jxta/peer/PeerID.java | 112 - .../api/src/net/jxta/peer/PeerInfoEvent.java | 112 - .../src/net/jxta/peer/PeerInfoListener.java | 93 - .../src/net/jxta/peer/PeerInfoService.java | 303 -- .../api/src/net/jxta/peer/package.html | 18 - .../src/net/jxta/peergroup/Configurator.java | 127 - .../jxta/peergroup/LightWeightPeerGroup.java | 584 ---- .../jxta/peergroup/NetPeerGroupFactory.java | 581 ---- .../api/src/net/jxta/peergroup/PeerGroup.java | 1003 ------ .../net/jxta/peergroup/PeerGroupFactory.java | 577 ---- .../src/net/jxta/peergroup/PeerGroupID.java | 241 -- .../jxta/peergroup/WorldPeerGroupFactory.java | 339 -- .../api/src/net/jxta/peergroup/package.html | 79 - .../api/src/net/jxta/pipe/InputPipe.java | 138 - .../api/src/net/jxta/pipe/OutputPipe.java | 142 - .../src/net/jxta/pipe/OutputPipeEvent.java | 117 - .../src/net/jxta/pipe/OutputPipeListener.java | 94 - .../api/src/net/jxta/pipe/PipeID.java | 114 - .../api/src/net/jxta/pipe/PipeMsgEvent.java | 111 - .../src/net/jxta/pipe/PipeMsgListener.java | 93 - .../api/src/net/jxta/pipe/PipeService.java | 206 -- .../api/src/net/jxta/pipe/package.html | 15 - .../src/net/jxta/platform/Application.java | 68 - .../api/src/net/jxta/platform/JxtaLoader.java | 151 - .../api/src/net/jxta/platform/Module.java | 212 -- .../src/net/jxta/platform/ModuleClassID.java | 191 -- .../src/net/jxta/platform/ModuleSpecID.java | 185 -- .../jxta/platform/NetworkConfigurator.java | 1947 ------------ .../src/net/jxta/platform/NetworkManager.java | 617 ---- .../api/src/net/jxta/platform/package.html | 14 - .../protocol/AccessPointAdvertisement.java | 387 --- .../src/net/jxta/protocol/ConfigParams.java | 587 ---- .../net/jxta/protocol/DiscoveryQueryMsg.java | 220 -- .../jxta/protocol/DiscoveryResponseMsg.java | 379 --- .../protocol/ModuleClassAdvertisement.java | 231 -- .../protocol/ModuleImplAdvertisement.java | 374 --- .../protocol/ModuleSpecAdvertisement.java | 404 --- .../net/jxta/protocol/PeerAdvertisement.java | 456 --- .../jxta/protocol/PeerGroupAdvertisement.java | 397 --- .../jxta/protocol/PeerInfoQueryMessage.java | 171 -- .../protocol/PeerInfoResponseMessage.java | 224 -- .../net/jxta/protocol/PipeAdvertisement.java | 324 -- .../jxta/protocol/PipeResolverMessage.java | 269 -- .../net/jxta/protocol/RdvAdvertisement.java | 256 -- .../net/jxta/protocol/ResolverQueryMsg.java | 312 -- .../jxta/protocol/ResolverResponseMsg.java | 199 -- .../net/jxta/protocol/ResolverSrdiMsg.java | 163 - .../net/jxta/protocol/RouteAdvertisement.java | 859 ------ .../src/net/jxta/protocol/RouteQueryMsg.java | 184 -- .../net/jxta/protocol/RouteResponseMsg.java | 147 - .../jxta/protocol/SignedAdvertisement.java | 127 - .../src/net/jxta/protocol/SrdiMessage.java | 323 -- .../jxta/protocol/TransportAdvertisement.java | 142 - .../api/src/net/jxta/protocol/package.html | 17 - .../jxta/rendezvous/RendezVousService.java | 455 --- .../net/jxta/rendezvous/RendezVousStatus.java | 100 - .../net/jxta/rendezvous/RendezvousEvent.java | 185 -- .../jxta/rendezvous/RendezvousListener.java | 95 - .../api/src/net/jxta/rendezvous/package.html | 14 - .../net/jxta/resolver/GenericResolver.java | 64 - .../src/net/jxta/resolver/QueryHandler.java | 102 - .../net/jxta/resolver/ResolverService.java | 172 -- .../src/net/jxta/resolver/SrdiHandler.java | 93 - .../api/src/net/jxta/resolver/package.html | 12 - .../api/src/net/jxta/service/Service.java | 106 - .../api/src/net/jxta/service/package.html | 14 - .../net/jxta/socket/JxtaMulticastSocket.java | 478 --- .../src/net/jxta/socket/JxtaServerSocket.java | 700 ----- .../api/src/net/jxta/socket/JxtaSocket.java | 1804 ----------- .../net/jxta/socket/JxtaSocketAddress.java | 283 -- .../jxta/socket/JxtaSocketInputStream.java | 317 -- .../jxta/socket/JxtaSocketOutputStream.java | 190 -- .../api/src/net/jxta/socket/package.html | 63 - .../api/src/net/jxta/user.properties | 22 - .../jxta/util/AbstractSimpleSelectable.java | 219 -- .../net/jxta/util/AdvertisementUtilities.java | 608 ---- .../api/src/net/jxta/util/AwtUtils.java | 93 - .../api/src/net/jxta/util/ClassFactory.java | 367 --- .../net/jxta/util/CountingInputStream.java | 153 - .../net/jxta/util/CountingOutputStream.java | 148 - .../api/src/net/jxta/util/CountingWriter.java | 149 - .../net/jxta/util/DevNullOutputStream.java | 113 - .../api/src/net/jxta/util/DevNullWriter.java | 117 - .../src/net/jxta/util/DocumentUtilities.java | 121 - .../util/IgnoreFlushFilterOutputStream.java | 78 - .../api/src/net/jxta/util/JxtaBiDiPipe.java | 1284 -------- .../api/src/net/jxta/util/JxtaServerPipe.java | 549 ---- .../src/net/jxta/util/LimitInputStream.java | 381 --- .../jxta/util/MarkProhibitedFilterStream.java | 110 - .../src/net/jxta/util/MessageUtilities.java | 160 - .../src/net/jxta/util/PipeEventListener.java | 92 - .../src/net/jxta/util/PipeStateListener.java | 108 - .../api/src/net/jxta/util/PipeUtilities.java | 116 - .../src/net/jxta/util/SimpleSelectable.java | 163 - .../api/src/net/jxta/util/SimpleSelector.java | 159 - .../src/net/jxta/util/WatchedInputStream.java | 247 -- .../net/jxta/util/WatchedOutputStream.java | 239 -- .../api/src/net/jxta/util/WatchedStream.java | 99 - .../DocumentSerializable.java | 68 - .../DocumentSerializableUtilities.java | 570 ---- .../DocumentSerializationException.java | 73 - .../api/src/net/jxta/util/package.html | 10 - .../src/sun/net/www/protocol/urn/Handler.java | 220 -- .../services/net.jxta.document.Advertisement | 23 - .../net.jxta.document.StructuredDocument | 4 - .../net.jxta.endpoint.WireFormatMessage | 3 - .../impl/src/META-INF/services/net.jxta.id.ID | 4 - .../services/net.jxta.platform.Module | 31 - .../impl/src/net/jxta/impl/Version.java | 149 - .../src/net/jxta/impl/access/AccessList.java | 563 ---- .../access/always/AlwaysAccessService.java | 415 --- .../net/jxta/impl/access/always/package.html | 14 - .../impl/access/pse/PSEAccessService.java | 495 --- .../src/net/jxta/impl/access/pse/package.html | 19 - .../simpleACL/SimpleACLAccessService.java | 525 ---- .../jxta/impl/access/simpleACL/package.html | 13 - .../impl/src/net/jxta/impl/cm/Cm.java | 1209 -------- .../impl/src/net/jxta/impl/cm/Indexer.java | 617 ---- .../impl/src/net/jxta/impl/cm/Srdi.java | 666 ---- .../impl/src/net/jxta/impl/cm/SrdiIndex.java | 987 ------ .../impl/src/net/jxta/impl/config.properties | 19 - .../impl/discovery/DiscoveryServiceImpl.java | 1718 ----------- .../discovery/DiscoveryServiceInterface.java | 258 -- .../src/net/jxta/impl/discovery/package.html | 15 - .../jxta/impl/document/DOMXMLDocument.java | 490 --- .../net/jxta/impl/document/DOMXMLElement.java | 383 --- .../jxta/impl/document/LiteXMLDocument.java | 526 ---- .../jxta/impl/document/LiteXMLElement.java | 1729 ----------- .../jxta/impl/document/PlainTextDocument.java | 293 -- .../jxta/impl/document/PlainTextElement.java | 353 --- .../impl/document/TextDocumentCommon.java | 95 - .../jxta/impl/endpoint/BlockingMessenger.java | 881 ------ .../impl/endpoint/EndpointServiceImpl.java | 1961 ------------ .../endpoint/EndpointServiceInterface.java | 494 --- .../net/jxta/impl/endpoint/EndpointUtils.java | 129 - .../src/net/jxta/impl/endpoint/IPUtils.java | 511 ---- .../endpoint/JxtaMessageMessageElement.java | 260 -- .../jxta/impl/endpoint/LoopbackMessenger.java | 213 -- .../net/jxta/impl/endpoint/SocketFactory.java | 103 - .../endpoint/WireFormatMessageBinary.java | 1280 -------- .../net/jxta/impl/endpoint/cbjx/CbJxDefs.java | 98 - .../impl/endpoint/cbjx/CbJxMessageInfo.java | 389 --- .../impl/endpoint/cbjx/CbJxMessenger.java | 230 -- .../impl/endpoint/cbjx/CbJxTransport.java | 692 ----- .../net/jxta/impl/endpoint/cbjx/package.html | 12 - ...ConditionalEndpointMeterBuildSettings.java | 80 - .../endpoint/endpointMeter/EndpointMeter.java | 188 -- .../EndpointMeterBuildSettings.java | 67 - .../endpointMeter/EndpointMetric.java | 282 -- .../endpointMeter/EndpointServiceMetric.java | 359 --- .../endpointMeter/EndpointServiceMonitor.java | 219 -- .../EndpointServiceMonitorFilter.java | 158 - .../endpoint/endpointMeter/InboundMeter.java | 154 - .../endpoint/endpointMeter/InboundMetric.java | 279 -- .../IncomingMessageListenerMeter.java | 68 - .../endpointMeter/MessengerMeter.java | 69 - .../endpoint/endpointMeter/OutboundMeter.java | 145 - .../endpointMeter/OutboundMetric.java | 289 -- .../endpointMeter/PropagationMeter.java | 124 - .../endpointMeter/PropagationMetric.java | 244 -- .../impl/endpoint/mcast/McastTransport.java | 887 ------ .../net/jxta/impl/endpoint/mcast/package.html | 17 - .../msgframing/MessagePackageHeader.java | 605 ---- .../endpoint/msgframing/WelcomeMessage.java | 529 ---- .../src/net/jxta/impl/endpoint/package.html | 13 - .../jxta/impl/endpoint/relay/RelayClient.java | 1351 -------- .../relay/RelayReferralSeedingManager.java | 203 -- .../jxta/impl/endpoint/relay/RelayServer.java | 1498 --------- .../endpoint/relay/RelayServerClient.java | 669 ---- .../impl/endpoint/relay/RelayTransport.java | 464 --- .../net/jxta/impl/endpoint/relay/package.html | 20 - .../jxta/impl/endpoint/router/BadRoute.java | 190 -- .../impl/endpoint/router/Destinations.java | 602 ---- .../impl/endpoint/router/EndpointRouter.java | 2715 ----------------- .../router/EndpointRouterMessage.java | 512 ---- .../jxta/impl/endpoint/router/RouteCM.java | 595 ---- .../impl/endpoint/router/RouteControl.java | 502 --- .../impl/endpoint/router/RouteResolver.java | 1432 --------- .../impl/endpoint/router/RouterMessenger.java | 258 -- .../jxta/impl/endpoint/router/package.html | 19 - .../servlethttp/HttpClientMessenger.java | 917 ------ .../servlethttp/HttpMessageReceiver.java | 404 --- .../servlethttp/HttpMessageSender.java | 261 -- .../servlethttp/HttpMessageServlet.java | 908 ------ .../servlethttp/HttpServletMessenger.java | 470 --- .../servlethttp/ServletHttpTransport.java | 473 --- .../impl/endpoint/servlethttp/package.html | 19 - .../endpoint/tcp/IncomingUnicastServer.java | 468 --- .../jxta/impl/endpoint/tcp/TcpMessenger.java | 1128 ------- .../jxta/impl/endpoint/tcp/TcpTransport.java | 1236 -------- .../net/jxta/impl/endpoint/tcp/package.html | 17 - .../net/jxta/impl/endpoint/tls/JTlsDefs.java | 80 - .../impl/endpoint/tls/JTlsInputStream.java | 590 ---- .../impl/endpoint/tls/JTlsOutputStream.java | 964 ------ .../net/jxta/impl/endpoint/tls/TlsConn.java | 741 ----- .../jxta/impl/endpoint/tls/TlsManager.java | 612 ---- .../jxta/impl/endpoint/tls/TlsMessenger.java | 207 -- .../net/jxta/impl/endpoint/tls/TlsSocket.java | 170 -- .../jxta/impl/endpoint/tls/TlsTransport.java | 772 ----- .../net/jxta/impl/endpoint/tls/package.html | 15 - ...onditionalTransportMeterBuildSettings.java | 80 - .../transportMeter/TransportBindingMeter.java | 242 -- .../TransportBindingMetric.java | 1135 ------- .../transportMeter/TransportMeter.java | 167 - .../TransportMeterBuildSettings.java | 67 - .../transportMeter/TransportMetric.java | 183 -- .../TransportServiceMetric.java | 260 -- .../TransportServiceMonitor.java | 178 -- .../TransportServiceMonitorFilter.java | 155 - .../src/net/jxta/impl/id/CBID/CodatID.java | 200 -- .../src/net/jxta/impl/id/CBID/IDFormat.java | 151 - .../net/jxta/impl/id/CBID/Instantiator.java | 445 --- .../net/jxta/impl/id/CBID/ModuleClassID.java | 146 - .../net/jxta/impl/id/CBID/ModuleSpecID.java | 128 - .../net/jxta/impl/id/CBID/PeerGroupID.java | 191 -- .../src/net/jxta/impl/id/CBID/PeerID.java | 183 -- .../src/net/jxta/impl/id/CBID/PipeID.java | 181 -- .../src/net/jxta/impl/id/CBID/package.html | 17 - .../src/net/jxta/impl/id/UUID/CodatID.java | 293 -- .../src/net/jxta/impl/id/UUID/IDBytes.java | 249 -- .../src/net/jxta/impl/id/UUID/IDFormat.java | 218 -- .../net/jxta/impl/id/UUID/Instantiator.java | 451 --- .../net/jxta/impl/id/UUID/ModuleClassID.java | 237 -- .../net/jxta/impl/id/UUID/ModuleSpecID.java | 216 -- .../net/jxta/impl/id/UUID/PeerGroupID.java | 242 -- .../src/net/jxta/impl/id/UUID/PeerID.java | 195 -- .../src/net/jxta/impl/id/UUID/PipeID.java | 201 -- .../impl/src/net/jxta/impl/id/UUID/UUID.java | 300 -- .../net/jxta/impl/id/UUID/UUIDFactory.java | 292 -- .../src/net/jxta/impl/id/UUID/package.html | 16 - .../net/jxta/impl/id/binaryID/BinaryID.java | 319 -- .../impl/id/binaryID/BinaryIDFactory.java | 79 - .../jxta/impl/id/binaryID/CodatBinaryID.java | 274 -- .../net/jxta/impl/id/binaryID/DigestTool.java | 417 --- .../net/jxta/impl/id/binaryID/IDFormat.java | 162 - .../jxta/impl/id/binaryID/Instantiator.java | 395 --- .../impl/id/binaryID/ModuleClassBinaryID.java | 326 -- .../impl/id/binaryID/ModuleSpecBinaryID.java | 283 -- .../jxta/impl/id/binaryID/PeerBinaryID.java | 212 -- .../impl/id/binaryID/PeerGroupBinaryID.java | 244 -- .../jxta/impl/id/binaryID/PipeBinaryID.java | 210 -- .../net/jxta/impl/id/binaryID/package.html | 49 - .../impl/src/net/jxta/impl/id/unknown/ID.java | 178 -- .../net/jxta/impl/id/unknown/IDFormat.java | 81 - .../jxta/impl/id/unknown/Instantiator.java | 272 -- .../src/net/jxta/impl/id/unknown/package.html | 13 - .../net/jxta/impl/loader/RefJxtaLoader.java | 386 --- .../src/net/jxta/impl/loader/package.html | 10 - .../membership/PasswdMembershipService.java | 180 -- .../none/NoneMembershipService.java | 700 ----- .../none/NoneMembershipServiceBeanInfo.java | 121 - .../jxta/impl/membership/none/package.html | 17 - .../src/net/jxta/impl/membership/package.html | 14 - .../passwd/PasswdMembershipService.java | 909 ------ .../PasswdMembershipServiceBeanInfo.java | 121 - .../jxta/impl/membership/passwd/package.html | 17 - .../membership/pse/CMKeyStoreManager.java | 315 -- .../membership/pse/DialogAuthenticator.java | 492 --- .../membership/pse/EngineAuthenticator.java | 365 --- .../membership/pse/FileKeyStoreManager.java | 293 -- .../impl/membership/pse/KeyStoreManager.java | 139 - .../pse/PSEAuthenticatorEngine.java | 89 - .../pse/PSEAuthenticatorEngineFactory.java | 114 - .../jxta/impl/membership/pse/PSEConfig.java | 648 ---- .../impl/membership/pse/PSECredential.java | 861 ------ .../pse/PSECrendentialBeanInfo.java | 134 - .../pse/PSEKeyStoreManagerFactory.java | 163 - .../membership/pse/PSEMembershipService.java | 797 ----- .../pse/PSEMembershipServiceBeanInfo.java | 125 - .../membership/pse/PSEPeerSecurityEngine.java | 114 - .../pse/PSESecurityEngineFactory.java | 209 -- .../jxta/impl/membership/pse/PSEUtils.java | 874 ------ .../membership/pse/StringAuthenticator.java | 356 --- .../membership/pse/URIKeyStoreManager.java | 313 -- .../net/jxta/impl/membership/pse/package.html | 11 - .../meter/ConditionalMeterBuildSettings.java | 80 - .../impl/meter/GenericServiceMonitor.java | 223 -- .../jxta/impl/meter/MeterBuildSettings.java | 67 - .../net/jxta/impl/meter/MetricUtilities.java | 100 - .../net/jxta/impl/meter/MonitorManager.java | 834 ----- .../jxta/impl/meter/ServiceMonitorImpl.java | 71 - .../impl/meter/ServiceMonitorPulseInfo.java | 195 -- .../impl/meter/ServiceMonitorResource.java | 68 - .../impl/src/net/jxta/impl/monitor.properties | 64 - .../impl/src/net/jxta/impl/overview.html | 26 - .../net/jxta/impl/peer/PeerInfoHandler.java | 70 - .../net/jxta/impl/peer/PeerInfoMessenger.java | 68 - .../jxta/impl/peer/PeerInfoServiceImpl.java | 560 ---- .../impl/peer/PeerInfoServiceInterface.java | 203 -- .../peer/RemoteMonitorPeerInfoHandler.java | 638 ---- .../jxta/impl/peer/RemoteMonitorQuery.java | 227 -- .../jxta/impl/peer/RemoteMonitorResponse.java | 334 -- .../impl/src/net/jxta/impl/peer/package.html | 11 - .../impl/peergroup/AutomaticConfigurator.java | 511 ---- .../src/net/jxta/impl/peergroup/Boot.java | 169 - .../impl/peergroup/CompatibilityEquater.java | 70 - .../net/jxta/impl/peergroup/ConfigDialog.java | 2022 ------------ .../impl/peergroup/DefaultConfigurator.java | 270 -- .../jxta/impl/peergroup/GenericPeerGroup.java | 1720 ----------- .../IncompleteConfigurationException.java | 66 - .../jxta/impl/peergroup/NullConfigurator.java | 304 -- .../impl/peergroup/PeerGroupInterface.java | 447 --- .../src/net/jxta/impl/peergroup/Platform.java | 257 -- .../impl/peergroup/PlatformConfigurator.java | 108 - .../peergroup/RefCountPeerGroupInterface.java | 267 -- .../jxta/impl/peergroup/ShadowPeerGroup.java | 186 -- .../net/jxta/impl/peergroup/StdPeerGroup.java | 986 ------ .../impl/peergroup/StdPeerGroupParamAdv.java | 517 ---- .../src/net/jxta/impl/peergroup/package.html | 13 - .../impl/pipe/BlockingWireOutputPipe.java | 260 -- .../src/net/jxta/impl/pipe/InputPipeImpl.java | 280 -- .../jxta/impl/pipe/NonBlockingOutputPipe.java | 768 ----- .../impl/pipe/NonBlockingWireOutputPipe.java | 221 -- .../src/net/jxta/impl/pipe/PipeRegistrar.java | 81 - .../src/net/jxta/impl/pipe/PipeResolver.java | 1218 -------- .../net/jxta/impl/pipe/PipeServiceImpl.java | 748 ----- .../jxta/impl/pipe/PipeServiceInterface.java | 197 -- .../jxta/impl/pipe/SecureInputPipeImpl.java | 117 - .../net/jxta/impl/pipe/SecureOutputPipe.java | 124 - .../src/net/jxta/impl/pipe/WireHeader.java | 271 -- .../impl/src/net/jxta/impl/pipe/WirePipe.java | 557 ---- .../src/net/jxta/impl/pipe/WirePipeImpl.java | 345 --- .../impl/src/net/jxta/impl/pipe/package.html | 18 - .../jxta/impl/protocol/AccessPointAdv.java | 319 -- .../net/jxta/impl/protocol/Certificate.java | 268 -- .../protocol/CertificateSigningRequest.java | 201 -- .../impl/protocol/DiscoveryConfigAdv.java | 347 --- .../jxta/impl/protocol/DiscoveryQuery.java | 327 -- .../jxta/impl/protocol/DiscoveryResponse.java | 347 --- .../net/jxta/impl/protocol/GroupConfig.java | 214 -- .../src/net/jxta/impl/protocol/HTTPAdv.java | 561 ---- .../jxta/impl/protocol/LeaseRequestMsg.java | 463 --- .../jxta/impl/protocol/LeaseResponseMsg.java | 626 ---- .../impl/protocol/LimitedRangeRdvMsg.java | 473 --- .../jxta/impl/protocol/ModuleClassAdv.java | 263 -- .../net/jxta/impl/protocol/ModuleImplAdv.java | 344 --- .../net/jxta/impl/protocol/ModuleSpecAdv.java | 376 --- .../net/jxta/impl/protocol/PSEConfigAdv.java | 766 ----- .../src/net/jxta/impl/protocol/PeerAdv.java | 364 --- .../net/jxta/impl/protocol/PeerGroupAdv.java | 334 -- .../impl/protocol/PeerGroupConfigAdv.java | 443 --- .../jxta/impl/protocol/PeerInfoQueryMsg.java | 179 -- .../impl/protocol/PeerInfoResponseMsg.java | 219 -- .../src/net/jxta/impl/protocol/PipeAdv.java | 303 -- .../jxta/impl/protocol/PipeResolverMsg.java | 341 --- .../jxta/impl/protocol/PlatformConfig.java | 441 --- .../src/net/jxta/impl/protocol/RdvAdv.java | 325 -- .../net/jxta/impl/protocol/RdvConfigAdv.java | 948 ------ .../jxta/impl/protocol/RelayConfigAdv.java | 997 ------ .../net/jxta/impl/protocol/ResolverQuery.java | 401 --- .../jxta/impl/protocol/ResolverResponse.java | 248 -- .../impl/protocol/ResolverSrdiMsgImpl.java | 219 -- .../src/net/jxta/impl/protocol/RouteAdv.java | 332 -- .../net/jxta/impl/protocol/RouteQuery.java | 227 -- .../net/jxta/impl/protocol/RouteResponse.java | 234 -- .../src/net/jxta/impl/protocol/SignedAdv.java | 384 --- .../jxta/impl/protocol/SrdiMessageImpl.java | 355 --- .../src/net/jxta/impl/protocol/TCPAdv.java | 827 ----- .../src/net/jxta/impl/protocol/package.html | 19 - .../src/net/jxta/impl/proxy/ProxyService.java | 1191 -------- .../src/net/jxta/impl/proxy/Requestor.java | 325 -- .../jxta/impl/rendezvous/PeerConnection.java | 370 --- .../net/jxta/impl/rendezvous/RdvGreeter.java | 84 - .../src/net/jxta/impl/rendezvous/RdvWalk.java | 168 - .../net/jxta/impl/rendezvous/RdvWalker.java | 93 - .../RendezVousPropagateMessage.java | 332 -- .../rendezvous/RendezVousServiceImpl.java | 945 ------ .../RendezVousServiceInterface.java | 377 --- .../rendezvous/RendezVousServiceProvider.java | 788 ----- .../impl/rendezvous/StdRendezVousService.java | 520 ---- .../rendezvous/adhoc/AdhocPeerRdvService.java | 401 --- .../rendezvous/edge/EdgePeerRdvService.java | 866 ------ .../impl/rendezvous/edge/RdvConnection.java | 157 - .../limited/LimitedRangeGreeter.java | 191 -- .../rendezvous/limited/LimitedRangeWalk.java | 219 -- .../limited/LimitedRangeWalker.java | 255 -- .../src/net/jxta/impl/rendezvous/package.html | 14 - .../impl/rendezvous/rdv/ClientConnection.java | 104 - .../rendezvous/rdv/RdvPeerRdvService.java | 869 ------ .../ClientConnectionMeter.java | 162 - .../ClientConnectionMetric.java | 399 --- ...nditionalRendezvousMeterBuildSettings.java | 80 - .../RendezvousConnectionMeter.java | 165 - .../RendezvousConnectionMetric.java | 422 --- .../rendezvousMeter/RendezvousMeter.java | 279 -- .../RendezvousMeterBuildSettings.java | 67 - .../rendezvousMeter/RendezvousMetric.java | 666 ---- .../RendezvousServiceMetric.java | 358 --- .../RendezvousServiceMonitor.java | 272 -- .../RendezvousServiceMonitorFilter.java | 130 - .../jxta/impl/rendezvous/rpv/PeerView.java | 2067 ------------- .../rendezvous/rpv/PeerViewDestination.java | 126 - .../impl/rendezvous/rpv/PeerViewElement.java | 391 --- .../impl/rendezvous/rpv/PeerViewEvent.java | 123 - .../impl/rendezvous/rpv/PeerViewListener.java | 71 - .../rpv/PeerViewRandomStrategy.java | 107 - .../PeerViewRandomWithReplaceStrategy.java | 102 - .../rpv/PeerViewSequentialStrategy.java | 132 - .../impl/rendezvous/rpv/PeerViewStrategy.java | 77 - .../rpv/PeerviewSeedingManager.java | 380 --- .../impl/resolver/InternalQueryHandler.java | 109 - .../impl/resolver/ResolverServiceImpl.java | 1293 -------- .../resolver/ResolverServiceInterface.java | 185 -- .../src/net/jxta/impl/resolver/package.html | 13 - ...ConditionalResolverMeterBuildSettings.java | 80 - .../resolverMeter/QueryDestinationMeter.java | 164 - .../resolverMeter/QueryDestinationMetric.java | 256 -- .../resolverMeter/QueryHandlerMeter.java | 522 ---- .../resolverMeter/QueryHandlerMetric.java | 582 ---- .../resolver/resolverMeter/ResolverMeter.java | 222 -- .../ResolverMeterBuildSettings.java | 67 - .../resolverMeter/ResolverMetric.java | 194 -- .../resolverMeter/ResolverServiceMetric.java | 327 -- .../resolverMeter/ResolverServiceMonitor.java | 249 -- .../ResolverServiceMonitorFilter.java | 132 - .../resolverMeter/SrdiDestinationMeter.java | 140 - .../resolverMeter/SrdiDestinationMetric.java | 191 -- .../resolverMeter/SrdiHandlerMeter.java | 239 -- .../resolverMeter/SrdiHandlerMetric.java | 299 -- .../net/jxta/impl/util/ACLSeedingManager.java | 193 -- .../src/net/jxta/impl/util/AdvCooker.java | 513 ---- .../net/jxta/impl/util/BASE64InputStream.java | 252 -- .../jxta/impl/util/BASE64OutputStream.java | 241 -- .../impl/src/net/jxta/impl/util/Base64.java | 284 -- .../impl/src/net/jxta/impl/util/Cache.java | 351 --- .../src/net/jxta/impl/util/CacheEntry.java | 71 - .../jxta/impl/util/CacheEntryListener.java | 71 - .../jxta/impl/util/ConsumerBiasedQueue.java | 248 -- .../impl/src/net/jxta/impl/util/Dlink.java | 130 - .../impl/src/net/jxta/impl/util/Dlist.java | 130 - .../jxta/impl/util/DynamicEnumeration.java | 171 -- .../impl/util/EndpointServiceStatsFilter.java | 193 -- .../src/net/jxta/impl/util/GenerateID.java | 115 - .../impl/src/net/jxta/impl/util/JxtaHash.java | 219 -- .../impl/src/net/jxta/impl/util/LRUCache.java | 216 -- .../src/net/jxta/impl/util/ModuleManager.java | 655 ---- .../jxta/impl/util/ProducerBiasedQueue.java | 244 -- .../jxta/impl/util/RdvAdvSeedingManager.java | 230 -- .../net/jxta/impl/util/ResourceAccount.java | 198 -- .../jxta/impl/util/ResourceDispatcher.java | 722 ----- .../net/jxta/impl/util/SeedingManager.java | 186 -- .../net/jxta/impl/util/SequenceIterator.java | 141 - .../src/net/jxta/impl/util/TimeUtils.java | 439 --- .../net/jxta/impl/util/TimerThreadNamer.java | 117 - .../net/jxta/impl/util/URISeedingManager.java | 554 ---- .../src/net/jxta/impl/util/UnbiasedQueue.java | 875 ------ .../src/net/jxta/impl/util/cm/DumpCm.java | 272 -- .../impl/src/net/jxta/impl/util/package.html | 11 - .../pipe/reliable/AdaptiveFlowControl.java | 360 --- .../jxta/impl/util/pipe/reliable/Defs.java | 84 - .../util/pipe/reliable/FixedFlowControl.java | 100 - .../impl/util/pipe/reliable/FlowControl.java | 110 - .../impl/util/pipe/reliable/Incoming.java | 78 - .../pipe/reliable/IncomingPipeAdaptor.java | 113 - .../impl/util/pipe/reliable/Outgoing.java | 125 - .../pipe/reliable/OutgoingMsgrAdaptor.java | 192 -- .../pipe/reliable/OutgoingPipeAdaptor.java | 164 - .../reliable/OutgoingPipeAdaptorSync.java | 205 -- .../pipe/reliable/ReliableInputStream.java | 779 ----- .../pipe/reliable/ReliableOutputStream.java | 1277 -------- .../impl/src/net/jxta/impl/xindice/Debug.java | 125 - .../jxta/impl/xindice/core/DBException.java | 86 - .../net/jxta/impl/xindice/core/DBObject.java | 127 - .../jxta/impl/xindice/core/FaultCodes.java | 555 ---- .../net/jxta/impl/xindice/core/data/Key.java | 125 - .../jxta/impl/xindice/core/data/Record.java | 151 - .../impl/xindice/core/data/RecordSet.java | 103 - .../jxta/impl/xindice/core/data/Value.java | 278 -- .../jxta/impl/xindice/core/filer/BTree.java | 1194 -------- .../xindice/core/filer/BTreeCallback.java | 76 - .../core/filer/BTreeCorruptException.java | 74 - .../xindice/core/filer/BTreeException.java | 75 - .../impl/xindice/core/filer/BTreeFiler.java | 491 --- .../core/filer/BTreeNotFoundException.java | 73 - .../jxta/impl/xindice/core/filer/Filer.java | 137 - .../xindice/core/filer/FilerException.java | 77 - .../impl/xindice/core/filer/MemFiler.java | 226 -- .../jxta/impl/xindice/core/filer/Paged.java | 1501 --------- .../impl/xindice/core/filer/Streamable.java | 84 - .../impl/xindice/core/indexer/IndexQuery.java | 275 -- .../impl/xindice/core/indexer/Indexer.java | 99 - .../xindice/core/indexer/NameIndexer.java | 113 - .../src/net/jxta/impl/xindice/util/Named.java | 75 - .../impl/xindice/util/XindiceException.java | 86 - .../xindice/util/XindiceRuntimeException.java | 78 - p2pproxy/dependencies/MJSIP.COPYRIGHT.txt | 22 - p2pproxy/dependencies/bcprov-jdk14.jar | Bin 1601132 -> 0 bytes .../dependencies/bouncycastle-LICENSE.txt | 22 - p2pproxy/dependencies/javax.servlet.jar | Bin 73373 -> 0 bytes p2pproxy/dependencies/jstun-0.7.0.jar | Bin 69133 -> 0 bytes p2pproxy/dependencies/junit-4.3.1.jar | Bin 106547 -> 0 bytes p2pproxy/dependencies/jxta_license.html | 248 -- p2pproxy/dependencies/log4j.LICENSE | 202 -- p2pproxy/dependencies/log4j.jar | Bin 358180 -> 0 bytes p2pproxy/dependencies/org.mortbay.jetty.jar | Bin 576379 -> 0 bytes p2pproxy/dependencies/sip.jar | Bin 201058 -> 0 bytes p2pproxy/launcher/.cdtproject | 12 - p2pproxy/launcher/.cproject | 848 ----- p2pproxy/launcher/.project | 81 - .../.settings/org.eclipse.cdt.core.prefs | 3 - p2pproxy/launcher/Debug/makefile | 44 - p2pproxy/launcher/Debug/objects.mk | 7 - p2pproxy/launcher/Debug/sources.mk | 17 - p2pproxy/launcher/Debug/src/launcher-tester.d | 4 - p2pproxy/launcher/Debug/src/p2pproxy.d | 9 - p2pproxy/launcher/Debug/src/p2pproxy_wrap.d | 7 - p2pproxy/launcher/Debug/src/subdir.mk | 37 - p2pproxy/launcher/Makefile.am | 1 - p2pproxy/launcher/src/Makefile.am | 24 - p2pproxy/launcher/src/launcher-tester.c | 98 - p2pproxy/launcher/src/p2pproxy.c | 268 -- p2pproxy/launcher/src/p2pproxy.h | 154 - p2pproxy/log4j.properties | 82 - p2pproxy/plugin-src/Makefile.am | 19 - p2pproxy/plugin-src/fonis.c | 178 -- .../p2pproxy/api/P2pProxyException.java | 45 - .../p2pproxy/api/P2pProxyInstance.java | 76 - .../p2pproxy/api/P2pProxyManagement.java | 33 - .../p2pproxy/api/P2pProxyNetworkProbe.java | 48 - .../api/P2pProxyNotReadyException.java | 55 - .../api/P2pProxyResourceManagement.java | 42 - .../api/P2pProxyRtpRelayManagement.java | 15 - .../P2pProxyUserAlreadyExistException.java | 58 - .../api/P2pProxyUserNotFoundException.java | 55 - .../linphone/p2pproxy/core/Configurator.java | 68 - .../p2pproxy/core/EdgePeerServiceManager.java | 61 - .../p2pproxy/core/GenericService.java | 157 - .../p2pproxy/core/GenericServiceClient.java | 121 - .../p2pproxy/core/GenericUdpSession.java | 89 - .../p2pproxy/core/JxtaNetworkManager.java | 411 --- .../p2pproxy/core/MessageDispatcher.java | 53 - .../core/P2pProxyAccountManagement.java | 120 - .../core/P2pProxyAccountManagementMBean.java | 49 - ...2pProxyAdvertisementNotFoundException.java | 57 - .../p2pproxy/core/P2pProxyInstanceImpl.java | 274 -- .../linphone/p2pproxy/core/P2pProxyMain.java | 520 ---- .../p2pproxy/core/P2pProxyMainMBean.java | 32 - .../p2pproxy/core/P2pProxyManagementImpl.java | 69 - .../core/P2pProxyResourceManagementImpl.java | 71 - .../core/P2pUserProfileAdvertisement.java | 251 -- .../core/SeedingPeerServiceManager.java | 51 - .../p2pproxy/core/ServiceProvider.java | 16 - .../core/SuperPeerServiceManager.java | 44 - .../core/jxtaext/EndpointRegistry.java | 63 - .../core/jxtaext/NatedEndPointAddress.java | 52 - .../core/media/MediaResourceService.java | 108 - .../MediaResoureUnreachableException.java | 34 - .../core/media/jxtaudpproxy/RtpSession.java | 9 - .../media/jxtaudpproxy/RtpSessionImpl.java | 81 - .../media/jxtaudpproxy/SdpProcessorImpl.java | 190 -- .../core/media/jxtaudpproxy/UdpSession.java | 90 - .../core/media/rtprelay/AddressRequest.java | 32 - .../core/media/rtprelay/AddressResponse.java | 47 - .../media/rtprelay/IceSdpProcessorImpl.java | 222 -- .../core/media/rtprelay/MediaType.java | 38 - .../core/media/rtprelay/RouteAddRequest.java | 57 - .../core/media/rtprelay/RouteAddResponse.java | 50 - .../core/media/rtprelay/RoutingTable.java | 60 - .../core/media/rtprelay/RtpRelayServer.java | 334 -- .../media/rtprelay/RtpRelayServerConfig.java | 28 - .../core/media/rtprelay/RtpRoutingRules.java | 48 - .../core/media/rtprelay/SdpProcessorImpl.java | 90 - .../media/rtprelay/SingleAddressResponse.java | 43 - .../core/rdvautoconfig/AutoConfigService.java | 147 - .../rdvautoconfig/P2pproxyRdvListener.java | 33 - .../core/rdvautoconfig/PeerInfoProvider.java | 33 - .../PeerInfoProviderService.java | 239 -- .../rdvautoconfig/PeerInfoServiceClient.java | 150 - .../rdvautoconfig/PublicIpAddressRequest.java | 41 - .../PublicIpAddressResponse.java | 58 - .../rdvautoconfig/SocketProbeRequest.java | 55 - .../NetworkResourceAdvertisement.java | 267 -- .../core/sipproxy/RegistrationHandler.java | 29 - .../p2pproxy/core/sipproxy/SdpProcessor.java | 39 - .../p2pproxy/core/sipproxy/SipProxy.java | 29 - .../core/sipproxy/SipProxyRegistrar.java | 404 --- .../core/sipproxy/SipProxyRegistrarMBean.java | 34 - .../p2pproxy/core/sipproxy/SipUtils.java | 52 - .../core/sipproxy/peers/JxtaSipProxy.java | 203 -- .../core/sipproxy/peers/NetworkResources.java | 93 - .../superpeers/JxtaNetworkResources.java | 64 - .../P2pUserRegistrationAdvertisement.java | 271 -- .../sipproxy/superpeers/SuperPeerProxy.java | 133 - .../p2pproxy/core/stun/AddressInfo.java | 67 - .../p2pproxy/core/stun/DiscoveryInfo.java | 110 - .../p2pproxy/core/stun/StunClient.java | 200 -- .../p2pproxy/core/stun/StunServer.java | 148 - .../core/utils/AccountManagerCli.java | 129 - .../p2pproxy/core/utils/DumpLocalCache.java | 45 - .../p2pproxy/core/utils/Excecutor.java | 8 - .../core/utils/PeerGroupIdGenerator.java | 74 - .../p2pproxy/test/P2pAutoConfigTester.java | 110 - .../test/P2pProxyAccountManagementTester.java | 86 - .../test/P2pProxyNatedNetworkTester.java | 48 - .../test/P2pProxyNetworkingTester.java | 148 - .../p2pproxy/test/P2pProxyTester.java | 487 --- .../p2pproxy/test/RtpRelayServerTester.java | 202 -- .../p2pproxy/test/StunServerTester.java | 425 --- .../p2pproxy/test/UdpRelayTester.java | 125 - .../test/utils/DefaultCallListener.java | 75 - .../p2pproxy/test/utils/P2pNetwork.java | 224 -- .../p2pproxy/test/utils/SipClient.java | 283 -- .../p2pproxy/test/utils/UserInstance.java | 224 -- {linphone/pixmaps => pixmaps}/.gitignore | 0 {linphone/pixmaps => pixmaps}/Makefile.am | 0 {linphone/pixmaps => pixmaps}/green.png | Bin {linphone/pixmaps => pixmaps}/linphone.png | Bin {linphone/pixmaps => pixmaps}/linphone2.png | Bin {linphone/pixmaps => pixmaps}/linphone2.xpm | 0 {linphone/pixmaps => pixmaps}/mic_active.png | Bin {linphone/pixmaps => pixmaps}/mic_muted.png | Bin {linphone/pixmaps => pixmaps}/red.png | Bin {linphone/pixmaps => pixmaps}/sip-away.png | Bin {linphone/pixmaps => pixmaps}/sip-bifm.png | Bin {linphone/pixmaps => pixmaps}/sip-busy.png | Bin {linphone/pixmaps => pixmaps}/sip-closed.png | Bin {linphone/pixmaps => pixmaps}/sip-online.png | Bin {linphone/pixmaps => pixmaps}/sip-otl.png | Bin {linphone/pixmaps => pixmaps}/sip-otp.png | Bin {linphone/pixmaps => pixmaps}/sip-wfa.png | Bin {linphone/po => po}/.gitignore | 0 {linphone/po => po}/ChangeLog | 0 {linphone/po => po}/Makefile.in.in | 0 {linphone/po => po}/Makevars | 0 {linphone/po => po}/Makevars.template | 0 {linphone/po => po}/POTFILES.in | 0 {linphone/po => po}/POTFILES.skip | 0 {linphone/po => po}/Rules-quot | 0 {linphone/po => po}/boldquot.sed | 0 {linphone/po => po}/cat-id-tbl.c | 0 {linphone/po => po}/cs.po | 0 {linphone/po => po}/de.po | 0 {linphone/po => po}/en@boldquot.header | 0 {linphone/po => po}/en@quot.header | 0 {linphone/po => po}/es.po | 0 {linphone/po => po}/fr.po | 0 {linphone/po => po}/hu.po | 0 {linphone/po => po}/insert-header.sin | 0 {linphone/po => po}/it.po | 0 {linphone/po => po}/ja.po | 0 {linphone/po => po}/nl.po | 0 {linphone/po => po}/pl.po | 0 {linphone/po => po}/pt_BR.po | 0 {linphone/po => po}/quot.sed | 0 {linphone/po => po}/remove-potcdate.sin | 0 {linphone/po => po}/ru.po | 0 {linphone/po => po}/sv.po | 0 {linphone/po => po}/zh_CN.po | 0 {linphone/scripts => scripts}/Makefile.am | 0 .../scripts => scripts}/Portfile-devel.tmpl | 0 {linphone/scripts => scripts}/Portfile.tmpl | 0 .../scripts => scripts}/builder-mingw.mk | 0 {linphone/share => share}/.gitignore | 0 {linphone/share => share}/C/.gitignore | 0 {linphone/share => share}/C/Makefile.am | 0 {linphone/share => share}/C/linphone.1 | 0 {linphone/share => share}/C/linphonec.1 | 0 {linphone/share => share}/C/linphonecsh.1 | 0 {linphone/share => share}/C/manual.lyx | 0 {linphone/share => share}/C/manual.sgml | 0 {linphone/share => share}/C/sipomatic.1 | 0 {linphone/share => share}/Makefile.am | 0 {linphone/share => share}/Makefile.inc | 0 {linphone/share => share}/cs/.gitignore | 0 {linphone/share => share}/cs/Makefile.am | 0 {linphone/share => share}/cs/linphone.1 | 0 {linphone/share => share}/cs/linphonec.1 | 0 {linphone/share => share}/cs/sipomatic.1 | 0 {linphone/share => share}/fr/.gitignore | 0 {linphone/share => share}/fr/Makefile.am | 0 {linphone/share => share}/fr/manual.lyx | 0 {linphone/share => share}/fr/manual.sgml | 0 {linphone/share => share}/hello16000.wav | Bin {linphone/share => share}/hello8000.wav | Bin {linphone/share => share}/it/.gitignore | 0 {linphone/share => share}/it/Makefile.am | 0 {linphone/share => share}/it/manual.lyx | 0 {linphone/share => share}/it/manual.sgml | 0 {linphone/share => share}/ja/.gitignore | 0 {linphone/share => share}/ja/Makefile.am | 0 {linphone/share => share}/ja/manual.lyx | 0 {linphone/share => share}/ja/manual.sgml | 0 {linphone/share => share}/linphone.desktop | 0 {linphone/share => share}/linphone.gnorba | 0 {linphone/share => share}/linphone.pc.in | 0 .../share => share}/linphone_applet.desktop | 0 {linphone/share => share}/ringback.wav | Bin {linphone/share => share}/rings/bigben.wav | Bin {linphone/share => share}/rings/oldphone.wav | Bin {linphone/share => share}/rings/orig.wav | Bin {linphone/share => share}/rings/rock.wav | Bin {linphone/share => share}/rings/sweet.wav | Bin {linphone/share => share}/rings/synth.wav | Bin {linphone/share => share}/rings/tapping.wav | Bin {linphone/share => share}/rings/toy.wav | Bin linphone/stamp-h.in => stamp-h.in | 0 1055 files changed, 2 insertions(+), 201099 deletions(-) rename linphone/ABOUT-NLS => ABOUT-NLS (100%) rename linphone/AUTHORS => AUTHORS (100%) rename linphone/BUGS => BUGS (100%) rename linphone/COPYING => COPYING (100%) rename linphone/ChangeLog => ChangeLog (100%) rename linphone/Makefile.am => Makefile.am (100%) rename linphone/NEWS => NEWS (100%) rename linphone/README => README (100%) rename linphone/README.M68k.txt => README.M68k.txt (100%) rename linphone/README.arm => README.arm (100%) rename linphone/README.macos => README.macos (100%) rename linphone/README.mingw => README.mingw (100%) rename linphone/TODO => TODO (100%) rename linphone/autogen.sh => autogen.sh (100%) rename {linphone/build => build}/wince/liblinphone.sln (100%) rename {linphone/build => build}/wince/liblinphone.vcproj (100%) rename {linphone/build => build}/wince/linphonec/linphonec.vcproj (100%) rename linphone/config.rpath => config.rpath (100%) rename linphone/configure.in => configure.in (100%) rename {linphone/console => console}/.gitignore (100%) rename {linphone/console => console}/Makefile.am (100%) rename {linphone/console => console}/TODO (100%) rename {linphone/console => console}/commands.c (100%) rename {linphone/console => console}/example/linphonec (100%) rename {linphone/console => console}/linphonec.c (100%) rename {linphone/console => console}/linphonec.h (100%) rename {linphone/console => console}/shell.c (100%) rename {linphone/console => console}/sipomatic.c (100%) rename {linphone/console => console}/sipomatic.h (100%) rename {linphone/console => console}/wav2raw.c (100%) rename {linphone/coreapi => coreapi}/.gitignore (100%) rename {linphone/coreapi => coreapi}/Makefile.am (100%) rename {linphone/coreapi => coreapi}/address.c (100%) rename {linphone/coreapi => coreapi}/authentication.c (100%) rename {linphone/coreapi => coreapi}/chat.c (100%) rename {linphone/coreapi => coreapi}/enum.c (100%) rename {linphone/coreapi => coreapi}/enum.h (100%) rename {linphone/coreapi => coreapi}/exevents.c (100%) rename {linphone/coreapi => coreapi}/exevents.h (100%) rename {linphone/coreapi => coreapi}/fonis.c (100%) rename {linphone/coreapi => coreapi}/friend.c (100%) rename {linphone/coreapi => coreapi}/general_state.c (100%) rename {linphone/coreapi => coreapi}/help/Doxyfile.in (100%) rename {linphone/coreapi => coreapi}/help/Makefile.am (100%) rename {linphone/coreapi => coreapi}/help/doxygen.dox.in (100%) rename {linphone/coreapi => coreapi}/linphonecore.c (100%) rename {linphone/coreapi => coreapi}/linphonecore.h (100%) rename {linphone/coreapi => coreapi}/lpconfig.c (100%) rename {linphone/coreapi => coreapi}/lpconfig.h (100%) rename {linphone/coreapi => coreapi}/misc.c (100%) rename {linphone/coreapi => coreapi}/plugins/buddylookup/AUTHORS (100%) rename {linphone/coreapi => coreapi}/plugins/buddylookup/COPYING (100%) rename {linphone/coreapi => coreapi}/plugins/buddylookup/ChangeLog (100%) rename {linphone/coreapi => coreapi}/plugins/buddylookup/INSTALL (100%) rename {linphone/coreapi => coreapi}/plugins/buddylookup/Makefile.am (100%) rename {linphone/coreapi => coreapi}/plugins/buddylookup/NEWS (100%) rename {linphone/coreapi => coreapi}/plugins/buddylookup/README (100%) rename {linphone/coreapi => coreapi}/plugins/buddylookup/autogen.sh (100%) rename {linphone/coreapi => coreapi}/plugins/buddylookup/configure.ac (100%) rename {linphone/coreapi => coreapi}/plugins/buddylookup/src/Makefile.am (100%) rename {linphone/coreapi => coreapi}/plugins/buddylookup/src/lookup.c (100%) rename {linphone/coreapi => coreapi}/presence.c (100%) rename {linphone/coreapi => coreapi}/private.h (100%) rename {linphone/coreapi => coreapi}/proxy.c (100%) rename {linphone/coreapi => coreapi}/sdphandler.c (100%) rename {linphone/coreapi => coreapi}/sdphandler.h (100%) rename {linphone/coreapi => coreapi}/siplogin.c (100%) rename {linphone/coreapi => coreapi}/sipsetup.c (100%) rename {linphone/coreapi => coreapi}/sipsetup.h (100%) rename linphone/gen-gtkfilelist.sh => gen-gtkfilelist.sh (100%) rename linphone/gtk+-2.16.2.filelist => gtk+-2.16.2.filelist (100%) rename linphone/gtk+-2.16.6.filelist => gtk+-2.16.6.filelist (100%) rename linphone/gtk+-2.18.5.filelist => gtk+-2.18.5.filelist (100%) rename {linphone/gtk-glade => gtk-glade}/.gitignore (100%) rename {linphone/gtk-glade => gtk-glade}/Makefile.am (100%) rename {linphone/gtk-glade => gtk-glade}/about.glade (100%) rename {linphone/gtk-glade => gtk-glade}/buddylookup.c (100%) rename {linphone/gtk-glade => gtk-glade}/buddylookup.glade (100%) rename {linphone/gtk-glade => gtk-glade}/call_logs.glade (100%) rename {linphone/gtk-glade => gtk-glade}/calllogs.c (100%) rename {linphone/gtk-glade => gtk-glade}/chat.c (100%) rename {linphone/gtk-glade => gtk-glade}/chatroom.glade (100%) rename {linphone/gtk-glade => gtk-glade}/contact.glade (100%) rename {linphone/gtk-glade => gtk-glade}/fonis.c (100%) rename {linphone/gtk-glade => gtk-glade}/friendlist.c (100%) rename {linphone/gtk-glade => gtk-glade}/gtkrc (100%) rename {linphone/gtk-glade => gtk-glade}/incall_view.c (100%) rename {linphone/gtk-glade => gtk-glade}/incoming_call.glade (100%) rename {linphone/gtk-glade => gtk-glade}/linphone.h (100%) rename {linphone/gtk-glade => gtk-glade}/linphone.ico (100%) rename {linphone/gtk-glade => gtk-glade}/linphone.iss (100%) rename {linphone/gtk-glade => gtk-glade}/linphone.png (100%) rename {linphone/gtk-glade => gtk-glade}/linphone.rc (100%) rename {linphone/gtk-glade => gtk-glade}/linphone2.png (100%) rename {linphone/gtk-glade => gtk-glade}/log.glade (100%) rename {linphone/gtk-glade => gtk-glade}/logging.c (100%) rename {linphone/gtk-glade => gtk-glade}/loginframe.c (100%) rename {linphone/gtk-glade => gtk-glade}/main.c (100%) rename {linphone/gtk-glade => gtk-glade}/main.glade (100%) rename {linphone/gtk-glade => gtk-glade}/p2pwizard.glade (100%) rename {linphone/gtk-glade => gtk-glade}/parameters.glade (100%) rename {linphone/gtk-glade => gtk-glade}/password.glade (100%) rename {linphone/gtk-glade => gtk-glade}/propertybox.c (100%) rename {linphone/gtk-glade => gtk-glade}/setupwizard.c (100%) rename {linphone/gtk-glade => gtk-glade}/sip_account.glade (100%) rename {linphone/gtk-glade => gtk-glade}/stock_people.png (100%) rename {linphone/gtk-glade => gtk-glade}/support.c (100%) rename {linphone/gtk-glade => gtk-glade}/update.c (100%) rename {linphone/gtk-glade => gtk-glade}/utils.c (100%) rename {linphone/gtk-glade => gtk-glade}/waiting.glade (100%) rename {linphone/intl => intl}/ChangeLog (100%) rename {linphone/intl => intl}/Makefile.in (100%) rename {linphone/intl => intl}/VERSION (100%) rename {linphone/intl => intl}/bindtextdom.c (100%) rename {linphone/intl => intl}/cat-compat.c (100%) rename {linphone/intl => intl}/dcgettext.c (100%) rename {linphone/intl => intl}/dgettext.c (100%) rename {linphone/intl => intl}/explodename.c (100%) rename {linphone/intl => intl}/finddomain.c (100%) rename {linphone/intl => intl}/gettext.c (100%) rename {linphone/intl => intl}/gettext.h (100%) rename {linphone/intl => intl}/gettextP.h (100%) rename {linphone/intl => intl}/hash-string.h (100%) rename {linphone/intl => intl}/intl-compat.c (100%) rename {linphone/intl => intl}/l10nflist.c (100%) rename {linphone/intl => intl}/libgettext.h (100%) rename {linphone/intl => intl}/linux-msg.sed (100%) rename {linphone/intl => intl}/loadinfo.h (100%) rename {linphone/intl => intl}/loadmsgcat.c (100%) rename {linphone/intl => intl}/localealias.c (100%) rename {linphone/intl => intl}/po2tbl.sed.in (100%) rename {linphone/intl => intl}/textdomain.c (100%) rename {linphone/intl => intl}/xopen-msg.sed (100%) rename linphone/intltool-extract.in => intltool-extract.in (100%) rename linphone/intltool-merge.in => intltool-merge.in (100%) rename linphone/intltool-update.in => intltool-update.in (100%) rename linphone/linphone-deps.filelist => linphone-deps.filelist (100%) rename linphone/linphone.iss.in => linphone.iss.in (100%) rename linphone/linphone.kdevelop => linphone.kdevelop (100%) rename linphone/linphone.spec.in => linphone.spec.in (100%) delete mode 100644 linphone/mingw-envsetup.sh rename {linphone/m4 => m4}/.gitignore (100%) rename {linphone/m4 => m4}/Makefile.am (100%) rename {linphone/m4 => m4}/codeset.m4 (100%) rename {linphone/m4 => m4}/exosip.m4 (100%) rename {linphone/m4 => m4}/gettext.m4 (100%) rename {linphone/m4 => m4}/glibc2.m4 (100%) rename {linphone/m4 => m4}/glibc21.m4 (100%) rename {linphone/m4 => m4}/iconv.m4 (100%) rename {linphone/m4 => m4}/ilbc.m4 (100%) rename {linphone/m4 => m4}/intdiv0.m4 (100%) rename {linphone/m4 => m4}/intl.m4 (100%) rename {linphone/m4 => m4}/intldir.m4 (100%) rename {linphone/m4 => m4}/intmax.m4 (100%) rename {linphone/m4 => m4}/inttypes-pri.m4 (100%) rename {linphone/m4 => m4}/inttypes.m4 (100%) rename {linphone/m4 => m4}/inttypes_h.m4 (100%) rename {linphone/m4 => m4}/isc-posix.m4 (100%) rename {linphone/m4 => m4}/lcmessage.m4 (100%) rename {linphone/m4 => m4}/lib-ld.m4 (100%) rename {linphone/m4 => m4}/lib-link.m4 (100%) rename {linphone/m4 => m4}/lib-prefix.m4 (100%) rename {linphone/m4 => m4}/lock.m4 (100%) rename {linphone/m4 => m4}/longdouble.m4 (100%) rename {linphone/m4 => m4}/longlong.m4 (100%) rename {linphone/m4 => m4}/nls.m4 (100%) rename {linphone/m4 => m4}/ortp.m4 (100%) rename {linphone/m4 => m4}/osip.m4 (100%) rename {linphone/m4 => m4}/po.m4 (100%) rename {linphone/m4 => m4}/printf-posix.m4 (100%) rename {linphone/m4 => m4}/progtest.m4 (100%) rename {linphone/m4 => m4}/readline.m4 (100%) rename {linphone/m4 => m4}/signed.m4 (100%) rename {linphone/m4 => m4}/size_max.m4 (100%) rename {linphone/m4 => m4}/stdint_h.m4 (100%) rename {linphone/m4 => m4}/uintmax_t.m4 (100%) rename {linphone/m4 => m4}/ulonglong.m4 (100%) rename {linphone/m4 => m4}/video.m4 (100%) rename {linphone/m4 => m4}/visibility.m4 (100%) rename {linphone/m4 => m4}/wchar_t.m4 (100%) rename {linphone/m4 => m4}/wint_t.m4 (100%) rename {linphone/m4 => m4}/xsize.m4 (100%) rename {linphone/media_api => media_api}/.gitignore (100%) rename {linphone/media_api => media_api}/DESIGN.txt (100%) rename {linphone/media_api => media_api}/Makefile.am (100%) rename {linphone/media_api => media_api}/apitest.c (100%) rename {linphone/media_api => media_api}/apitest.h (100%) rename {linphone/media_api => media_api}/basiccall.c (100%) rename {linphone/media_api => media_api}/basiccall.h (100%) rename {linphone/media_api => media_api}/callmember.c (100%) rename {linphone/media_api => media_api}/callmember.h (100%) rename {linphone/media_api => media_api}/ccl (100%) rename {linphone/media_api => media_api}/common.h (100%) rename {linphone/media_api => media_api}/media_api.c (100%) rename {linphone/media_api => media_api}/media_api.h (100%) rename {linphone/media_api => media_api}/mediaflow.c (100%) rename {linphone/media_api => media_api}/mediaflow.h (100%) delete mode 100644 p2pproxy/.classpath delete mode 100644 p2pproxy/.cvsignore delete mode 100644 p2pproxy/.gcjbuilder delete mode 100644 p2pproxy/.project delete mode 100644 p2pproxy/AUTHORS delete mode 100644 p2pproxy/COPYING delete mode 100644 p2pproxy/ChangeLog delete mode 100644 p2pproxy/INSTALL delete mode 100644 p2pproxy/Makefile.am delete mode 100644 p2pproxy/NEWS delete mode 100644 p2pproxy/README delete mode 100755 p2pproxy/autogen.sh delete mode 100644 p2pproxy/bin/p2pproxy-cmd.bat delete mode 100644 p2pproxy/bin/p2pproxy-cmd.sh delete mode 100644 p2pproxy/bin/p2pproxy.bat delete mode 100644 p2pproxy/bin/p2pproxy.sh delete mode 100644 p2pproxy/build.xml delete mode 100644 p2pproxy/configure.ac delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ChangeRequest.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ChangedAddress.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Data.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Dummy.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ErrorCode.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MappedAddress.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MappedResponseChangedSourceAddressReflectedFrom.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttribute.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttributeException.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttributeInterface.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttributeParsingException.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageIntegrity.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Password.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ReflectedFrom.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ResponseAddress.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/SourceAddress.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/UnknownAttribute.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/UnknownMessageAttributeException.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Username.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeader.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeaderException.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeaderInterface.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeaderParsingException.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/BindingLifetimeTest.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/DiscoveryInfo.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/DiscoveryTest.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/BindingLifetimeTestDemo.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/DiscoveryTestDemo.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/StunServer.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/ice/Candidate.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/ice/ICENegociator.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/util/Address.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/util/Utility.java delete mode 100644 p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/util/UtilityException.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/pom.xml delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/Version.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/access/AccessService.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/access/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/Codat.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/CodatID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/Metadata.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/AuthenticationCredential.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/Credential.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/CredentialPCLSupport.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/CredentialValidator.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/PrivilegedOperation.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/discovery/DiscoveryEvent.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/discovery/DiscoveryListener.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/discovery/DiscoveryService.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/discovery/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/Advertisement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/AdvertisementFactory.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/Attributable.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/Attribute.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/BinaryDocument.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/Document.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/DocumentByteArrayIO.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/DocumentByteBufferIO.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/DocumentStreamIO.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/Element.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/ExtendableAdvertisement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/FileDocument.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/MimeMediaType.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/StructuredDocument.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/StructuredDocumentFactory.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/StructuredDocumentUtils.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/StructuredTextDocument.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextDocument.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextDocumentCharArrayIO.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextDocumentCharBufferIO.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextDocumentCharSequenceIO.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextDocumentReaderIO.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/TextElement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/XMLDocument.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/XMLElement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/document/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/AbstractMessenger.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/AsyncChannelMessenger.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/ByteArrayMessageElement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/ChannelMessenger.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/EndpointAddress.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/EndpointListener.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/EndpointService.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/InputStreamMessageElement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/ListenerAdaptor.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/Message.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/MessageElement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/MessageFilterListener.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/MessagePropagater.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/MessageReceiver.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/MessageSender.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/MessageTransport.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/Messenger.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/MessengerEvent.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/MessengerEventListener.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/MessengerState.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/OutgoingMessageEvent.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/OutgoingMessageEventListener.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/StringMessageElement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/TextDocumentMessageElement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/TextMessageElement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/ThreadedMessenger.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/WireFormatMessage.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/WireFormatMessageFactory.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/endpoint/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/exception/ConfiguratorException.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/exception/JxtaError.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/exception/JxtaException.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/exception/PeerGroupException.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/exception/ProtocolNotSupportedException.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/exception/ServiceNotFoundException.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/exception/UnknownServiceException.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/exception/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/id/ID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/id/IDFactory.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/id/jxta/IDFormat.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/id/jxta/Instantiator.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/id/jxta/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/id/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/logging/Logging.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/logging/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/membership/Authenticator.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/membership/InteractiveAuthenticator.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/membership/MembershipService.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/membership/doc-files/memberAndAccess.png delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/membership/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/meter/MonitorEvent.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/meter/MonitorException.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/meter/MonitorFilter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/meter/MonitorFilterException.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/meter/MonitorListener.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/meter/MonitorReport.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/meter/MonitorResources.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/meter/PeerMonitorInfo.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/meter/PeerMonitorInfoEvent.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/meter/PeerMonitorInfoListener.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/meter/ServiceMetric.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/meter/ServiceMonitor.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/meter/ServiceMonitorFilter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/meter/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/overview.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/peer/PeerID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/peer/PeerInfoEvent.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/peer/PeerInfoListener.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/peer/PeerInfoService.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/peer/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/peergroup/Configurator.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/peergroup/LightWeightPeerGroup.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/peergroup/NetPeerGroupFactory.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/peergroup/PeerGroup.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/peergroup/PeerGroupFactory.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/peergroup/PeerGroupID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/peergroup/WorldPeerGroupFactory.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/peergroup/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/pipe/InputPipe.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/pipe/OutputPipe.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/pipe/OutputPipeEvent.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/pipe/OutputPipeListener.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/pipe/PipeID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/pipe/PipeMsgEvent.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/pipe/PipeMsgListener.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/pipe/PipeService.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/pipe/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/platform/Application.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/platform/JxtaLoader.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/platform/Module.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/platform/ModuleClassID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/platform/ModuleSpecID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/platform/NetworkConfigurator.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/platform/NetworkManager.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/platform/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/AccessPointAdvertisement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/ConfigParams.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/DiscoveryQueryMsg.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/DiscoveryResponseMsg.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/ModuleClassAdvertisement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/ModuleImplAdvertisement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/ModuleSpecAdvertisement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/PeerAdvertisement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/PeerGroupAdvertisement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/PeerInfoQueryMessage.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/PeerInfoResponseMessage.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/PipeAdvertisement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/PipeResolverMessage.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/RdvAdvertisement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/ResolverQueryMsg.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/ResolverResponseMsg.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/ResolverSrdiMsg.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/RouteAdvertisement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/RouteQueryMsg.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/RouteResponseMsg.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/SignedAdvertisement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/SrdiMessage.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/TransportAdvertisement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/protocol/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/rendezvous/RendezVousService.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/rendezvous/RendezVousStatus.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/rendezvous/RendezvousEvent.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/rendezvous/RendezvousListener.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/rendezvous/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/resolver/GenericResolver.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/resolver/QueryHandler.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/resolver/ResolverService.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/resolver/SrdiHandler.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/resolver/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/service/Service.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/service/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/socket/JxtaMulticastSocket.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/socket/JxtaServerSocket.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/socket/JxtaSocket.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/socket/JxtaSocketAddress.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/socket/JxtaSocketInputStream.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/socket/JxtaSocketOutputStream.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/socket/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/user.properties delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/AbstractSimpleSelectable.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/AdvertisementUtilities.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/AwtUtils.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/ClassFactory.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/CountingInputStream.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/CountingOutputStream.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/CountingWriter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/DevNullOutputStream.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/DevNullWriter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/DocumentUtilities.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/IgnoreFlushFilterOutputStream.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/JxtaBiDiPipe.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/JxtaServerPipe.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/LimitInputStream.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/MarkProhibitedFilterStream.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/MessageUtilities.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/PipeEventListener.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/PipeStateListener.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/PipeUtilities.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/SimpleSelectable.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/SimpleSelector.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/WatchedInputStream.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/WatchedOutputStream.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/WatchedStream.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/documentSerializable/DocumentSerializable.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/documentSerializable/DocumentSerializableUtilities.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/documentSerializable/DocumentSerializationException.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/util/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/api/src/sun/net/www/protocol/urn/Handler.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/META-INF/services/net.jxta.document.Advertisement delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/META-INF/services/net.jxta.document.StructuredDocument delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/META-INF/services/net.jxta.endpoint.WireFormatMessage delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/META-INF/services/net.jxta.id.ID delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/META-INF/services/net.jxta.platform.Module delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/Version.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/access/AccessList.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/access/always/AlwaysAccessService.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/access/always/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/access/pse/PSEAccessService.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/access/pse/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/access/simpleACL/SimpleACLAccessService.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/access/simpleACL/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/cm/Cm.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/cm/Indexer.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/cm/Srdi.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/cm/SrdiIndex.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/config.properties delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/discovery/DiscoveryServiceImpl.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/discovery/DiscoveryServiceInterface.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/discovery/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/document/DOMXMLDocument.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/document/DOMXMLElement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/document/LiteXMLDocument.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/document/LiteXMLElement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/document/PlainTextDocument.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/document/PlainTextElement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/document/TextDocumentCommon.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/BlockingMessenger.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/EndpointServiceImpl.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/EndpointServiceInterface.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/EndpointUtils.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/IPUtils.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/JxtaMessageMessageElement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/LoopbackMessenger.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/SocketFactory.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/WireFormatMessageBinary.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/cbjx/CbJxDefs.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/cbjx/CbJxMessageInfo.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/cbjx/CbJxMessenger.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/cbjx/CbJxTransport.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/cbjx/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/endpointMeter/ConditionalEndpointMeterBuildSettings.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/endpointMeter/EndpointMeter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/endpointMeter/EndpointMeterBuildSettings.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/endpointMeter/EndpointMetric.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/endpointMeter/EndpointServiceMetric.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/endpointMeter/EndpointServiceMonitor.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/endpointMeter/EndpointServiceMonitorFilter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/endpointMeter/InboundMeter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/endpointMeter/InboundMetric.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/endpointMeter/IncomingMessageListenerMeter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/endpointMeter/MessengerMeter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/endpointMeter/OutboundMeter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/endpointMeter/OutboundMetric.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/endpointMeter/PropagationMeter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/endpointMeter/PropagationMetric.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/mcast/McastTransport.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/mcast/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/msgframing/MessagePackageHeader.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/msgframing/WelcomeMessage.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/relay/RelayClient.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/relay/RelayReferralSeedingManager.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/relay/RelayServer.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/relay/RelayServerClient.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/relay/RelayTransport.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/relay/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/router/BadRoute.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/router/Destinations.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/router/EndpointRouter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/router/EndpointRouterMessage.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/router/RouteCM.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/router/RouteControl.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/router/RouteResolver.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/router/RouterMessenger.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/router/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/servlethttp/HttpClientMessenger.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/servlethttp/HttpMessageReceiver.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/servlethttp/HttpMessageSender.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/servlethttp/HttpMessageServlet.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/servlethttp/HttpServletMessenger.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/servlethttp/ServletHttpTransport.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/servlethttp/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/tcp/IncomingUnicastServer.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/tcp/TcpMessenger.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/tcp/TcpTransport.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/tcp/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/tls/JTlsDefs.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/tls/JTlsInputStream.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/tls/JTlsOutputStream.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/tls/TlsConn.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/tls/TlsManager.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/tls/TlsMessenger.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/tls/TlsSocket.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/tls/TlsTransport.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/tls/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/transportMeter/ConditionalTransportMeterBuildSettings.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/transportMeter/TransportBindingMeter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/transportMeter/TransportBindingMetric.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/transportMeter/TransportMeter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/transportMeter/TransportMeterBuildSettings.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/transportMeter/TransportMetric.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/transportMeter/TransportServiceMetric.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/transportMeter/TransportServiceMonitor.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/endpoint/transportMeter/TransportServiceMonitorFilter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/CBID/CodatID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/CBID/IDFormat.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/CBID/Instantiator.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/CBID/ModuleClassID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/CBID/ModuleSpecID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/CBID/PeerGroupID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/CBID/PeerID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/CBID/PipeID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/CBID/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/UUID/CodatID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/UUID/IDBytes.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/UUID/IDFormat.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/UUID/Instantiator.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/UUID/ModuleClassID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/UUID/ModuleSpecID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/UUID/PeerGroupID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/UUID/PeerID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/UUID/PipeID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/UUID/UUID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/UUID/UUIDFactory.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/UUID/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/binaryID/BinaryID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/binaryID/BinaryIDFactory.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/binaryID/CodatBinaryID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/binaryID/DigestTool.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/binaryID/IDFormat.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/binaryID/Instantiator.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/binaryID/ModuleClassBinaryID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/binaryID/ModuleSpecBinaryID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/binaryID/PeerBinaryID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/binaryID/PeerGroupBinaryID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/binaryID/PipeBinaryID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/binaryID/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/unknown/ID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/unknown/IDFormat.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/unknown/Instantiator.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/id/unknown/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/loader/RefJxtaLoader.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/loader/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/PasswdMembershipService.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/none/NoneMembershipService.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/none/NoneMembershipServiceBeanInfo.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/none/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/passwd/PasswdMembershipService.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/passwd/PasswdMembershipServiceBeanInfo.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/passwd/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/pse/CMKeyStoreManager.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/pse/DialogAuthenticator.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/pse/EngineAuthenticator.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/pse/FileKeyStoreManager.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/pse/KeyStoreManager.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/pse/PSEAuthenticatorEngine.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/pse/PSEAuthenticatorEngineFactory.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/pse/PSEConfig.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/pse/PSECredential.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/pse/PSECrendentialBeanInfo.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/pse/PSEKeyStoreManagerFactory.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/pse/PSEMembershipService.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/pse/PSEMembershipServiceBeanInfo.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/pse/PSEPeerSecurityEngine.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/pse/PSESecurityEngineFactory.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/pse/PSEUtils.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/pse/StringAuthenticator.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/pse/URIKeyStoreManager.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/membership/pse/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/meter/ConditionalMeterBuildSettings.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/meter/GenericServiceMonitor.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/meter/MeterBuildSettings.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/meter/MetricUtilities.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/meter/MonitorManager.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/meter/ServiceMonitorImpl.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/meter/ServiceMonitorPulseInfo.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/meter/ServiceMonitorResource.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/monitor.properties delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/overview.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peer/PeerInfoHandler.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peer/PeerInfoMessenger.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peer/PeerInfoServiceImpl.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peer/PeerInfoServiceInterface.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peer/RemoteMonitorPeerInfoHandler.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peer/RemoteMonitorQuery.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peer/RemoteMonitorResponse.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peer/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peergroup/AutomaticConfigurator.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peergroup/Boot.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peergroup/CompatibilityEquater.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peergroup/ConfigDialog.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peergroup/DefaultConfigurator.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peergroup/GenericPeerGroup.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peergroup/IncompleteConfigurationException.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peergroup/NullConfigurator.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peergroup/PeerGroupInterface.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peergroup/Platform.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peergroup/PlatformConfigurator.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peergroup/RefCountPeerGroupInterface.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peergroup/ShadowPeerGroup.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peergroup/StdPeerGroup.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peergroup/StdPeerGroupParamAdv.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/peergroup/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/pipe/BlockingWireOutputPipe.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/pipe/InputPipeImpl.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/pipe/NonBlockingOutputPipe.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/pipe/NonBlockingWireOutputPipe.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/pipe/PipeRegistrar.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/pipe/PipeResolver.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/pipe/PipeServiceImpl.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/pipe/PipeServiceInterface.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/pipe/SecureInputPipeImpl.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/pipe/SecureOutputPipe.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/pipe/WireHeader.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/pipe/WirePipe.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/pipe/WirePipeImpl.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/pipe/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/AccessPointAdv.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/Certificate.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/CertificateSigningRequest.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/DiscoveryConfigAdv.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/DiscoveryQuery.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/DiscoveryResponse.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/GroupConfig.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/HTTPAdv.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/LeaseRequestMsg.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/LeaseResponseMsg.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/LimitedRangeRdvMsg.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/ModuleClassAdv.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/ModuleImplAdv.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/ModuleSpecAdv.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/PSEConfigAdv.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/PeerAdv.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/PeerGroupAdv.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/PeerGroupConfigAdv.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/PeerInfoQueryMsg.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/PeerInfoResponseMsg.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/PipeAdv.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/PipeResolverMsg.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/PlatformConfig.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/RdvAdv.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/RdvConfigAdv.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/RelayConfigAdv.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/ResolverQuery.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/ResolverResponse.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/ResolverSrdiMsgImpl.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/RouteAdv.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/RouteQuery.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/RouteResponse.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/SignedAdv.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/SrdiMessageImpl.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/TCPAdv.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/protocol/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/proxy/ProxyService.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/proxy/Requestor.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/PeerConnection.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/RdvGreeter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/RdvWalk.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/RdvWalker.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/RendezVousPropagateMessage.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/RendezVousServiceImpl.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/RendezVousServiceInterface.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/RendezVousServiceProvider.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/StdRendezVousService.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/adhoc/AdhocPeerRdvService.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/edge/EdgePeerRdvService.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/edge/RdvConnection.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/limited/LimitedRangeGreeter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/limited/LimitedRangeWalk.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/limited/LimitedRangeWalker.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/rdv/ClientConnection.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/rdv/RdvPeerRdvService.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/rendezvousMeter/ClientConnectionMeter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/rendezvousMeter/ClientConnectionMetric.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/rendezvousMeter/ConditionalRendezvousMeterBuildSettings.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/rendezvousMeter/RendezvousConnectionMeter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/rendezvousMeter/RendezvousConnectionMetric.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/rendezvousMeter/RendezvousMeter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/rendezvousMeter/RendezvousMeterBuildSettings.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/rendezvousMeter/RendezvousMetric.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/rendezvousMeter/RendezvousServiceMetric.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/rendezvousMeter/RendezvousServiceMonitor.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/rendezvousMeter/RendezvousServiceMonitorFilter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/rpv/PeerView.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/rpv/PeerViewDestination.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/rpv/PeerViewElement.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/rpv/PeerViewEvent.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/rpv/PeerViewListener.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/rpv/PeerViewRandomStrategy.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/rpv/PeerViewRandomWithReplaceStrategy.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/rpv/PeerViewSequentialStrategy.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/rpv/PeerViewStrategy.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/rendezvous/rpv/PeerviewSeedingManager.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/resolver/InternalQueryHandler.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/resolver/ResolverServiceImpl.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/resolver/ResolverServiceInterface.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/resolver/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/resolver/resolverMeter/ConditionalResolverMeterBuildSettings.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/resolver/resolverMeter/QueryDestinationMeter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/resolver/resolverMeter/QueryDestinationMetric.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/resolver/resolverMeter/QueryHandlerMeter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/resolver/resolverMeter/QueryHandlerMetric.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/resolver/resolverMeter/ResolverMeter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/resolver/resolverMeter/ResolverMeterBuildSettings.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/resolver/resolverMeter/ResolverMetric.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/resolver/resolverMeter/ResolverServiceMetric.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/resolver/resolverMeter/ResolverServiceMonitor.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/resolver/resolverMeter/ResolverServiceMonitorFilter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/resolver/resolverMeter/SrdiDestinationMeter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/resolver/resolverMeter/SrdiDestinationMetric.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/resolver/resolverMeter/SrdiHandlerMeter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/resolver/resolverMeter/SrdiHandlerMetric.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/ACLSeedingManager.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/AdvCooker.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/BASE64InputStream.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/BASE64OutputStream.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/Base64.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/Cache.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/CacheEntry.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/CacheEntryListener.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/ConsumerBiasedQueue.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/Dlink.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/Dlist.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/DynamicEnumeration.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/EndpointServiceStatsFilter.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/GenerateID.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/JxtaHash.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/LRUCache.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/ModuleManager.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/ProducerBiasedQueue.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/RdvAdvSeedingManager.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/ResourceAccount.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/ResourceDispatcher.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/SeedingManager.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/SequenceIterator.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/TimeUtils.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/TimerThreadNamer.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/URISeedingManager.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/UnbiasedQueue.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/cm/DumpCm.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/package.html delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/pipe/reliable/AdaptiveFlowControl.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/pipe/reliable/Defs.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/pipe/reliable/FixedFlowControl.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/pipe/reliable/FlowControl.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/pipe/reliable/Incoming.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/pipe/reliable/IncomingPipeAdaptor.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/pipe/reliable/Outgoing.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/pipe/reliable/OutgoingMsgrAdaptor.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/pipe/reliable/OutgoingPipeAdaptor.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/pipe/reliable/OutgoingPipeAdaptorSync.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/pipe/reliable/ReliableInputStream.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/util/pipe/reliable/ReliableOutputStream.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/Debug.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/core/DBException.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/core/DBObject.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/core/FaultCodes.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/core/data/Key.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/core/data/Record.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/core/data/RecordSet.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/core/data/Value.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/core/filer/BTree.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/core/filer/BTreeCallback.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/core/filer/BTreeCorruptException.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/core/filer/BTreeException.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/core/filer/BTreeFiler.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/core/filer/BTreeNotFoundException.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/core/filer/Filer.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/core/filer/FilerException.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/core/filer/MemFiler.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/core/filer/Paged.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/core/filer/Streamable.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/core/indexer/IndexQuery.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/core/indexer/Indexer.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/core/indexer/NameIndexer.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/util/Named.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/util/XindiceException.java delete mode 100644 p2pproxy/dependencies-src/jxse-src-2.5/impl/src/net/jxta/impl/xindice/util/XindiceRuntimeException.java delete mode 100644 p2pproxy/dependencies/MJSIP.COPYRIGHT.txt delete mode 100644 p2pproxy/dependencies/bcprov-jdk14.jar delete mode 100644 p2pproxy/dependencies/bouncycastle-LICENSE.txt delete mode 100644 p2pproxy/dependencies/javax.servlet.jar delete mode 100644 p2pproxy/dependencies/jstun-0.7.0.jar delete mode 100644 p2pproxy/dependencies/junit-4.3.1.jar delete mode 100644 p2pproxy/dependencies/jxta_license.html delete mode 100644 p2pproxy/dependencies/log4j.LICENSE delete mode 100644 p2pproxy/dependencies/log4j.jar delete mode 100644 p2pproxy/dependencies/org.mortbay.jetty.jar delete mode 100644 p2pproxy/dependencies/sip.jar delete mode 100644 p2pproxy/launcher/.cdtproject delete mode 100644 p2pproxy/launcher/.cproject delete mode 100644 p2pproxy/launcher/.project delete mode 100644 p2pproxy/launcher/.settings/org.eclipse.cdt.core.prefs delete mode 100644 p2pproxy/launcher/Debug/makefile delete mode 100644 p2pproxy/launcher/Debug/objects.mk delete mode 100644 p2pproxy/launcher/Debug/sources.mk delete mode 100644 p2pproxy/launcher/Debug/src/launcher-tester.d delete mode 100644 p2pproxy/launcher/Debug/src/p2pproxy.d delete mode 100644 p2pproxy/launcher/Debug/src/p2pproxy_wrap.d delete mode 100644 p2pproxy/launcher/Debug/src/subdir.mk delete mode 100644 p2pproxy/launcher/Makefile.am delete mode 100644 p2pproxy/launcher/src/Makefile.am delete mode 100644 p2pproxy/launcher/src/launcher-tester.c delete mode 100644 p2pproxy/launcher/src/p2pproxy.c delete mode 100644 p2pproxy/launcher/src/p2pproxy.h delete mode 100644 p2pproxy/log4j.properties delete mode 100644 p2pproxy/plugin-src/Makefile.am delete mode 100644 p2pproxy/plugin-src/fonis.c delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/api/P2pProxyException.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/api/P2pProxyInstance.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/api/P2pProxyManagement.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/api/P2pProxyNetworkProbe.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/api/P2pProxyNotReadyException.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/api/P2pProxyResourceManagement.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/api/P2pProxyRtpRelayManagement.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/api/P2pProxyUserAlreadyExistException.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/api/P2pProxyUserNotFoundException.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/Configurator.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/EdgePeerServiceManager.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/GenericService.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/GenericServiceClient.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/GenericUdpSession.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/JxtaNetworkManager.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/MessageDispatcher.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/P2pProxyAccountManagement.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/P2pProxyAccountManagementMBean.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/P2pProxyAdvertisementNotFoundException.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/P2pProxyInstanceImpl.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/P2pProxyMain.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/P2pProxyMainMBean.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/P2pProxyManagementImpl.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/P2pProxyResourceManagementImpl.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/P2pUserProfileAdvertisement.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/SeedingPeerServiceManager.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/ServiceProvider.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/SuperPeerServiceManager.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/jxtaext/EndpointRegistry.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/jxtaext/NatedEndPointAddress.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/media/MediaResourceService.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/media/MediaResoureUnreachableException.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/media/jxtaudpproxy/RtpSession.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/media/jxtaudpproxy/RtpSessionImpl.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/media/jxtaudpproxy/SdpProcessorImpl.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/media/jxtaudpproxy/UdpSession.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/media/rtprelay/AddressRequest.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/media/rtprelay/AddressResponse.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/media/rtprelay/IceSdpProcessorImpl.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/media/rtprelay/MediaType.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/media/rtprelay/RouteAddRequest.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/media/rtprelay/RouteAddResponse.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/media/rtprelay/RoutingTable.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/media/rtprelay/RtpRelayServer.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/media/rtprelay/RtpRelayServerConfig.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/media/rtprelay/RtpRoutingRules.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/media/rtprelay/SdpProcessorImpl.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/media/rtprelay/SingleAddressResponse.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/rdvautoconfig/AutoConfigService.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/rdvautoconfig/P2pproxyRdvListener.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/rdvautoconfig/PeerInfoProvider.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/rdvautoconfig/PeerInfoProviderService.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/rdvautoconfig/PeerInfoServiceClient.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/rdvautoconfig/PublicIpAddressRequest.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/rdvautoconfig/PublicIpAddressResponse.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/rdvautoconfig/SocketProbeRequest.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/NetworkResourceAdvertisement.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/RegistrationHandler.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/SdpProcessor.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/SipProxy.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/SipProxyRegistrar.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/SipProxyRegistrarMBean.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/SipUtils.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/peers/JxtaSipProxy.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/peers/NetworkResources.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/superpeers/JxtaNetworkResources.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/superpeers/P2pUserRegistrationAdvertisement.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/superpeers/SuperPeerProxy.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/stun/AddressInfo.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/stun/DiscoveryInfo.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/stun/StunClient.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/stun/StunServer.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/utils/AccountManagerCli.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/utils/DumpLocalCache.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/utils/Excecutor.java delete mode 100644 p2pproxy/src/org/linphone/p2pproxy/core/utils/PeerGroupIdGenerator.java delete mode 100644 p2pproxy/test-src/org/linphone/p2pproxy/test/P2pAutoConfigTester.java delete mode 100644 p2pproxy/test-src/org/linphone/p2pproxy/test/P2pProxyAccountManagementTester.java delete mode 100644 p2pproxy/test-src/org/linphone/p2pproxy/test/P2pProxyNatedNetworkTester.java delete mode 100644 p2pproxy/test-src/org/linphone/p2pproxy/test/P2pProxyNetworkingTester.java delete mode 100644 p2pproxy/test-src/org/linphone/p2pproxy/test/P2pProxyTester.java delete mode 100644 p2pproxy/test-src/org/linphone/p2pproxy/test/RtpRelayServerTester.java delete mode 100644 p2pproxy/test-src/org/linphone/p2pproxy/test/StunServerTester.java delete mode 100644 p2pproxy/test-src/org/linphone/p2pproxy/test/UdpRelayTester.java delete mode 100644 p2pproxy/test-src/org/linphone/p2pproxy/test/utils/DefaultCallListener.java delete mode 100644 p2pproxy/test-src/org/linphone/p2pproxy/test/utils/P2pNetwork.java delete mode 100644 p2pproxy/test-src/org/linphone/p2pproxy/test/utils/SipClient.java delete mode 100644 p2pproxy/test-src/org/linphone/p2pproxy/test/utils/UserInstance.java rename {linphone/pixmaps => pixmaps}/.gitignore (100%) rename {linphone/pixmaps => pixmaps}/Makefile.am (100%) rename {linphone/pixmaps => pixmaps}/green.png (100%) rename {linphone/pixmaps => pixmaps}/linphone.png (100%) rename {linphone/pixmaps => pixmaps}/linphone2.png (100%) rename {linphone/pixmaps => pixmaps}/linphone2.xpm (100%) rename {linphone/pixmaps => pixmaps}/mic_active.png (100%) rename {linphone/pixmaps => pixmaps}/mic_muted.png (100%) rename {linphone/pixmaps => pixmaps}/red.png (100%) rename {linphone/pixmaps => pixmaps}/sip-away.png (100%) rename {linphone/pixmaps => pixmaps}/sip-bifm.png (100%) rename {linphone/pixmaps => pixmaps}/sip-busy.png (100%) rename {linphone/pixmaps => pixmaps}/sip-closed.png (100%) rename {linphone/pixmaps => pixmaps}/sip-online.png (100%) rename {linphone/pixmaps => pixmaps}/sip-otl.png (100%) rename {linphone/pixmaps => pixmaps}/sip-otp.png (100%) rename {linphone/pixmaps => pixmaps}/sip-wfa.png (100%) rename {linphone/po => po}/.gitignore (100%) rename {linphone/po => po}/ChangeLog (100%) rename {linphone/po => po}/Makefile.in.in (100%) rename {linphone/po => po}/Makevars (100%) rename {linphone/po => po}/Makevars.template (100%) rename {linphone/po => po}/POTFILES.in (100%) rename {linphone/po => po}/POTFILES.skip (100%) rename {linphone/po => po}/Rules-quot (100%) rename {linphone/po => po}/boldquot.sed (100%) rename {linphone/po => po}/cat-id-tbl.c (100%) rename {linphone/po => po}/cs.po (100%) rename {linphone/po => po}/de.po (100%) rename {linphone/po => po}/en@boldquot.header (100%) rename {linphone/po => po}/en@quot.header (100%) rename {linphone/po => po}/es.po (100%) rename {linphone/po => po}/fr.po (100%) rename {linphone/po => po}/hu.po (100%) rename {linphone/po => po}/insert-header.sin (100%) rename {linphone/po => po}/it.po (100%) rename {linphone/po => po}/ja.po (100%) rename {linphone/po => po}/nl.po (100%) rename {linphone/po => po}/pl.po (100%) rename {linphone/po => po}/pt_BR.po (100%) rename {linphone/po => po}/quot.sed (100%) rename {linphone/po => po}/remove-potcdate.sin (100%) rename {linphone/po => po}/ru.po (100%) rename {linphone/po => po}/sv.po (100%) rename {linphone/po => po}/zh_CN.po (100%) rename {linphone/scripts => scripts}/Makefile.am (100%) rename {linphone/scripts => scripts}/Portfile-devel.tmpl (100%) rename {linphone/scripts => scripts}/Portfile.tmpl (100%) rename {linphone/scripts => scripts}/builder-mingw.mk (100%) rename {linphone/share => share}/.gitignore (100%) rename {linphone/share => share}/C/.gitignore (100%) rename {linphone/share => share}/C/Makefile.am (100%) rename {linphone/share => share}/C/linphone.1 (100%) rename {linphone/share => share}/C/linphonec.1 (100%) rename {linphone/share => share}/C/linphonecsh.1 (100%) rename {linphone/share => share}/C/manual.lyx (100%) rename {linphone/share => share}/C/manual.sgml (100%) rename {linphone/share => share}/C/sipomatic.1 (100%) rename {linphone/share => share}/Makefile.am (100%) rename {linphone/share => share}/Makefile.inc (100%) rename {linphone/share => share}/cs/.gitignore (100%) rename {linphone/share => share}/cs/Makefile.am (100%) rename {linphone/share => share}/cs/linphone.1 (100%) rename {linphone/share => share}/cs/linphonec.1 (100%) rename {linphone/share => share}/cs/sipomatic.1 (100%) rename {linphone/share => share}/fr/.gitignore (100%) rename {linphone/share => share}/fr/Makefile.am (100%) rename {linphone/share => share}/fr/manual.lyx (100%) rename {linphone/share => share}/fr/manual.sgml (100%) rename {linphone/share => share}/hello16000.wav (100%) rename {linphone/share => share}/hello8000.wav (100%) rename {linphone/share => share}/it/.gitignore (100%) rename {linphone/share => share}/it/Makefile.am (100%) rename {linphone/share => share}/it/manual.lyx (100%) rename {linphone/share => share}/it/manual.sgml (100%) rename {linphone/share => share}/ja/.gitignore (100%) rename {linphone/share => share}/ja/Makefile.am (100%) rename {linphone/share => share}/ja/manual.lyx (100%) rename {linphone/share => share}/ja/manual.sgml (100%) rename {linphone/share => share}/linphone.desktop (100%) rename {linphone/share => share}/linphone.gnorba (100%) rename {linphone/share => share}/linphone.pc.in (100%) rename {linphone/share => share}/linphone_applet.desktop (100%) rename {linphone/share => share}/ringback.wav (100%) rename {linphone/share => share}/rings/bigben.wav (100%) rename {linphone/share => share}/rings/oldphone.wav (100%) rename {linphone/share => share}/rings/orig.wav (100%) rename {linphone/share => share}/rings/rock.wav (100%) rename {linphone/share => share}/rings/sweet.wav (100%) rename {linphone/share => share}/rings/synth.wav (100%) rename {linphone/share => share}/rings/tapping.wav (100%) rename {linphone/share => share}/rings/toy.wav (100%) rename linphone/stamp-h.in => stamp-h.in (100%) diff --git a/.gitmodules b/.gitmodules index 98a346518..4e701d076 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "linphone/oRTP"] - path = linphone/oRTP + path = oRTP url = git://git.linphone.org/ortp.git [submodule "linphone/mediastreamer2"] - path = linphone/mediastreamer2 + path = mediastreamer2 url = git://git.linphone.org/mediastreamer2.git diff --git a/linphone/ABOUT-NLS b/ABOUT-NLS similarity index 100% rename from linphone/ABOUT-NLS rename to ABOUT-NLS diff --git a/linphone/AUTHORS b/AUTHORS similarity index 100% rename from linphone/AUTHORS rename to AUTHORS diff --git a/linphone/BUGS b/BUGS similarity index 100% rename from linphone/BUGS rename to BUGS diff --git a/linphone/COPYING b/COPYING similarity index 100% rename from linphone/COPYING rename to COPYING diff --git a/linphone/ChangeLog b/ChangeLog similarity index 100% rename from linphone/ChangeLog rename to ChangeLog diff --git a/linphone/Makefile.am b/Makefile.am similarity index 100% rename from linphone/Makefile.am rename to Makefile.am diff --git a/linphone/NEWS b/NEWS similarity index 100% rename from linphone/NEWS rename to NEWS diff --git a/linphone/README b/README similarity index 100% rename from linphone/README rename to README diff --git a/linphone/README.M68k.txt b/README.M68k.txt similarity index 100% rename from linphone/README.M68k.txt rename to README.M68k.txt diff --git a/linphone/README.arm b/README.arm similarity index 100% rename from linphone/README.arm rename to README.arm diff --git a/linphone/README.macos b/README.macos similarity index 100% rename from linphone/README.macos rename to README.macos diff --git a/linphone/README.mingw b/README.mingw similarity index 100% rename from linphone/README.mingw rename to README.mingw diff --git a/linphone/TODO b/TODO similarity index 100% rename from linphone/TODO rename to TODO diff --git a/linphone/autogen.sh b/autogen.sh similarity index 100% rename from linphone/autogen.sh rename to autogen.sh diff --git a/linphone/build/wince/liblinphone.sln b/build/wince/liblinphone.sln similarity index 100% rename from linphone/build/wince/liblinphone.sln rename to build/wince/liblinphone.sln diff --git a/linphone/build/wince/liblinphone.vcproj b/build/wince/liblinphone.vcproj similarity index 100% rename from linphone/build/wince/liblinphone.vcproj rename to build/wince/liblinphone.vcproj diff --git a/linphone/build/wince/linphonec/linphonec.vcproj b/build/wince/linphonec/linphonec.vcproj similarity index 100% rename from linphone/build/wince/linphonec/linphonec.vcproj rename to build/wince/linphonec/linphonec.vcproj diff --git a/linphone/config.rpath b/config.rpath similarity index 100% rename from linphone/config.rpath rename to config.rpath diff --git a/linphone/configure.in b/configure.in similarity index 100% rename from linphone/configure.in rename to configure.in diff --git a/linphone/console/.gitignore b/console/.gitignore similarity index 100% rename from linphone/console/.gitignore rename to console/.gitignore diff --git a/linphone/console/Makefile.am b/console/Makefile.am similarity index 100% rename from linphone/console/Makefile.am rename to console/Makefile.am diff --git a/linphone/console/TODO b/console/TODO similarity index 100% rename from linphone/console/TODO rename to console/TODO diff --git a/linphone/console/commands.c b/console/commands.c similarity index 100% rename from linphone/console/commands.c rename to console/commands.c diff --git a/linphone/console/example/linphonec b/console/example/linphonec similarity index 100% rename from linphone/console/example/linphonec rename to console/example/linphonec diff --git a/linphone/console/linphonec.c b/console/linphonec.c similarity index 100% rename from linphone/console/linphonec.c rename to console/linphonec.c diff --git a/linphone/console/linphonec.h b/console/linphonec.h similarity index 100% rename from linphone/console/linphonec.h rename to console/linphonec.h diff --git a/linphone/console/shell.c b/console/shell.c similarity index 100% rename from linphone/console/shell.c rename to console/shell.c diff --git a/linphone/console/sipomatic.c b/console/sipomatic.c similarity index 100% rename from linphone/console/sipomatic.c rename to console/sipomatic.c diff --git a/linphone/console/sipomatic.h b/console/sipomatic.h similarity index 100% rename from linphone/console/sipomatic.h rename to console/sipomatic.h diff --git a/linphone/console/wav2raw.c b/console/wav2raw.c similarity index 100% rename from linphone/console/wav2raw.c rename to console/wav2raw.c diff --git a/linphone/coreapi/.gitignore b/coreapi/.gitignore similarity index 100% rename from linphone/coreapi/.gitignore rename to coreapi/.gitignore diff --git a/linphone/coreapi/Makefile.am b/coreapi/Makefile.am similarity index 100% rename from linphone/coreapi/Makefile.am rename to coreapi/Makefile.am diff --git a/linphone/coreapi/address.c b/coreapi/address.c similarity index 100% rename from linphone/coreapi/address.c rename to coreapi/address.c diff --git a/linphone/coreapi/authentication.c b/coreapi/authentication.c similarity index 100% rename from linphone/coreapi/authentication.c rename to coreapi/authentication.c diff --git a/linphone/coreapi/chat.c b/coreapi/chat.c similarity index 100% rename from linphone/coreapi/chat.c rename to coreapi/chat.c diff --git a/linphone/coreapi/enum.c b/coreapi/enum.c similarity index 100% rename from linphone/coreapi/enum.c rename to coreapi/enum.c diff --git a/linphone/coreapi/enum.h b/coreapi/enum.h similarity index 100% rename from linphone/coreapi/enum.h rename to coreapi/enum.h diff --git a/linphone/coreapi/exevents.c b/coreapi/exevents.c similarity index 100% rename from linphone/coreapi/exevents.c rename to coreapi/exevents.c diff --git a/linphone/coreapi/exevents.h b/coreapi/exevents.h similarity index 100% rename from linphone/coreapi/exevents.h rename to coreapi/exevents.h diff --git a/linphone/coreapi/fonis.c b/coreapi/fonis.c similarity index 100% rename from linphone/coreapi/fonis.c rename to coreapi/fonis.c diff --git a/linphone/coreapi/friend.c b/coreapi/friend.c similarity index 100% rename from linphone/coreapi/friend.c rename to coreapi/friend.c diff --git a/linphone/coreapi/general_state.c b/coreapi/general_state.c similarity index 100% rename from linphone/coreapi/general_state.c rename to coreapi/general_state.c diff --git a/linphone/coreapi/help/Doxyfile.in b/coreapi/help/Doxyfile.in similarity index 100% rename from linphone/coreapi/help/Doxyfile.in rename to coreapi/help/Doxyfile.in diff --git a/linphone/coreapi/help/Makefile.am b/coreapi/help/Makefile.am similarity index 100% rename from linphone/coreapi/help/Makefile.am rename to coreapi/help/Makefile.am diff --git a/linphone/coreapi/help/doxygen.dox.in b/coreapi/help/doxygen.dox.in similarity index 100% rename from linphone/coreapi/help/doxygen.dox.in rename to coreapi/help/doxygen.dox.in diff --git a/linphone/coreapi/linphonecore.c b/coreapi/linphonecore.c similarity index 100% rename from linphone/coreapi/linphonecore.c rename to coreapi/linphonecore.c diff --git a/linphone/coreapi/linphonecore.h b/coreapi/linphonecore.h similarity index 100% rename from linphone/coreapi/linphonecore.h rename to coreapi/linphonecore.h diff --git a/linphone/coreapi/lpconfig.c b/coreapi/lpconfig.c similarity index 100% rename from linphone/coreapi/lpconfig.c rename to coreapi/lpconfig.c diff --git a/linphone/coreapi/lpconfig.h b/coreapi/lpconfig.h similarity index 100% rename from linphone/coreapi/lpconfig.h rename to coreapi/lpconfig.h diff --git a/linphone/coreapi/misc.c b/coreapi/misc.c similarity index 100% rename from linphone/coreapi/misc.c rename to coreapi/misc.c diff --git a/linphone/coreapi/plugins/buddylookup/AUTHORS b/coreapi/plugins/buddylookup/AUTHORS similarity index 100% rename from linphone/coreapi/plugins/buddylookup/AUTHORS rename to coreapi/plugins/buddylookup/AUTHORS diff --git a/linphone/coreapi/plugins/buddylookup/COPYING b/coreapi/plugins/buddylookup/COPYING similarity index 100% rename from linphone/coreapi/plugins/buddylookup/COPYING rename to coreapi/plugins/buddylookup/COPYING diff --git a/linphone/coreapi/plugins/buddylookup/ChangeLog b/coreapi/plugins/buddylookup/ChangeLog similarity index 100% rename from linphone/coreapi/plugins/buddylookup/ChangeLog rename to coreapi/plugins/buddylookup/ChangeLog diff --git a/linphone/coreapi/plugins/buddylookup/INSTALL b/coreapi/plugins/buddylookup/INSTALL similarity index 100% rename from linphone/coreapi/plugins/buddylookup/INSTALL rename to coreapi/plugins/buddylookup/INSTALL diff --git a/linphone/coreapi/plugins/buddylookup/Makefile.am b/coreapi/plugins/buddylookup/Makefile.am similarity index 100% rename from linphone/coreapi/plugins/buddylookup/Makefile.am rename to coreapi/plugins/buddylookup/Makefile.am diff --git a/linphone/coreapi/plugins/buddylookup/NEWS b/coreapi/plugins/buddylookup/NEWS similarity index 100% rename from linphone/coreapi/plugins/buddylookup/NEWS rename to coreapi/plugins/buddylookup/NEWS diff --git a/linphone/coreapi/plugins/buddylookup/README b/coreapi/plugins/buddylookup/README similarity index 100% rename from linphone/coreapi/plugins/buddylookup/README rename to coreapi/plugins/buddylookup/README diff --git a/linphone/coreapi/plugins/buddylookup/autogen.sh b/coreapi/plugins/buddylookup/autogen.sh similarity index 100% rename from linphone/coreapi/plugins/buddylookup/autogen.sh rename to coreapi/plugins/buddylookup/autogen.sh diff --git a/linphone/coreapi/plugins/buddylookup/configure.ac b/coreapi/plugins/buddylookup/configure.ac similarity index 100% rename from linphone/coreapi/plugins/buddylookup/configure.ac rename to coreapi/plugins/buddylookup/configure.ac diff --git a/linphone/coreapi/plugins/buddylookup/src/Makefile.am b/coreapi/plugins/buddylookup/src/Makefile.am similarity index 100% rename from linphone/coreapi/plugins/buddylookup/src/Makefile.am rename to coreapi/plugins/buddylookup/src/Makefile.am diff --git a/linphone/coreapi/plugins/buddylookup/src/lookup.c b/coreapi/plugins/buddylookup/src/lookup.c similarity index 100% rename from linphone/coreapi/plugins/buddylookup/src/lookup.c rename to coreapi/plugins/buddylookup/src/lookup.c diff --git a/linphone/coreapi/presence.c b/coreapi/presence.c similarity index 100% rename from linphone/coreapi/presence.c rename to coreapi/presence.c diff --git a/linphone/coreapi/private.h b/coreapi/private.h similarity index 100% rename from linphone/coreapi/private.h rename to coreapi/private.h diff --git a/linphone/coreapi/proxy.c b/coreapi/proxy.c similarity index 100% rename from linphone/coreapi/proxy.c rename to coreapi/proxy.c diff --git a/linphone/coreapi/sdphandler.c b/coreapi/sdphandler.c similarity index 100% rename from linphone/coreapi/sdphandler.c rename to coreapi/sdphandler.c diff --git a/linphone/coreapi/sdphandler.h b/coreapi/sdphandler.h similarity index 100% rename from linphone/coreapi/sdphandler.h rename to coreapi/sdphandler.h diff --git a/linphone/coreapi/siplogin.c b/coreapi/siplogin.c similarity index 100% rename from linphone/coreapi/siplogin.c rename to coreapi/siplogin.c diff --git a/linphone/coreapi/sipsetup.c b/coreapi/sipsetup.c similarity index 100% rename from linphone/coreapi/sipsetup.c rename to coreapi/sipsetup.c diff --git a/linphone/coreapi/sipsetup.h b/coreapi/sipsetup.h similarity index 100% rename from linphone/coreapi/sipsetup.h rename to coreapi/sipsetup.h diff --git a/linphone/gen-gtkfilelist.sh b/gen-gtkfilelist.sh similarity index 100% rename from linphone/gen-gtkfilelist.sh rename to gen-gtkfilelist.sh diff --git a/linphone/gtk+-2.16.2.filelist b/gtk+-2.16.2.filelist similarity index 100% rename from linphone/gtk+-2.16.2.filelist rename to gtk+-2.16.2.filelist diff --git a/linphone/gtk+-2.16.6.filelist b/gtk+-2.16.6.filelist similarity index 100% rename from linphone/gtk+-2.16.6.filelist rename to gtk+-2.16.6.filelist diff --git a/linphone/gtk+-2.18.5.filelist b/gtk+-2.18.5.filelist similarity index 100% rename from linphone/gtk+-2.18.5.filelist rename to gtk+-2.18.5.filelist diff --git a/linphone/gtk-glade/.gitignore b/gtk-glade/.gitignore similarity index 100% rename from linphone/gtk-glade/.gitignore rename to gtk-glade/.gitignore diff --git a/linphone/gtk-glade/Makefile.am b/gtk-glade/Makefile.am similarity index 100% rename from linphone/gtk-glade/Makefile.am rename to gtk-glade/Makefile.am diff --git a/linphone/gtk-glade/about.glade b/gtk-glade/about.glade similarity index 100% rename from linphone/gtk-glade/about.glade rename to gtk-glade/about.glade diff --git a/linphone/gtk-glade/buddylookup.c b/gtk-glade/buddylookup.c similarity index 100% rename from linphone/gtk-glade/buddylookup.c rename to gtk-glade/buddylookup.c diff --git a/linphone/gtk-glade/buddylookup.glade b/gtk-glade/buddylookup.glade similarity index 100% rename from linphone/gtk-glade/buddylookup.glade rename to gtk-glade/buddylookup.glade diff --git a/linphone/gtk-glade/call_logs.glade b/gtk-glade/call_logs.glade similarity index 100% rename from linphone/gtk-glade/call_logs.glade rename to gtk-glade/call_logs.glade diff --git a/linphone/gtk-glade/calllogs.c b/gtk-glade/calllogs.c similarity index 100% rename from linphone/gtk-glade/calllogs.c rename to gtk-glade/calllogs.c diff --git a/linphone/gtk-glade/chat.c b/gtk-glade/chat.c similarity index 100% rename from linphone/gtk-glade/chat.c rename to gtk-glade/chat.c diff --git a/linphone/gtk-glade/chatroom.glade b/gtk-glade/chatroom.glade similarity index 100% rename from linphone/gtk-glade/chatroom.glade rename to gtk-glade/chatroom.glade diff --git a/linphone/gtk-glade/contact.glade b/gtk-glade/contact.glade similarity index 100% rename from linphone/gtk-glade/contact.glade rename to gtk-glade/contact.glade diff --git a/linphone/gtk-glade/fonis.c b/gtk-glade/fonis.c similarity index 100% rename from linphone/gtk-glade/fonis.c rename to gtk-glade/fonis.c diff --git a/linphone/gtk-glade/friendlist.c b/gtk-glade/friendlist.c similarity index 100% rename from linphone/gtk-glade/friendlist.c rename to gtk-glade/friendlist.c diff --git a/linphone/gtk-glade/gtkrc b/gtk-glade/gtkrc similarity index 100% rename from linphone/gtk-glade/gtkrc rename to gtk-glade/gtkrc diff --git a/linphone/gtk-glade/incall_view.c b/gtk-glade/incall_view.c similarity index 100% rename from linphone/gtk-glade/incall_view.c rename to gtk-glade/incall_view.c diff --git a/linphone/gtk-glade/incoming_call.glade b/gtk-glade/incoming_call.glade similarity index 100% rename from linphone/gtk-glade/incoming_call.glade rename to gtk-glade/incoming_call.glade diff --git a/linphone/gtk-glade/linphone.h b/gtk-glade/linphone.h similarity index 100% rename from linphone/gtk-glade/linphone.h rename to gtk-glade/linphone.h diff --git a/linphone/gtk-glade/linphone.ico b/gtk-glade/linphone.ico similarity index 100% rename from linphone/gtk-glade/linphone.ico rename to gtk-glade/linphone.ico diff --git a/linphone/gtk-glade/linphone.iss b/gtk-glade/linphone.iss similarity index 100% rename from linphone/gtk-glade/linphone.iss rename to gtk-glade/linphone.iss diff --git a/linphone/gtk-glade/linphone.png b/gtk-glade/linphone.png similarity index 100% rename from linphone/gtk-glade/linphone.png rename to gtk-glade/linphone.png diff --git a/linphone/gtk-glade/linphone.rc b/gtk-glade/linphone.rc similarity index 100% rename from linphone/gtk-glade/linphone.rc rename to gtk-glade/linphone.rc diff --git a/linphone/gtk-glade/linphone2.png b/gtk-glade/linphone2.png similarity index 100% rename from linphone/gtk-glade/linphone2.png rename to gtk-glade/linphone2.png diff --git a/linphone/gtk-glade/log.glade b/gtk-glade/log.glade similarity index 100% rename from linphone/gtk-glade/log.glade rename to gtk-glade/log.glade diff --git a/linphone/gtk-glade/logging.c b/gtk-glade/logging.c similarity index 100% rename from linphone/gtk-glade/logging.c rename to gtk-glade/logging.c diff --git a/linphone/gtk-glade/loginframe.c b/gtk-glade/loginframe.c similarity index 100% rename from linphone/gtk-glade/loginframe.c rename to gtk-glade/loginframe.c diff --git a/linphone/gtk-glade/main.c b/gtk-glade/main.c similarity index 100% rename from linphone/gtk-glade/main.c rename to gtk-glade/main.c diff --git a/linphone/gtk-glade/main.glade b/gtk-glade/main.glade similarity index 100% rename from linphone/gtk-glade/main.glade rename to gtk-glade/main.glade diff --git a/linphone/gtk-glade/p2pwizard.glade b/gtk-glade/p2pwizard.glade similarity index 100% rename from linphone/gtk-glade/p2pwizard.glade rename to gtk-glade/p2pwizard.glade diff --git a/linphone/gtk-glade/parameters.glade b/gtk-glade/parameters.glade similarity index 100% rename from linphone/gtk-glade/parameters.glade rename to gtk-glade/parameters.glade diff --git a/linphone/gtk-glade/password.glade b/gtk-glade/password.glade similarity index 100% rename from linphone/gtk-glade/password.glade rename to gtk-glade/password.glade diff --git a/linphone/gtk-glade/propertybox.c b/gtk-glade/propertybox.c similarity index 100% rename from linphone/gtk-glade/propertybox.c rename to gtk-glade/propertybox.c diff --git a/linphone/gtk-glade/setupwizard.c b/gtk-glade/setupwizard.c similarity index 100% rename from linphone/gtk-glade/setupwizard.c rename to gtk-glade/setupwizard.c diff --git a/linphone/gtk-glade/sip_account.glade b/gtk-glade/sip_account.glade similarity index 100% rename from linphone/gtk-glade/sip_account.glade rename to gtk-glade/sip_account.glade diff --git a/linphone/gtk-glade/stock_people.png b/gtk-glade/stock_people.png similarity index 100% rename from linphone/gtk-glade/stock_people.png rename to gtk-glade/stock_people.png diff --git a/linphone/gtk-glade/support.c b/gtk-glade/support.c similarity index 100% rename from linphone/gtk-glade/support.c rename to gtk-glade/support.c diff --git a/linphone/gtk-glade/update.c b/gtk-glade/update.c similarity index 100% rename from linphone/gtk-glade/update.c rename to gtk-glade/update.c diff --git a/linphone/gtk-glade/utils.c b/gtk-glade/utils.c similarity index 100% rename from linphone/gtk-glade/utils.c rename to gtk-glade/utils.c diff --git a/linphone/gtk-glade/waiting.glade b/gtk-glade/waiting.glade similarity index 100% rename from linphone/gtk-glade/waiting.glade rename to gtk-glade/waiting.glade diff --git a/linphone/intl/ChangeLog b/intl/ChangeLog similarity index 100% rename from linphone/intl/ChangeLog rename to intl/ChangeLog diff --git a/linphone/intl/Makefile.in b/intl/Makefile.in similarity index 100% rename from linphone/intl/Makefile.in rename to intl/Makefile.in diff --git a/linphone/intl/VERSION b/intl/VERSION similarity index 100% rename from linphone/intl/VERSION rename to intl/VERSION diff --git a/linphone/intl/bindtextdom.c b/intl/bindtextdom.c similarity index 100% rename from linphone/intl/bindtextdom.c rename to intl/bindtextdom.c diff --git a/linphone/intl/cat-compat.c b/intl/cat-compat.c similarity index 100% rename from linphone/intl/cat-compat.c rename to intl/cat-compat.c diff --git a/linphone/intl/dcgettext.c b/intl/dcgettext.c similarity index 100% rename from linphone/intl/dcgettext.c rename to intl/dcgettext.c diff --git a/linphone/intl/dgettext.c b/intl/dgettext.c similarity index 100% rename from linphone/intl/dgettext.c rename to intl/dgettext.c diff --git a/linphone/intl/explodename.c b/intl/explodename.c similarity index 100% rename from linphone/intl/explodename.c rename to intl/explodename.c diff --git a/linphone/intl/finddomain.c b/intl/finddomain.c similarity index 100% rename from linphone/intl/finddomain.c rename to intl/finddomain.c diff --git a/linphone/intl/gettext.c b/intl/gettext.c similarity index 100% rename from linphone/intl/gettext.c rename to intl/gettext.c diff --git a/linphone/intl/gettext.h b/intl/gettext.h similarity index 100% rename from linphone/intl/gettext.h rename to intl/gettext.h diff --git a/linphone/intl/gettextP.h b/intl/gettextP.h similarity index 100% rename from linphone/intl/gettextP.h rename to intl/gettextP.h diff --git a/linphone/intl/hash-string.h b/intl/hash-string.h similarity index 100% rename from linphone/intl/hash-string.h rename to intl/hash-string.h diff --git a/linphone/intl/intl-compat.c b/intl/intl-compat.c similarity index 100% rename from linphone/intl/intl-compat.c rename to intl/intl-compat.c diff --git a/linphone/intl/l10nflist.c b/intl/l10nflist.c similarity index 100% rename from linphone/intl/l10nflist.c rename to intl/l10nflist.c diff --git a/linphone/intl/libgettext.h b/intl/libgettext.h similarity index 100% rename from linphone/intl/libgettext.h rename to intl/libgettext.h diff --git a/linphone/intl/linux-msg.sed b/intl/linux-msg.sed similarity index 100% rename from linphone/intl/linux-msg.sed rename to intl/linux-msg.sed diff --git a/linphone/intl/loadinfo.h b/intl/loadinfo.h similarity index 100% rename from linphone/intl/loadinfo.h rename to intl/loadinfo.h diff --git a/linphone/intl/loadmsgcat.c b/intl/loadmsgcat.c similarity index 100% rename from linphone/intl/loadmsgcat.c rename to intl/loadmsgcat.c diff --git a/linphone/intl/localealias.c b/intl/localealias.c similarity index 100% rename from linphone/intl/localealias.c rename to intl/localealias.c diff --git a/linphone/intl/po2tbl.sed.in b/intl/po2tbl.sed.in similarity index 100% rename from linphone/intl/po2tbl.sed.in rename to intl/po2tbl.sed.in diff --git a/linphone/intl/textdomain.c b/intl/textdomain.c similarity index 100% rename from linphone/intl/textdomain.c rename to intl/textdomain.c diff --git a/linphone/intl/xopen-msg.sed b/intl/xopen-msg.sed similarity index 100% rename from linphone/intl/xopen-msg.sed rename to intl/xopen-msg.sed diff --git a/linphone/intltool-extract.in b/intltool-extract.in similarity index 100% rename from linphone/intltool-extract.in rename to intltool-extract.in diff --git a/linphone/intltool-merge.in b/intltool-merge.in similarity index 100% rename from linphone/intltool-merge.in rename to intltool-merge.in diff --git a/linphone/intltool-update.in b/intltool-update.in similarity index 100% rename from linphone/intltool-update.in rename to intltool-update.in diff --git a/linphone/linphone-deps.filelist b/linphone-deps.filelist similarity index 100% rename from linphone/linphone-deps.filelist rename to linphone-deps.filelist diff --git a/linphone/linphone.iss.in b/linphone.iss.in similarity index 100% rename from linphone/linphone.iss.in rename to linphone.iss.in diff --git a/linphone/linphone.kdevelop b/linphone.kdevelop similarity index 100% rename from linphone/linphone.kdevelop rename to linphone.kdevelop diff --git a/linphone/linphone.spec.in b/linphone.spec.in similarity index 100% rename from linphone/linphone.spec.in rename to linphone.spec.in diff --git a/linphone/mingw-envsetup.sh b/linphone/mingw-envsetup.sh deleted file mode 100644 index 9f79d8976..000000000 --- a/linphone/mingw-envsetup.sh +++ /dev/null @@ -1,5 +0,0 @@ -export PATH=$PATH:"${PROGRAMFILES}\GnuWin32\bin":"${PROGRAMFILES}\Inno Setup 5" -export PERL=/c/Perl/bin/perl.exe -export INTLTOOL_PERL=/c/Perl/bin/perl.exe - - diff --git a/linphone/m4/.gitignore b/m4/.gitignore similarity index 100% rename from linphone/m4/.gitignore rename to m4/.gitignore diff --git a/linphone/m4/Makefile.am b/m4/Makefile.am similarity index 100% rename from linphone/m4/Makefile.am rename to m4/Makefile.am diff --git a/linphone/m4/codeset.m4 b/m4/codeset.m4 similarity index 100% rename from linphone/m4/codeset.m4 rename to m4/codeset.m4 diff --git a/linphone/m4/exosip.m4 b/m4/exosip.m4 similarity index 100% rename from linphone/m4/exosip.m4 rename to m4/exosip.m4 diff --git a/linphone/m4/gettext.m4 b/m4/gettext.m4 similarity index 100% rename from linphone/m4/gettext.m4 rename to m4/gettext.m4 diff --git a/linphone/m4/glibc2.m4 b/m4/glibc2.m4 similarity index 100% rename from linphone/m4/glibc2.m4 rename to m4/glibc2.m4 diff --git a/linphone/m4/glibc21.m4 b/m4/glibc21.m4 similarity index 100% rename from linphone/m4/glibc21.m4 rename to m4/glibc21.m4 diff --git a/linphone/m4/iconv.m4 b/m4/iconv.m4 similarity index 100% rename from linphone/m4/iconv.m4 rename to m4/iconv.m4 diff --git a/linphone/m4/ilbc.m4 b/m4/ilbc.m4 similarity index 100% rename from linphone/m4/ilbc.m4 rename to m4/ilbc.m4 diff --git a/linphone/m4/intdiv0.m4 b/m4/intdiv0.m4 similarity index 100% rename from linphone/m4/intdiv0.m4 rename to m4/intdiv0.m4 diff --git a/linphone/m4/intl.m4 b/m4/intl.m4 similarity index 100% rename from linphone/m4/intl.m4 rename to m4/intl.m4 diff --git a/linphone/m4/intldir.m4 b/m4/intldir.m4 similarity index 100% rename from linphone/m4/intldir.m4 rename to m4/intldir.m4 diff --git a/linphone/m4/intmax.m4 b/m4/intmax.m4 similarity index 100% rename from linphone/m4/intmax.m4 rename to m4/intmax.m4 diff --git a/linphone/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4 similarity index 100% rename from linphone/m4/inttypes-pri.m4 rename to m4/inttypes-pri.m4 diff --git a/linphone/m4/inttypes.m4 b/m4/inttypes.m4 similarity index 100% rename from linphone/m4/inttypes.m4 rename to m4/inttypes.m4 diff --git a/linphone/m4/inttypes_h.m4 b/m4/inttypes_h.m4 similarity index 100% rename from linphone/m4/inttypes_h.m4 rename to m4/inttypes_h.m4 diff --git a/linphone/m4/isc-posix.m4 b/m4/isc-posix.m4 similarity index 100% rename from linphone/m4/isc-posix.m4 rename to m4/isc-posix.m4 diff --git a/linphone/m4/lcmessage.m4 b/m4/lcmessage.m4 similarity index 100% rename from linphone/m4/lcmessage.m4 rename to m4/lcmessage.m4 diff --git a/linphone/m4/lib-ld.m4 b/m4/lib-ld.m4 similarity index 100% rename from linphone/m4/lib-ld.m4 rename to m4/lib-ld.m4 diff --git a/linphone/m4/lib-link.m4 b/m4/lib-link.m4 similarity index 100% rename from linphone/m4/lib-link.m4 rename to m4/lib-link.m4 diff --git a/linphone/m4/lib-prefix.m4 b/m4/lib-prefix.m4 similarity index 100% rename from linphone/m4/lib-prefix.m4 rename to m4/lib-prefix.m4 diff --git a/linphone/m4/lock.m4 b/m4/lock.m4 similarity index 100% rename from linphone/m4/lock.m4 rename to m4/lock.m4 diff --git a/linphone/m4/longdouble.m4 b/m4/longdouble.m4 similarity index 100% rename from linphone/m4/longdouble.m4 rename to m4/longdouble.m4 diff --git a/linphone/m4/longlong.m4 b/m4/longlong.m4 similarity index 100% rename from linphone/m4/longlong.m4 rename to m4/longlong.m4 diff --git a/linphone/m4/nls.m4 b/m4/nls.m4 similarity index 100% rename from linphone/m4/nls.m4 rename to m4/nls.m4 diff --git a/linphone/m4/ortp.m4 b/m4/ortp.m4 similarity index 100% rename from linphone/m4/ortp.m4 rename to m4/ortp.m4 diff --git a/linphone/m4/osip.m4 b/m4/osip.m4 similarity index 100% rename from linphone/m4/osip.m4 rename to m4/osip.m4 diff --git a/linphone/m4/po.m4 b/m4/po.m4 similarity index 100% rename from linphone/m4/po.m4 rename to m4/po.m4 diff --git a/linphone/m4/printf-posix.m4 b/m4/printf-posix.m4 similarity index 100% rename from linphone/m4/printf-posix.m4 rename to m4/printf-posix.m4 diff --git a/linphone/m4/progtest.m4 b/m4/progtest.m4 similarity index 100% rename from linphone/m4/progtest.m4 rename to m4/progtest.m4 diff --git a/linphone/m4/readline.m4 b/m4/readline.m4 similarity index 100% rename from linphone/m4/readline.m4 rename to m4/readline.m4 diff --git a/linphone/m4/signed.m4 b/m4/signed.m4 similarity index 100% rename from linphone/m4/signed.m4 rename to m4/signed.m4 diff --git a/linphone/m4/size_max.m4 b/m4/size_max.m4 similarity index 100% rename from linphone/m4/size_max.m4 rename to m4/size_max.m4 diff --git a/linphone/m4/stdint_h.m4 b/m4/stdint_h.m4 similarity index 100% rename from linphone/m4/stdint_h.m4 rename to m4/stdint_h.m4 diff --git a/linphone/m4/uintmax_t.m4 b/m4/uintmax_t.m4 similarity index 100% rename from linphone/m4/uintmax_t.m4 rename to m4/uintmax_t.m4 diff --git a/linphone/m4/ulonglong.m4 b/m4/ulonglong.m4 similarity index 100% rename from linphone/m4/ulonglong.m4 rename to m4/ulonglong.m4 diff --git a/linphone/m4/video.m4 b/m4/video.m4 similarity index 100% rename from linphone/m4/video.m4 rename to m4/video.m4 diff --git a/linphone/m4/visibility.m4 b/m4/visibility.m4 similarity index 100% rename from linphone/m4/visibility.m4 rename to m4/visibility.m4 diff --git a/linphone/m4/wchar_t.m4 b/m4/wchar_t.m4 similarity index 100% rename from linphone/m4/wchar_t.m4 rename to m4/wchar_t.m4 diff --git a/linphone/m4/wint_t.m4 b/m4/wint_t.m4 similarity index 100% rename from linphone/m4/wint_t.m4 rename to m4/wint_t.m4 diff --git a/linphone/m4/xsize.m4 b/m4/xsize.m4 similarity index 100% rename from linphone/m4/xsize.m4 rename to m4/xsize.m4 diff --git a/linphone/media_api/.gitignore b/media_api/.gitignore similarity index 100% rename from linphone/media_api/.gitignore rename to media_api/.gitignore diff --git a/linphone/media_api/DESIGN.txt b/media_api/DESIGN.txt similarity index 100% rename from linphone/media_api/DESIGN.txt rename to media_api/DESIGN.txt diff --git a/linphone/media_api/Makefile.am b/media_api/Makefile.am similarity index 100% rename from linphone/media_api/Makefile.am rename to media_api/Makefile.am diff --git a/linphone/media_api/apitest.c b/media_api/apitest.c similarity index 100% rename from linphone/media_api/apitest.c rename to media_api/apitest.c diff --git a/linphone/media_api/apitest.h b/media_api/apitest.h similarity index 100% rename from linphone/media_api/apitest.h rename to media_api/apitest.h diff --git a/linphone/media_api/basiccall.c b/media_api/basiccall.c similarity index 100% rename from linphone/media_api/basiccall.c rename to media_api/basiccall.c diff --git a/linphone/media_api/basiccall.h b/media_api/basiccall.h similarity index 100% rename from linphone/media_api/basiccall.h rename to media_api/basiccall.h diff --git a/linphone/media_api/callmember.c b/media_api/callmember.c similarity index 100% rename from linphone/media_api/callmember.c rename to media_api/callmember.c diff --git a/linphone/media_api/callmember.h b/media_api/callmember.h similarity index 100% rename from linphone/media_api/callmember.h rename to media_api/callmember.h diff --git a/linphone/media_api/ccl b/media_api/ccl similarity index 100% rename from linphone/media_api/ccl rename to media_api/ccl diff --git a/linphone/media_api/common.h b/media_api/common.h similarity index 100% rename from linphone/media_api/common.h rename to media_api/common.h diff --git a/linphone/media_api/media_api.c b/media_api/media_api.c similarity index 100% rename from linphone/media_api/media_api.c rename to media_api/media_api.c diff --git a/linphone/media_api/media_api.h b/media_api/media_api.h similarity index 100% rename from linphone/media_api/media_api.h rename to media_api/media_api.h diff --git a/linphone/media_api/mediaflow.c b/media_api/mediaflow.c similarity index 100% rename from linphone/media_api/mediaflow.c rename to media_api/mediaflow.c diff --git a/linphone/media_api/mediaflow.h b/media_api/mediaflow.h similarity index 100% rename from linphone/media_api/mediaflow.h rename to media_api/mediaflow.h diff --git a/p2pproxy/.classpath b/p2pproxy/.classpath deleted file mode 100644 index d4307deff..000000000 --- a/p2pproxy/.classpath +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/p2pproxy/.cvsignore b/p2pproxy/.cvsignore deleted file mode 100644 index da41270a3..000000000 --- a/p2pproxy/.cvsignore +++ /dev/null @@ -1,5 +0,0 @@ -eclipsebuild -.settings -antbuild* -P2pNetwork-* -sipp2 diff --git a/p2pproxy/.gcjbuilder b/p2pproxy/.gcjbuilder deleted file mode 100644 index 1084bf2f2..000000000 --- a/p2pproxy/.gcjbuilder +++ /dev/null @@ -1,21 +0,0 @@ - - 0 - 0 - - 0 - - - - 0 - - 2 - - - - - - - debug - p2pproxy - make - \ No newline at end of file diff --git a/p2pproxy/.project b/p2pproxy/.project deleted file mode 100644 index fbea50776..000000000 --- a/p2pproxy/.project +++ /dev/null @@ -1,24 +0,0 @@ - - - p2pproxy - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - - - jni_src - 2 - jni_src - - - diff --git a/p2pproxy/AUTHORS b/p2pproxy/AUTHORS deleted file mode 100644 index e69de29bb..000000000 diff --git a/p2pproxy/COPYING b/p2pproxy/COPYING deleted file mode 100644 index 94a9ed024..000000000 --- a/p2pproxy/COPYING +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If 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 convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/p2pproxy/ChangeLog b/p2pproxy/ChangeLog deleted file mode 100644 index e69de29bb..000000000 diff --git a/p2pproxy/INSTALL b/p2pproxy/INSTALL deleted file mode 100644 index 8b82ade08..000000000 --- a/p2pproxy/INSTALL +++ /dev/null @@ -1,291 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007, 2008 Free Software Foundation, Inc. - - This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. - -Basic Installation -================== - - Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for -instructions specific to this package. - - 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 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. - - Running `configure' might take a while. 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. - - 6. Often, you can also type `make uninstall' to remove the installed - files again. - -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=c99 CFLAGS=-g 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 can use 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 `..'. - - With a non-GNU `make', it is safer 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. - - On MacOS X 10.5 and later systems, you can create libraries and -executables that work on multiple system types--known as "fat" or -"universal" binaries--by specifying multiple `-arch' options to the -compiler but only a single `-arch' option to the preprocessor. Like -this: - - ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CPP="gcc -E" CXXCPP="g++ -E" - - This is not guaranteed to produce working output in all cases, you -may have to build one architecture at a time and combine the results -using the `lipo' tool if you have problems. - -Installation Names -================== - - By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' 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. - -Particular systems -================== - - On HP-UX, the default C compiler is not ANSI C compatible. If GNU -CC is not installed, it is recommended to use the following options in -order to use an ANSI C compiler: - - ./configure CC="cc -Ae" - -and if that doesn't work, install pre-built binaries of GCC for HP-UX. - - On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot -parse its `' header file. The option `-nodtk' can be used as -a workaround. If GNU CC is not installed, it is therefore recommended -to try - - ./configure CC="cc" - -and if that doesn't work, try - - ./configure CC="cc -nodtk" - -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 option `--target=TYPE' 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 - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). - -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf bug. Until the bug is fixed you can use this workaround: - - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. - -`--help=short' -`--help=recursive' - Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. - -`--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. - -`--prefix=DIR' - Use DIR as the installation prefix. *Note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. - -`--no-create' -`-n' - Run the configure checks, but stop before creating any output - files. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - diff --git a/p2pproxy/Makefile.am b/p2pproxy/Makefile.am deleted file mode 100644 index aaa51ae78..000000000 --- a/p2pproxy/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -EXTRA_DIST=dependencies dependencies-src src test-src - -SUBDIRS=launcher plugin-src - -ALL_JARS= \ - $(top_builddir)/antbuild/dist/p2pproxy_0.1/bcprov-jdk14.jar $(top_builddir)/antbuild/dist/p2pproxy_0.1/log4j.jar \ - $(top_builddir)/antbuild/dist/p2pproxy_0.1/javax.servlet.jar $(top_builddir)/antbuild/dist/p2pproxy_0.1/org.mortbay.jetty.jar \ - $(top_builddir)/antbuild/dist/p2pproxy_0.1/jstun-0.7.0.jar $(top_builddir)/antbuild/dist/p2pproxy_0.1/p2pproxy.jar \ - $(top_builddir)/antbuild/dist/p2pproxy_0.1/junit-4.3.1.jar $(top_builddir)/antbuild/dist/p2pproxy_0.1/sip.jar - -$(ALL_JARS): src/org/linphone/p2pproxy/*/*.java - $(ANT) dist - -jarsdir=$(datadir)/java/fonis - -jars_DATA=$(ALL_JARS) - -clean-local: - $(ANT) clean diff --git a/p2pproxy/NEWS b/p2pproxy/NEWS deleted file mode 100644 index e69de29bb..000000000 diff --git a/p2pproxy/README b/p2pproxy/README deleted file mode 100644 index e69de29bb..000000000 diff --git a/p2pproxy/autogen.sh b/p2pproxy/autogen.sh deleted file mode 100755 index d342f286b..000000000 --- a/p2pproxy/autogen.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -#AM_VERSION=1.10 -#1.9 was the recommended version -if test -n "$AM_VERSION" ; then - ACLOCAL=aclocal-${AM_VERSION} - AUTOMAKE=automake-${AM_VERSION} -else - ACLOCAL=aclocal - AUTOMAKE=automake -fi - -echo "Generating build scripts in this mediastreamer plugin" -set -x -libtoolize --copy --force -$ACLOCAL -$AUTOMAKE --force-missing --add-missing --copy -autoconf -rm -rf config.cache - diff --git a/p2pproxy/bin/p2pproxy-cmd.bat b/p2pproxy/bin/p2pproxy-cmd.bat deleted file mode 100644 index f1fc5f0c8..000000000 --- a/p2pproxy/bin/p2pproxy-cmd.bat +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -"%JAVA_HOME%\bin\java.exe" -cp p2pproxy.jar org.linphone.p2pproxy.core.utils.AccountManagerCli %1 %2 %3 %4 %5 %6 %7 %8 %9 \ No newline at end of file diff --git a/p2pproxy/bin/p2pproxy-cmd.sh b/p2pproxy/bin/p2pproxy-cmd.sh deleted file mode 100644 index 1598057d7..000000000 --- a/p2pproxy/bin/p2pproxy-cmd.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec ${JAVA_HOME}/bin/java -cp p2pproxy.jar org.linphone.p2pproxy.core.utils.AccountManagerCli $* \ No newline at end of file diff --git a/p2pproxy/bin/p2pproxy.bat b/p2pproxy/bin/p2pproxy.bat deleted file mode 100644 index 21eaf9330..000000000 --- a/p2pproxy/bin/p2pproxy.bat +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -"%JAVA_HOME%\bin\java.exe" -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=6789 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -jar p2pproxy.jar %1 %2 %3 %4 %5 %6 %7 %8 %9 \ No newline at end of file diff --git a/p2pproxy/bin/p2pproxy.sh b/p2pproxy/bin/p2pproxy.sh deleted file mode 100644 index 91f319160..000000000 --- a/p2pproxy/bin/p2pproxy.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -if [ -z "$P2P_JMX_PORT"] ; then - P2P_JMX_PORT=6789 -fi -exec ${JAVA_HOME}/bin/java -Dcom.sun.management.jmxremote \ - -Dcom.sun.management.jmxremote.port=${P2P_JMX_PORT} \ - -Dcom.sun.management.jmxremote.authenticate=false \ - -Dcom.sun.management.jmxremote.ssl=false \ - -jar p2pproxy.jar $* \ No newline at end of file diff --git a/p2pproxy/build.xml b/p2pproxy/build.xml deleted file mode 100644 index 02d3a759f..000000000 --- a/p2pproxy/build.xml +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/p2pproxy/configure.ac b/p2pproxy/configure.ac deleted file mode 100644 index fffaf614f..000000000 --- a/p2pproxy/configure.ac +++ /dev/null @@ -1,134 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -AC_INIT([p2pproxy],[0.0.1]) - -AM_INIT_AUTOMAKE([tar-ustar]) - -AC_CANONICAL_SYSTEM - -AC_MSG_CHECKING([warning make an error on compilation]) -AC_ARG_ENABLE(strict, -[ --enable-strict Enable error on compilation warning [default=no]], -[wall_werror=$enableval], -[wall_werror=no] -) - - -dnl Checks for programs. -AC_PROG_CC -AC_PROG_LIBTOOL -AC_DISABLE_STATIC - - -CFLAGS="$CFLAGS -Wall" - - -dnl Checks for header files. -AC_HEADER_STDC - -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 - CFLAGS="$CFLAGS -D_BIGENDIAN" -fi - -if test $GCC = yes && test $wall_werror = yes; then - CFLAGS="$CFLAGS -Werror " -fi - -AC_ARG_WITH(java, - [ --with-java Sets directory of java home, [default=/usr/lib/jvm/java-6-sun] ], - [ javadir=${withval}],[javadir=/usr/lib/jvm/java-6-sun/]) - -AC_SUBST(javadir) - -AC_PATH_PROG(ANT,ant,false) - -AC_PATH_PROG(SWIG,swig,false) - -if test x$ANT = xfalse ; then - AC_MSG_ERROR([ant not found: you must install ant to build this package.]) -fi - -if test x$prefix = xNONE ; then - jarsdir="/usr/local/share/java/fonis" -else - jarsdir="$prefix/share/java/fonis" -fi - -AC_DEFINE_UNQUOTED(P2PPROXY_INSTALLDIR,"$jarsdir",[path of jars]) - -PKG_CHECK_MODULES(LIBLINPHONE, linphone >= 3.0.0) - -LINPHONE_PLUGINS_DIR="\$(libdir)/liblinphone/plugins/" -AC_SUBST(LINPHONE_PLUGINS_DIR) - -dnl ################################################## -dnl # Check for ESP Packager -dnl ################################################## - -AC_PATH_PROG(EPM,epm,false) -AC_PATH_PROG(MKEPMLIST,mkepmlist,false) -AC_PATH_PROG(EPMINSTALL,epminstall,false) -AM_CONDITIONAL(WITH_EPM,test $EPM != false && test $MKEPMLIST != false && test $EPMINSTALL != false) - - -# Preferred packaging system, as per EPM terminology -case $target in -*-*-linux*) - if test -f /etc/debian_version ; then - EPM_PKG_EXT=deb - else - EPM_PKG_EXT=rpm - fi - ;; -*-hp-hpux*) - EPM_PKG_EXT=depot.gz;; -*-dec-osf*) - EPM_PKG_EXT=setld;; -esac -AC_SUBST(EPM_PKG_EXT) - -# System software User & Group names -case $target in -*-*-linux*) - SYS_USER=root - SYS_GROUP=root - ;; -*-*-hpux*|*-dec-osf*) - SYS_USER=bin - SYS_GROUP=bin - ;; -esac -AC_SUBST(SYS_USER) -AC_SUBST(SYS_GROUP) - -# CPU Architecture -case $target_cpu in -i?86) ARCH=i386;; -*) ARCH=$target_cpu;; -esac -AC_SUBST(ARCH) - -# Various other packaging variables, that can be over-ridden ad `make -# package' time -SUMMARY="A SIP P2P proxy and toolkit" -AC_SUBST(SUMMARY) -PACKAGER=anonymous -AC_SUBST(PACKAGER) -LICENSE=GPL -AC_SUBST(LICENSE) -VENDOR=Linphone -AC_SUBST(VENDOR) -RELEASE=1 -AC_SUBST(RELEASE) - - -AC_OUTPUT( -Makefile -launcher/Makefile -launcher/src/Makefile -plugin-src/Makefile -) diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ChangeRequest.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ChangeRequest.java deleted file mode 100644 index bf83df66c..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ChangeRequest.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.attribute; - -import de.javawi.jstun.util.*; - -public class ChangeRequest extends MessageAttribute { - /* - * 0 1 2 3 - * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 A B 0| - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - */ - boolean changeIP = false; - boolean changePort = false; - - public ChangeRequest() { - super(MessageAttribute.MessageAttributeType.ChangeRequest); - } - - public boolean isChangeIP() { - return changeIP; - } - - public boolean isChangePort() { - return changePort; - } - - public void setChangeIP() { - changeIP = true; - } - - public void setChangePort() { - changePort = true; - } - - public byte[] getBytes() throws UtilityException { - byte[] result = new byte[8]; - // message attribute header - // type - System.arraycopy(Utility.integerToTwoBytes(typeToInteger(type)), 0, result, 0, 2); - // length - System.arraycopy(Utility.integerToTwoBytes(4), 0, result, 2, 2); - - // change request header - if (changeIP) result[7] = Utility.integerToOneByte(4); - if (changePort) result[7] = Utility.integerToOneByte(2); - if (changeIP && changePort) result[7] = Utility.integerToOneByte(6); - return result; - } - - public static ChangeRequest parse(byte[] data) throws MessageAttributeParsingException { - try { - if (data.length < 4) { - throw new MessageAttributeParsingException("Data array too short"); - } - ChangeRequest cr = new ChangeRequest(); - int status = Utility.oneByteToInteger(data[3]); - switch (status) { - case 0: break; - case 2: cr.setChangePort(); break; - case 4: cr.setChangeIP(); break; - case 6: cr.setChangeIP(); cr.setChangePort(); break; - default: throw new MessageAttributeParsingException("Status parsing error"); - } - return cr; - } catch (UtilityException ue) { - throw new MessageAttributeParsingException("Parsing error"); - } - } -} diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ChangedAddress.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ChangedAddress.java deleted file mode 100644 index ce06b603c..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ChangedAddress.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.attribute; - -import java.util.logging.Logger; - - -public class ChangedAddress extends MappedResponseChangedSourceAddressReflectedFrom { - private static Logger logger = Logger.getLogger("de.javawi.stun.attribute.ChangedAddress"); - - public ChangedAddress() { - super(MessageAttribute.MessageAttributeType.ChangedAddress); - } - - public static MessageAttribute parse(byte[] data) throws MessageAttributeParsingException { - ChangedAddress ca = new ChangedAddress(); - MappedResponseChangedSourceAddressReflectedFrom.parse(ca, data); - logger.finer("Message Attribute: Changed Address parsed: " + ca.toString() + "."); - return ca; - } -} diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Data.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Data.java deleted file mode 100644 index 71452ad2f..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Data.java +++ /dev/null @@ -1,20 +0,0 @@ -package de.javawi.jstun.attribute; - -import java.util.logging.Logger; - -import de.javawi.jstun.util.UtilityException; - -public class Data extends MessageAttribute { - private static Logger logger = Logger.getLogger(Data.class.getName()); - @Override - public byte[] getBytes() throws UtilityException { - // TODO Auto-generated method stub - return null; - } - public static MessageAttribute parse(byte[] data) throws MessageAttributeParsingException { - Data ma = new Data(); - - logger.finer("Message Attribute: Data Address parsed: " + ma.toString() + "."); - return ma; - } -} diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Dummy.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Dummy.java deleted file mode 100644 index 8e780dcc0..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Dummy.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.attribute; - -import de.javawi.jstun.util.Utility; -import de.javawi.jstun.util.UtilityException; - -public class Dummy extends MessageAttribute { - int lengthValue; - public Dummy() { - super(MessageAttributeType.Dummy); - } - - public void setLengthValue(int length) { - this.lengthValue = length; - } - - public byte[] getBytes() throws UtilityException { - byte[] result = new byte[lengthValue + 4]; - // message attribute header - // type - System.arraycopy(Utility.integerToTwoBytes(typeToInteger(type)), 0, result, 0, 2); - // length - System.arraycopy(Utility.integerToTwoBytes(lengthValue), 0, result, 2, 2); - return result; - } - - public static Dummy parse(byte[] data) { - Dummy dummy = new Dummy(); - dummy.setLengthValue(data.length); - return dummy; - } -} diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ErrorCode.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ErrorCode.java deleted file mode 100644 index 04436dd7c..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ErrorCode.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.attribute; - -import de.javawi.jstun.util.Utility; -import de.javawi.jstun.util.UtilityException; - -public class ErrorCode extends MessageAttribute { - /* - * 0 1 2 3 - * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | 0 |Class| Number | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | Reason Phrase (variable) .. - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - */ - - int responseCode; - String reason; - - public ErrorCode() { - super(MessageAttribute.MessageAttributeType.ErrorCode); - } - - public void setResponseCode(int responseCode) throws MessageAttributeException { - switch (responseCode) { - case 400: reason = "Bad Request"; break; - case 401: reason = "Unauthorized"; break; - case 420: reason = "Unkown Attribute"; break; - case 430: reason = "Stale Credentials"; break; - case 431: reason = "Integrity Check Failure"; break; - case 432: reason = "Missing Username"; break; - case 433: reason = "Use TLS"; break; - case 500: reason = "Server Error"; break; - case 600: reason = "Global Failure"; break; - default: throw new MessageAttributeException("Response Code is not valid"); - } - this.responseCode = responseCode; - } - - public int getResponseCode() { - return responseCode; - } - - public String getReason() { - return reason; - } - - public byte[] getBytes() throws UtilityException { - int length = reason.length(); - // length adjustment - if ((length % 4) != 0) { - length += 4 - (length % 4); - } - // message attribute header - length += 4; - byte[] result = new byte[length]; - // message attribute header - // type - System.arraycopy(Utility.integerToTwoBytes(typeToInteger(type)), 0, result, 0, 2); - // length - System.arraycopy(Utility.integerToTwoBytes(length-4), 0, result, 2, 2); - - // error code header - int classHeader = (int) Math.floor(((double)responseCode)/100); - result[6] = Utility.integerToOneByte(classHeader); - result[7] = Utility.integerToOneByte(responseCode%100); - byte[] reasonArray = reason.getBytes(); - System.arraycopy(reasonArray, 0, result, 8, reasonArray.length); - return result; - } - - public static ErrorCode parse(byte[] data) throws MessageAttributeParsingException { - try { - if (data.length < 4) { - throw new MessageAttributeParsingException("Data array too short"); - } - byte classHeaderByte = data[3]; - int classHeader = Utility.oneByteToInteger(classHeaderByte); - if ((classHeader < 1) || (classHeader > 6)) throw new MessageAttributeParsingException("Class parsing error"); - byte numberByte = data[4]; - int number = Utility.oneByteToInteger(numberByte); - if ((number < 0) || (number > 99)) throw new MessageAttributeParsingException("Number parsing error"); - int responseCode = (classHeader * 100) + number; - ErrorCode result = new ErrorCode(); - result.setResponseCode(responseCode); - return result; - } catch (UtilityException ue) { - throw new MessageAttributeParsingException("Parsing error"); - } catch (MessageAttributeException mae) { - throw new MessageAttributeParsingException("Parsing error"); - } - } -} diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MappedAddress.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MappedAddress.java deleted file mode 100644 index bdb84acfe..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MappedAddress.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.attribute; - -import java.util.logging.Logger; - - -public class MappedAddress extends MappedResponseChangedSourceAddressReflectedFrom { - private static Logger logger = Logger.getLogger("de.javawi.stun.attribute.MappedAddress"); - public MappedAddress() { - super(MessageAttribute.MessageAttributeType.MappedAddress); - } - - public static MessageAttribute parse(byte[] data) throws MessageAttributeParsingException { - MappedAddress ma = new MappedAddress(); - MappedResponseChangedSourceAddressReflectedFrom.parse(ma, data); - logger.finer("Message Attribute: Mapped Address parsed: " + ma.toString() + "."); - return ma; - } -} diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MappedResponseChangedSourceAddressReflectedFrom.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MappedResponseChangedSourceAddressReflectedFrom.java deleted file mode 100644 index 252e96052..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MappedResponseChangedSourceAddressReflectedFrom.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.attribute; - -import de.javawi.jstun.util.*; - -public class MappedResponseChangedSourceAddressReflectedFrom extends MessageAttribute { - int port; - Address address; - - /* - * 0 1 2 3 - * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * |x x x x x x x x| Family | Port | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | Address | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - */ - public MappedResponseChangedSourceAddressReflectedFrom() { - super(); - try { - port = 0; - address = new Address("0.0.0.0"); - } catch (UtilityException ue) { - ue.getMessage(); - ue.printStackTrace(); - } - } - - public MappedResponseChangedSourceAddressReflectedFrom(MessageAttribute.MessageAttributeType type) { - super(type); - } - - public int getPort() { - return port; - } - - public Address getAddress() { - return address; - } - - public void setPort(int port) throws MessageAttributeException { - if ((port > 65536) || (port < 0)) { - throw new MessageAttributeException("Port value " + port + " out of range."); - } - this.port = port; - } - - public void setAddress(Address address) { - this.address = address; - } - - public byte[] getBytes() throws UtilityException { - byte[] result = new byte[12]; - // message attribute header - // type - System.arraycopy(Utility.integerToTwoBytes(typeToInteger(type)), 0, result, 0, 2); - // length - System.arraycopy(Utility.integerToTwoBytes(8), 0, result, 2, 2); - - // mappedaddress header - // family - result[5] = Utility.integerToOneByte(0x01); - // port - System.arraycopy(Utility.integerToTwoBytes(port), 0, result, 6, 2); - // address - System.arraycopy(address.getBytes(), 0, result, 8, 4); - return result; - } - - protected static MappedResponseChangedSourceAddressReflectedFrom parse(MappedResponseChangedSourceAddressReflectedFrom ma, byte[] data) throws MessageAttributeParsingException { - try { - if (data.length < 8) { - throw new MessageAttributeParsingException("Data array too short"); - } - int family = Utility.oneByteToInteger(data[1]); - if (family != 0x01) throw new MessageAttributeParsingException("Family " + family + " is not supported"); - byte[] portArray = new byte[2]; - System.arraycopy(data, 2, portArray, 0, 2); - ma.setPort(Utility.twoBytesToInteger(portArray)); - int firstOctet = Utility.oneByteToInteger(data[4]); - int secondOctet = Utility.oneByteToInteger(data[5]); - int thirdOctet = Utility.oneByteToInteger(data[6]); - int fourthOctet = Utility.oneByteToInteger(data[7]); - ma.setAddress(new Address(firstOctet, secondOctet, thirdOctet, fourthOctet)); - return ma; - } catch (UtilityException ue) { - throw new MessageAttributeParsingException("Parsing error"); - } catch (MessageAttributeException mae) { - throw new MessageAttributeParsingException("Port parsing error"); - } - } - - public String toString() { - return "Address " +address.toString() + ", Port " + port; - } -} \ No newline at end of file diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttribute.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttribute.java deleted file mode 100644 index 2c1f1ef7f..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttribute.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.attribute; - -import java.util.logging.*; - -import de.javawi.jstun.util.*; - - -public abstract class MessageAttribute implements MessageAttributeInterface { - private static Logger logger = Logger.getLogger("de.javawi.stun.util.MessageAttribute"); - MessageAttributeType type; - - public MessageAttribute() { - } - - public MessageAttribute(MessageAttributeType type) { - setType(type); - } - - public void setType(MessageAttributeType type) { - this.type = type; - } - - public MessageAttribute.MessageAttributeType getType() { - return type; - } - - public static int typeToInteger(MessageAttributeType type) { - if (type == MessageAttributeType.MappedAddress) return MAPPEDADDRESS; - if (type == MessageAttributeType.ResponseAddress) return RESPONSEADDRESS; - if (type == MessageAttributeType.ChangeRequest) return CHANGEREQUEST; - if (type == MessageAttributeType.SourceAddress) return SOURCEADDRESS; - if (type == MessageAttributeType.ChangedAddress) return CHANGEDADDRESS; - if (type == MessageAttributeType.Username) return USERNAME; - if (type == MessageAttributeType.Password) return PASSWORD; - if (type == MessageAttributeType.MessageIntegrity) return MESSAGEINTEGRITY; - if (type == MessageAttributeType.ErrorCode) return ERRORCODE; - if (type == MessageAttributeType.UnknownAttribute) return UNKNOWNATTRIBUTE; - if (type == MessageAttributeType.ReflectedFrom) return REFLECTEDFROM; - if (type == MessageAttributeType.Dummy) return DUMMY; - //turn - if (type == MessageAttributeType.ChannelNumber) return CHANNELNUMBER; - if (type == MessageAttributeType.LifeTime) return LIFETIME; - if (type == MessageAttributeType.Bandwidth ) return BANDWIDTH; - if (type == MessageAttributeType.PeerAddress ) return PEERADDRESS; - if (type == MessageAttributeType.Data ) return DATA; - if (type == MessageAttributeType.RelayAddress ) return RELAYADDRESS; - if (type == MessageAttributeType.RequestedProps ) return REQUESTEDPROPS; - if (type == MessageAttributeType.RequestedTransport ) return REQUESTEDTRANSPORT; - if (type == MessageAttributeType.ReservationToken ) return RESERVATIONTOKEN; - return -1; - } - - public static MessageAttributeType intToType(long type) { - if (type == MAPPEDADDRESS) return MessageAttributeType.MappedAddress; - if (type == RESPONSEADDRESS) return MessageAttributeType.ResponseAddress; - if (type == CHANGEREQUEST) return MessageAttributeType.ChangeRequest; - if (type == SOURCEADDRESS) return MessageAttributeType.SourceAddress; - if (type == CHANGEDADDRESS) return MessageAttributeType.ChangedAddress; - if (type == USERNAME) return MessageAttributeType.Username; - if (type == PASSWORD) return MessageAttributeType.Password; - if (type == MESSAGEINTEGRITY) return MessageAttributeType.MessageIntegrity; - if (type == ERRORCODE) return MessageAttributeType.ErrorCode; - if (type == UNKNOWNATTRIBUTE) return MessageAttributeType.UnknownAttribute; - if (type == REFLECTEDFROM) return MessageAttributeType.ReflectedFrom; - if (type == DUMMY) return MessageAttributeType.Dummy; - //turn - if (type == CHANNELNUMBER) return MessageAttributeType.ChannelNumber; - if (type == LIFETIME) return MessageAttributeType.LifeTime; - if (type == BANDWIDTH) return MessageAttributeType.Bandwidth; - if (type == PEERADDRESS) return MessageAttributeType.PeerAddress; - if (type == DATA) return MessageAttributeType.Data; - if (type == RELAYADDRESS) return MessageAttributeType.RelayAddress; - if (type == REQUESTEDPROPS) return MessageAttributeType.RequestedProps; - if (type == REQUESTEDTRANSPORT) return MessageAttributeType.RequestedTransport; - if (type == RESERVATIONTOKEN) return MessageAttributeType.ReservationToken; - return null; - } - - abstract public byte[] getBytes() throws UtilityException; - //abstract public MessageAttribute parse(byte[] data) throws MessageAttributeParsingException; - - public int getLength() throws UtilityException { - int length = getBytes().length; - return length; - } - - public static MessageAttribute parseCommonHeader(byte[] data) throws MessageAttributeParsingException { - try { - byte[] typeArray = new byte[2]; - System.arraycopy(data, 0, typeArray, 0, 2); - int type = Utility.twoBytesToInteger(typeArray); - byte[] lengthArray = new byte[2]; - System.arraycopy(data, 2, lengthArray, 0, 2); - int lengthValue = Utility.twoBytesToInteger(lengthArray); - byte[] valueArray = new byte[lengthValue]; - System.arraycopy(data, 4, valueArray, 0, lengthValue); - MessageAttribute ma; - switch (type) { - case MAPPEDADDRESS: ma = MappedAddress.parse(valueArray); break; - case RESPONSEADDRESS: ma = ResponseAddress.parse(valueArray); break; - case CHANGEREQUEST: ma = ChangeRequest.parse(valueArray); break; - case SOURCEADDRESS: ma = SourceAddress.parse(valueArray); break; - case CHANGEDADDRESS: ma = ChangedAddress.parse(valueArray); break; - case USERNAME: ma = Username.parse(valueArray); break; - case PASSWORD: ma = Password.parse(valueArray); break; - case MESSAGEINTEGRITY: ma = MessageIntegrity.parse(valueArray); break; - case ERRORCODE: ma = ErrorCode.parse(valueArray); break; - case UNKNOWNATTRIBUTE: ma = UnknownAttribute.parse(valueArray); break; - case REFLECTEDFROM: ma = ReflectedFrom.parse(valueArray); break; - default: - if (type <= 0x7fff) { - throw new UnknownMessageAttributeException("Unkown mandatory message attribute", intToType(type)); - } else { - logger.finer("MessageAttribute with type " + type + " unkown."); - ma = Dummy.parse(valueArray); - break; - } - } - return ma; - } catch (UtilityException ue) { - throw new MessageAttributeParsingException("Parsing error"); - } - } -} diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttributeException.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttributeException.java deleted file mode 100644 index a8109cfd1..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttributeException.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.attribute; - -public class MessageAttributeException extends Exception { - private static final long serialVersionUID = 3258131345099404850L; - - public MessageAttributeException(String mesg) { - super(mesg); - } -} \ No newline at end of file diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttributeInterface.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttributeInterface.java deleted file mode 100644 index 8c55d7806..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttributeInterface.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.attribute; - -public interface MessageAttributeInterface { - public enum MessageAttributeType { MappedAddress - , ResponseAddress - , ChangeRequest - , SourceAddress - , ChangedAddress - , Username - , Password - , MessageIntegrity - , ErrorCode - , UnknownAttribute - , ReflectedFrom - , Dummy - , ChannelNumber - , LifeTime - , Bandwidth - , PeerAddress - , Data - , RelayAddress - , RequestedProps - , RequestedTransport - , ReservationToken}; - final static int MAPPEDADDRESS = 0x0001; - final static int RESPONSEADDRESS = 0x0002; - final static int CHANGEREQUEST = 0x0003; - final static int SOURCEADDRESS = 0x0004; - final static int CHANGEDADDRESS = 0x0005; - final static int USERNAME = 0x0006; - final static int PASSWORD = 0x0007; - final static int MESSAGEINTEGRITY = 0x0008; - final static int ERRORCODE = 0x0009; - final static int UNKNOWNATTRIBUTE = 0x000a; - final static int REFLECTEDFROM = 0x000b; - final static int DUMMY = 0x0000; -// turn attributes -// 0x000C: CHANNEL-NUMBER -// 0x000D: LIFETIME -// 0x0010: BANDWIDTH -// 0x0012: PEER-ADDRESS -// 0x0013: DATA -// 0x0016: RELAY-ADDRESS -// 0x0018: REQUESTED-PROPS -// 0x0019: REQUESTED-TRANSPORT -// 0x0022: RESERVATION-TOKEN - final static int CHANNELNUMBER = 0x000C; - final static int LIFETIME = 0x000D; - final static int BANDWIDTH = 0x0010; - final static int PEERADDRESS = 0x0012; - final static int DATA = 0x0013; - final static int RELAYADDRESS = 0x0016; - final static int REQUESTEDPROPS = 0x0018; - final static int REQUESTEDTRANSPORT = 0x0019; - final static int RESERVATIONTOKEN = 0x0022; - -} \ No newline at end of file diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttributeParsingException.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttributeParsingException.java deleted file mode 100644 index d20278976..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageAttributeParsingException.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.attribute; - -public class MessageAttributeParsingException extends MessageAttributeException { - private static final long serialVersionUID = 3258409534426263605L; - - public MessageAttributeParsingException(String mesg) { - super(mesg); - } -} \ No newline at end of file diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageIntegrity.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageIntegrity.java deleted file mode 100644 index 7aa7df3d7..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/MessageIntegrity.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.attribute; - -public class MessageIntegrity extends MessageAttribute { - // incomplete message integrity implementation - public MessageIntegrity() { - super(MessageAttribute.MessageAttributeType.MessageIntegrity); - } - - public byte[] getBytes() { - return new byte[0]; - } - - public static MessageIntegrity parse(byte[] data) { - return new MessageIntegrity(); - } -} diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Password.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Password.java deleted file mode 100644 index 679a193d9..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Password.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.attribute; - -import de.javawi.jstun.util.Utility; -import de.javawi.jstun.util.UtilityException; - -public class Password extends MessageAttribute { - String password; - - public Password() { - super(MessageAttribute.MessageAttributeType.Password); - } - - public Password(String password) { - super(MessageAttribute.MessageAttributeType.Password); - setPassword(password); - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public byte[] getBytes() throws UtilityException { - int length = password.length(); - // password header - if ((length % 4) != 0) { - length += 4 - (length % 4); - } - // message attribute header - length += 4; - byte[] result = new byte[length]; - // message attribute header - // type - System.arraycopy(Utility.integerToTwoBytes(typeToInteger(type)), 0, result, 0, 2); - // length - System.arraycopy(Utility.integerToTwoBytes(length - 4), 0, result, 2, 2); - - // password header - byte[] temp = password.getBytes(); - System.arraycopy(temp, 0, result, 4, temp.length); - return result; - } - - public static Password parse(byte[] data) { - Password result = new Password(); - String password = new String(data); - result.setPassword(password); - return result; - } -} \ No newline at end of file diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ReflectedFrom.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ReflectedFrom.java deleted file mode 100644 index e29831431..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ReflectedFrom.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.attribute; - -import java.util.logging.Logger; - -public class ReflectedFrom extends MappedResponseChangedSourceAddressReflectedFrom { - private static Logger logger = Logger.getLogger("de.javawi.stun.attribute.ReflectedFrom"); - - public ReflectedFrom() { - super(MessageAttribute.MessageAttributeType.ReflectedFrom); - } - - public static ReflectedFrom parse(byte[] data) throws MessageAttributeParsingException { - ReflectedFrom result = new ReflectedFrom(); - MappedResponseChangedSourceAddressReflectedFrom.parse(result, data); - logger.finer("Message Attribute: ReflectedFrom parsed: " + result.toString() + "."); - return result; - } - - -} diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ResponseAddress.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ResponseAddress.java deleted file mode 100644 index 40c73bd0b..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/ResponseAddress.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.attribute; - -import java.util.logging.Logger; - - -public class ResponseAddress extends MappedResponseChangedSourceAddressReflectedFrom { - private static Logger logger = Logger.getLogger("de.javawi.stun.attribute.ResponseAddress"); - public ResponseAddress() { - super(MessageAttribute.MessageAttributeType.ResponseAddress); - } - - public static MessageAttribute parse(byte[] data) throws MessageAttributeParsingException { - ResponseAddress ra = new ResponseAddress(); - MappedResponseChangedSourceAddressReflectedFrom.parse(ra, data); - logger.finer("Message Attribute: Response Address parsed: " + ra.toString() + "."); - return ra; - } -} diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/SourceAddress.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/SourceAddress.java deleted file mode 100644 index 070d7d8d0..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/SourceAddress.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.attribute; - -import java.util.logging.Logger; - - -public class SourceAddress extends MappedResponseChangedSourceAddressReflectedFrom { - private static Logger logger = Logger.getLogger("de.javawi.stun.attribute.SourceAddress"); - public SourceAddress() { - super(MessageAttribute.MessageAttributeType.SourceAddress); - } - - public static MessageAttribute parse(byte[] data) throws MessageAttributeParsingException { - SourceAddress sa = new SourceAddress(); - MappedResponseChangedSourceAddressReflectedFrom.parse(sa, data); - logger.finer("Message Attribute: Source Address parsed: " + sa.toString() + "."); - return sa; - } -} \ No newline at end of file diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/UnknownAttribute.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/UnknownAttribute.java deleted file mode 100644 index 04f1abb8b..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/UnknownAttribute.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.attribute; - -import java.util.*; - -import de.javawi.jstun.util.Utility; -import de.javawi.jstun.util.UtilityException; - -public class UnknownAttribute extends MessageAttribute { - /* - * 0 1 2 3 - * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | Attribute 1 Type | Attribute 2 Type | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | Attribute 3 Type | Attribute 4 Type ... - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - */ - - Vector unkown = new Vector(); - - public UnknownAttribute() { - super(MessageAttribute.MessageAttributeType.UnknownAttribute); - } - - public void addAttribute(MessageAttributeType attribute) { - unkown.add(attribute); - } - - public byte[] getBytes() throws UtilityException { - int length = 0; - if (unkown.size()%2 == 1) { - length = 2 * (unkown.size() + 1) + 4; - } else { - length = 2 * unkown.size() + 4; - } - byte[] result = new byte[length]; - // message attribute header - // type - System.arraycopy(Utility.integerToTwoBytes(typeToInteger(type)), 0, result, 0, 2); - // length - System.arraycopy(Utility.integerToTwoBytes(length - 4), 0, result, 2, 2); - - // unkown attribute header - Iterator it = unkown.iterator(); - while(it.hasNext()) { - MessageAttributeType attri = it.next(); - System.arraycopy(Utility.integerToTwoBytes(typeToInteger(attri)), 0, result, 4, 2); - } - // padding - if (unkown.size()%2 == 1) { - System.arraycopy(Utility.integerToTwoBytes(typeToInteger(unkown.elementAt(1))), 0, result, 4, 2); - } - return result; - } - - public static UnknownAttribute parse(byte[] data) throws MessageAttributeParsingException { - try { - UnknownAttribute result = new UnknownAttribute(); - if (data.length % 4 != 0) throw new MessageAttributeParsingException("Data array too short"); - for (int i = 0; i < data.length; i += 4) { - byte[] temp = new byte[4]; - System.arraycopy(data, i, temp, 0, 4); - long attri = Utility.fourBytesToLong(temp); - result.addAttribute(MessageAttribute.intToType(attri)); - } - return result; - } catch (UtilityException ue) { - throw new MessageAttributeParsingException("Parsing error"); - } - } -} \ No newline at end of file diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/UnknownMessageAttributeException.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/UnknownMessageAttributeException.java deleted file mode 100644 index 4ddd49229..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/UnknownMessageAttributeException.java +++ /dev/null @@ -1,18 +0,0 @@ -package de.javawi.jstun.attribute; - -import de.javawi.jstun.attribute.MessageAttributeInterface.MessageAttributeType; - -public class UnknownMessageAttributeException extends MessageAttributeParsingException { - private static final long serialVersionUID = 5375193544145543299L; - - private MessageAttributeType type; - - public UnknownMessageAttributeException(String mesg, MessageAttributeType type) { - super(mesg); - this.type = type; - } - - public MessageAttributeType getType() { - return type; - } -} diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Username.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Username.java deleted file mode 100644 index 1afaec7b1..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/attribute/Username.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.attribute; - -import de.javawi.jstun.util.Utility; -import de.javawi.jstun.util.UtilityException; - -public class Username extends MessageAttribute { - String username; - - public Username() { - super(MessageAttribute.MessageAttributeType.Username); - } - - public Username(String username) { - super(MessageAttribute.MessageAttributeType.Username); - setUsername(username); - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public byte[] getBytes() throws UtilityException { - int length = username.length(); - // username header - if ((length % 4) != 0) { - length += 4 - (length % 4); - } - // message attribute header - length += 4; - byte[] result = new byte[length]; - // message attribute header - // type - System.arraycopy(Utility.integerToTwoBytes(typeToInteger(type)), 0, result, 0, 2); - // length - System.arraycopy(Utility.integerToTwoBytes(length-4), 0, result, 2, 2); - - // username header - byte[] temp = username.getBytes(); - System.arraycopy(temp, 0, result, 4, temp.length); - return result; - } - - public static Username parse(byte[] data) { - Username result = new Username(); - String username = new String(data); - result.setUsername(username); - return result; - } -} diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeader.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeader.java deleted file mode 100644 index 1e6dab58b..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeader.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.header; - -import de.javawi.jstun.attribute.*; -import de.javawi.jstun.util.*; - -import java.util.*; -import java.util.logging.*; - -public class MessageHeader implements MessageHeaderInterface { - /* - * 0 1 2 3 - * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | STUN Message Type | Message Length | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * Transaction ID - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - */ - private static Logger logger = Logger.getLogger("de.javawi.stun.header.MessageHeader"); - MessageHeaderType type; - byte[] id = new byte[16]; - - TreeMap ma = new TreeMap(); - - public MessageHeader() { - super(); - } - - public MessageHeader(MessageHeaderType type) { - super(); - setType(type); - } - - public void setType(MessageHeaderType type) { - this.type = type; - } - - public MessageHeaderType getType() { - return type; - } - - public static int typeToInteger(MessageHeaderType type) { - if (type == MessageHeaderType.BindingRequest) return BINDINGREQUEST; - if (type == MessageHeaderType.BindingResponse) return BINDINGRESPONSE; - if (type == MessageHeaderType.BindingErrorResponse) return BINDINGERRORRESPONSE; - if (type == MessageHeaderType.SharedSecretRequest) return SHAREDSECRETREQUEST; - if (type == MessageHeaderType.SharedSecretResponse) return SHAREDSECRETRESPONSE; - if (type == MessageHeaderType.SharedSecretErrorResponse) return SHAREDSECRETERRORRESPONSE; - //turn headers - if (type == MessageHeaderType.AllocateRequest) return ALLOCATEREQUEST; - if (type == MessageHeaderType.AllocateResponse) return ALLOCATERESPONSE; - if (type == MessageHeaderType.AllocateErrorResponse) return ALLOCATEERRORRESPONSE; - if (type == MessageHeaderType.RefreshRequest) return REFRESHREQUEST; - if (type == MessageHeaderType.RefreshResponse) return REFRESHRESPONSE; - if (type == MessageHeaderType.RefreshErrorResponse) return REFRESHERRORRESPONSE; - if (type == MessageHeaderType.ChannelBindRequest) return CHANNELBINDREQUEST; - if (type == MessageHeaderType.ChannelBindResponse) return CHANNELBINDRESPONSE; - if (type == MessageHeaderType.ChannelBindErrorResponse) return CHANNELBINDERRORRESPONSE; - - - return -1; - } - - public void setTransactionID(byte[] id) { - System.arraycopy(id, 0, this.id, 0, 16); - } - - public void generateTransactionID() throws UtilityException { - System.arraycopy(Utility.integerToTwoBytes((int)(Math.random() * 65536)), 0, id, 0, 2); - System.arraycopy(Utility.integerToTwoBytes((int)(Math.random() * 65536)), 0, id, 2, 2); - System.arraycopy(Utility.integerToTwoBytes((int)(Math.random() * 65536)), 0, id, 4, 2); - System.arraycopy(Utility.integerToTwoBytes((int)(Math.random() * 65536)), 0, id, 6, 2); - System.arraycopy(Utility.integerToTwoBytes((int)(Math.random() * 65536)), 0, id, 8, 2); - System.arraycopy(Utility.integerToTwoBytes((int)(Math.random() * 65536)), 0, id, 10, 2); - System.arraycopy(Utility.integerToTwoBytes((int)(Math.random() * 65536)), 0, id, 12, 2); - System.arraycopy(Utility.integerToTwoBytes((int)(Math.random() * 65536)), 0, id, 14, 2); - } - - public byte[] getTransactionID() { - byte[] idCopy = new byte[id.length]; - System.arraycopy(id, 0, idCopy, 0, id.length); - return idCopy; - } - - public boolean equalTransactionID(MessageHeader header) { - byte[] idHeader = header.getTransactionID(); - if (idHeader.length != 16) return false; - if ((idHeader[0] == id[0]) && (idHeader[1] == id[1]) && (idHeader[2] == id[2]) && (idHeader[3] == id[3]) && - (idHeader[4] == id[4]) && (idHeader[5] == id[5]) && (idHeader[6] == id[6]) && (idHeader[7] == id[7]) && - (idHeader[8] == id[8]) && (idHeader[9] == id[9]) && (idHeader[10] == id[10]) && (idHeader[11] == id[11]) && - (idHeader[12] == id[12]) && (idHeader[13] == id[13]) && (idHeader[14] == id[14]) && (idHeader[15] == id[15])) { - return true; - } else { - return false; - } - } - - public void addMessageAttribute(MessageAttribute attri) { - ma.put(attri.getType(), attri); - } - - public MessageAttribute getMessageAttribute(MessageAttribute.MessageAttributeType type) { - return ma.get(type); - } - - public byte[] getBytes() throws UtilityException { - int length = 20; - Iterator it = ma.keySet().iterator(); - while (it.hasNext()) { - MessageAttribute attri = ma.get(it.next()); - length += attri.getLength(); - } - // add attribute size + attributes.getSize(); - byte[] result = new byte[length]; - System.arraycopy(Utility.integerToTwoBytes(typeToInteger(type)), 0, result, 0, 2); - System.arraycopy(Utility.integerToTwoBytes(length-20), 0, result, 2, 2); - System.arraycopy(id, 0, result, 4, 16); - - // arraycopy of attributes - int offset = 20; - it = ma.keySet().iterator(); - while (it.hasNext()) { - MessageAttribute attri = ma.get(it.next()); - System.arraycopy(attri.getBytes(), 0, result, offset, attri.getLength()); - offset += attri.getLength(); - } - return result; - } - - public int getLength() throws UtilityException { - return getBytes().length; - } - - public void parseAttributes(byte[] data) throws MessageAttributeParsingException { - try { - byte[] lengthArray = new byte[2]; - System.arraycopy(data, 2, lengthArray, 0, 2); - int length = Utility.twoBytesToInteger(lengthArray); - System.arraycopy(data, 4, id, 0, 16); - byte[] cuttedData; - int offset = 20; - while (length > 0) { - cuttedData = new byte[length]; - System.arraycopy(data, offset, cuttedData, 0, length); - MessageAttribute ma = MessageAttribute.parseCommonHeader(cuttedData); - addMessageAttribute(ma); - length -= ma.getLength(); - offset += ma.getLength(); - } - } catch (UtilityException ue) { - throw new MessageAttributeParsingException("Parsing error"); - } - } - - public static MessageHeader parseHeader(byte[] data) throws MessageHeaderParsingException { - try { - MessageHeader mh = new MessageHeader(); - byte[] typeArray = new byte[2]; - System.arraycopy(data, 0, typeArray, 0, 2); - int type = Utility.twoBytesToInteger(typeArray); - switch (type) { - case BINDINGREQUEST: mh.setType(MessageHeaderType.BindingRequest); logger.finer("Binding Request received."); break; - case BINDINGRESPONSE: mh.setType(MessageHeaderType.BindingResponse); logger.finer("Binding Response received."); break; - case BINDINGERRORRESPONSE: mh.setType(MessageHeaderType.BindingErrorResponse); logger.finer("Binding Error Response received."); break; - case SHAREDSECRETREQUEST: mh.setType(MessageHeaderType.SharedSecretRequest); logger.finer("Shared Secret Request received."); break; - case SHAREDSECRETRESPONSE: mh.setType(MessageHeaderType.SharedSecretResponse); logger.finer("Shared Secret Response received."); break; - case SHAREDSECRETERRORRESPONSE: mh.setType(MessageHeaderType.SharedSecretErrorResponse); logger.finer("Shared Secret Error Response received.");break; - //turn - case ALLOCATEREQUEST: mh.setType(MessageHeaderType.AllocateRequest); logger.finer("Allocate Request received."); break; - case ALLOCATERESPONSE: mh.setType(MessageHeaderType.AllocateResponse); logger.finer("Allocate Response received."); break; - case ALLOCATEERRORRESPONSE: mh.setType(MessageHeaderType.AllocateErrorResponse); logger.finer("Allocate Errro received."); break; - case REFRESHREQUEST: mh.setType(MessageHeaderType.RefreshRequest); logger.finer("Refresh Request received."); break; - case REFRESHRESPONSE: mh.setType(MessageHeaderType.RefreshResponse); logger.finer("Refresh Response received."); break; - case REFRESHERRORRESPONSE: mh.setType(MessageHeaderType.RefreshErrorResponse); logger.finer("Refresh Error received."); break; - case CHANNELBINDREQUEST: mh.setType(MessageHeaderType.ChannelBindRequest); logger.finer("ChannelBind Request received."); break; - case CHANNELBINDRESPONSE: mh.setType(MessageHeaderType.ChannelBindResponse); logger.finer("ChannelBind Response received."); break; - case CHANNELBINDERRORRESPONSE: mh.setType(MessageHeaderType.ChannelBindErrorResponse); logger.finer("ChannelBind Error received."); break; - default: throw new MessageHeaderParsingException("Message type " + type + "is not supported"); - } - return mh; - } catch (UtilityException ue) { - throw new MessageHeaderParsingException("Parsing error"); - } - } -} \ No newline at end of file diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeaderException.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeaderException.java deleted file mode 100644 index f4a9fa498..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeaderException.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.header; - -public class MessageHeaderException extends Exception { - private static final long serialVersionUID = 3689066248944103737L; - - public MessageHeaderException(String mesg) { - super(mesg); - } -} \ No newline at end of file diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeaderInterface.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeaderInterface.java deleted file mode 100644 index 1b7a2cfe6..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeaderInterface.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.header; - -public interface MessageHeaderInterface { - public enum MessageHeaderType { BindingRequest - , BindingResponse - , BindingErrorResponse - , SharedSecretRequest - , SharedSecretResponse - , SharedSecretErrorResponse - , AllocateRequest - , AllocateResponse - , AllocateErrorResponse - , RefreshRequest - , RefreshResponse - , RefreshErrorResponse - , ChannelBindRequest - , ChannelBindResponse - , ChannelBindErrorResponse - ,SendIndication - ,DataIndication}; - final static int BINDINGREQUEST = 0x0001; - final static int BINDINGRESPONSE = 0x0101; - final static int BINDINGERRORRESPONSE = 0x0111; - final static int SHAREDSECRETREQUEST = 0x0002; - final static int SHAREDSECRETRESPONSE = 0x0102; - final static int SHAREDSECRETERRORRESPONSE = 0x0112; - -// TURN defines ten new Message Types: -//Request/Response Transactions -//0x003 : Allocate -//0x004 : Refresh -//0x009 : ChannelBind -//0x006 : Send -//0x007 : Data - - - final static int ALLOCATEREQUEST = 0x0003; - final static int ALLOCATERESPONSE = 0x0103; - final static int ALLOCATEERRORRESPONSE = 0x0113; - final static int REFRESHREQUEST = 0x0004; - final static int REFRESHRESPONSE = 0x0104; - final static int REFRESHERRORRESPONSE = 0x0114; - final static int CHANNELBINDREQUEST = 0x0009; - final static int CHANNELBINDRESPONSE = 0x0109; - final static int CHANNELBINDERRORRESPONSE = 0x0119; - final static int SENDINDICATION = 0x0006; - final static int DATAINDICATION = 0x0007; - - -} \ No newline at end of file diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeaderParsingException.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeaderParsingException.java deleted file mode 100644 index d5192ef28..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/header/MessageHeaderParsingException.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.header; - -public class MessageHeaderParsingException extends MessageHeaderException { - private static final long serialVersionUID = 3544393617029607478L; - - public MessageHeaderParsingException(String mesg) { - super(mesg); - } -} \ No newline at end of file diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/BindingLifetimeTest.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/BindingLifetimeTest.java deleted file mode 100644 index 1dca91b47..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/BindingLifetimeTest.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.test; - -import java.util.logging.*; -import java.util.*; -import java.io.*; -import java.net.*; - -import de.javawi.jstun.attribute.*; -import de.javawi.jstun.header.*; -import de.javawi.jstun.util.UtilityException; - -public class BindingLifetimeTest { - private static Logger logger = Logger.getLogger("de.javawi.stun.test.BindingLifetimeTest"); - String stunServer; - int port; - int timeout = 300; //ms - MappedAddress ma; - Timer timer; - DatagramSocket initialSocket; - - // start value for binary search - should be carefully choosen - int upperBinarySearchLifetime = 345000; // ms - int lowerBinarySearchLifetime = 0; - int binarySearchLifetime = ( upperBinarySearchLifetime + lowerBinarySearchLifetime ) / 2; - - // lifetime value - int lifetime = -1; // -1 means undefined. - boolean completed = false; - - public BindingLifetimeTest(String stunServer, int port) { - super(); - this.stunServer = stunServer; - this.port = port; - timer = new Timer(true); - } - - public void test() throws UtilityException, SocketException, UnknownHostException, IOException, MessageAttributeParsingException, MessageAttributeException, MessageHeaderParsingException { - initialSocket = new DatagramSocket(); - initialSocket.connect(InetAddress.getByName(stunServer), port); - initialSocket.setSoTimeout(timeout); - - if (bindingCommunicationInitialSocket()) { - return; - } - BindingLifetimeTask task = new BindingLifetimeTask(); - timer.schedule(task, binarySearchLifetime); - logger.finer("Timer scheduled initially: " + binarySearchLifetime + "."); - } - - private boolean bindingCommunicationInitialSocket() throws UtilityException, IOException, MessageHeaderParsingException, MessageAttributeParsingException { - MessageHeader sendMH = new MessageHeader(MessageHeader.MessageHeaderType.BindingRequest); - sendMH.generateTransactionID(); - ChangeRequest changeRequest = new ChangeRequest(); - sendMH.addMessageAttribute(changeRequest); - byte[] data = sendMH.getBytes(); - - DatagramPacket send = new DatagramPacket(data, data.length, InetAddress.getByName(stunServer), port); - initialSocket.send(send); - logger.finer("Binding Request sent."); - - MessageHeader receiveMH = new MessageHeader(); - while (!(receiveMH.equalTransactionID(sendMH))) { - DatagramPacket receive = new DatagramPacket(new byte[200], 200); - initialSocket.receive(receive); - receiveMH = MessageHeader.parseHeader(receive.getData()); - receiveMH.parseAttributes(receive.getData()); - } - ma = (MappedAddress) receiveMH.getMessageAttribute(MessageAttribute.MessageAttributeType.MappedAddress); - ErrorCode ec = (ErrorCode) receiveMH.getMessageAttribute(MessageAttribute.MessageAttributeType.ErrorCode); - if (ec != null) { - logger.config("Message header contains an Errorcode message attribute."); - return true; - } - if (ma == null) { - logger.config("Response does not contain a Mapped Address message attribute."); - return true; - } - return false; - } - - public int getLifetime() { - return lifetime; - } - - public boolean isCompleted() { - return completed; - } - - public void setUpperBinarySearchLifetime(int upperBinarySearchLifetime) { - this.upperBinarySearchLifetime = upperBinarySearchLifetime; - binarySearchLifetime = ( upperBinarySearchLifetime + lowerBinarySearchLifetime ) / 2; - } - - class BindingLifetimeTask extends TimerTask { - - public BindingLifetimeTask() { - super(); - } - - public void run() { - try { - lifetimeQuery(); - } catch (Exception e) { - logger.config("Unhandled Exception. BindLifetimeTasks stopped."); - e.printStackTrace(); - } - } - - public void lifetimeQuery() throws UtilityException, MessageAttributeException, MessageHeaderParsingException, MessageAttributeParsingException, IOException { - try { - DatagramSocket socket = new DatagramSocket(); - socket.connect(InetAddress.getByName(stunServer), port); - socket.setSoTimeout(timeout); - - MessageHeader sendMH = new MessageHeader(MessageHeader.MessageHeaderType.BindingRequest); - sendMH.generateTransactionID(); - ChangeRequest changeRequest = new ChangeRequest(); - ResponseAddress responseAddress = new ResponseAddress(); - responseAddress.setAddress(ma.getAddress()); - responseAddress.setPort(ma.getPort()); - sendMH.addMessageAttribute(changeRequest); - sendMH.addMessageAttribute(responseAddress); - byte[] data = sendMH.getBytes(); - - DatagramPacket send = new DatagramPacket(data, data.length, InetAddress.getByName(stunServer), port); - socket.send(send); - logger.finer("Binding Request sent."); - - MessageHeader receiveMH = new MessageHeader(); - while (!(receiveMH.equalTransactionID(sendMH))) { - DatagramPacket receive = new DatagramPacket(new byte[200], 200); - initialSocket.receive(receive); - receiveMH = MessageHeader.parseHeader(receive.getData()); - receiveMH.parseAttributes(receive.getData()); - } - ErrorCode ec = (ErrorCode) receiveMH.getMessageAttribute(MessageAttribute.MessageAttributeType.ErrorCode); - if (ec != null) { - logger.config("Message header contains errorcode message attribute."); - return; - } - logger.finer("Binding Response received."); - if (upperBinarySearchLifetime == (lowerBinarySearchLifetime + 1)) { - logger.config("BindingLifetimeTest completed. UDP binding lifetime: " + binarySearchLifetime + "."); - completed = true; - return; - } - lifetime = binarySearchLifetime; - logger.finer("Lifetime update: " + lifetime + "."); - lowerBinarySearchLifetime = binarySearchLifetime; - binarySearchLifetime = ( upperBinarySearchLifetime + lowerBinarySearchLifetime ) / 2; - if (binarySearchLifetime > 0) { - BindingLifetimeTask task = new BindingLifetimeTask(); - timer.schedule(task, binarySearchLifetime); - logger.finer("Timer scheduled: " + binarySearchLifetime + "."); - } else { - completed = true; - } - } catch (SocketTimeoutException ste) { - logger.finest("Read operation at query socket timeout."); - if (upperBinarySearchLifetime == (lowerBinarySearchLifetime + 1)) { - logger.config("BindingLifetimeTest completed. UDP binding lifetime: " + binarySearchLifetime + "."); - completed = true; - return; - } - upperBinarySearchLifetime = binarySearchLifetime; - binarySearchLifetime = ( upperBinarySearchLifetime + lowerBinarySearchLifetime ) / 2; - if (binarySearchLifetime > 0) { - if (bindingCommunicationInitialSocket()) { - return; - } - BindingLifetimeTask task = new BindingLifetimeTask(); - timer.schedule(task, binarySearchLifetime); - logger.finer("Timer scheduled: " + binarySearchLifetime + "."); - } else { - completed = true; - } - } - } - } -} - diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/DiscoveryInfo.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/DiscoveryInfo.java deleted file mode 100644 index abaab15eb..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/DiscoveryInfo.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.test; - -import java.net.*; - -public class DiscoveryInfo { - private InetAddress testIP; - private boolean error = false; - private int errorResponseCode = 0; - private String errorReason; - private boolean openAccess = false; - private boolean blockedUDP = false; - private boolean fullCone = false; - private boolean restrictedCone = false; - private boolean portRestrictedCone = false; - private boolean symmetric = false; - private boolean symmetricUDPFirewall = false; - private InetAddress publicIP; - - public DiscoveryInfo(InetAddress testIP) { - this.testIP = testIP; - } - - public boolean isError() { - return error; - } - - public void setError(int responseCode, String reason) { - this.error = true; - this.errorResponseCode = responseCode; - this.errorReason = reason; - } - - public boolean isOpenAccess() { - if (error) return false; - return openAccess; - } - - public void setOpenAccess() { - this.openAccess = true; - } - - public boolean isBlockedUDP() { - if (error) return false; - return blockedUDP; - } - - public void setBlockedUDP() { - this.blockedUDP = true; - } - - public boolean isFullCone() { - if (error) return false; - return fullCone; - } - - public void setFullCone() { - this.fullCone = true; - } - - public boolean isPortRestrictedCone() { - if (error) return false; - return portRestrictedCone; - } - - public void setPortRestrictedCone() { - this.portRestrictedCone = true; - } - - public boolean isRestrictedCone() { - if (error) return false; - return restrictedCone; - } - - public void setRestrictedCone() { - this.restrictedCone = true; - } - - public boolean isSymmetric() { - if (error) return false; - return symmetric; - } - - public void setSymmetric() { - this.symmetric = true; - } - - public boolean isSymmetricUDPFirewall() { - if (error) return false; - return symmetricUDPFirewall; - } - - public void setSymmetricUDPFirewall() { - this.symmetricUDPFirewall = true; - } - - public InetAddress getPublicIP() { - return publicIP; - } - - public InetAddress getLocalIP() { - return testIP; - } - - public void setPublicIP(InetAddress publicIP) { - this.publicIP = publicIP; - } - - public String toString() { - StringBuffer sb = new StringBuffer(); - sb.append("Network interface: "); - try { - sb.append(NetworkInterface.getByInetAddress(testIP).getName()); - } catch (SocketException se) { - sb.append("unknown"); - } - sb.append("\n"); - sb.append("Local IP address: "); - sb.append(testIP.getHostAddress()); - sb.append("\n"); - if (error) { - sb.append(errorReason + " - Responsecode: " + errorResponseCode); - return sb.toString(); - } - sb.append("Result: "); - if (openAccess) sb.append("Open access to the Internet.\n"); - if (blockedUDP) sb.append("Firewall blocks UDP.\n"); - if (fullCone) sb.append("Full Cone NAT handles connections.\n"); - if (restrictedCone) sb.append("Restricted Cone NAT handles connections.\n"); - if (portRestrictedCone) sb.append("Port restricted Cone NAT handles connections.\n"); - if (symmetric) sb.append("Symmetric Cone NAT handles connections.\n"); - if (symmetricUDPFirewall) sb.append ("Symmetric UDP Firewall handles connections.\n"); - if (!openAccess && !blockedUDP && !fullCone && !restrictedCone && !portRestrictedCone && !symmetric && !symmetricUDPFirewall) sb.append("unkown\n"); - sb.append("Public IP address: "); - if (publicIP != null) { - sb.append(publicIP.getHostAddress()); - } else { - sb.append("unknown"); - } - sb.append("\n"); - return sb.toString(); - } -} diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/DiscoveryTest.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/DiscoveryTest.java deleted file mode 100644 index 4f940adfe..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/DiscoveryTest.java +++ /dev/null @@ -1,351 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.test; - -import java.io.IOException; -import java.net.DatagramPacket; -import java.net.DatagramSocket; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.net.SocketException; -import java.net.SocketTimeoutException; -import java.net.UnknownHostException; -import java.util.logging.Logger; - - - - - -import de.javawi.jstun.attribute.ChangeRequest; -import de.javawi.jstun.attribute.ChangedAddress; -import de.javawi.jstun.attribute.ErrorCode; -import de.javawi.jstun.attribute.MappedAddress; -import de.javawi.jstun.attribute.MessageAttribute; -import de.javawi.jstun.attribute.MessageAttributeException; -import de.javawi.jstun.attribute.MessageAttributeParsingException; -import de.javawi.jstun.header.MessageHeader; -import de.javawi.jstun.header.MessageHeaderParsingException; -import de.javawi.jstun.util.UtilityException; - -public class DiscoveryTest { - private static Logger logger = Logger.getLogger("de.javawi.stun.test.DiscoveryTest"); - InetAddress iaddress; - String stunServer; - int port; - int timeoutInitValue = 300; //ms - MappedAddress ma = null; - ChangedAddress ca = null; - boolean nodeNatted = true; - DatagramSocket socketTest1 = null; - DiscoveryInfo di = null; - - public DiscoveryTest(InetAddress iaddress , String stunServer, int port) { - super(); - this.iaddress = iaddress; - this.stunServer = stunServer; - this.port = port; - } - - public DiscoveryInfo test() throws UtilityException, SocketException, UnknownHostException, IOException, MessageAttributeParsingException, MessageAttributeException, MessageHeaderParsingException{ - ma = null; - ca = null; - nodeNatted = true; - socketTest1 = null; - di = new DiscoveryInfo(iaddress); - - if (test1()) { - if (test2()) { - if (test1Redo()) { - test3(); - } - } - } - - socketTest1.close(); - - return di; - } - - private boolean test1() throws UtilityException, SocketException, UnknownHostException, IOException, MessageAttributeParsingException, MessageHeaderParsingException { - int timeSinceFirstTransmission = 0; - int timeout = timeoutInitValue; - while (true) { - try { - // Test 1 including response - socketTest1 = new DatagramSocket(new InetSocketAddress(iaddress, 0)); - socketTest1.setReuseAddress(true); - socketTest1.connect(InetAddress.getByName(stunServer), port); - socketTest1.setSoTimeout(timeout); - - MessageHeader sendMH = new MessageHeader(MessageHeader.MessageHeaderType.BindingRequest); - sendMH.generateTransactionID(); - - ChangeRequest changeRequest = new ChangeRequest(); - sendMH.addMessageAttribute(changeRequest); - - byte[] data = sendMH.getBytes(); - DatagramPacket send = new DatagramPacket(data, data.length); - socketTest1.send(send); - logger.finer("Test 1: Binding Request sent."); - - MessageHeader receiveMH = new MessageHeader(); - while (!(receiveMH.equalTransactionID(sendMH))) { - DatagramPacket receive = new DatagramPacket(new byte[200], 200); - socketTest1.receive(receive); - receiveMH = MessageHeader.parseHeader(receive.getData()); - receiveMH.parseAttributes(receive.getData()); - } - - ma = (MappedAddress) receiveMH.getMessageAttribute(MessageAttribute.MessageAttributeType.MappedAddress); - ca = (ChangedAddress) receiveMH.getMessageAttribute(MessageAttribute.MessageAttributeType.ChangedAddress); - ErrorCode ec = (ErrorCode) receiveMH.getMessageAttribute(MessageAttribute.MessageAttributeType.ErrorCode); - if (ec != null) { - di.setError(ec.getResponseCode(), ec.getReason()); - logger.config("Message header contains an Errorcode message attribute."); - return false; - } - if ((ma == null) || (ca == null)) { - di.setError(700, "The server is sending an incomplete response (Mapped Address and Changed Address message attributes are missing). The client should not retry."); - logger.config("Response does not contain a Mapped Address or Changed Address message attribute."); - return false; - } else { - di.setPublicIP(ma.getAddress().getInetAddress()); - if ((ma.getPort() == socketTest1.getLocalPort()) && (ma.getAddress().getInetAddress().equals(socketTest1.getLocalAddress()))) { - logger.fine("Node is not natted."); - nodeNatted = false; - } else { - logger.fine("Node is natted."); - } - return true; - } - } catch (SocketTimeoutException ste) { - if (timeSinceFirstTransmission < 7900) { - logger.finer("Test 1: Socket timeout while receiving the response."); - timeSinceFirstTransmission += timeout; - int timeoutAddValue = (timeSinceFirstTransmission * 2); - if (timeoutAddValue > 1600) timeoutAddValue = 1600; - timeout = timeoutAddValue; - } else { - // node is not capable of udp communication - logger.finer("Test 1: Socket timeout while receiving the response. Maximum retry limit exceed. Give up."); - di.setBlockedUDP(); - logger.fine("Node is not capable of UDP communication."); - return false; - } - } - } - } - - private boolean test2() throws UtilityException, SocketException, UnknownHostException, IOException, MessageAttributeParsingException, MessageAttributeException, MessageHeaderParsingException { - int timeSinceFirstTransmission = 0; - int timeout = timeoutInitValue; - while (true) { - try { - // Test 2 including response - DatagramSocket sendSocket = new DatagramSocket(new InetSocketAddress(iaddress, 0)); - sendSocket.connect(InetAddress.getByName(stunServer), port); - sendSocket.setSoTimeout(timeout); - - MessageHeader sendMH = new MessageHeader(MessageHeader.MessageHeaderType.BindingRequest); - sendMH.generateTransactionID(); - - ChangeRequest changeRequest = new ChangeRequest(); - changeRequest.setChangeIP(); - changeRequest.setChangePort(); - sendMH.addMessageAttribute(changeRequest); - - byte[] data = sendMH.getBytes(); - DatagramPacket send = new DatagramPacket(data, data.length); - sendSocket.send(send); - logger.finer("Test 2: Binding Request sent."); - - int localPort = sendSocket.getLocalPort(); - InetAddress localAddress = sendSocket.getLocalAddress(); - - sendSocket.close(); - - DatagramSocket receiveSocket = new DatagramSocket(localPort, localAddress); - receiveSocket.connect(ca.getAddress().getInetAddress(), ca.getPort()); - receiveSocket.setSoTimeout(timeout); - - MessageHeader receiveMH = new MessageHeader(); - while(!(receiveMH.equalTransactionID(sendMH))) { - DatagramPacket receive = new DatagramPacket(new byte[200], 200); - receiveSocket.receive(receive); - receiveMH = MessageHeader.parseHeader(receive.getData()); - receiveMH.parseAttributes(receive.getData()); - } - ErrorCode ec = (ErrorCode) receiveMH.getMessageAttribute(MessageAttribute.MessageAttributeType.ErrorCode); - if (ec != null) { - di.setError(ec.getResponseCode(), ec.getReason()); - logger.config("Message header contains an Errorcode message attribute."); - return false; - } - if (!nodeNatted) { - di.setOpenAccess(); - logger.fine("Node has open access to the Internet (or, at least the node is behind a full-cone NAT without translation)."); - } else { - di.setFullCone(); - logger.fine("Node is behind a full-cone NAT."); - } - return false; - } catch (SocketTimeoutException ste) { - if (timeSinceFirstTransmission < 7900) { - logger.finer("Test 2: Socket timeout while receiving the response."); - timeSinceFirstTransmission += timeout; - int timeoutAddValue = (timeSinceFirstTransmission * 2); - if (timeoutAddValue > 1600) timeoutAddValue = 1600; - timeout = timeoutAddValue; - } else { - logger.finer("Test 2: Socket timeout while receiving the response. Maximum retry limit exceed. Give up."); - if (!nodeNatted) { - di.setSymmetricUDPFirewall(); - logger.fine("Node is behind a symmetric UDP firewall."); - return false; - } else { - // not is natted - // redo test 1 with address and port as offered in the changed-address message attribute - return true; - } - } - } - } - } - - private boolean test1Redo() throws UtilityException, SocketException, UnknownHostException, IOException, MessageAttributeParsingException, MessageHeaderParsingException{ - int timeSinceFirstTransmission = 0; - int timeout = timeoutInitValue; - while (true) { - // redo test 1 with address and port as offered in the changed-address message attribute - try { - // Test 1 with changed port and address values - socketTest1.connect(ca.getAddress().getInetAddress(), ca.getPort()); - socketTest1.setSoTimeout(timeout); - - MessageHeader sendMH = new MessageHeader(MessageHeader.MessageHeaderType.BindingRequest); - sendMH.generateTransactionID(); - - ChangeRequest changeRequest = new ChangeRequest(); - sendMH.addMessageAttribute(changeRequest); - - byte[] data = sendMH.getBytes(); - DatagramPacket send = new DatagramPacket(data, data.length); - socketTest1.send(send); - logger.finer("Test 1 redo with changed address: Binding Request sent."); - - MessageHeader receiveMH = new MessageHeader(); - while (!(receiveMH.equalTransactionID(sendMH))) { - DatagramPacket receive = new DatagramPacket(new byte[200], 200); - socketTest1.receive(receive); - receiveMH = MessageHeader.parseHeader(receive.getData()); - receiveMH.parseAttributes(receive.getData()); - } - MappedAddress ma2 = (MappedAddress) receiveMH.getMessageAttribute(MessageAttribute.MessageAttributeType.MappedAddress); - ErrorCode ec = (ErrorCode) receiveMH.getMessageAttribute(MessageAttribute.MessageAttributeType.ErrorCode); - if (ec != null) { - di.setError(ec.getResponseCode(), ec.getReason()); - logger.config("Message header contains an Errorcode message attribute."); - return false; - } - if (ma2 == null) { - di.setError(700, "The server is sending an incomplete response (Mapped Address message attribute is missing). The client should not retry."); - logger.config("Response does not contain a Mapped Address message attribute."); - return false; - } else { - if ((ma.getPort() != ma2.getPort()) || (!(ma.getAddress().getInetAddress().equals(ma2.getAddress().getInetAddress())))) { - di.setSymmetric(); - logger.fine("Node is behind a symmetric NAT."); - return false; - } - } - return true; - } catch (SocketTimeoutException ste2) { - if (timeSinceFirstTransmission < 7900) { - logger.config("Test 1 redo with changed address: Socket timeout while receiving the response."); - timeSinceFirstTransmission += timeout; - int timeoutAddValue = (timeSinceFirstTransmission * 2); - if (timeoutAddValue > 1600) timeoutAddValue = 1600; - timeout = timeoutAddValue; - } else { - logger.config("Test 1 redo with changed address: Socket timeout while receiving the response. Maximum retry limit exceed. Give up."); - return false; - } - } - } - } - - private void test3() throws UtilityException, SocketException, UnknownHostException, IOException, MessageAttributeParsingException, MessageAttributeException, MessageHeaderParsingException { - int timeSinceFirstTransmission = 0; - int timeout = timeoutInitValue; - while (true) { - try { - // Test 3 including response - DatagramSocket sendSocket = new DatagramSocket(new InetSocketAddress(iaddress, 0)); - sendSocket.connect(InetAddress.getByName(stunServer), port); - sendSocket.setSoTimeout(timeout); - - MessageHeader sendMH = new MessageHeader(MessageHeader.MessageHeaderType.BindingRequest); - sendMH.generateTransactionID(); - - ChangeRequest changeRequest = new ChangeRequest(); - changeRequest.setChangePort(); - sendMH.addMessageAttribute(changeRequest); - - byte[] data = sendMH.getBytes(); - DatagramPacket send = new DatagramPacket(data, data.length); - sendSocket.send(send); - logger.finer("Test 3: Binding Request sent."); - - int localPort = sendSocket.getLocalPort(); - InetAddress localAddress = sendSocket.getLocalAddress(); - - sendSocket.close(); - - DatagramSocket receiveSocket = new DatagramSocket(localPort, localAddress); - receiveSocket.connect(InetAddress.getByName(stunServer), ca.getPort()); - receiveSocket.setSoTimeout(timeout); - - MessageHeader receiveMH = new MessageHeader(); - while (!(receiveMH.equalTransactionID(sendMH))) { - DatagramPacket receive = new DatagramPacket(new byte[200], 200); - receiveSocket.receive(receive); - receiveMH = MessageHeader.parseHeader(receive.getData()); - receiveMH.parseAttributes(receive.getData()); - } - ErrorCode ec = (ErrorCode) receiveMH.getMessageAttribute(MessageAttribute.MessageAttributeType.ErrorCode); - if (ec != null) { - di.setError(ec.getResponseCode(), ec.getReason()); - logger.config("Message header contains an Errorcode message attribute."); - return; - } - if (nodeNatted) { - di.setRestrictedCone(); - logger.fine("Node is behind a restricted NAT."); - return; - } - } catch (SocketTimeoutException ste) { - if (timeSinceFirstTransmission < 7900) { - logger.finer("Test 3: Socket timeout while receiving the response."); - timeSinceFirstTransmission += timeout; - int timeoutAddValue = (timeSinceFirstTransmission * 2); - if (timeoutAddValue > 1600) timeoutAddValue = 1600; - timeout = timeoutAddValue; - } else { - logger.finer("Test 3: Socket timeout while receiving the response. Maximum retry limit exceed. Give up."); - di.setPortRestrictedCone(); - logger.fine("Node is behind a port restricted NAT."); - return; - } - } - } - } -} diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/BindingLifetimeTestDemo.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/BindingLifetimeTestDemo.java deleted file mode 100644 index 37e20f846..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/BindingLifetimeTestDemo.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.test.demo; - -import java.util.logging.FileHandler; -import java.util.logging.Handler; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.logging.SimpleFormatter; - -import de.javawi.jstun.test.BindingLifetimeTest; - -public class BindingLifetimeTestDemo { - public static void main(String args[]) { - try { - Handler fh = new FileHandler("logging.txt"); - fh.setFormatter(new SimpleFormatter()); - Logger.getLogger("de.javawi.stun").addHandler(fh); - Logger.getLogger("de.javawi.stun").setLevel(Level.ALL); - BindingLifetimeTest test = new BindingLifetimeTest("iphone-stun.freenet.de", 3478); - // iphone-stun.freenet.de:3478 - // larry.gloo.net:3478 - // stun.xten.net:3478 - test.test(); - boolean continueWhile = true; - while(continueWhile) { - Thread.sleep(5000); - if (test.getLifetime() != -1) { - System.out.println("Lifetime: " + test.getLifetime() + " Finished: " + test.isCompleted()); - if (test.isCompleted()) continueWhile = false; - } - } - } catch (Exception e) { - System.out.println(e.getMessage()); - e.printStackTrace(); - } - } -} diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/DiscoveryTestDemo.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/DiscoveryTestDemo.java deleted file mode 100644 index 76a6c17e7..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/DiscoveryTestDemo.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.test.demo; - -import java.net.BindException; -import java.net.InetAddress; -import java.net.NetworkInterface; -import java.util.Enumeration; -import java.util.logging.FileHandler; -import java.util.logging.Handler; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.logging.SimpleFormatter; - -import de.javawi.jstun.test.DiscoveryTest; - -public class DiscoveryTestDemo implements Runnable { - InetAddress iaddress; - - public DiscoveryTestDemo(InetAddress iaddress) { - this.iaddress = iaddress; - } - - public void run() { - try { - DiscoveryTest test = new DiscoveryTest(iaddress, "jstun.javawi.de", 3478); - //DiscoveryTest test = new DiscoveryTest(iaddress, "stun.sipgate.net", 10000); - // iphone-stun.freenet.de:3478 - // larry.gloo.net:3478 - // stun.xten.net:3478 - // stun.sipgate.net:10000 - System.out.println(test.test()); - } catch (BindException be) { - System.out.println(iaddress.toString() + ": " + be.getMessage()); - } catch (Exception e) { - System.out.println(e.getMessage()); - e.printStackTrace(); - } - } - - public static void main(String args[]) { - try { - Handler fh = new FileHandler("logging.txt"); - fh.setFormatter(new SimpleFormatter()); - Logger.getLogger("de.javawi.stun").addHandler(fh); - Logger.getLogger("de.javawi.stun").setLevel(Level.ALL); - - Enumeration ifaces = NetworkInterface.getNetworkInterfaces(); - while (ifaces.hasMoreElements()) { - NetworkInterface iface = ifaces.nextElement(); - Enumeration iaddresses = iface.getInetAddresses(); - while (iaddresses.hasMoreElements()) { - InetAddress iaddress = iaddresses.nextElement(); - if (Class.forName("java.net.Inet4Address").isInstance(iaddress)) { - if ((!iaddress.isLoopbackAddress()) && (!iaddress.isLinkLocalAddress())) { - Thread thread = new Thread(new DiscoveryTestDemo(iaddress)); - thread.start(); - } - } - } - } - } catch (Exception e) { - System.out.println(e.getMessage()); - } - } -} diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/StunServer.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/StunServer.java deleted file mode 100644 index b72ffe7c2..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/StunServer.java +++ /dev/null @@ -1,263 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.test.demo; - -import java.io.IOException; -import java.net.DatagramPacket; -import java.net.DatagramSocket; -import java.net.InetAddress; -import java.net.SocketException; -import java.net.UnknownHostException; -import java.util.Vector; -import java.util.logging.FileHandler; -import java.util.logging.Handler; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.logging.SimpleFormatter; - -import de.javawi.jstun.attribute.ChangeRequest; -import de.javawi.jstun.attribute.ChangedAddress; -import de.javawi.jstun.attribute.MappedAddress; -import de.javawi.jstun.attribute.MessageAttributeException; -import de.javawi.jstun.attribute.MessageAttributeParsingException; -import de.javawi.jstun.attribute.ResponseAddress; -import de.javawi.jstun.attribute.SourceAddress; -import de.javawi.jstun.attribute.UnknownAttribute; -import de.javawi.jstun.attribute.UnknownMessageAttributeException; -import de.javawi.jstun.attribute.MessageAttributeInterface.MessageAttributeType; -import de.javawi.jstun.header.MessageHeader; -import de.javawi.jstun.header.MessageHeaderParsingException; -import de.javawi.jstun.header.MessageHeaderInterface.MessageHeaderType; -import de.javawi.jstun.util.Address; -import de.javawi.jstun.util.UtilityException; - -/* - * This class implements a STUN server as described in RFC 3489. - * The server requires a machine that is dual-homed to be functional. - */ -public class StunServer { - private static Logger logger = Logger.getLogger("de.javawi.stun.test.StunServer"); - Vector sockets; - - public StunServer(int primaryPort, InetAddress primary, int secondaryPort, InetAddress secondary) throws SocketException { - sockets = new Vector(); - sockets.add(new DatagramSocket(primaryPort, primary)); - sockets.add(new DatagramSocket(secondaryPort, primary)); - sockets.add(new DatagramSocket(primaryPort, secondary)); - sockets.add(new DatagramSocket(secondaryPort, secondary)); - } - - public void start() throws SocketException { - for (DatagramSocket socket : sockets) { - socket.setReceiveBufferSize(2000); - StunServerReceiverThread ssrt = new StunServerReceiverThread(socket); - ssrt.start(); - } - } - - /* - * Inner class to handle incoming packets and react accordingly. - * I decided not to start a thread for every received Binding Request, because the time - * required to receive a Binding Request, parse it, generate a Binding Response and send - * it varies only between 2 and 4 milliseconds. This amount of time is small enough so - * that no extra thread is needed for incoming Binding Request. - */ - class StunServerReceiverThread extends Thread { - private DatagramSocket receiverSocket; - private DatagramSocket changedPort; - private DatagramSocket changedIP; - private DatagramSocket changedPortIP; - - StunServerReceiverThread(DatagramSocket datagramSocket) { - this.receiverSocket = datagramSocket; - for (DatagramSocket socket : sockets) { - if ((socket.getLocalPort() != receiverSocket.getLocalPort()) && - (socket.getLocalAddress().equals(receiverSocket.getLocalAddress()))) - changedPort = socket; - if ((socket.getLocalPort() == receiverSocket.getLocalPort()) && - (!socket.getLocalAddress().equals(receiverSocket.getLocalAddress()))) - changedIP = socket; - if ((socket.getLocalPort() != receiverSocket.getLocalPort()) && - (!socket.getLocalAddress().equals(receiverSocket.getLocalAddress()))) - changedPortIP = socket; - } - } - - public void run() { - while (true) { - try { - DatagramPacket receive = new DatagramPacket(new byte[200], 200); - receiverSocket.receive(receive); - logger.finest(receiverSocket.getLocalAddress().getHostAddress() + ":" + receiverSocket.getLocalPort() + " datagram received from " + receive.getAddress().getHostAddress() + ":" + receive.getPort()); - MessageHeader receiveMH = MessageHeader.parseHeader(receive.getData()); - try { - receiveMH.parseAttributes(receive.getData()); - if (receiveMH.getType() == MessageHeaderType.BindingRequest) { - logger.config(receiverSocket.getLocalAddress().getHostAddress() + ":" + receiverSocket.getLocalPort() + " Binding Request received from " + receive.getAddress().getHostAddress() + ":" + receive.getPort()); - ChangeRequest cr = (ChangeRequest) receiveMH.getMessageAttribute(MessageAttributeType.ChangeRequest); - if (cr == null) throw new MessageAttributeException("Message attribute change request is not set."); - ResponseAddress ra = (ResponseAddress) receiveMH.getMessageAttribute(MessageAttributeType.ResponseAddress); - - MessageHeader sendMH = new MessageHeader(MessageHeaderType.BindingResponse); - sendMH.setTransactionID(receiveMH.getTransactionID()); - - // Mapped address attribute - MappedAddress ma = new MappedAddress(); - ma.setAddress(new Address(receive.getAddress().getAddress())); - ma.setPort(receive.getPort()); - sendMH.addMessageAttribute(ma); - // Changed address attribute - ChangedAddress ca = new ChangedAddress(); - ca.setAddress(new Address(changedPortIP.getLocalAddress().getAddress())); - ca.setPort(changedPortIP.getLocalPort()); - sendMH.addMessageAttribute(ca); - if (cr.isChangePort() && (!cr.isChangeIP())) { - logger.finer("Change port received in Change Request attribute"); - // Source address attribute - SourceAddress sa = new SourceAddress(); - sa.setAddress(new Address(changedPort.getLocalAddress().getAddress())); - sa.setPort(changedPort.getLocalPort()); - sendMH.addMessageAttribute(sa); - byte[] data = sendMH.getBytes(); - DatagramPacket send = new DatagramPacket(data, data.length); - if (ra != null) { - send.setPort(ra.getPort()); - send.setAddress(ra.getAddress().getInetAddress()); - } else { - send.setPort(receive.getPort()); - send.setAddress(receive.getAddress()); - } - changedPort.send(send); - logger.config(changedPort.getLocalAddress().getHostAddress() + ":" + changedPort.getLocalPort() + " send Binding Response to " + send.getAddress().getHostAddress() + ":" + send.getPort()); - } else if ((!cr.isChangePort()) && cr.isChangeIP()) { - logger.finer("Change ip received in Change Request attribute"); - // Source address attribute - SourceAddress sa = new SourceAddress(); - sa.setAddress(new Address(changedIP.getLocalAddress().getAddress())); - sa.setPort(changedIP.getLocalPort()); - sendMH.addMessageAttribute(sa); - byte[] data = sendMH.getBytes(); - DatagramPacket send = new DatagramPacket(data, data.length); - if (ra != null) { - send.setPort(ra.getPort()); - send.setAddress(ra.getAddress().getInetAddress()); - } else { - send.setPort(receive.getPort()); - send.setAddress(receive.getAddress()); - } - changedIP.send(send); - logger.config(changedIP.getLocalAddress().getHostAddress() + ":" + changedIP.getLocalPort() + " send Binding Response to " + send.getAddress().getHostAddress() + ":" + send.getPort()); - } else if ((!cr.isChangePort()) && (!cr.isChangeIP())) { - logger.finer("Nothing received in Change Request attribute"); - // Source address attribute - SourceAddress sa = new SourceAddress(); - sa.setAddress(new Address(receiverSocket.getLocalAddress().getAddress())); - sa.setPort(receiverSocket.getLocalPort()); - sendMH.addMessageAttribute(sa); - byte[] data = sendMH.getBytes(); - DatagramPacket send = new DatagramPacket(data, data.length); - if (ra != null) { - send.setPort(ra.getPort()); - send.setAddress(ra.getAddress().getInetAddress()); - } else { - send.setPort(receive.getPort()); - send.setAddress(receive.getAddress()); - } - receiverSocket.send(send); - logger.config(receiverSocket.getLocalAddress().getHostAddress() + ":" + receiverSocket.getLocalPort() + " send Binding Response to " + send.getAddress().getHostAddress() + ":" + send.getPort()); - } else if (cr.isChangePort() && cr.isChangeIP()) { - logger.finer("Change port and ip received in Change Request attribute"); - // Source address attribute - SourceAddress sa = new SourceAddress(); - sa.setAddress(new Address(changedPortIP.getLocalAddress().getAddress())); - sa.setPort(changedPortIP.getLocalPort()); - sendMH.addMessageAttribute(sa); - byte[] data = sendMH.getBytes(); - DatagramPacket send = new DatagramPacket(data, data.length); - if (ra != null) { - send.setPort(ra.getPort()); - send.setAddress(ra.getAddress().getInetAddress()); - } else { - send.setPort(receive.getPort()); - send.setAddress(receive.getAddress()); - } - changedPortIP.send(send); - logger.config(changedPortIP.getLocalAddress().getHostAddress() + ":" + changedPortIP.getLocalPort() + " send Binding Response to " + send.getAddress().getHostAddress() + ":" + send.getPort()); - } - } - } catch (UnknownMessageAttributeException umae) { - umae.printStackTrace(); - // Generate Binding error response - MessageHeader sendMH = new MessageHeader(MessageHeaderType.BindingErrorResponse); - sendMH.setTransactionID(receiveMH.getTransactionID()); - - // Unknown attributes - UnknownAttribute ua = new UnknownAttribute(); - ua.addAttribute(umae.getType()); - sendMH.addMessageAttribute(ua); - - byte[] data = sendMH.getBytes(); - DatagramPacket send = new DatagramPacket(data, data.length); - send.setPort(receive.getPort()); - send.setAddress(receive.getAddress()); - receiverSocket.send(send); - logger.config(changedPortIP.getLocalAddress().getHostAddress() + ":" + changedPortIP.getLocalPort() + " send Binding Error Response to " + send.getAddress().getHostAddress() + ":" + send.getPort()); - } - } catch (IOException ioe) { - ioe.printStackTrace(); - } catch (MessageAttributeParsingException mape) { - mape.printStackTrace(); - } catch (MessageAttributeException mae) { - mae.printStackTrace(); - } catch (MessageHeaderParsingException mhpe) { - mhpe.printStackTrace(); - } catch (UtilityException ue) { - ue.printStackTrace(); - } catch (ArrayIndexOutOfBoundsException aioobe) { - aioobe.printStackTrace(); - } - } - } - } - - /* - * To invoke the STUN server two IP addresses and two ports are required. - */ - public static void main(String args[]) { - try { - if (args.length != 4) { - System.out.println("usage: java de.javawi.jstun.test.demo.StunServer PORT1 IP1 PORT2 IP2"); - System.out.println(); - System.out.println(" PORT1 - the first port that should be used by the server"); - System.out.println(" IP1 - the first ip address that should be used by the server"); - System.out.println(" PORT2 - the second port that should be used by the server"); - System.out.println(" IP2 - the second ip address that should be used by the server"); - System.exit(0); - } - Handler fh = new FileHandler("logging_server.txt"); - fh.setFormatter(new SimpleFormatter()); - Logger.getLogger("de.javawi.stun").addHandler(fh); - Logger.getLogger("de.javawi.stun").setLevel(Level.ALL); - StunServer ss = new StunServer(Integer.parseInt(args[0]), - InetAddress.getByName(args[1]), - Integer.parseInt(args[2]), - InetAddress.getByName(args[3])); - ss.start(); - } catch (SocketException se) { - se.printStackTrace(); - } catch (UnknownHostException uhe) { - uhe.printStackTrace(); - } catch (IOException ioe) { - ioe.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/ice/Candidate.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/ice/Candidate.java deleted file mode 100644 index 22dd58fb5..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/ice/Candidate.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.test.demo.ice; - -import java.net.DatagramSocket; -import java.net.SocketException; -import java.net.UnknownHostException; - -import de.javawi.jstun.util.Address; -import de.javawi.jstun.util.UtilityException; - -public class Candidate implements Comparable { - // The ieft-mmusic-ice-12 draft is not non-ambigious about the number of types. - // Chapter 5.1 defines 3 and 4 types on page 16 and page 17, respectively. - public enum CandidateType { Local, ServerReflexive, PeerReflexive, Relayed }; - - private DatagramSocket socket; - private CandidateType type; - private short componentId; - private int priority; - private int foundationId; - private Candidate base; - private boolean isInUse; - - public Candidate(Address address, short componentId) throws SocketException, UnknownHostException, UtilityException { - this.socket = new DatagramSocket(0, address.getInetAddress()); - this.type = CandidateType.Local; - this.componentId = componentId; - this.priority = 0; - this.base = this; - this.isInUse = false; - } - - public Candidate(Address address, CandidateType type, short componentId, Candidate base) throws SocketException, UnknownHostException, UtilityException { - this.socket = new DatagramSocket(0, address.getInetAddress()); - this.type = type; - setComponentId(componentId); - this.priority = 0; - this.base = base; - this.isInUse = false; - } - - public void setBase(Candidate base) { - this.base = base; - } - - public Candidate getBase() { - return base; - } - - public CandidateType getCandidateType() { - return type; - } - - public void setComponentId(short componentId) { - if ((componentId < 1) || (componentId > 256)) throw new IllegalArgumentException(componentId + " is not between 1 and 256 inclusive."); - this.componentId = componentId; - } - - public short getComponentId() { - return componentId; - } - - public void setFoundationId(int foundationId) { - this.foundationId = foundationId; - } - - public int getFoundationId() { - return foundationId; - } - - public void setPriority(int priority) { - this.priority = priority; - } - - public int getPriority() { - return priority; - } - - public Address getAddress() throws UtilityException { - return new Address(socket.getLocalAddress().getAddress()); - } - - public int getPort() { - return socket.getLocalPort(); - } - - public void setInUse(boolean isInUse) { - this.isInUse = isInUse; - } - - public boolean getInUse() { - return isInUse; - } - - public int compareTo(Object arg0) { - Candidate cand = (Candidate) arg0; - return cand.getPriority() - getPriority(); - } - - public boolean equals(Object o) { - if (o == null) return false; - if ((((Candidate) o).socket.equals(socket)) && (((Candidate) o).base.equals(base))) return true; - return false; - } -} diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/ice/ICENegociator.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/ice/ICENegociator.java deleted file mode 100644 index 502528c5b..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/test/demo/ice/ICENegociator.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.test.demo.ice; - -import java.net.InetAddress; -import java.net.NetworkInterface; -import java.util.Collections; -import java.util.Enumeration; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Vector; - -import de.javawi.jstun.test.DiscoveryInfo; -import de.javawi.jstun.test.DiscoveryTest; -import de.javawi.jstun.test.demo.ice.Candidate.CandidateType; -import de.javawi.jstun.util.Address; - -public class ICENegociator { - // type preference must be an integere from 0 (=lowest) to 126 (=highest) (inclusive) - private final static int LOCAL_PREFERENCE = 0; - private final static int SERVER_REFLEXIVE_PREFERENCE = 42; - private final static int PEER_REFLEXIVE_PREFERENCE = 84; - private final static int RELAYED_PREFERENCE = 126; - - // component id - private short componentId; - - // candidates - HashSet candidates; - - public ICENegociator(short componentId) { - this.componentId = componentId; - candidates = new HashSet(); - } - - /* - * This method gathers candidate addresses as described in draft-ietf-mmusic-ice-12.txt Chapter 2.1 - * Unfortunately, only the candidates of the direct attached network interfaces and server reflexive - * addreses are gathered. So far, no support for relayed candidates is available (because I am not - * aware of any STUN relay server). - */ - public void gatherCandidateAddresses() { - candidates = new HashSet(); - try { - Enumeration ifaces = NetworkInterface.getNetworkInterfaces(); - while (ifaces.hasMoreElements()) { - NetworkInterface iface = ifaces.nextElement(); - Enumeration iaddresses = iface.getInetAddresses(); - while (iaddresses.hasMoreElements()) { - InetAddress iaddress = iaddresses.nextElement(); - if (!iaddress.isLoopbackAddress() && !iaddress.isLinkLocalAddress()) { - // add host candidate - Candidate local = new Candidate(new Address(iaddress.getAddress()), componentId); - candidates.add(local); - // add server reflexive address - DiscoveryTest test = new DiscoveryTest(iaddress, "iphone-stun.freenet.de", 3478); - DiscoveryInfo di = test.test(); - if (di.getPublicIP() != null) { - Candidate cand = new Candidate(new Address(di.getPublicIP().getAddress()), CandidateType.ServerReflexive, componentId, local); - cand.setComponentId(componentId); - candidates.add(cand); - } - } - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void prioritizeCandidates() { - // count number of candidate types - int numberLocal = 0; - int numberServerReflexive = 0; - int numberPeerReflexive = 0; - int numberRelayed = 0; - // count number of candidates of a particular type - Iterator iterCandidates = candidates.iterator(); - while (iterCandidates.hasNext()) { - Candidate cand = iterCandidates.next(); - CandidateType type = cand.getCandidateType(); - if (type == CandidateType.Local) numberLocal++; - else if (type == CandidateType.ServerReflexive) numberServerReflexive++; - else if (type == CandidateType.PeerReflexive) numberPeerReflexive++; - else if (type == CandidateType.Relayed) numberRelayed++; - } - // assign priorities - iterCandidates = candidates.iterator(); - while (iterCandidates.hasNext()) { - int typeValue = 0; - int localValue = 0; - int componentValue = 0; - Candidate cand = iterCandidates.next(); - CandidateType type = cand.getCandidateType(); - if (type == CandidateType.Local) { - typeValue = LOCAL_PREFERENCE; - localValue = numberLocal--; - } - else if (type == CandidateType.ServerReflexive) { - typeValue = SERVER_REFLEXIVE_PREFERENCE; - localValue = numberServerReflexive--; - } - else if (type == CandidateType.PeerReflexive) { - typeValue = PEER_REFLEXIVE_PREFERENCE; - localValue = numberPeerReflexive--; - } - else if (type == CandidateType.Relayed) { - typeValue = RELAYED_PREFERENCE; - localValue = numberRelayed--; - } - componentValue = cand.getComponentId(); - int priority = ((2 ^ 24) * typeValue) + ((2 ^ 8) * localValue) + componentValue; - cand.setPriority(priority); - } - } - - public List getSortedCandidates() { - Vector sortedCandidates = new Vector(candidates); - Collections.sort(sortedCandidates); - return sortedCandidates; - } - - public static void main(String args[]) { - ICENegociator cc = new ICENegociator((short) 1); - // gather candidates - cc.gatherCandidateAddresses(); - // priorize candidates - cc.prioritizeCandidates(); - // get SortedCandidates - List sortedCandidates = cc.getSortedCandidates(); - - // sent sorted candidate addresses to peer over SDP - // received sorted candidate addresses of peer over SDP - - } -} diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/util/Address.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/util/Address.java deleted file mode 100644 index 46ad1a0ef..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/util/Address.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.util; - -import java.util.*; -import java.net.*; - -public class Address { - int firstOctet; - int secondOctet; - int thirdOctet; - int fourthOctet; - - public Address(int firstOctet, int secondOctet, int thirdOctet, int fourthOctet) throws UtilityException { - if ((firstOctet < 0) || (firstOctet > 255) || (secondOctet < 0) || (secondOctet > 255) || (thirdOctet < 0) || (thirdOctet > 255) || (fourthOctet < 0) || (fourthOctet > 255)) { - throw new UtilityException("Address is malformed."); - } - this.firstOctet = firstOctet; - this.secondOctet = secondOctet; - this.thirdOctet = thirdOctet; - this.fourthOctet = fourthOctet; - } - - public Address(String address) throws UtilityException { - StringTokenizer st = new StringTokenizer(address, "."); - if (st.countTokens() != 4) { - throw new UtilityException("4 octets in address string are required."); - } - int i = 0; - while (st.hasMoreTokens()) { - int temp = Integer.parseInt(st.nextToken()); - if ((temp < 0) || (temp > 255)) { - throw new UtilityException("Address is in incorrect format."); - } - switch (i) { - case 0: firstOctet = temp; ++i; break; - case 1: secondOctet = temp; ++i; break; - case 2: thirdOctet = temp; ++i; break; - case 3: fourthOctet = temp; ++i; break; - } - } - } - - public Address(byte[] address) throws UtilityException { - if (address.length < 4) { - throw new UtilityException("4 bytes are required."); - } - firstOctet = Utility.oneByteToInteger(address[0]); - secondOctet = Utility.oneByteToInteger(address[1]); - thirdOctet = Utility.oneByteToInteger(address[2]); - fourthOctet = Utility.oneByteToInteger(address[3]); - } - - public String toString() { - return firstOctet + "." + secondOctet + "." + thirdOctet + "." + fourthOctet; - } - - public byte[] getBytes() throws UtilityException { - byte[] result = new byte[4]; - result[0] = Utility.integerToOneByte(firstOctet); - result[1] = Utility.integerToOneByte(secondOctet); - result[2] = Utility.integerToOneByte(thirdOctet); - result[3] = Utility.integerToOneByte(fourthOctet); - return result; - } - - public InetAddress getInetAddress() throws UtilityException, UnknownHostException { - byte[] address = new byte[4]; - address[0] = Utility.integerToOneByte(firstOctet); - address[1] = Utility.integerToOneByte(secondOctet); - address[2] = Utility.integerToOneByte(thirdOctet); - address[3] = Utility.integerToOneByte(fourthOctet); - return InetAddress.getByAddress(address); - } - - public boolean equals(Object obj) { - if (obj == null) return false; - try { - byte[] data1 = this.getBytes(); - byte[] data2 = ((Address) obj).getBytes(); - if ((data1[0] == data2[0]) && (data1[1] == data2[1]) && - (data1[2] == data2[2]) && (data1[3] == data2[3])) return true; - return false; - } catch (UtilityException ue) { - return false; - } - } - - public int hashCode() { - return (firstOctet << 24) + (secondOctet << 16) + (thirdOctet << 8) + fourthOctet; - } - -} diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/util/Utility.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/util/Utility.java deleted file mode 100644 index 91c2d88e9..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/util/Utility.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.util; - -public class Utility { - - public static final byte integerToOneByte(int value) throws UtilityException { - if ((value > Math.pow(2,15)) || (value < 0)) { - throw new UtilityException("Integer value " + value + " is larger than 2^15"); - } - return (byte)(value & 0xFF); - } - - public static final byte[] integerToTwoBytes(int value) throws UtilityException { - byte[] result = new byte[2]; - if ((value > Math.pow(2,31)) || (value < 0)) { - throw new UtilityException("Integer value " + value + " is larger than 2^31"); - } - result[0] = (byte)((value >>> 8) & 0xFF); - result[1] = (byte)(value & 0xFF); - return result; - } - - public static final byte[] integerToFourBytes(int value) throws UtilityException { - byte[] result = new byte[4]; - if ((value > Math.pow(2,63)) || (value < 0)) { - throw new UtilityException("Integer value " + value + " is larger than 2^63"); - } - result[0] = (byte)((value >>> 24) & 0xFF); - result[1] = (byte)((value >>> 16) & 0xFF); - result[2] = (byte)((value >>> 8) & 0xFF); - result[3] = (byte)(value & 0xFF); - return result; - } - - public static final int oneByteToInteger(byte value) throws UtilityException { - return (int)value & 0xFF; - } - - public static final int twoBytesToInteger(byte[] value) throws UtilityException { - if (value.length < 2) { - throw new UtilityException("Byte array too short!"); - } - int temp0 = value[0] & 0xFF; - int temp1 = value[1] & 0xFF; - return ((temp0 << 8) + temp1); - } - - public static final long fourBytesToLong(byte[] value) throws UtilityException { - if (value.length < 4) { - throw new UtilityException("Byte array too short!"); - } - int temp0 = value[0] & 0xFF; - int temp1 = value[1] & 0xFF; - int temp2 = value[2] & 0xFF; - int temp3 = value[3] & 0xFF; - return (((long)temp0 << 24) + (temp1 << 16) + (temp2 << 8) + temp3); - } -} diff --git a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/util/UtilityException.java b/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/util/UtilityException.java deleted file mode 100644 index d6f65fa75..000000000 --- a/p2pproxy/dependencies-src/jstun-src-0.7.1/de/javawi/jstun/util/UtilityException.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * This file is part of JSTUN. - * - * Copyright (c) 2005 Thomas King - All rights - * reserved. - * - * This software is licensed under either the GNU Public License (GPL), - * or the Apache 2.0 license. Copies of both license agreements are - * included in this distribution. - */ - -package de.javawi.jstun.util; - -public class UtilityException extends Exception { - private static final long serialVersionUID = 3545800974716581680L; - - UtilityException(String mesg) { - super(mesg); - } - -} diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/pom.xml b/p2pproxy/dependencies-src/jxse-src-2.5/api/pom.xml deleted file mode 100644 index 4f467d1c9..000000000 --- a/p2pproxy/dependencies-src/jxse-src-2.5/api/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - net.jxta.platform - jxta - 1.0 - ../pom.xml - - 4.0.0 - jxta-api - net.jxta.platform - jxta-api - jar - 1.0 - - diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/Version.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/Version.java deleted file mode 100644 index f6604de0f..000000000 --- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/Version.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * - * ==================================================================== - * - * Copyright (c) 2001 Sun Microsystems, Inc. All rights reserved. - * - * The Sun Project JXTA(TM) Software License - * - * 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 end-user documentation included with the redistribution, if any, must - * include the following acknowledgment: "This product includes software - * developed by Sun Microsystems, Inc. for JXTA(TM) technology." - * Alternately, this acknowledgment may appear in the software itself, if - * and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must - * not be used to endorse or promote products derived from this software - * without prior written permission. For written permission, please contact - * Project JXTA at http://www.jxta.org. - * - * 5. Products derived from this software may not be called "JXTA", nor may - * "JXTA" appear in their name, without prior written permission of Sun. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 SUN - * MICROSYSTEMS OR ITS 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. - * - * JXTA is a registered trademark of Sun Microsystems, Inc. in the United - * States and other countries. - * - * Please see the license information page at : - * for instructions on use of - * the license in source files. - * - * ==================================================================== - * - * This software consists of voluntary contributions made by many individuals - * on behalf of Project JXTA. For more information on Project JXTA, please see - * http://www.jxta.org. - * - * This license is based on the BSD license adopted by the Apache Foundation. - */ - -package net.jxta; - -import java.lang.Package; - -/** - * Provides easy access to Java Package information for the JXSE API. - */ -public final class Version { - - /** - * Returns the package. - * - * @return The specification title. - */ - public static Package getPackage() { - return Version.class.getPackage(); - } - - /** - * Returns the specification title. - * - * @return The specification title. - */ - public static String getSpecTitle() { - Package versionPackage = Version.class.getPackage(); - - return versionPackage.getSpecificationTitle(); - } - - /** - * Returns the specification vendor. - * - * @return The specification vendor. - */ - public static String getSpecVendor() { - Package versionPackage = Version.class.getPackage(); - - return versionPackage.getSpecificationVendor(); - } - - /** - * Returns the specification version. - * - * @return The specification version. - */ - public static String getSpecVersion() { - Package versionPackage = Version.class.getPackage(); - - return versionPackage.getSpecificationVersion(); - } - - /** - * Returns the specification title. - * - * @return The specification title. - */ - public static String getImplTitle() { - Package versionPackage = Version.class.getPackage(); - - return versionPackage.getImplementationTitle(); - } - - /** - * Returns the specification vendor. - * - * @return The specification vendor. - */ - public static String getImplVendor() { - Package versionPackage = Version.class.getPackage(); - - return versionPackage.getImplementationVendor(); - } - - /** - * Returns the specification version. - * - * @return The specification version. - */ - public static String getImplVersion() { - Package versionPackage = Version.class.getPackage(); - - return versionPackage.getImplementationVersion(); - } - - /** - * This class is a singleton. - */ - private Version() { - } -} diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/access/AccessService.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/access/AccessService.java deleted file mode 100644 index e5183e820..000000000 --- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/access/AccessService.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * - * ==================================================================== - * - * Copyright (c) 2001 Sun Microsystems, Inc. All rights reserved. - * - * The Sun Project JXTA(TM) Software License - * - * 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 end-user documentation included with the redistribution, if any, must - * include the following acknowledgment: "This product includes software - * developed by Sun Microsystems, Inc. for JXTA(TM) technology." - * Alternately, this acknowledgment may appear in the software itself, if - * and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must - * not be used to endorse or promote products derived from this software - * without prior written permission. For written permission, please contact - * Project JXTA at http://www.jxta.org. - * - * 5. Products derived from this software may not be called "JXTA", nor may - * "JXTA" appear in their name, without prior written permission of Sun. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 SUN - * MICROSYSTEMS OR ITS 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. - * - * JXTA is a registered trademark of Sun Microsystems, Inc. in the United - * States and other countries. - * - * Please see the license information page at : - * for instructions on use of - * the license in source files. - * - * ==================================================================== - * - * This software consists of voluntary contributions made by many individuals - * on behalf of Project JXTA. For more information on Project JXTA, please see - * http://www.jxta.org. - * - * This license is based on the BSD license adopted by the Apache Foundation. - */ - -package net.jxta.access; - - -import net.jxta.credential.Credential; -import net.jxta.credential.PrivilegedOperation; -import net.jxta.document.Element; -import net.jxta.service.Service; - - -/** - * The Access Service is used by JXTA Applications and Services to determine if - specific operations are permitted for a particular identity. - * - *

Each Access Service implementation provides a mechanism for determining - * if, for a given operation and identity, the operation is permitted. - **/ -public interface AccessService extends Service { - - /** - * The result of an access check. - **/ - public enum AccessResult { - - /** - * State is unknown or could not be established. - * - *

The operation should not be performed. - * - *

This result may not be used by all Access Service - * implementations. - **/ - UNDETERMINED, /** - * Operation is disallowed. - * - *

The operation should not be performed. - * - **/ DISALLOWED, /** - * Operation is permitted. - * - *

The operation should be performed. - * - **/ PERMITTED, /** - * Operation would be permitted, but one (or more) of the provided - * credentials was expired. - * - *

The operation should not be performed. - * - *

This result may not be used by all Access Service - * implementations. - **/ PERMITTED_EXPIRED - } - - /** - * Determine if a privileged operation is permitted for a given identity. - * - * @param operation The operation which is being requested or {@code null}. - * {@code null} signifies that the operation is unimportant though the - * credential must be valid. - * @param credential The identity which is requesting or {@code null}. A - * {@code null} value indicates that no credential is available. - * @return the result of the access check. - **/ - public AccessResult doAccessCheck(PrivilegedOperation operation, Credential credential); - - /** - * Create a new privileged operation with the specified subject. Each - * operation is also associated with an identity, the offerer. Generally - * the privileged operation is cryptographically signed by the offerer. - * - * @see net.jxta.credential.Credential - * - * @param subject The subject of the operation. This usually identifies - * what operation is being requested. - * @param offerer The identity which is offering the operation. - * @return The privileged operation object - **/ - public PrivilegedOperation newPrivilegedOperation(Object subject, Credential offerer); - - /** - * Read a privileged operation from a portion of a structured document. - * - * @param source The root of the document portion containing the serialized - * representation of the privileged operation. - * @return The privileged operation object. - **/ - public PrivilegedOperation newPrivilegedOperation(Element source); -} diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/access/package.html b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/access/package.html deleted file mode 100644 index e9f7516ff..000000000 --- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/access/package.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - The Access Service provides a framework for using the identities created - with the Membership Service to control whether specific operations are - permitted. - -

The Access Service, like the Membership Service, is not associated with - a particular JXTA protocol. Each Access Service implementation is - responsible for its own protocol definition (if any). This approach is used - primarily so that JXTA bridges well to existing common Membership and Access - technologies. For example; PKI, LDAP Kerberos, NTLM and API based interfaces - such as PAM and JAAS. - - @see net.jxta.credential.Credential - @see net.jxta.credential.PrivilegedOperation - @see net.jxta.membership.MembershipService - @see JXTA Protocols Specification : Protocols - - diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/Codat.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/Codat.java deleted file mode 100644 index 75a45844a..000000000 --- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/Codat.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved. - * - * The Sun Project JXTA(TM) Software License - * - * 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 end-user documentation included with the redistribution, if any, must - * include the following acknowledgment: "This product includes software - * developed by Sun Microsystems, Inc. for JXTA(TM) technology." - * Alternately, this acknowledgment may appear in the software itself, if - * and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must - * not be used to endorse or promote products derived from this software - * without prior written permission. For written permission, please contact - * Project JXTA at http://www.jxta.org. - * - * 5. Products derived from this software may not be called "JXTA", nor may - * "JXTA" appear in their name, without prior written permission of Sun. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 SUN - * MICROSYSTEMS OR ITS 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. - * - * JXTA is a registered trademark of Sun Microsystems, Inc. in the United - * States and other countries. - * - * Please see the license information page at : - * for instructions on use of - * the license in source files. - * - * ==================================================================== - * - * This software consists of voluntary contributions made by many individuals - * on behalf of Project JXTA. For more information on Project JXTA, please see - * http://www.jxta.org. - * - * This license is based on the BSD license adopted by the Apache Foundation. - */ - -package net.jxta.codat; - - -import net.jxta.document.Document; -import net.jxta.id.ID; -import net.jxta.id.IDFactory; -import net.jxta.peergroup.PeerGroupID; - -import java.io.IOException; - - -/** - * The common container for managing content within JXTA. A Codat consists of: - *

    - *
  • Content data for the Codat in the form of a JXTA - * {@link net.jxta.document.Document}.
  • - *
  • A persistent canonical identifier for the Codat in the form of a - * {@link net.jxta.codat.CodatID}.
  • - *
  • An optional CodatID for an associated Codat for which this Codat is - * metadata.
  • - *
- * - * @see net.jxta.codat.CodatID - * @see net.jxta.document.Document - */ -public class Codat { - - /** - * CodatID of this Codat. A persistent canonical identifier for this Codat. - */ - private final CodatID id; - - /** - * CodatID for an associated Codat for which this Codat is metadata. This - * may be the CodatId of another Codat in the same Peer Group or - * null. - */ - private final CodatID metaId; - - /** - * Contains the data of this Codat. - */ - private final Document doc; - - /** - * Constructs a Codat instance with a new CodatId given a PeerGroupID and - * a Document. - * - * @param groupID The peer group to which this Codat will belong. - * @param about The CodatID of an associated Codat for which this Codat is - * metadata or null if there is no associated Codat. - * @param document Document which contains the content data for this Codat. - * @throws IOException if there is an error accessing the document. - */ - public Codat(PeerGroupID groupID, CodatID about, Document document) throws IOException { - this(IDFactory.newCodatID(groupID, document.getStream()), about, document); - } - - /** - * Constructs a Codat instance for an existing Codat given it's - * CodatID and a document. - *

- *

This implementation does not verify that the CodatID matches the - * provided Document. - * - * @param id CodatId of the new Codat. - * @param about CodatID of an associated Codat for which this Codat is metadata. - * @param document Document which contains the content data for this Codat. - */ - public Codat(CodatID id, CodatID about, Document document) { - if (null == id) { - throw new IllegalArgumentException("CodatID may not be null."); - } - - if (null == document) { - throw new IllegalArgumentException("Document may not be null."); - } - - this.id = id; - this.metaId = about; - this.doc = document; - } - - /** - * Returns the CodatID of this Codat. - * - * @return The CodatID of this Codat. - */ - public ID getCodatID() { - return id; - } - - /** - * Returns the CodatID of an associated Codat for which this Codat is - * metadata or null if there is no associated Codat. - * - * @return CodatID The CodatID of an associated Codat for which this Codat - * is metadata or null if there is no associated Codat. - */ - public ID getMetaID() { - return metaId; - } - - /** - * Returns a Document containing the data of this Codat. - * - * @return A Document containing the data of this Codat. - */ - public Document getDocument() { - return doc; - } -} diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/CodatID.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/CodatID.java deleted file mode 100644 index 5e7c94d75..000000000 --- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/CodatID.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved. - * - * The Sun Project JXTA(TM) Software License - * - * 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 end-user documentation included with the redistribution, if any, must - * include the following acknowledgment: "This product includes software - * developed by Sun Microsystems, Inc. for JXTA(TM) technology." - * Alternately, this acknowledgment may appear in the software itself, if - * and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must - * not be used to endorse or promote products derived from this software - * without prior written permission. For written permission, please contact - * Project JXTA at http://www.jxta.org. - * - * 5. Products derived from this software may not be called "JXTA", nor may - * "JXTA" appear in their name, without prior written permission of Sun. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 SUN - * MICROSYSTEMS OR ITS 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. - * - * JXTA is a registered trademark of Sun Microsystems, Inc. in the United - * States and other countries. - * - * Please see the license information page at : - * for instructions on use of - * the license in source files. - * - * ==================================================================== - * - * This software consists of voluntary contributions made by many individuals - * on behalf of Project JXTA. For more information on Project JXTA, please see - * http://www.jxta.org. - * - * This license is based on the BSD license adopted by the Apache Foundation. - */ - -package net.jxta.codat; - - -import java.net.URI; -import net.jxta.id.ID; - - -/** - * An identifier that enables canonical references to be made to a Codat within - * the context of a specific peer group. - *

- *

A CodatID is formed by the conjuction of:

    - *
  • a PeerGroupID
  • - *
  • a randomly chosen value that has a high probability of being unique
  • - *
  • an optional SHA1 cryptographic hash of the Codat contents
- *

- *

Codats which contain static content will normally include the hash value - * as part of their CodatID. - * - * @see net.jxta.codat.Codat - * @see net.jxta.peergroup.PeerGroupID - */ -public abstract class CodatID extends ID { - - /** - * Creates an ID by parsing the given URI. - * - *

This convenience factory method works as if by invoking the - * {@link net.jxta.id.IDFactory#fromURI(URI)} method; any - * {@link java.net.URISyntaxException} thrown is caught and wrapped in a - * new {@link IllegalArgumentException} object, which is then thrown. - * - *

This method is provided for use in situations where it is known that - * the given string is a legal ID, for example for ID constants declared - * within in a program, and so it would be considered a programming error - * for the URI not to parse as such. The {@link net.jxta.id.IDFactory}, - * which throws {@link java.net.URISyntaxException} directly, should be used - * situations where a ID is being constructed from user input or from some - * other source that may be prone to errors. - * - * @param fromURI The URI to be parsed into an ID - * @return The new ID - * - * @throws NullPointerException If {@code fromURI} is {@code null}. - * @throws IllegalArgumentException If the given URI is not a valid ID. - */ - public static CodatID create(URI fromURI) { - return (CodatID) ID.create(fromURI); - } - - /** - * {@inheritDoc} - */ - public CodatID intern() { - return (CodatID) super.intern(); - } - - /** - * Returns PeerGroupID of the Peer Group to which this Codat ID belongs. - * - * @return PeerGroupID of the Peer Group which this ID is part of. - */ - public abstract ID getPeerGroupID(); - - /** - * Returns true if this CodatID is associated with a static Codat. - * - * @return true if the codatId is for a Codat with static content - * otherwise false. - */ - public abstract boolean isStatic(); -} diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/Metadata.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/Metadata.java deleted file mode 100644 index 1d1f7bbd9..000000000 --- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/Metadata.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved. - * - * The Sun Project JXTA(TM) Software License - * - * 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 end-user documentation included with the redistribution, if any, must - * include the following acknowledgment: "This product includes software - * developed by Sun Microsystems, Inc. for JXTA(TM) technology." - * Alternately, this acknowledgment may appear in the software itself, if - * and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must - * not be used to endorse or promote products derived from this software - * without prior written permission. For written permission, please contact - * Project JXTA at http://www.jxta.org. - * - * 5. Products derived from this software may not be called "JXTA", nor may - * "JXTA" appear in their name, without prior written permission of Sun. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 SUN - * MICROSYSTEMS OR ITS 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. - * - * JXTA is a registered trademark of Sun Microsystems, Inc. in the United - * States and other countries. - * - * Please see the license information page at : - * for instructions on use of - * the license in source files. - * - * ==================================================================== - * - * This software consists of voluntary contributions made by many individuals - * on behalf of Project JXTA. For more information on Project JXTA, please see - * http://www.jxta.org. - * - * This license is based on the BSD license adopted by the Apache Foundation. - */ -package net.jxta.codat; - - -import net.jxta.document.Document; -import net.jxta.peergroup.PeerGroupID; - -import java.io.IOException; - - -/** - * Medata Codats are special codats that contain information about another - * Codat. Multiple medata Codats can refer to the same Codat. Medata codats can - * hold any kind of information about a codat, such as a symbolic name, - * description, index and searching information, etc. - * - * @see net.jxta.codat.Codat - * @see net.jxta.codat.CodatID - * @see net.jxta.document.Document - */ -public class Metadata extends Codat { - - /** - * Constructs a Metadata instance with a new CodatId given a PeerGroupID, - * the CodatID of the associated Codat and a Document. - * - * @param groupID The peer group to which this Codat will belong. - * @param about The CodatID of an associated Codat for which this Codat is - * metadata or null if there is no associated Codat. - * @param document Document which contains the content data for this Codat. - * @throws IOException if there is an error accessing the document. - */ - public Metadata(PeerGroupID groupID, CodatID about, Document document) throws IOException { - super(groupID, about, document); - } - - /** - * Constructs a Metadata instance for an existing Codat given it's - * CodatID, the CodatID of the associated Codat and a Document. - *

- *

This implementation does not verify that the CodatID matches the - * provided Document. - * - * @param id CodatId of the new Codat. - * @param about CodatID of an associated Codat for which this Codat is metadata. - * @param document Document which contains the content data for this Codat. - */ - public Metadata(CodatID id, CodatID about, Document document) { - super(id, about, document); - } -} diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/package.html b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/package.html deleted file mode 100644 index 7b4aa9a5a..000000000 --- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/codat/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -Codats are container objects that can hold both data or code and are -associated with a JXTA ID. - -@see net.jxta.id -@see JXTA Protocols - Specification : Protocols - - -file:///home/mike/code/jxta/spec/www/v1.0/docbook/JXTAProtocols.html#overview-codats diff --git a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/AuthenticationCredential.java b/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/AuthenticationCredential.java deleted file mode 100644 index 081e8364c..000000000 --- a/p2pproxy/dependencies-src/jxse-src-2.5/api/src/net/jxta/credential/AuthenticationCredential.java +++ /dev/null @@ -1,386 +0,0 @@ -/* - * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved. - * - * The Sun Project JXTA(TM) Software License - * - * 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 end-user documentation included with the redistribution, if any, must - * include the following acknowledgment: "This product includes software - * developed by Sun Microsystems, Inc. for JXTA(TM) technology." - * Alternately, this acknowledgment may appear in the software itself, if - * and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must - * not be used to endorse or promote products derived from this software - * without prior written permission. For written permission, please contact - * Project JXTA at http://www.jxta.org. - * - * 5. Products derived from this software may not be called "JXTA", nor may - * "JXTA" appear in their name, without prior written permission of Sun. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 SUN - * MICROSYSTEMS OR ITS 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. - * - * JXTA is a registered trademark of Sun Microsystems, Inc. in the United - * States and other countries. - * - * Please see the license information page at : - * for instructions on use of - * the license in source files. - * - * ==================================================================== - * - * This software consists of voluntary contributions made by many individuals - * on behalf of Project JXTA. For more information on Project JXTA, please see - * http://www.jxta.org. - * - * This license is based on the BSD license adopted by the Apache Foundation. - */ - -package net.jxta.credential; - -import net.jxta.document.*; -import net.jxta.id.ID; -import net.jxta.id.IDFactory; -import net.jxta.peergroup.PeerGroup; -import net.jxta.service.Service; - -import java.util.logging.Level; - -import net.jxta.logging.Logging; - -import java.util.logging.Logger; - -import java.net.URI; -import java.net.URISyntaxException; -import java.util.Enumeration; - -/** - * Authenication credentials are used by JXTA Membership Services as the - * basis for applications for peergroup membership. The AuthenticationCredential - * provides two important pieces of inforamtion: - *

QUBH#7*lHA79kv{joiK0Cyzkpt}|=6h~g})Ydz)*lV}-{`OENM!o?; zw47<*UFiK9^4Zb8GI;W-m-8<5@tyM|q+yXq4HzwC@n&-4lXSv_m0Poh_EQ-Oc1@4V zOPOV6Sz^j+M|IzIRbJ{T9ds5(r~%iN<}UfT3miU&K=jWBpyi~V5pHtYD0(zKvJuOJ z!SPhq?E&qD4&zrkcnAB%(k-%%c46&6`1h!DKyOK8Xceoz%Yc9?1QIG)0Y|!JA$LIq zNxiibQm^du$s-C*oeA_k7A~Pz zPrt6xH>Z|2bnKL!ORi_28jjl!8WQgHdsDJafx1A+1zles~2`;G+-Jv z(Ah|M25n|lSL!pI$F>-o*GQa*r<|J2k4p4g57#1UrqvTQI{#YVxj4@)tYl+Crn3y4 zL})Y{ipUA~XRb60XYs#J{9%o)!8y(+yKmvRJ{XLcfvuX#99lh#bw(Y>q3>N0Jcqs55 z7fPo_m(#{aA1e!Y-Tt$ogYD>RCaVaWYHfi9C=s(F)M`+>=4^l$ixSM!?QB% zdhE08yz#5VJjulK3TTV``!_$N3T-1sc|UcB)sTWzj6Gnq1mGssRVma}t|zEqY0ft4%g&|z3;d#oXAO@Fzw?V|9=Mu3iFJ9b|P+~%f!j;e>i zKWoKs>|`zZ;_q)XGp|1GmE~Y>tsrQgSVX~S%mt>$e;^|arRj&Cj!#sL&t%6<+G~qU z)l6R_>lsi@8K}xeESB6@bHBE}DxYjc#Sb9-2jB##UkkBiQT(*F@s`! zyhjLF%;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