]> sjero.net Git - linphone/commitdiff
remove mediastreamer2 and add it as a submodule instead.
authorSimon Morlat <simon.morlat@hp.com>
Wed, 20 Jan 2010 10:37:11 +0000 (11:37 +0100)
committerSimon Morlat <simon.morlat@hp.com>
Wed, 20 Jan 2010 10:37:11 +0000 (11:37 +0100)
180 files changed:
.gitmodules
linphone/mediastreamer2 [new submodule]
linphone/mediastreamer2/.gitignore [deleted file]
linphone/mediastreamer2/.indent.pro [deleted file]
linphone/mediastreamer2/AUTHORS [deleted file]
linphone/mediastreamer2/COPYING [deleted file]
linphone/mediastreamer2/ChangeLog [deleted file]
linphone/mediastreamer2/Makefile.am [deleted file]
linphone/mediastreamer2/Makefile.macosx [deleted file]
linphone/mediastreamer2/NEWS [deleted file]
linphone/mediastreamer2/README [deleted file]
linphone/mediastreamer2/acinclude.m4 [deleted file]
linphone/mediastreamer2/autogen.sh [deleted file]
linphone/mediastreamer2/build/.gitignore [deleted file]
linphone/mediastreamer2/build/Makefile.am [deleted file]
linphone/mediastreamer2/build/win32-novideo/.gitignore [deleted file]
linphone/mediastreamer2/build/win32-novideo/Makefile.am [deleted file]
linphone/mediastreamer2/build/win32-novideo/alldescs.h [deleted file]
linphone/mediastreamer2/build/win32-novideo/mediastream.vcproj [deleted file]
linphone/mediastreamer2/build/win32-novideo/mediastreamer2.def [deleted file]
linphone/mediastreamer2/build/win32-novideo/mediastreamer2.vcproj [deleted file]
linphone/mediastreamer2/build/win32native/.gitignore [deleted file]
linphone/mediastreamer2/build/win32native/Makefile.am [deleted file]
linphone/mediastreamer2/build/win32native/alldescs.h [deleted file]
linphone/mediastreamer2/build/win32native/mediastream.vcproj [deleted file]
linphone/mediastreamer2/build/win32native/mediastreamer2.def [deleted file]
linphone/mediastreamer2/build/win32native/mediastreamer2.vcproj [deleted file]
linphone/mediastreamer2/build/win32native/videodisplay.vcproj [deleted file]
linphone/mediastreamer2/build/wince/.gitignore [deleted file]
linphone/mediastreamer2/build/wince/Makefile.am [deleted file]
linphone/mediastreamer2/build/wince/alldescs.h [deleted file]
linphone/mediastreamer2/build/wince/mediastreamer2.def [deleted file]
linphone/mediastreamer2/build/wince/mediastreamer2.vcproj [deleted file]
linphone/mediastreamer2/build/winmob/Makefile.am [deleted file]
linphone/mediastreamer2/build/winmob/alldescs.h [deleted file]
linphone/mediastreamer2/build/winmob/echo/echo.vcproj [deleted file]
linphone/mediastreamer2/build/winmob/mediastreamer2.def [deleted file]
linphone/mediastreamer2/build/winmob/mediastreamer2.sln [deleted file]
linphone/mediastreamer2/build/winmob/mediastreamer2.vcproj [deleted file]
linphone/mediastreamer2/configure.ac [deleted file]
linphone/mediastreamer2/help/.gitignore [deleted file]
linphone/mediastreamer2/help/Doxyfile.in [deleted file]
linphone/mediastreamer2/help/Makefile.am [deleted file]
linphone/mediastreamer2/help/doxygen.dox.in [deleted file]
linphone/mediastreamer2/help/ht0-buildagraph.dox [deleted file]
linphone/mediastreamer2/include/.gitignore [deleted file]
linphone/mediastreamer2/include/Makefile.am [deleted file]
linphone/mediastreamer2/include/mediastreamer2/.gitignore [deleted file]
linphone/mediastreamer2/include/mediastreamer2/Makefile.am [deleted file]
linphone/mediastreamer2/include/mediastreamer2/allfilters.h [deleted file]
linphone/mediastreamer2/include/mediastreamer2/dsptools.h [deleted file]
linphone/mediastreamer2/include/mediastreamer2/dtmfgen.h [deleted file]
linphone/mediastreamer2/include/mediastreamer2/ice.h [deleted file]
linphone/mediastreamer2/include/mediastreamer2/mediastream.h [deleted file]
linphone/mediastreamer2/include/mediastreamer2/mscommon.h [deleted file]
linphone/mediastreamer2/include/mediastreamer2/msequalizer.h [deleted file]
linphone/mediastreamer2/include/mediastreamer2/msfileplayer.h [deleted file]
linphone/mediastreamer2/include/mediastreamer2/msfilerec.h [deleted file]
linphone/mediastreamer2/include/mediastreamer2/msfilter.h [deleted file]
linphone/mediastreamer2/include/mediastreamer2/msqueue.h [deleted file]
linphone/mediastreamer2/include/mediastreamer2/msrtp.h [deleted file]
linphone/mediastreamer2/include/mediastreamer2/mssndcard.h [deleted file]
linphone/mediastreamer2/include/mediastreamer2/msspeexec.h [deleted file]
linphone/mediastreamer2/include/mediastreamer2/mstee.h [deleted file]
linphone/mediastreamer2/include/mediastreamer2/msticker.h [deleted file]
linphone/mediastreamer2/include/mediastreamer2/msv4l.h [deleted file]
linphone/mediastreamer2/include/mediastreamer2/msvideo.h [deleted file]
linphone/mediastreamer2/include/mediastreamer2/msvideoout.h [deleted file]
linphone/mediastreamer2/include/mediastreamer2/msvolume.h [deleted file]
linphone/mediastreamer2/include/mediastreamer2/mswebcam.h [deleted file]
linphone/mediastreamer2/include/mediastreamer2/rfc3984.h [deleted file]
linphone/mediastreamer2/include/mediastreamer2/waveheader.h [deleted file]
linphone/mediastreamer2/mediastreamer.pc.in [deleted file]
linphone/mediastreamer2/mediastreamer2.spec.in [deleted file]
linphone/mediastreamer2/pkg.list [deleted file]
linphone/mediastreamer2/plugins/.gitignore [deleted file]
linphone/mediastreamer2/plugins/msilbc/AUTHORS [deleted file]
linphone/mediastreamer2/plugins/msilbc/COPYING [deleted file]
linphone/mediastreamer2/plugins/msilbc/ChangeLog [deleted file]
linphone/mediastreamer2/plugins/msilbc/INSTALL [deleted file]
linphone/mediastreamer2/plugins/msilbc/Makefile.am [deleted file]
linphone/mediastreamer2/plugins/msilbc/NEWS [deleted file]
linphone/mediastreamer2/plugins/msilbc/README [deleted file]
linphone/mediastreamer2/plugins/msilbc/configure.ac [deleted file]
linphone/mediastreamer2/plugins/msilbc/ilbc-rfc3951.tar.gz [deleted file]
linphone/mediastreamer2/plugins/msilbc/ilbc.c [deleted file]
linphone/mediastreamer2/plugins/msx264/AUTHORS [deleted file]
linphone/mediastreamer2/plugins/msx264/COPYING [deleted file]
linphone/mediastreamer2/plugins/msx264/ChangeLog [deleted file]
linphone/mediastreamer2/plugins/msx264/INSTALL [deleted file]
linphone/mediastreamer2/plugins/msx264/Makefile.am [deleted file]
linphone/mediastreamer2/plugins/msx264/NEWS [deleted file]
linphone/mediastreamer2/plugins/msx264/README [deleted file]
linphone/mediastreamer2/plugins/msx264/autogen.sh [deleted file]
linphone/mediastreamer2/plugins/msx264/configure.ac [deleted file]
linphone/mediastreamer2/plugins/msx264/msx264.iss.in [deleted file]
linphone/mediastreamer2/plugins/msx264/src/Makefile.am [deleted file]
linphone/mediastreamer2/plugins/msx264/src/msx264.c [deleted file]
linphone/mediastreamer2/src/.gitignore [deleted file]
linphone/mediastreamer2/src/Makefile.am [deleted file]
linphone/mediastreamer2/src/_kiss_fft_guts.h [deleted file]
linphone/mediastreamer2/src/alaw.c [deleted file]
linphone/mediastreamer2/src/alsa.c [deleted file]
linphone/mediastreamer2/src/aqsnd.c [deleted file]
linphone/mediastreamer2/src/arts.c [deleted file]
linphone/mediastreamer2/src/audiostream.c [deleted file]
linphone/mediastreamer2/src/dsptools.c [deleted file]
linphone/mediastreamer2/src/dtmfgen.c [deleted file]
linphone/mediastreamer2/src/dxfilter.cpp [deleted file]
linphone/mediastreamer2/src/dxfilter.h [deleted file]
linphone/mediastreamer2/src/equalizer.c [deleted file]
linphone/mediastreamer2/src/ffmpeg-priv.h [deleted file]
linphone/mediastreamer2/src/g711common.h [deleted file]
linphone/mediastreamer2/src/gsm.c [deleted file]
linphone/mediastreamer2/src/ice.c [deleted file]
linphone/mediastreamer2/src/kiss_fft.c [deleted file]
linphone/mediastreamer2/src/kiss_fft.h [deleted file]
linphone/mediastreamer2/src/kiss_fftr.c [deleted file]
linphone/mediastreamer2/src/kiss_fftr.h [deleted file]
linphone/mediastreamer2/src/macsnd.c [deleted file]
linphone/mediastreamer2/src/mire.c [deleted file]
linphone/mediastreamer2/src/mscommon.c [deleted file]
linphone/mediastreamer2/src/msconf.c [deleted file]
linphone/mediastreamer2/src/msdscap-mingw.cc [deleted file]
linphone/mediastreamer2/src/msfileplayer.c [deleted file]
linphone/mediastreamer2/src/msfileplayer_win.c [deleted file]
linphone/mediastreamer2/src/msfilerec.c [deleted file]
linphone/mediastreamer2/src/msfilerec_win.c [deleted file]
linphone/mediastreamer2/src/msfilter.c [deleted file]
linphone/mediastreamer2/src/msjoin.c [deleted file]
linphone/mediastreamer2/src/msqueue.c [deleted file]
linphone/mediastreamer2/src/msresample.c [deleted file]
linphone/mediastreamer2/src/msrtp.c [deleted file]
linphone/mediastreamer2/src/mssndcard.c [deleted file]
linphone/mediastreamer2/src/msspeex.c [deleted file]
linphone/mediastreamer2/src/msticker.c [deleted file]
linphone/mediastreamer2/src/msv4l.c [deleted file]
linphone/mediastreamer2/src/msv4l2.c [deleted file]
linphone/mediastreamer2/src/msv4m.m [deleted file]
linphone/mediastreamer2/src/msvideo.c [deleted file]
linphone/mediastreamer2/src/msvolume.c [deleted file]
linphone/mediastreamer2/src/mswebcam.c [deleted file]
linphone/mediastreamer2/src/mtu.c [deleted file]
linphone/mediastreamer2/src/nowebcam.c [deleted file]
linphone/mediastreamer2/src/nowebcam.h [deleted file]
linphone/mediastreamer2/src/nowebcamCIF.jpg [deleted file]
linphone/mediastreamer2/src/oss.c [deleted file]
linphone/mediastreamer2/src/pasnd.c [deleted file]
linphone/mediastreamer2/src/pixconv.c [deleted file]
linphone/mediastreamer2/src/rfc2429.h [deleted file]
linphone/mediastreamer2/src/rfc3984.c [deleted file]
linphone/mediastreamer2/src/sdlout.c [deleted file]
linphone/mediastreamer2/src/sizeconv.c [deleted file]
linphone/mediastreamer2/src/speexec.c [deleted file]
linphone/mediastreamer2/src/swscale.h [deleted file]
linphone/mediastreamer2/src/tee.c [deleted file]
linphone/mediastreamer2/src/theora.c [deleted file]
linphone/mediastreamer2/src/ulaw.c [deleted file]
linphone/mediastreamer2/src/vfw-missing.h [deleted file]
linphone/mediastreamer2/src/videodec.c [deleted file]
linphone/mediastreamer2/src/videoenc.c [deleted file]
linphone/mediastreamer2/src/videoout.c [deleted file]
linphone/mediastreamer2/src/videostream.c [deleted file]
linphone/mediastreamer2/src/void.c [deleted file]
linphone/mediastreamer2/src/wincevideods.c [deleted file]
linphone/mediastreamer2/src/winsnd.c [deleted file]
linphone/mediastreamer2/src/winsnd2.c [deleted file]
linphone/mediastreamer2/src/winsnd3.c [deleted file]
linphone/mediastreamer2/src/winsndds.cpp [deleted file]
linphone/mediastreamer2/src/winvideo.c [deleted file]
linphone/mediastreamer2/src/winvideo2.c [deleted file]
linphone/mediastreamer2/src/winvideods.c [deleted file]
linphone/mediastreamer2/tests/.gitignore [deleted file]
linphone/mediastreamer2/tests/Makefile.am [deleted file]
linphone/mediastreamer2/tests/bench.c [deleted file]
linphone/mediastreamer2/tests/echo.c [deleted file]
linphone/mediastreamer2/tests/mediastream.c [deleted file]
linphone/mediastreamer2/tests/mtudiscover.c [deleted file]
linphone/mediastreamer2/tests/ring.c [deleted file]
linphone/mediastreamer2/tests/videodisplay.c [deleted file]

index fb753dd0fb5e2090543d7dfffe3059a7f4e99d8d..98a34651839470b4ff9b895bda7ff6151907055a 100644 (file)
@@ -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 (submodule)
index 0000000..d32cda0
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit d32cda04540a3a2b0604a3184a5fec8dbc6d7b18
diff --git a/linphone/mediastreamer2/.gitignore b/linphone/mediastreamer2/.gitignore
deleted file mode 100644 (file)
index 6be2672..0000000
+++ /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 (file)
index 0f95558..0000000
+++ /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 (file)
index ff6dbf1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Simon MORLAT <simon dot morlat at linphone dot org>
\ No newline at end of file
diff --git a/linphone/mediastreamer2/COPYING b/linphone/mediastreamer2/COPYING
deleted file mode 100644 (file)
index d60c31a..0000000
+++ /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.
-\f
-                   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.)
-\f
-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.
-\f
-  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.
-\f
-  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
-\f
-           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.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    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.
-
-  <signature of Ty Coon>, 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 (file)
index e69de29..0000000
diff --git a/linphone/mediastreamer2/Makefile.am b/linphone/mediastreamer2/Makefile.am
deleted file mode 100644 (file)
index fb24614..0000000
+++ /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
-# <https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=206841>
-       TAR_OPTIONS=--wildcards rpmbuild -ta --clean --rmsource --rmspec $(PACKAGE)-$(VERSION).tar.gz
-
-# `make package'
-
-if WITH_EPM
-
-.PHONY: package
-
-PKG_NAME = $(PACKAGE)-$(VERSION)-$(RELEASE)
-BUILDROOT=`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 (file)
index bff3896..0000000
+++ /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 (file)
index 0b4abfc..0000000
+++ /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 (file)
index bf67fab..0000000
+++ /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 <simon.morlat_at_linphone.org>.
-
-Use the *linphone* mailing list for question about mediastreamer2.
-  <linphone-developers@nongnu.org>.
-
-Subscribe by writing to:
-  <linphone-developers-request@nongnu.org> 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 (file)
index 98f1b46..0000000
+++ /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 (executable)
index f88915e..0000000
+++ /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 (file)
index 3dda729..0000000
+++ /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 (executable)
index 7d64e0e..0000000
+++ /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 (file)
index 3dda729..0000000
+++ /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 (executable)
index b8a8dc2..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-EXTRA_DIST=alldescs.h mediastreamer2.vcproj mediastream.vcproj mediastreamer2.def\r
-\r
diff --git a/linphone/mediastreamer2/build/win32-novideo/alldescs.h b/linphone/mediastreamer2/build/win32-novideo/alldescs.h
deleted file mode 100755 (executable)
index 146f85d..0000000
+++ /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 (executable)
index b44c284..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>\r
-<VisualStudioProject\r
-       ProjectType="Visual C++"\r
-       Version="7.10"\r
-       Name="mediastream"\r
-       ProjectGUID="{92C82019-2DAC-4923-A05C-681AD5BDD04B}"\r
-       Keyword="Win32Proj">\r
-       <Platforms>\r
-               <Platform\r
-                       Name="Win32"/>\r
-       </Platforms>\r
-       <Configurations>\r
-               <Configuration\r
-                       Name="Debug|Win32"\r
-                       OutputDirectory="Debug"\r
-                       IntermediateDirectory="Debug"\r
-                       ConfigurationType="1"\r
-                       CharacterSet="2">\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               Optimization="0"\r
-                               AdditionalIncludeDirectories="&quot;..\..&quot;;&quot;..\..\..\oRTP\include&quot;"\r
-                               PreprocessorDefinitions="ICE_TEST;ORTP_INET6;WIN32;_DEBUG;_CONSOLE"\r
-                               MinimalRebuild="FALSE"\r
-                               BasicRuntimeChecks="3"\r
-                               RuntimeLibrary="1"\r
-                               BufferSecurityCheck="TRUE"\r
-                               UsePrecompiledHeader="0"\r
-                               ProgramDataBaseFileName="$(IntDir)/mediastream.pdb"\r
-                               WarningLevel="3"\r
-                               Detect64BitPortabilityProblems="TRUE"\r
-                               DebugInformationFormat="4"/>\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"/>\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalDependencies="Ws2_32.lib Winmm.lib ortp.lib mediastreamer2.lib"\r
-                               OutputFile="$(OutDir)/mediastream.exe"\r
-                               LinkIncremental="2"\r
-                               AdditionalLibraryDirectories="&quot;$(IntDir)/&quot;;&quot;..\..\..\oRTP\build\win32native\debug&quot;"\r
-                               GenerateDebugInformation="TRUE"\r
-                               ProgramDatabaseFile="$(OutDir)/mediastream.pdb"\r
-                               SubSystem="1"\r
-                               TargetMachine="1"/>\r
-                       <Tool\r
-                               Name="VCMIDLTool"/>\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"/>\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"/>\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"/>\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"/>\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"/>\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"/>\r
-                       <Tool\r
-                               Name="VCWebDeploymentTool"/>\r
-                       <Tool\r
-                               Name="VCManagedWrapperGeneratorTool"/>\r
-                       <Tool\r
-                               Name="VCAuxiliaryManagedWrapperGeneratorTool"/>\r
-               </Configuration>\r
-               <Configuration\r
-                       Name="Release|Win32"\r
-                       OutputDirectory="Release"\r
-                       IntermediateDirectory="Release"\r
-                       ConfigurationType="1"\r
-                       CharacterSet="2">\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               AdditionalIncludeDirectories="&quot;.&quot;;&quot;..\..\..\oRTP\include&quot;"\r
-                               PreprocessorDefinitions="ICE_TEST;ORTP_INET6;WIN32;NDEBUG;_CONSOLE"\r
-                               MinimalRebuild="FALSE"\r
-                               RuntimeLibrary="0"\r
-                               EnableFunctionLevelLinking="TRUE"\r
-                               UsePrecompiledHeader="0"\r
-                               ProgramDataBaseFileName="$(IntDir)/mediastream.pdb"\r
-                               WarningLevel="3"\r
-                               Detect64BitPortabilityProblems="TRUE"\r
-                               DebugInformationFormat="3"/>\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"/>\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalDependencies="Ws2_32.lib Winmm.lib ortp.lib mediastreamer2.lib"\r
-                               OutputFile="$(OutDir)/mediastream.exe"\r
-                               LinkIncremental="1"\r
-                               AdditionalLibraryDirectories="&quot;$(IntDir)/&quot;;&quot;..\..\..\oRTP\build\win32native\debug&quot;"\r
-                               GenerateDebugInformation="TRUE"\r
-                               SubSystem="1"\r
-                               OptimizeReferences="2"\r
-                               EnableCOMDATFolding="2"\r
-                               TargetMachine="1"/>\r
-                       <Tool\r
-                               Name="VCMIDLTool"/>\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"/>\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"/>\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"/>\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"/>\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"/>\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"/>\r
-                       <Tool\r
-                               Name="VCWebDeploymentTool"/>\r
-                       <Tool\r
-                               Name="VCManagedWrapperGeneratorTool"/>\r
-                       <Tool\r
-                               Name="VCAuxiliaryManagedWrapperGeneratorTool"/>\r
-               </Configuration>\r
-       </Configurations>\r
-       <References>\r
-       </References>\r
-       <Files>\r
-               <Filter\r
-                       Name="Source Files"\r
-                       Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
-                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">\r
-                       <File\r
-                               RelativePath="..\..\tests\mediastream.c">\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="Header Files"\r
-                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
-                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">\r
-               </Filter>\r
-               <Filter\r
-                       Name="Resource Files"\r
-                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"\r
-                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">\r
-               </Filter>\r
-       </Files>\r
-       <Globals>\r
-       </Globals>\r
-</VisualStudioProject>\r
diff --git a/linphone/mediastreamer2/build/win32-novideo/mediastreamer2.def b/linphone/mediastreamer2/build/win32-novideo/mediastreamer2.def
deleted file mode 100755 (executable)
index 8287deb..0000000
+++ /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\r
-       ms_filter_set_notify_callback\r
-       
-       ms_snd_card_new\r
-       ms_snd_card_manager_destroy\r
-       ms_snd_card_manager_reload\r
-       ms_snd_card_manager_add_card\r
-       ms_snd_card_manager_register_desc\r
-       ms_snd_card_create_reader\r
-       ms_snd_card_create_writer\r
-       ms_snd_card_get_name\r
-       ms_snd_card_get_string_id\r
-       ms_snd_card_manager_get\r
-       ms_snd_card_manager_get_default_card\r
-       ms_snd_card_manager_get_default_capture_card\r
-       ms_snd_card_manager_get_default_playback_card\r
-       ms_snd_card_manager_get_card\r
-       ms_snd_card_manager_get_list\r
-       ms_snd_card_dup\r
-       ms_snd_card_destroy\r
-       ms_snd_card_set_level\r
-       ms_snd_card_get_level\r
-       ms_snd_card_set_capture\r
-       ms_snd_card_set_control\r
-       ms_snd_card_get_control\r
-       
-       ms_ticker_new\r
-       ms_ticker_set_name\r
-       ms_ticker_destroy\r
-       ms_ticker_attach\r
-       ms_ticker_detach\r
-       ms_ticker_set_time_func\r
-       ms_ticker_print_graphs\r
-
-       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\r
-       \r
-       ms_sleep\r
-\r
-       ms_queue_init\r
-       ms_queue_flush\r
-       \r
-       ms_list_free\r
-       ms_list_for_each\r
-       ms_list_append\r
-       ms_list_remove\r
-       \r
-       ms_discover_mtu\r
-       ms_set_mtu\r
-       
\ 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 (executable)
index e57e5b0..0000000
+++ /dev/null
@@ -1,416 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>\r
-<VisualStudioProject\r
-       ProjectType="Visual C++"\r
-       Version="8,00"\r
-       Name="mediastreamer2"\r
-       ProjectGUID="{4A07BB2B-F56E-4F1B-A729-D28B782AC128}"\r
-       RootNamespace="mediastreamer2"\r
-       Keyword="Win32Proj"\r
-       >\r
-       <Platforms>\r
-               <Platform\r
-                       Name="Win32"\r
-               />\r
-       </Platforms>\r
-       <ToolFiles>\r
-       </ToolFiles>\r
-       <Configurations>\r
-               <Configuration\r
-                       Name="Debug|Win32"\r
-                       OutputDirectory="Debug"\r
-                       IntermediateDirectory="Debug"\r
-                       ConfigurationType="2"\r
-                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
-                       CharacterSet="0"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               Optimization="0"\r
-                               AdditionalIncludeDirectories="..\..\..\win32-bin\include,&quot;.&quot;;&quot;..\..\..\mediastreamer2\include&quot;;&quot;..\..\..\oRTP\include&quot;;..\..\..\codecs\speex\include;..\..\..\codecs\gsm\inc"\r
-                               PreprocessorDefinitions="__DIRECTSOUND_ENABLED__;HAVE_SPEEXDSP;__VIDEO_DISABLED__;EMULATE_INTTYPES;AMD_HACK;CONF_GRAN_MAX=12;HAVE_SPEEX_NOISE;ICE_TEST;ORTP_INET6;WIN32;_DEBUG;_WINDOWS;_USRDLL;MEDIASTREAMER2_EXPORTS;WINDOW_NATIVE;_CRT_SECURE_NO_DEPRECATE"\r
-                               MinimalRebuild="true"\r
-                               BasicRuntimeChecks="3"\r
-                               RuntimeLibrary="1"\r
-                               UsePrecompiledHeader="0"\r
-                               ProgramDataBaseFileName="$(IntDir)/libmediastreamer2.pdb"\r
-                               WarningLevel="3"\r
-                               DebugInformationFormat="4"\r
-                               CompileAs="2"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalDependencies="strmiids.lib Ws2_32.lib Winmm.lib ortp.lib libspeexd.lib libspeexdspd.lib libcmtd.lib"\r
-                               OutputFile="$(IntDir)/mediastreamer2.dll"\r
-                               LinkIncremental="2"\r
-                               AdditionalLibraryDirectories="&quot;..\..\..\oRTP\build\win32native\debug&quot;,..\..\..\codecs\speex\lib"\r
-                               IgnoreAllDefaultLibraries="true"\r
-                               ModuleDefinitionFile="mediastreamer2.def"\r
-                               GenerateDebugInformation="true"\r
-                               ProgramDatabaseFile="$(OutDir)/mediastreamer2.pdb"\r
-                               SubSystem="2"\r
-                               ImportLibrary="$(IntDir)/mediastreamer2.lib"\r
-                               TargetMachine="1"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManifestTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCAppVerifierTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebDeploymentTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-               </Configuration>\r
-               <Configuration\r
-                       Name="Release|Win32"\r
-                       OutputDirectory="Release"\r
-                       IntermediateDirectory="Release"\r
-                       ConfigurationType="2"\r
-                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
-                       CharacterSet="2"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               AdditionalIncludeDirectories="..\..\..\win32-bin\include,&quot;.&quot;;&quot;..\..\..\mediastreamer2\include&quot;;&quot;..\..\..\oRTP\include&quot;;..\..\..\codecs\speex\include;..\..\..\codecs\gsm\inc"\r
-                               PreprocessorDefinitions="__DIRECTSOUND_ENABLED__;HAVE_SPEEXDSP;__VIDEO_DISABLED__;CONF_GRAN_MAX=12;AMD_HACK;HAVE_SPEEX_NOISE;ICE_TEST;ORTP_INET6;WIN32;NDEBUG;_WINDOWS;_USRDLL;MEDIASTREAMER2_EXPORTS;WINDOW_NATIVE;_CRT_SECURE_NO_DEPRECATE"\r
-                               RuntimeLibrary="0"\r
-                               UsePrecompiledHeader="0"\r
-                               ProgramDataBaseFileName="$(IntDir)/libmediastreamer2.pdb"\r
-                               WarningLevel="3"\r
-                               DebugInformationFormat="3"\r
-                               CallingConvention="0"\r
-                               CompileAs="2"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalDependencies="strmiids.lib Ws2_32.lib Winmm.lib ortp.lib libspeex.lib libspeexdsp.lib libcmt.lib"\r
-                               OutputFile="$(IntDir)/mediastreamer2.dll"\r
-                               LinkIncremental="1"\r
-                               AdditionalLibraryDirectories="&quot;..\..\..\oRTP\build\win32native\release&quot;,..\..\..\codecs\speex\lib"\r
-                               IgnoreAllDefaultLibraries="true"\r
-                               ModuleDefinitionFile="mediastreamer2.def"\r
-                               GenerateDebugInformation="true"\r
-                               SubSystem="2"\r
-                               OptimizeReferences="2"\r
-                               EnableCOMDATFolding="2"\r
-                               ImportLibrary="$(IntDir)/mediastreamer2.lib"\r
-                               TargetMachine="1"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManifestTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCAppVerifierTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebDeploymentTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-               </Configuration>\r
-       </Configurations>\r
-       <References>\r
-       </References>\r
-       <Files>\r
-               <Filter\r
-                       Name="Source Files"\r
-                       Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
-                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
-                       >\r
-                       <File\r
-                               RelativePath="..\..\src\_kiss_fft_guts.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\alaw.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\audiostream.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\dsptools.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\dtmfgen.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\equalizer.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\gsm.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\ice.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\kiss_fft.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\kiss_fft.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\kiss_fftr.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\kiss_fftr.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\mscommon.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msconf.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msfileplayer_win.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msfilerec_win.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msfilter.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msjoin.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msqueue.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msresample.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msrtp.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\mssndcard.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msspeex.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msticker.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msvolume.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\mtu.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\speexec.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\tee.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\ulaw.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\winsnd2.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\winsndds.cpp"\r
-                               >\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="Header Files"\r
-                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
-                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
-                       >\r
-                       <File\r
-                               RelativePath=".\alldescs.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\allfilters.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\dsptools.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\dtmfgen.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\g711common.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\ice.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\mediastream.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\mscommon.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msequalizer.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msfileplayer.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msfilerec.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msfilter.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msqueue.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msrtp.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\mssndcard.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msticker.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msvolume.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\rfc2429.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\waveheader.h"\r
-                               >\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="Resource Files"\r
-                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"\r
-                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
-                       >\r
-               </Filter>\r
-               <File\r
-                       RelativePath=".\mediastreamer2.def"\r
-                       >\r
-               </File>\r
-       </Files>\r
-       <Globals>\r
-       </Globals>\r
-</VisualStudioProject>\r
diff --git a/linphone/mediastreamer2/build/win32native/.gitignore b/linphone/mediastreamer2/build/win32native/.gitignore
deleted file mode 100644 (file)
index 3dda729..0000000
+++ /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 (executable)
index 82fc563..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-EXTRA_DIST=alldescs.h mediastreamer2.vcproj mediastream.vcproj videodisplay.vcproj mediastreamer2.def \r
-\r
diff --git a/linphone/mediastreamer2/build/win32native/alldescs.h b/linphone/mediastreamer2/build/win32native/alldescs.h
deleted file mode 100755 (executable)
index a83db96..0000000
+++ /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 (executable)
index 1dd3ec7..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>\r
-<VisualStudioProject\r
-       ProjectType="Visual C++"\r
-       Version="8,00"\r
-       Name="mediastream"\r
-       ProjectGUID="{92C82019-2DAC-4923-A05C-681AD5BDD04B}"\r
-       Keyword="Win32Proj"\r
-       >\r
-       <Platforms>\r
-               <Platform\r
-                       Name="Win32"\r
-               />\r
-       </Platforms>\r
-       <ToolFiles>\r
-       </ToolFiles>\r
-       <Configurations>\r
-               <Configuration\r
-                       Name="Debug|Win32"\r
-                       OutputDirectory="Debug"\r
-                       IntermediateDirectory="Debug"\r
-                       ConfigurationType="1"\r
-                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
-                       CharacterSet="2"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               Optimization="0"\r
-                               AdditionalIncludeDirectories="&quot;.&quot;;&quot;..\..\include&quot;;&quot;..\..\..\oRTP\include&quot;"\r
-                               PreprocessorDefinitions="VIDEO_ENABLED;OSIP_MT;ICE_TEST;ORTP_INET6;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE"\r
-                               MinimalRebuild="false"\r
-                               BasicRuntimeChecks="3"\r
-                               RuntimeLibrary="1"\r
-                               BufferSecurityCheck="true"\r
-                               UsePrecompiledHeader="0"\r
-                               ProgramDataBaseFileName="$(IntDir)/mediastream.pdb"\r
-                               WarningLevel="3"\r
-                               Detect64BitPortabilityProblems="true"\r
-                               DebugInformationFormat="4"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalDependencies="Ws2_32.lib Winmm.lib ortp.lib mediastreamer2.lib"\r
-                               OutputFile="$(OutDir)/mediastream.exe"\r
-                               LinkIncremental="2"\r
-                               AdditionalLibraryDirectories="&quot;$(IntDir)/&quot;;&quot;..\..\..\oRTP\build\win32native\debug&quot;"\r
-                               GenerateDebugInformation="true"\r
-                               ProgramDatabaseFile="$(OutDir)/mediastream.pdb"\r
-                               SubSystem="1"\r
-                               TargetMachine="1"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManifestTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCAppVerifierTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebDeploymentTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-               </Configuration>\r
-               <Configuration\r
-                       Name="Release|Win32"\r
-                       OutputDirectory="Release"\r
-                       IntermediateDirectory="Release"\r
-                       ConfigurationType="1"\r
-                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
-                       CharacterSet="2"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               AdditionalIncludeDirectories="&quot;.&quot;;&quot;..\..\include&quot;;&quot;..\..\..\oRTP\include&quot;"\r
-                               PreprocessorDefinitions="OSIP_MT;ICE_TEST;ORTP_INET6;_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_CONSOLE"\r
-                               MinimalRebuild="false"\r
-                               RuntimeLibrary="0"\r
-                               EnableFunctionLevelLinking="true"\r
-                               UsePrecompiledHeader="0"\r
-                               ProgramDataBaseFileName="$(IntDir)/mediastream.pdb"\r
-                               WarningLevel="3"\r
-                               Detect64BitPortabilityProblems="true"\r
-                               DebugInformationFormat="3"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalDependencies="Ws2_32.lib Winmm.lib ortp.lib mediastreamer2.lib"\r
-                               OutputFile="$(OutDir)/mediastream.exe"\r
-                               LinkIncremental="1"\r
-                               AdditionalLibraryDirectories="&quot;$(IntDir)/&quot;;&quot;..\..\..\oRTP\build\win32native\debug&quot;"\r
-                               GenerateDebugInformation="true"\r
-                               SubSystem="1"\r
-                               OptimizeReferences="2"\r
-                               EnableCOMDATFolding="2"\r
-                               TargetMachine="1"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManifestTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCAppVerifierTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebDeploymentTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-               </Configuration>\r
-       </Configurations>\r
-       <References>\r
-       </References>\r
-       <Files>\r
-               <Filter\r
-                       Name="Source Files"\r
-                       Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
-                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
-                       >\r
-                       <File\r
-                               RelativePath="..\..\tests\mediastream.c"\r
-                               >\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="Header Files"\r
-                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
-                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
-                       >\r
-               </Filter>\r
-               <Filter\r
-                       Name="Resource Files"\r
-                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"\r
-                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
-                       >\r
-               </Filter>\r
-       </Files>\r
-       <Globals>\r
-       </Globals>\r
-</VisualStudioProject>\r
diff --git a/linphone/mediastreamer2/build/win32native/mediastreamer2.def b/linphone/mediastreamer2/build/win32native/mediastreamer2.def
deleted file mode 100755 (executable)
index e13dd86..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-LIBRARY mediastreamer2\r
-\r
-EXPORTS\r
-\r
-       ms_init\r
-       ms_exit\r
-               \r
-       ms_filter_new\r
-       ms_filter_new_from_desc\r
-       ms_filter_destroy\r
-       ms_filter_create_encoder\r
-       ms_filter_create_decoder\r
-       ms_filter_call_method\r
-       ms_filter_call_method_noarg\r
-       ms_filter_link\r
-       ms_filter_unlink\r
-       ms_filter_preprocess\r
-       ms_filter_postprocess\r
-       ms_filter_codec_supported\r
-       ms_filter_register\r
-       ms_filter_new_from_name\r
-       ms_filter_set_notify_callback\r
-       \r
-       ms_snd_card_new\r
-       ms_snd_card_manager_destroy\r
-       ms_snd_card_manager_reload\r
-       ms_snd_card_manager_add_card\r
-       ms_snd_card_manager_register_desc\r
-       ms_snd_card_create_reader\r
-       ms_snd_card_create_writer\r
-       ms_snd_card_get_name\r
-       ms_snd_card_get_string_id\r
-       ms_snd_card_manager_get\r
-       ms_snd_card_manager_get_default_card\r
-       ms_snd_card_manager_get_default_capture_card\r
-       ms_snd_card_manager_get_default_playback_card\r
-       ms_snd_card_manager_get_card\r
-       ms_snd_card_manager_get_list\r
-       ms_snd_card_dup\r
-       ms_snd_card_destroy\r
-       ms_snd_card_set_level\r
-       ms_snd_card_get_level\r
-       ms_snd_card_set_capture\r
-       ms_snd_card_set_control\r
-       ms_snd_card_get_control\r
-       \r
-       ms_ticker_new\r
-       ms_ticker_set_name\r
-       ms_ticker_destroy\r
-       ms_ticker_attach\r
-       ms_ticker_detach\r
-       ms_ticker_set_time_func\r
-       ms_ticker_print_graphs\r
-\r
-       ms_bufferizer_init\r
-       ms_bufferizer_uninit\r
-       ms_bufferizer_read\r
-       ms_bufferizer_put\r
-       ms_bufferizer_put_from_queue\r
-       \r
-       audio_stream_start\r
-       audio_stream_stop\r
-       audio_stream_free\r
-       create_duplex_rtpsession\r
-\r
-       ms_load_plugins\r
-\r
-       ms_display_new\r
-       ms_display_set_window_id\r
-       ms_display_desc_set_default\r
-       ms_display_destroy\r
-\r
-       video_preview_stop\r
-       video_preview_start\r
-       video_stream_new\r
-       video_stream_start\r
-       video_stream_stop\r
-       video_stream_iterate\r
-       video_stream_set_sent_video_size\r
-       \r
-       ms_is_ipv6\r
-       \r
-       yuv_buf_alloc\r
-       yuv_buf_init_from_mblk\r
-       yuv_buf_init_from_mblk_with_size\r
-\r
-       ms_sleep\r
-       \r
-       ms_queue_init\r
-       ms_queue_flush\r
-       \r
-       rfc3984_init\r
-       rfc3984_uninit\r
-       rfc3984_pack\r
-       rfc3984_unpack\r
-       rfc3984_set_mode\r
-\r
-       ms_list_free\r
-       ms_list_for_each\r
-       ms_list_append\r
-       ms_list_remove\r
-       \r
-       ms_discover_mtu\r
-       ms_set_mtu\r
-       \r
-       ms_web_cam_new\r
-       ms_web_cam_manager_reload\r
-       ms_web_cam_manager_get_default_cam\r
-       ms_web_cam_manager_get\r
-       ms_web_cam_manager_get_list\r
-       ms_web_cam_manager_get_cam\r
-       ms_web_cam_manager_add_cam\r
-       ms_web_cam_manager_register_desc\r
-       ms_web_cam_create_reader\r
-       ms_web_cam_get_driver_type\r
-       ms_web_cam_get_name\r
-       ms_web_cam_get_string_id\r
diff --git a/linphone/mediastreamer2/build/win32native/mediastreamer2.vcproj b/linphone/mediastreamer2/build/win32native/mediastreamer2.vcproj
deleted file mode 100755 (executable)
index 93dd635..0000000
+++ /dev/null
@@ -1,504 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>\r
-<VisualStudioProject\r
-       ProjectType="Visual C++"\r
-       Version="8,00"\r
-       Name="mediastreamer2"\r
-       ProjectGUID="{4A07BB2B-F56E-4F1B-A729-D28B782AC128}"\r
-       RootNamespace="mediastreamer2"\r
-       Keyword="Win32Proj"\r
-       >\r
-       <Platforms>\r
-               <Platform\r
-                       Name="Win32"\r
-               />\r
-       </Platforms>\r
-       <ToolFiles>\r
-       </ToolFiles>\r
-       <Configurations>\r
-               <Configuration\r
-                       Name="Debug|Win32"\r
-                       OutputDirectory="Debug"\r
-                       IntermediateDirectory="Debug"\r
-                       ConfigurationType="2"\r
-                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
-                       CharacterSet="0"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               Optimization="0"\r
-                               AdditionalIncludeDirectories="..\..\..\portaudio\include;&quot;..\..\..\win32-bin\include\baseclasses&quot;;&quot;..\..\..\win32-bin\include&quot;;.;..\..\..\mediastreamer2\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include;..\..\..\codecs\gsm\inc"\r
-                               PreprocessorDefinitions="__DIRECTSOUND_ENABLED__;__STDC_CONSTANT_MACROS;HAVE_LIBSWSCALE_SWSCALE_H;HAVE_LIBAVCODEC_AVCODEC_H;HAVE_SPEEXDSP;HAVE_DIRECTSHOW;VIDEO_ENABLED;AMD_HACK;ORTP_INET6;WIN32;_DEBUG;_WINDOWS;_USRDLL;MEDIASTREAMER2_EXPORTS;WINDOW_NATIVE;_CRT_SECURE_NO_DEPRECATE"\r
-                               MinimalRebuild="true"\r
-                               BasicRuntimeChecks="3"\r
-                               RuntimeLibrary="1"\r
-                               UsePrecompiledHeader="0"\r
-                               ProgramDataBaseFileName="$(IntDir)/libmediastreamer2.pdb"\r
-                               WarningLevel="3"\r
-                               DebugInformationFormat="4"\r
-                               CompileAs="2"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalDependencies="swscale.lib avcodec-52.lib quartz.lib dmoguids.lib strmiids.lib strmbasd.lib libtheora.lib vfw32.lib Ws2_32.lib Winmm.lib ortp.lib libspeexd.lib libspeexdspd.lib libcmtd.lib"\r
-                               OutputFile="$(IntDir)/mediastreamer2.dll"\r
-                               LinkIncremental="1"\r
-                               AdditionalLibraryDirectories="..\..\..\win32-bin\lib,&quot;..\..\..\oRTP\build\win32native\debug&quot;,..\..\..\codecs\speex\lib"\r
-                               IgnoreAllDefaultLibraries="true"\r
-                               ModuleDefinitionFile="mediastreamer2.def"\r
-                               GenerateDebugInformation="true"\r
-                               ProgramDatabaseFile="$(OutDir)/mediastreamer2.pdb"\r
-                               SubSystem="2"\r
-                               ImportLibrary="$(IntDir)/mediastreamer2.lib"\r
-                               TargetMachine="1"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManifestTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCAppVerifierTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebDeploymentTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-               </Configuration>\r
-               <Configuration\r
-                       Name="Release|Win32"\r
-                       OutputDirectory="Release"\r
-                       IntermediateDirectory="Release"\r
-                       ConfigurationType="2"\r
-                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"\r
-                       CharacterSet="2"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               AdditionalIncludeDirectories="..\..\..\portaudio\include;&quot;..\..\..\win32-bin\include\baseclasses&quot;;&quot;..\..\..\win32-bin\include&quot;;.;..\..\..\mediastreamer2\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include;..\..\..\codecs\gsm\inc"\r
-                               PreprocessorDefinitions="__DIRECTSOUND_ENABLED__;__STDC_CONSTANT_MACROS;HAVE_LIBSWSCALE_SWSCALE_H;HAVE_LIBAVCODEC_AVCODEC_H;HAVE_SPEEXDSP;HAVE_DIRECTSHOW;VIDEO_ENABLED;AMD_HACK;ORTP_INET6;WIN32;NDEBUG;_WINDOWS;_USRDLL;MEDIASTREAMER2_EXPORTS;WINDOW_NATIVE;_CRT_SECURE_NO_DEPRECATE"\r
-                               RuntimeLibrary="0"\r
-                               UsePrecompiledHeader="0"\r
-                               ProgramDataBaseFileName="$(IntDir)/libmediastreamer2.pdb"\r
-                               WarningLevel="3"\r
-                               DebugInformationFormat="0"\r
-                               CallingConvention="0"\r
-                               CompileAs="2"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalDependencies="swscale.lib avcodec-52.lib quartz.lib dmoguids.lib strmiids.lib strmbase.lib libtheora.lib vfw32.lib Ws2_32.lib Winmm.lib ortp.lib libspeex.lib libspeexdsp.lib libcmt.lib"\r
-                               OutputFile="$(IntDir)/mediastreamer2.dll"\r
-                               LinkIncremental="1"\r
-                               AdditionalLibraryDirectories="..\..\..\win32-bin\lib,&quot;..\..\..\oRTP\build\win32native\release&quot;,..\..\..\codecs\speex\lib"\r
-                               IgnoreAllDefaultLibraries="true"\r
-                               ModuleDefinitionFile="mediastreamer2.def"\r
-                               GenerateDebugInformation="false"\r
-                               SubSystem="2"\r
-                               OptimizeReferences="2"\r
-                               EnableCOMDATFolding="2"\r
-                               ImportLibrary="$(IntDir)/mediastreamer2.lib"\r
-                               TargetMachine="1"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManifestTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCAppVerifierTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebDeploymentTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-               </Configuration>\r
-       </Configurations>\r
-       <References>\r
-       </References>\r
-       <Files>\r
-               <Filter\r
-                       Name="Source Files"\r
-                       Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
-                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
-                       >\r
-                       <File\r
-                               RelativePath="..\..\src\alaw.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\audiostream.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\dsptools.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\dtmfgen.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\dxfilter.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\equalizer.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\gsm.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\ice.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\kiss_fft.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\kiss_fftr.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\mire.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\mscommon.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msconf.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msfileplayer_win.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msfilerec_win.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msfilter.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msjoin.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msqueue.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msresample.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msrtp.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\mssndcard.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msspeex.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msticker.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msvideo.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msvolume.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\mswebcam.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\mtu.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\nowebcam.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\pixconv.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\rfc3984.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\sizeconv.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\speexec.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\tee.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\theora.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\ulaw.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\videodec.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\videoenc.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\videoout.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\videostream.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\void.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\winsnd2.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\winsndds.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\winvideo2.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\winvideods.c"\r
-                               >\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="Header Files"\r
-                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
-                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
-                       >\r
-                       <File\r
-                               RelativePath="..\..\src\_kiss_fft_guts.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\alldescs.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\allfilters.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\dtmfgen.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\dxfilter.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\ffmpeg-priv.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\g711common.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\ice.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\kiss_fft.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\kiss_fftr.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\mediastream.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\mscommon.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msfileplayer.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msfilerec.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msfilter.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msqueue.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msrtp.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\mssndcard.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msticker.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msv4l.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msvideo.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msvideoout.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msvolume.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\mswebcam.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\nowebcam.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\rfc2429.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\vfw-missing.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\waveheader.h"\r
-                               >\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="Resource Files"\r
-                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"\r
-                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
-                       >\r
-               </Filter>\r
-               <File\r
-                       RelativePath=".\mediastreamer2.def"\r
-                       >\r
-               </File>\r
-       </Files>\r
-       <Globals>\r
-       </Globals>\r
-</VisualStudioProject>\r
diff --git a/linphone/mediastreamer2/build/win32native/videodisplay.vcproj b/linphone/mediastreamer2/build/win32native/videodisplay.vcproj
deleted file mode 100755 (executable)
index 5784ff3..0000000
+++ /dev/null
@@ -1,203 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>\r
-<VisualStudioProject\r
-       ProjectType="Visual C++"\r
-       Version="8,00"\r
-       Name="videodisplay"\r
-       ProjectGUID="{389D13D7-536A-4544-B0DB-DDE98CC53009}"\r
-       RootNamespace="videodisplay"\r
-       Keyword="Win32Proj"\r
-       >\r
-       <Platforms>\r
-               <Platform\r
-                       Name="Win32"\r
-               />\r
-       </Platforms>\r
-       <ToolFiles>\r
-       </ToolFiles>\r
-       <Configurations>\r
-               <Configuration\r
-                       Name="Debug|Win32"\r
-                       OutputDirectory="$(ConfigurationName)"\r
-                       IntermediateDirectory="$(ConfigurationName)"\r
-                       ConfigurationType="1"\r
-                       CharacterSet="1"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               Optimization="0"\r
-                               AdditionalIncludeDirectories="&quot;.&quot;;&quot;..\..\include&quot;;&quot;..\..\..\oRTP\include&quot;"\r
-                               PreprocessorDefinitions="OSIP_MT;EMULATE_INTTYPES;ORTP_INET6;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE"\r
-                               MinimalRebuild="true"\r
-                               BasicRuntimeChecks="3"\r
-                               RuntimeLibrary="1"\r
-                               UsePrecompiledHeader="0"\r
-                               WarningLevel="3"\r
-                               Detect64BitPortabilityProblems="true"\r
-                               DebugInformationFormat="4"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalDependencies="Ws2_32.lib Winmm.lib ortp.lib mediastreamer2.lib"\r
-                               LinkIncremental="2"\r
-                               AdditionalLibraryDirectories="&quot;$(IntDir)/&quot;;&quot;..\..\..\oRTP\build\win32native\debug&quot;"\r
-                               GenerateDebugInformation="true"\r
-                               SubSystem="1"\r
-                               TargetMachine="1"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManifestTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCAppVerifierTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebDeploymentTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-               </Configuration>\r
-               <Configuration\r
-                       Name="Release|Win32"\r
-                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
-                       IntermediateDirectory="$(ConfigurationName)"\r
-                       ConfigurationType="1"\r
-                       CharacterSet="1"\r
-                       WholeProgramOptimization="1"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               AdditionalIncludeDirectories="&quot;.&quot;;&quot;..\..\include&quot;;&quot;..\..\..\oRTP\include&quot;"\r
-                               PreprocessorDefinitions="OSIP_MT;EMULATE_INTTYPES;ORTP_INET6;_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_CONSOLE"\r
-                               RuntimeLibrary="0"\r
-                               UsePrecompiledHeader="0"\r
-                               WarningLevel="3"\r
-                               Detect64BitPortabilityProblems="true"\r
-                               DebugInformationFormat="3"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalDependencies="Ws2_32.lib Winmm.lib ortp.lib mediastreamer2.lib"\r
-                               LinkIncremental="1"\r
-                               AdditionalLibraryDirectories="&quot;$(IntDir)/&quot;;&quot;..\..\..\oRTP\build\win32native\release&quot;"\r
-                               GenerateDebugInformation="true"\r
-                               SubSystem="1"\r
-                               OptimizeReferences="2"\r
-                               EnableCOMDATFolding="2"\r
-                               TargetMachine="1"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManifestTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCAppVerifierTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebDeploymentTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-               </Configuration>\r
-       </Configurations>\r
-       <References>\r
-       </References>\r
-       <Files>\r
-               <Filter\r
-                       Name="Source Files"\r
-                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
-                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
-                       >\r
-                       <File\r
-                               RelativePath="..\..\tests\videodisplay.c"\r
-                               >\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="Header Files"\r
-                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
-                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
-                       >\r
-               </Filter>\r
-               <Filter\r
-                       Name="Resource Files"\r
-                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
-                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
-                       >\r
-               </Filter>\r
-       </Files>\r
-       <Globals>\r
-       </Globals>\r
-</VisualStudioProject>\r
diff --git a/linphone/mediastreamer2/build/wince/.gitignore b/linphone/mediastreamer2/build/wince/.gitignore
deleted file mode 100644 (file)
index 282522d..0000000
+++ /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 (executable)
index 07d97c8..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-EXTRA_DIST=alldescs.h mediastreamer2.vcproj mediastreamer2.def\r
-\r
diff --git a/linphone/mediastreamer2/build/wince/alldescs.h b/linphone/mediastreamer2/build/wince/alldescs.h
deleted file mode 100644 (file)
index e5e1794..0000000
+++ /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 (file)
index 80dad5f..0000000
+++ /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 (file)
index ac78735..0000000
+++ /dev/null
@@ -1,1568 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-       ProjectType="Visual C++"
-       Version="8,00"
-       Name="mediastreamer2"
-       ProjectGUID="{177F5AE2-A40C-4412-8F26-7F85FA32464E}"
-       RootNamespace="mediastreamer2"
-       Keyword="MFCDLLProj"
-       >
-       <Platforms>
-               <Platform
-                       Name="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-               />
-               <Platform
-                       Name="Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
-               />
-               <Platform
-                       Name="Windows Mobile 6 Standard SDK (ARMV4I)"
-               />
-               <Platform
-                       Name="MP100_2P21 (ARMV4I)"
-               />
-       </Platforms>
-       <ToolFiles>
-       </ToolFiles>
-       <Configurations>
-               <Configuration
-                       Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-                       OutputDirectory="$(PlatformName)\Debug"
-                       IntermediateDirectory="$(PlatformName)\Debug"
-                       ConfigurationType="2"
-                       UseOfMFC="0"
-                       CharacterSet="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                               PreprocessorDefinitions="_DEBUG"
-                               MkTypLibCompatible="false"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               ExecutionBucket="7"
-                               Optimization="2"
-                               FavorSizeOrSpeed="1"
-                               AdditionalIncludeDirectories=".;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"
-                               PreprocessorDefinitions="__VIDEO_DISABLED__;AMD_HACK;HAVE_SPEEX_NOISE;ORTP_INET6;MEDIASTREAMER2_EXPORT;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);POCKETPC2003_UI_MODEL;POCKETPC2003_UI_MODEL"
-                               RuntimeLibrary="3"
-                               TreatWChar_tAsBuiltInType="false"
-                               UsePrecompiledHeader="0"
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"
-                               WarningLevel="3"
-                               DebugInformationFormat="3"
-                               CompileAs="2"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="_DEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
-                               Culture="1033"
-                               AdditionalIncludeDirectories="$(IntDir)"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
-                               AdditionalDependencies=" ws2.lib iphlpapi.lib mmtimer.lib libcmtd.lib "
-                               IgnoreAllDefaultLibraries="true"
-                               ModuleDefinitionFile="mediastreamer2.def"
-                               GenerateDebugInformation="true"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCCodeSignTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-                       <DeploymentTool
-                               ForceDirty="-1"
-                               RemoteDirectory="%CSIDL_PROGRAM_FILES%\amsipua"
-                               RegisterOutput="0"
-                               AdditionalFiles=""
-                       />
-                       <DebuggerTool
-                       />
-               </Configuration>
-               <Configuration
-                       Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
-                       OutputDirectory="$(PlatformName)\Debug"
-                       IntermediateDirectory="$(PlatformName)\Debug"
-                       ConfigurationType="2"
-                       UseOfMFC="0"
-                       CharacterSet="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                               PreprocessorDefinitions="_DEBUG"
-                               MkTypLibCompatible="false"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               ExecutionBucket="7"
-                               Optimization="0"
-                               AdditionalIncludeDirectories=".;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"
-                               PreprocessorDefinitions="__VIDEO_DISABLED__;ORTP_INET6;MEDIASTREAMER2_EXPORT;AMD_HACK;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);SMARTPHONE2003_UI_MODEL;SMARTPHONE2003_UI_MODEL"
-                               RuntimeLibrary="3"
-                               TreatWChar_tAsBuiltInType="false"
-                               UsePrecompiledHeader="0"
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"
-                               WarningLevel="3"
-                               DebugInformationFormat="3"
-                               CompileAs="2"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="_DEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
-                               Culture="1033"
-                               AdditionalIncludeDirectories="$(IntDir)"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
-                               AdditionalDependencies=" ws2.lib iphlpapi.lib mmtimer.lib libcmtd.lib dmoguids.lib strmiids.lib strmbase.lib atlsd.lib d3dmx.lib"
-                               IgnoreAllDefaultLibraries="true"
-                               ModuleDefinitionFile="mediastreamer2.def"
-                               GenerateDebugInformation="true"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCCodeSignTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-                       <DeploymentTool
-                               ForceDirty="-1"
-                               RemoteDirectory="%CSIDL_PROGRAM_FILES%\amsipua"
-                               RegisterOutput="0"
-                               AdditionalFiles=""
-                       />
-                       <DebuggerTool
-                       />
-               </Configuration>
-               <Configuration
-                       Name="Debug|Windows Mobile 6 Standard SDK (ARMV4I)"
-                       OutputDirectory="Windows Mobile 6 Standard SDK (ARMV4I)\$(ConfigurationName)"
-                       IntermediateDirectory="Windows Mobile 6 Standard SDK (ARMV4I)\$(ConfigurationName)"
-                       ConfigurationType="2"
-                       UseOfMFC="0"
-                       UseOfATL="0"
-                       CharacterSet="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                               PreprocessorDefinitions="_DEBUG"
-                               MkTypLibCompatible="false"
-                               TargetEnvironment="1"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               ExecutionBucket="7"
-                               Optimization="2"
-                               FavorSizeOrSpeed="1"
-                               AdditionalIncludeDirectories=".;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"
-                               PreprocessorDefinitions="__VIDEO_DISABLED__;AMD_HACK;HAVE_SPEEX_NOISE;ORTP_INET6;MEDIASTREAMER2_EXPORT;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_)"
-                               ExceptionHandling="1"
-                               RuntimeLibrary="3"
-                               TreatWChar_tAsBuiltInType="false"
-                               UsePrecompiledHeader="0"
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"
-                               WarningLevel="3"
-                               DebugInformationFormat="3"
-                               CompileAs="2"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="_DEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
-                               Culture="1033"
-                               AdditionalIncludeDirectories="$(IntDir)"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
-                               AdditionalDependencies="atlsd.lib strmiids.lib dmoguids.lib strmbase.lib ws2.lib iphlpapi.lib mmtimer.lib libcmtd.lib"
-                               IgnoreAllDefaultLibraries="true"
-                               ModuleDefinitionFile="mediastreamer2.def"
-                               GenerateDebugInformation="true"
-                               TargetMachine="0"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCCodeSignTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-                       <DeploymentTool
-                               ForceDirty="-1"
-                               RemoteDirectory="%CSIDL_PROGRAM_FILES%\amsipua"
-                               RegisterOutput="0"
-                               AdditionalFiles=""
-                       />
-                       <DebuggerTool
-                       />
-               </Configuration>
-               <Configuration
-                       Name="Debug|MP100_2P21 (ARMV4I)"
-                       OutputDirectory="MP100_2P21 (ARMV4I)\$(ConfigurationName)"
-                       IntermediateDirectory="MP100_2P21 (ARMV4I)\$(ConfigurationName)"
-                       ConfigurationType="2"
-                       UseOfMFC="0"
-                       CharacterSet="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                               PreprocessorDefinitions="_DEBUG"
-                               MkTypLibCompatible="false"
-                               TargetEnvironment="1"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               ExecutionBucket="7"
-                               Optimization="0"
-                               FavorSizeOrSpeed="0"
-                               AdditionalIncludeDirectories=".;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"
-                               PreprocessorDefinitions="NO_FFMPEG;VIDEO_ENABLED;AMD_HACK;HAVE_SPEEX_NOISE;ORTP_INET6;MEDIASTREAMER2_EXPORT;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);POCKETPC2003_UI_MODEL;POCKETPC2003_UI_MODEL"
-                               RuntimeLibrary="3"
-                               TreatWChar_tAsBuiltInType="false"
-                               UsePrecompiledHeader="0"
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"
-                               WarningLevel="3"
-                               DebugInformationFormat="3"
-                               CompileAs="2"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="_DEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
-                               Culture="1033"
-                               AdditionalIncludeDirectories="$(IntDir)"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalOptions=" /SUBSYSTEM:$(CESubsystem) /MACHINE:THUMB"
-                               AdditionalDependencies=" ws2.lib iphlpapi.lib mmtimer.lib libcmtd.lib "
-                               IgnoreAllDefaultLibraries="true"
-                               ModuleDefinitionFile="mediastreamer2.def"
-                               GenerateDebugInformation="true"
-                               TargetMachine="0"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCCodeSignTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-                       <DeploymentTool
-                               ForceDirty="-1"
-                               RemoteDirectory="%CSIDL_PROGRAM_FILES%\amsipua"
-                               RegisterOutput="0"
-                               AdditionalFiles=""
-                       />
-                       <DebuggerTool
-                       />
-               </Configuration>
-               <Configuration
-                       Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-                       OutputDirectory="$(PlatformName)\Release"
-                       IntermediateDirectory="$(PlatformName)\Release"
-                       ConfigurationType="2"
-                       UseOfMFC="0"
-                       CharacterSet="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                               PreprocessorDefinitions="NDEBUG"
-                               MkTypLibCompatible="false"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               ExecutionBucket="7"
-                               AdditionalIncludeDirectories=".;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"
-                               PreprocessorDefinitions="__VIDEO_DISABLED__;AMD_HACK;HAVE_SPEEX_NOISE;ORTP_INET6;MEDIASTREAMER2_EXPORT;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);POCKETPC2003_UI_MODEL;POCKETPC2003_UI_MODEL"
-                               RuntimeLibrary="2"
-                               TreatWChar_tAsBuiltInType="false"
-                               UsePrecompiledHeader="0"
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"
-                               WarningLevel="3"
-                               DebugInformationFormat="0"
-                               CompileAs="2"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
-                               Culture="1033"
-                               AdditionalIncludeDirectories="$(IntDir)"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
-                               AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmt.lib"
-                               IgnoreAllDefaultLibraries="true"
-                               ModuleDefinitionFile="mediastreamer2.def"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCCodeSignTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-                       <DeploymentTool
-                               ForceDirty="-1"
-                               RemoteDirectory="%CSIDL_PROGRAM_FILES%\amsipua"
-                               RegisterOutput="0"
-                               AdditionalFiles=""
-                       />
-                       <DebuggerTool
-                       />
-               </Configuration>
-               <Configuration
-                       Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
-                       OutputDirectory="$(PlatformName)\Release"
-                       IntermediateDirectory="$(PlatformName)\Release"
-                       ConfigurationType="2"
-                       UseOfMFC="0"
-                       CharacterSet="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                               PreprocessorDefinitions="NDEBUG"
-                               MkTypLibCompatible="false"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               ExecutionBucket="7"
-                               AdditionalIncludeDirectories=".;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"
-                               PreprocessorDefinitions="__VIDEO_DISABLED__;ORTP_INET6;MEDIASTREAMER2_EXPORT;AMD_HACK;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);SMARTPHONE2003_UI_MODEL;SMARTPHONE2003_UI_MODEL"
-                               RuntimeLibrary="2"
-                               TreatWChar_tAsBuiltInType="false"
-                               UsePrecompiledHeader="0"
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"
-                               WarningLevel="3"
-                               DebugInformationFormat="0"
-                               CompileAs="2"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
-                               Culture="1033"
-                               AdditionalIncludeDirectories="$(IntDir)"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
-                               AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmt.lib dmoguids.lib strmiids.lib strmbase.lib atls.lib"
-                               IgnoreAllDefaultLibraries="true"
-                               ModuleDefinitionFile="mediastreamer2.def"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCCodeSignTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-                       <DeploymentTool
-                               ForceDirty="-1"
-                               RemoteDirectory="%CSIDL_PROGRAM_FILES%\amsipua"
-                               RegisterOutput="0"
-                               AdditionalFiles=""
-                       />
-                       <DebuggerTool
-                       />
-               </Configuration>
-               <Configuration
-                       Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)"
-                       OutputDirectory="Windows Mobile 6 Standard SDK (ARMV4I)\$(ConfigurationName)"
-                       IntermediateDirectory="Windows Mobile 6 Standard SDK (ARMV4I)\$(ConfigurationName)"
-                       ConfigurationType="2"
-                       UseOfMFC="0"
-                       CharacterSet="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                               PreprocessorDefinitions="NDEBUG"
-                               MkTypLibCompatible="false"
-                               TargetEnvironment="1"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               ExecutionBucket="7"
-                               AdditionalIncludeDirectories=".;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"
-                               PreprocessorDefinitions="__VIDEO_DISABLED__;AMD_HACK;HAVE_SPEEX_NOISE;ORTP_INET6;MEDIASTREAMER2_EXPORT;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_)"
-                               RuntimeLibrary="2"
-                               TreatWChar_tAsBuiltInType="false"
-                               UsePrecompiledHeader="0"
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"
-                               WarningLevel="3"
-                               DebugInformationFormat="0"
-                               CompileAs="2"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
-                               Culture="1033"
-                               AdditionalIncludeDirectories="$(IntDir)"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
-                               AdditionalDependencies="atls.lib strmiids.lib dmoguids.lib strmbase.lib ws2.lib iphlpapi.lib mmtimer.lib libcmt.lib"
-                               IgnoreAllDefaultLibraries="true"
-                               ModuleDefinitionFile="mediastreamer2.def"
-                               TargetMachine="0"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCCodeSignTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-                       <DeploymentTool
-                               ForceDirty="-1"
-                               RemoteDirectory="%CSIDL_PROGRAM_FILES%\amsipua"
-                               RegisterOutput="0"
-                               AdditionalFiles=""
-                       />
-                       <DebuggerTool
-                       />
-               </Configuration>
-               <Configuration
-                       Name="Release|MP100_2P21 (ARMV4I)"
-                       OutputDirectory="MP100_2P21 (ARMV4I)\$(ConfigurationName)"
-                       IntermediateDirectory="MP100_2P21 (ARMV4I)\$(ConfigurationName)"
-                       ConfigurationType="2"
-                       UseOfMFC="0"
-                       CharacterSet="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                               PreprocessorDefinitions="NDEBUG"
-                               MkTypLibCompatible="false"
-                               TargetEnvironment="1"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               ExecutionBucket="7"
-                               Optimization="3"
-                               FavorSizeOrSpeed="1"
-                               AdditionalIncludeDirectories=".;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"
-                               PreprocessorDefinitions="NO_FFMPEG;VIDEO_ENABLED;AMD_HACK;HAVE_SPEEX_NOISE;ORTP_INET6;MEDIASTREAMER2_EXPORT;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);POCKETPC2003_UI_MODEL;POCKETPC2003_UI_MODEL"
-                               RuntimeLibrary="2"
-                               TreatWChar_tAsBuiltInType="false"
-                               UsePrecompiledHeader="0"
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"
-                               WarningLevel="3"
-                               DebugInformationFormat="0"
-                               CompileAs="2"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
-                               Culture="1033"
-                               AdditionalIncludeDirectories="$(IntDir)"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalOptions=" /SUBSYSTEM:$(CESubsystem) /MACHINE:THUMB"
-                               AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmt.lib"
-                               IgnoreAllDefaultLibraries="true"
-                               ModuleDefinitionFile="mediastreamer2.def"
-                               TargetMachine="0"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCCodeSignTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-                       <DeploymentTool
-                               ForceDirty="-1"
-                               RemoteDirectory="%CSIDL_PROGRAM_FILES%\amsipua"
-                               RegisterOutput="0"
-                               AdditionalFiles=""
-                       />
-                       <DebuggerTool
-                       />
-               </Configuration>
-               <Configuration
-                       Name="DebugVideo|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-                       OutputDirectory="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\$(ConfigurationName)"
-                       IntermediateDirectory="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\$(ConfigurationName)"
-                       ConfigurationType="2"
-                       UseOfMFC="0"
-                       CharacterSet="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                               PreprocessorDefinitions="_DEBUG"
-                               MkTypLibCompatible="false"
-                               TargetEnvironment="1"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               ExecutionBucket="7"
-                               Optimization="2"
-                               FavorSizeOrSpeed="1"
-                               AdditionalIncludeDirectories=".;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"
-                               PreprocessorDefinitions="VIDEO_ENABLED;AMD_HACK;HAVE_SPEEX_NOISE;ORTP_INET6;MEDIASTREAMER2_EXPORT;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);POCKETPC2003_UI_MODEL;POCKETPC2003_UI_MODEL"
-                               RuntimeLibrary="3"
-                               TreatWChar_tAsBuiltInType="false"
-                               UsePrecompiledHeader="0"
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"
-                               WarningLevel="3"
-                               DebugInformationFormat="3"
-                               CompileAs="2"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="_DEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
-                               Culture="1033"
-                               AdditionalIncludeDirectories="$(IntDir)"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
-                               AdditionalDependencies=" ws2.lib iphlpapi.lib mmtimer.lib libcmtd.lib "
-                               IgnoreAllDefaultLibraries="true"
-                               ModuleDefinitionFile="mediastreamer2-video.def"
-                               GenerateDebugInformation="true"
-                               TargetMachine="0"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCCodeSignTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-                       <DeploymentTool
-                               ForceDirty="-1"
-                               RemoteDirectory=""
-                               RegisterOutput="0"
-                               AdditionalFiles=""
-                       />
-                       <DebuggerTool
-                       />
-               </Configuration>
-               <Configuration
-                       Name="DebugVideo|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
-                       OutputDirectory="Windows Mobile 5.0 Smartphone SDK (ARMV4I)\$(ConfigurationName)"
-                       IntermediateDirectory="Windows Mobile 5.0 Smartphone SDK (ARMV4I)\$(ConfigurationName)"
-                       ConfigurationType="2"
-                       UseOfMFC="0"
-                       CharacterSet="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                               PreprocessorDefinitions="_DEBUG"
-                               MkTypLibCompatible="false"
-                               TargetEnvironment="1"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               ExecutionBucket="7"
-                               Optimization="0"
-                               AdditionalIncludeDirectories=".;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"
-                               PreprocessorDefinitions="__VIDEO_DISABLED__;ORTP_INET6;MEDIASTREAMER2_EXPORT;AMD_HACK;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);SMARTPHONE2003_UI_MODEL;SMARTPHONE2003_UI_MODEL"
-                               RuntimeLibrary="3"
-                               TreatWChar_tAsBuiltInType="false"
-                               UsePrecompiledHeader="0"
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"
-                               WarningLevel="3"
-                               DebugInformationFormat="3"
-                               CompileAs="2"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="_DEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
-                               Culture="1033"
-                               AdditionalIncludeDirectories="$(IntDir)"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
-                               AdditionalDependencies=" ws2.lib iphlpapi.lib mmtimer.lib libcmtd.lib dmoguids.lib strmiids.lib strmbase.lib atlsd.lib d3dmx.lib"
-                               IgnoreAllDefaultLibraries="true"
-                               ModuleDefinitionFile="mediastreamer2.def"
-                               GenerateDebugInformation="true"
-                               TargetMachine="0"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCCodeSignTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-                       <DeploymentTool
-                               ForceDirty="-1"
-                               RemoteDirectory=""
-                               RegisterOutput="0"
-                               AdditionalFiles=""
-                       />
-                       <DebuggerTool
-                       />
-               </Configuration>
-               <Configuration
-                       Name="DebugVideo|Windows Mobile 6 Standard SDK (ARMV4I)"
-                       OutputDirectory="Windows Mobile 6 Standard SDK (ARMV4I)\$(ConfigurationName)"
-                       IntermediateDirectory="Windows Mobile 6 Standard SDK (ARMV4I)\$(ConfigurationName)"
-                       ConfigurationType="2"
-                       UseOfMFC="0"
-                       UseOfATL="0"
-                       CharacterSet="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                               PreprocessorDefinitions="_DEBUG"
-                               MkTypLibCompatible="false"
-                               TargetEnvironment="1"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               ExecutionBucket="7"
-                               Optimization="2"
-                               FavorSizeOrSpeed="1"
-                               AdditionalIncludeDirectories=".;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"
-                               PreprocessorDefinitions="__VIDEO_DISABLED__;AMD_HACK;HAVE_SPEEX_NOISE;ORTP_INET6;MEDIASTREAMER2_EXPORT;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_)"
-                               ExceptionHandling="1"
-                               RuntimeLibrary="3"
-                               TreatWChar_tAsBuiltInType="false"
-                               UsePrecompiledHeader="0"
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"
-                               WarningLevel="3"
-                               DebugInformationFormat="3"
-                               CompileAs="2"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="_DEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
-                               Culture="1033"
-                               AdditionalIncludeDirectories="$(IntDir)"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
-                               AdditionalDependencies="atlsd.lib strmiids.lib dmoguids.lib strmbase.lib ws2.lib iphlpapi.lib mmtimer.lib libcmtd.lib"
-                               IgnoreAllDefaultLibraries="true"
-                               ModuleDefinitionFile="mediastreamer2.def"
-                               GenerateDebugInformation="true"
-                               TargetMachine="0"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCCodeSignTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-                       <DeploymentTool
-                               ForceDirty="-1"
-                               RemoteDirectory=""
-                               RegisterOutput="0"
-                               AdditionalFiles=""
-                       />
-                       <DebuggerTool
-                       />
-               </Configuration>
-               <Configuration
-                       Name="DebugVideo|MP100_2P21 (ARMV4I)"
-                       OutputDirectory="MP100_2P21 (ARMV4I)\$(ConfigurationName)"
-                       IntermediateDirectory="MP100_2P21 (ARMV4I)\$(ConfigurationName)"
-                       ConfigurationType="2"
-                       UseOfMFC="0"
-                       CharacterSet="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                               PreprocessorDefinitions="_DEBUG"
-                               MkTypLibCompatible="false"
-                               TargetEnvironment="1"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               ExecutionBucket="7"
-                               Optimization="0"
-                               FavorSizeOrSpeed="0"
-                               AdditionalIncludeDirectories=".;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"
-                               PreprocessorDefinitions="NO_FFMPEG;VIDEO_ENABLED;AMD_HACK;HAVE_SPEEX_NOISE;ORTP_INET6;MEDIASTREAMER2_EXPORT;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);POCKETPC2003_UI_MODEL;POCKETPC2003_UI_MODEL"
-                               RuntimeLibrary="3"
-                               TreatWChar_tAsBuiltInType="false"
-                               UsePrecompiledHeader="0"
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"
-                               WarningLevel="3"
-                               DebugInformationFormat="0"
-                               CompileAs="2"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="_DEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
-                               Culture="1033"
-                               AdditionalIncludeDirectories="$(IntDir)"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalOptions=" /SUBSYSTEM:$(CESubsystem) /MACHINE:THUMB"
-                               AdditionalDependencies=" ws2.lib iphlpapi.lib mmtimer.lib libcmtd.lib "
-                               IgnoreAllDefaultLibraries="true"
-                               ModuleDefinitionFile="mediastreamer2-video.def"
-                               GenerateDebugInformation="true"
-                               TargetMachine="0"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCCodeSignTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-                       <DeploymentTool
-                               ForceDirty="-1"
-                               RemoteDirectory="%CSIDL_PROGRAM_FILES%\amsipua"
-                               RegisterOutput="0"
-                               AdditionalFiles=""
-                       />
-                       <DebuggerTool
-                       />
-               </Configuration>
-               <Configuration
-                       Name="ReleaseVideo|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-                       OutputDirectory="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\$(ConfigurationName)"
-                       IntermediateDirectory="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\$(ConfigurationName)"
-                       ConfigurationType="2"
-                       UseOfMFC="0"
-                       CharacterSet="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                               PreprocessorDefinitions="NDEBUG"
-                               MkTypLibCompatible="false"
-                               TargetEnvironment="1"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               ExecutionBucket="7"
-                               AdditionalIncludeDirectories=".;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"
-                               PreprocessorDefinitions="NO_FFMPEG;VIDEO_ENABLED;AMD_HACK;HAVE_SPEEX_NOISE;ORTP_INET6;MEDIASTREAMER2_EXPORT;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);POCKETPC2003_UI_MODEL;POCKETPC2003_UI_MODEL"
-                               RuntimeLibrary="2"
-                               TreatWChar_tAsBuiltInType="false"
-                               UsePrecompiledHeader="0"
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"
-                               WarningLevel="3"
-                               DebugInformationFormat="0"
-                               CompileAs="2"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
-                               Culture="1033"
-                               AdditionalIncludeDirectories="$(IntDir)"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
-                               AdditionalDependencies="dmoguids.lib strmiids.lib strmbase.lib atls.lib ws2.lib iphlpapi.lib mmtimer.lib libcmt.lib"
-                               IgnoreAllDefaultLibraries="true"
-                               ModuleDefinitionFile="mediastreamer2-video.def"
-                               TargetMachine="0"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCCodeSignTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-                       <DeploymentTool
-                               ForceDirty="-1"
-                               RemoteDirectory=""
-                               RegisterOutput="0"
-                               AdditionalFiles=""
-                       />
-                       <DebuggerTool
-                       />
-               </Configuration>
-               <Configuration
-                       Name="ReleaseVideo|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
-                       OutputDirectory="Windows Mobile 5.0 Smartphone SDK (ARMV4I)\$(ConfigurationName)"
-                       IntermediateDirectory="Windows Mobile 5.0 Smartphone SDK (ARMV4I)\$(ConfigurationName)"
-                       ConfigurationType="2"
-                       UseOfMFC="0"
-                       CharacterSet="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                               PreprocessorDefinitions="NDEBUG"
-                               MkTypLibCompatible="false"
-                               TargetEnvironment="1"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               ExecutionBucket="7"
-                               AdditionalIncludeDirectories=".;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"
-                               PreprocessorDefinitions="__VIDEO_DISABLED__;ORTP_INET6;MEDIASTREAMER2_EXPORT;AMD_HACK;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);SMARTPHONE2003_UI_MODEL;SMARTPHONE2003_UI_MODEL"
-                               RuntimeLibrary="2"
-                               TreatWChar_tAsBuiltInType="false"
-                               UsePrecompiledHeader="0"
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"
-                               WarningLevel="3"
-                               DebugInformationFormat="0"
-                               CompileAs="2"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
-                               Culture="1033"
-                               AdditionalIncludeDirectories="$(IntDir)"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
-                               AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmt.lib dmoguids.lib strmiids.lib strmbase.lib atls.lib"
-                               IgnoreAllDefaultLibraries="true"
-                               ModuleDefinitionFile="mediastreamer2.def"
-                               TargetMachine="0"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCCodeSignTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-                       <DeploymentTool
-                               ForceDirty="-1"
-                               RemoteDirectory=""
-                               RegisterOutput="0"
-                               AdditionalFiles=""
-                       />
-                       <DebuggerTool
-                       />
-               </Configuration>
-               <Configuration
-                       Name="ReleaseVideo|Windows Mobile 6 Standard SDK (ARMV4I)"
-                       OutputDirectory="Windows Mobile 6 Standard SDK (ARMV4I)\$(ConfigurationName)"
-                       IntermediateDirectory="Windows Mobile 6 Standard SDK (ARMV4I)\$(ConfigurationName)"
-                       ConfigurationType="2"
-                       UseOfMFC="0"
-                       CharacterSet="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                               PreprocessorDefinitions="NDEBUG"
-                               MkTypLibCompatible="false"
-                               TargetEnvironment="1"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               ExecutionBucket="7"
-                               AdditionalIncludeDirectories=".;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"
-                               PreprocessorDefinitions="__VIDEO_DISABLED__;AMD_HACK;HAVE_SPEEX_NOISE;ORTP_INET6;MEDIASTREAMER2_EXPORT;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_)"
-                               RuntimeLibrary="2"
-                               TreatWChar_tAsBuiltInType="false"
-                               UsePrecompiledHeader="0"
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"
-                               WarningLevel="3"
-                               DebugInformationFormat="0"
-                               CompileAs="2"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
-                               Culture="1033"
-                               AdditionalIncludeDirectories="$(IntDir)"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"
-                               AdditionalDependencies="atls.lib strmiids.lib dmoguids.lib strmbase.lib ws2.lib iphlpapi.lib mmtimer.lib libcmt.lib"
-                               IgnoreAllDefaultLibraries="true"
-                               ModuleDefinitionFile="mediastreamer2.def"
-                               TargetMachine="0"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCCodeSignTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-                       <DeploymentTool
-                               ForceDirty="-1"
-                               RemoteDirectory=""
-                               RegisterOutput="0"
-                               AdditionalFiles=""
-                       />
-                       <DebuggerTool
-                       />
-               </Configuration>
-               <Configuration
-                       Name="ReleaseVideo|MP100_2P21 (ARMV4I)"
-                       OutputDirectory="MP100_2P21 (ARMV4I)\$(ConfigurationName)"
-                       IntermediateDirectory="MP100_2P21 (ARMV4I)\$(ConfigurationName)"
-                       ConfigurationType="2"
-                       UseOfMFC="0"
-                       CharacterSet="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                               PreprocessorDefinitions="NDEBUG"
-                               MkTypLibCompatible="false"
-                               TargetEnvironment="1"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               ExecutionBucket="7"
-                               Optimization="3"
-                               FavorSizeOrSpeed="1"
-                               AdditionalIncludeDirectories=".;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"
-                               PreprocessorDefinitions="NO_FFMPEG;VIDEO_ENABLED;AMD_HACK;HAVE_SPEEX_NOISE;ORTP_INET6;MEDIASTREAMER2_EXPORT;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);POCKETPC2003_UI_MODEL;POCKETPC2003_UI_MODEL"
-                               RuntimeLibrary="2"
-                               TreatWChar_tAsBuiltInType="false"
-                               UsePrecompiledHeader="0"
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"
-                               WarningLevel="3"
-                               DebugInformationFormat="0"
-                               CompileAs="2"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"
-                               Culture="1033"
-                               AdditionalIncludeDirectories="$(IntDir)"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalOptions=" /SUBSYSTEM:$(CESubsystem) /MACHINE:THUMB"
-                               AdditionalDependencies="atls.lib ws2.lib iphlpapi.lib mmtimer.lib libcmt.lib"
-                               IgnoreAllDefaultLibraries="true"
-                               ModuleDefinitionFile="mediastreamer2-video.def"
-                               TargetMachine="0"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCCodeSignTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-                       <DeploymentTool
-                               ForceDirty="-1"
-                               RemoteDirectory="%CSIDL_PROGRAM_FILES%\amsipua"
-                               RegisterOutput="0"
-                               AdditionalFiles=""
-                       />
-                       <DebuggerTool
-                       />
-               </Configuration>
-       </Configurations>
-       <References>
-       </References>
-       <Files>
-               <Filter
-                       Name="Source Files"
-                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
-                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
-                       >
-                       <File
-                               RelativePath="..\..\src\alaw.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\audiostream.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\dtmfgen.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ice.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\mscommon.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\msconf.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\msfileplayer_win.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\msfilerec_win.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\msfilter.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\msjoin.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\msqueue.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\msresample.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\msrtp.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\mssndcard.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\msspeex.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\msticker.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\msvolume.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\mswebcam.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\mtu.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\rfc3984.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\speexec.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\tee.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\ulaw.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\void.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\winsnd.c"
-                               >
-                       </File>
-               </Filter>
-               <Filter
-                       Name="Header Files"
-                       Filter="h;hpp;hxx;hm;inl;inc;xsd"
-                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
-                       >
-                       <File
-                               RelativePath=".\alldescs.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\include\mediastreamer2\allfilters.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\include\mediastreamer2\dtmfgen.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\dxfilter.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\src\g711common.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\include\mediastreamer2\ice.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\include\mediastreamer2\mscommon.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\include\mediastreamer2\msfileplayer.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\include\mediastreamer2\msfilerec.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\include\mediastreamer2\msfilter.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\include\mediastreamer2\msqueue.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\include\mediastreamer2\msrtp.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\include\mediastreamer2\mssndcard.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\include\mediastreamer2\msticker.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\include\mediastreamer2\mswebcam.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\include\mediastreamer2\rfc3984.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\include\mediastreamer2\waveheader.h"
-                               >
-                       </File>
-               </Filter>
-               <File
-                       RelativePath=".\mediastreamer2.def"
-                       >
-               </File>
-       </Files>
-       <Globals>
-       </Globals>
-</VisualStudioProject>
diff --git a/linphone/mediastreamer2/build/winmob/Makefile.am b/linphone/mediastreamer2/build/winmob/Makefile.am
deleted file mode 100755 (executable)
index 29f9841..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-EXTRA_DIST=alldescs.h mediastreamer2.vcproj mediastreamer2.sln mediastreamer2.def\r
-\r
diff --git a/linphone/mediastreamer2/build/winmob/alldescs.h b/linphone/mediastreamer2/build/winmob/alldescs.h
deleted file mode 100644 (file)
index e5e1794..0000000
+++ /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 (file)
index 5a8b40e..0000000
+++ /dev/null
@@ -1,227 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>\r
-<VisualStudioProject\r
-       ProjectType="Visual C++"\r
-       Version="9,00"\r
-       Name="echo"\r
-       ProjectGUID="{B616AC95-748E-4CD5-89AC-772DC3C069D9}"\r
-       RootNamespace="echo"\r
-       Keyword="Win32Proj"\r
-       TargetFrameworkVersion="196613"\r
-       >\r
-       <Platforms>\r
-               <Platform\r
-                       Name="Windows Mobile 6 Professional SDK (ARMV4I)"\r
-               />\r
-       </Platforms>\r
-       <ToolFiles>\r
-       </ToolFiles>\r
-       <Configurations>\r
-               <Configuration\r
-                       Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)"\r
-                       OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
-                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
-                       ConfigurationType="1"\r
-                       CharacterSet="1"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               ExecutionBucket="7"\r
-                               Optimization="0"\r
-                               AdditionalIncludeDirectories="..\..\..\include;..\..\..\..\oRTP\include"\r
-                               PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE;ORTP_INET6"\r
-                               MinimalRebuild="true"\r
-                               RuntimeLibrary="1"\r
-                               UsePrecompiledHeader="0"\r
-                               WarningLevel="3"\r
-                               DebugInformationFormat="3"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                               PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"\r
-                               Culture="1033"\r
-                               AdditionalIncludeDirectories="$(IntDir)"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalOptions=" /subsystem:windowsce,5.02"\r
-                               AdditionalDependencies="mediastreamer2.lib oRTP.lib"\r
-                               OutputFile="$(OutDir)/echo.exe"\r
-                               LinkIncremental="2"\r
-                               AdditionalLibraryDirectories="&quot;..\$(PlatformName)\$(ConfigurationName)&quot;;&quot;..\..\..\..\oRTP\build\wince\$(PlatformName)\$(ConfigurationName)&quot;"\r
-                               DelayLoadDLLs="$(NOINHERIT)"\r
-                               GenerateDebugInformation="true"\r
-                               ProgramDatabaseFile="$(OutDir)/echo.pdb"\r
-                               SubSystem="0"\r
-                               StackReserveSize="65536"\r
-                               StackCommitSize="4096"\r
-                               EntryPointSymbol="mainWCRTStartup"\r
-                               RandomizedBaseAddress="1"\r
-                               DataExecutionPrevention="0"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCodeSignTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-                       <DeploymentTool\r
-                               ForceDirty="-1"\r
-                               RemoteDirectory=""\r
-                               RegisterOutput="0"\r
-                               AdditionalFiles=""\r
-                       />\r
-                       <DebuggerTool\r
-                       />\r
-               </Configuration>\r
-               <Configuration\r
-                       Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)"\r
-                       OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
-                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
-                       ConfigurationType="1"\r
-                       CharacterSet="1"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               ExecutionBucket="7"\r
-                               Optimization="2"\r
-                               FavorSizeOrSpeed="2"\r
-                               PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"\r
-                               RuntimeLibrary="0"\r
-                               UsePrecompiledHeader="0"\r
-                               WarningLevel="3"\r
-                               DebugInformationFormat="3"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                               PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"\r
-                               Culture="1033"\r
-                               AdditionalIncludeDirectories="$(IntDir)"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalOptions=" /subsystem:windowsce,5.02"\r
-                               OutputFile="$(OutDir)/echo.exe"\r
-                               LinkIncremental="1"\r
-                               DelayLoadDLLs="$(NOINHERIT)"\r
-                               GenerateDebugInformation="true"\r
-                               ProgramDatabaseFile="$(OutDir)/echo.pdb"\r
-                               SubSystem="0"\r
-                               StackReserveSize="65536"\r
-                               StackCommitSize="4096"\r
-                               OptimizeReferences="2"\r
-                               EnableCOMDATFolding="2"\r
-                               EntryPointSymbol="mainWCRTStartup"\r
-                               RandomizedBaseAddress="1"\r
-                               DataExecutionPrevention="0"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCodeSignTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-                       <DeploymentTool\r
-                               ForceDirty="-1"\r
-                               RemoteDirectory=""\r
-                               RegisterOutput="0"\r
-                               AdditionalFiles=""\r
-                       />\r
-                       <DebuggerTool\r
-                       />\r
-               </Configuration>\r
-       </Configurations>\r
-       <References>\r
-       </References>\r
-       <Files>\r
-               <Filter\r
-                       Name="Source Files"\r
-                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
-                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
-                       >\r
-                       <File\r
-                               RelativePath="..\..\..\tests\echo.c"\r
-                               >\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="Header Files"\r
-                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
-                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
-                       >\r
-               </Filter>\r
-               <Filter\r
-                       Name="Resource Files"\r
-                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
-                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
-                       >\r
-               </Filter>\r
-       </Files>\r
-       <Globals>\r
-       </Globals>\r
-</VisualStudioProject>\r
diff --git a/linphone/mediastreamer2/build/winmob/mediastreamer2.def b/linphone/mediastreamer2/build/winmob/mediastreamer2.def
deleted file mode 100644 (file)
index 80dad5f..0000000
+++ /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 (file)
index 8a3de9d..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-\r
-Microsoft Visual Studio Solution File, Format Version 10.00\r
-# Visual Studio 2008\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mediastreamer2", "mediastreamer2.vcproj", "{177F5AE2-A40C-4412-8F26-7F85FA32464E}"\r
-EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "echo", "echo\echo.vcproj", "{B616AC95-748E-4CD5-89AC-772DC3C069D9}"\r
-EndProject\r
-Global\r
-       GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
-               Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\r
-               Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)\r
-               Debug|Windows Mobile 6 Professional SDK (ARMV4I) = Debug|Windows Mobile 6 Professional SDK (ARMV4I)\r
-               Debug|Windows Mobile 6 Standard SDK (ARMV4I) = Debug|Windows Mobile 6 Standard SDK (ARMV4I)\r
-               Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\r
-               Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)\r
-               Release|Windows Mobile 6 Professional SDK (ARMV4I) = Release|Windows Mobile 6 Professional SDK (ARMV4I)\r
-               Release|Windows Mobile 6 Standard SDK (ARMV4I) = Release|Windows Mobile 6 Standard SDK (ARMV4I)\r
-       EndGlobalSection\r
-       GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
-               {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\r
-               {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)\r
-               {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)\r
-               {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)\r
-               {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)\r
-               {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)\r
-               {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I)\r
-               {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I)\r
-               {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I)\r
-               {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Standard SDK (ARMV4I)\r
-               {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Standard SDK (ARMV4I)\r
-               {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Standard SDK (ARMV4I)\r
-               {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\r
-               {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)\r
-               {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)\r
-               {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)\r
-               {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)\r
-               {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)\r
-               {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I)\r
-               {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I)\r
-               {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I)\r
-               {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Standard SDK (ARMV4I)\r
-               {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I)\r
-               {177F5AE2-A40C-4412-8F26-7F85FA32464E}.Release|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I)\r
-               {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I)\r
-               {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I)\r
-               {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I)\r
-               {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I)\r
-               {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I)\r
-               {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I)\r
-               {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I)\r
-               {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I)\r
-               {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I)\r
-               {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I)\r
-               {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I)\r
-               {B616AC95-748E-4CD5-89AC-772DC3C069D9}.Release|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I)\r
-       EndGlobalSection\r
-       GlobalSection(SolutionProperties) = preSolution\r
-               HideSolutionNode = FALSE\r
-       EndGlobalSection\r
-EndGlobal\r
diff --git a/linphone/mediastreamer2/build/winmob/mediastreamer2.vcproj b/linphone/mediastreamer2/build/winmob/mediastreamer2.vcproj
deleted file mode 100644 (file)
index 8758723..0000000
+++ /dev/null
@@ -1,933 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>\r
-<VisualStudioProject\r
-       ProjectType="Visual C++"\r
-       Version="9,00"\r
-       Name="mediastreamer2"\r
-       ProjectGUID="{177F5AE2-A40C-4412-8F26-7F85FA32464E}"\r
-       RootNamespace="mediastreamer2"\r
-       Keyword="MFCDLLProj"\r
-       TargetFrameworkVersion="131072"\r
-       >\r
-       <Platforms>\r
-               <Platform\r
-                       Name="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"\r
-               />\r
-               <Platform\r
-                       Name="Windows Mobile 5.0 Smartphone SDK (ARMV4I)"\r
-               />\r
-               <Platform\r
-                       Name="Windows Mobile 6 Standard SDK (ARMV4I)"\r
-               />\r
-               <Platform\r
-                       Name="Windows Mobile 6 Professional SDK (ARMV4I)"\r
-               />\r
-       </Platforms>\r
-       <ToolFiles>\r
-       </ToolFiles>\r
-       <Configurations>\r
-               <Configuration\r
-                       Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"\r
-                       OutputDirectory="$(PlatformName)\Debug"\r
-                       IntermediateDirectory="$(PlatformName)\Debug"\r
-                       ConfigurationType="2"\r
-                       UseOfMFC="0"\r
-                       CharacterSet="1"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                               PreprocessorDefinitions="_DEBUG"\r
-                               MkTypLibCompatible="false"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               ExecutionBucket="7"\r
-                               Optimization="2"\r
-                               FavorSizeOrSpeed="1"\r
-                               AdditionalIncludeDirectories=".;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"\r
-                               PreprocessorDefinitions="__VIDEO_DISABLED__;AMD_HACK;HAVE_SPEEX_NOISE;ORTP_INET6;MEDIASTREAMER2_EXPORT;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);POCKETPC2003_UI_MODEL;POCKETPC2003_UI_MODEL"\r
-                               RuntimeLibrary="3"\r
-                               TreatWChar_tAsBuiltInType="false"\r
-                               UsePrecompiledHeader="0"\r
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"\r
-                               WarningLevel="3"\r
-                               DebugInformationFormat="3"\r
-                               CompileAs="2"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                               PreprocessorDefinitions="_DEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"\r
-                               Culture="1033"\r
-                               AdditionalIncludeDirectories="$(IntDir)"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"\r
-                               AdditionalDependencies=" ws2.lib iphlpapi.lib mmtimer.lib libcmtd.lib dmoguids.lib strmiids.lib strmbase.lib atlsd.lib d3dmx.lib"\r
-                               IgnoreAllDefaultLibraries="true"\r
-                               ModuleDefinitionFile="mediastreamer2.def"\r
-                               GenerateDebugInformation="true"\r
-                               RandomizedBaseAddress="1"\r
-                               DataExecutionPrevention="0"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCodeSignTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-                       <DeploymentTool\r
-                               ForceDirty="-1"\r
-                               RemoteDirectory="%CSIDL_PROGRAM_FILES%\vbamsipua"\r
-                               RegisterOutput="0"\r
-                               AdditionalFiles=""\r
-                       />\r
-                       <DebuggerTool\r
-                       />\r
-               </Configuration>\r
-               <Configuration\r
-                       Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"\r
-                       OutputDirectory="$(PlatformName)\Debug"\r
-                       IntermediateDirectory="$(PlatformName)\Debug"\r
-                       ConfigurationType="2"\r
-                       UseOfMFC="0"\r
-                       CharacterSet="1"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                               PreprocessorDefinitions="_DEBUG"\r
-                               MkTypLibCompatible="false"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               ExecutionBucket="7"\r
-                               Optimization="0"\r
-                               AdditionalIncludeDirectories=".;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"\r
-                               PreprocessorDefinitions="__VIDEO_DISABLED__;ORTP_INET6;MEDIASTREAMER2_EXPORT;AMD_HACK;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);SMARTPHONE2003_UI_MODEL;SMARTPHONE2003_UI_MODEL"\r
-                               RuntimeLibrary="3"\r
-                               TreatWChar_tAsBuiltInType="false"\r
-                               UsePrecompiledHeader="0"\r
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"\r
-                               WarningLevel="3"\r
-                               DebugInformationFormat="3"\r
-                               CompileAs="2"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                               PreprocessorDefinitions="_DEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"\r
-                               Culture="1033"\r
-                               AdditionalIncludeDirectories="$(IntDir)"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"\r
-                               AdditionalDependencies=" ws2.lib iphlpapi.lib mmtimer.lib libcmtd.lib dmoguids.lib strmiids.lib strmbase.lib atlsd.lib d3dmx.lib"\r
-                               IgnoreAllDefaultLibraries="true"\r
-                               ModuleDefinitionFile="mediastreamer2.def"\r
-                               GenerateDebugInformation="true"\r
-                               RandomizedBaseAddress="1"\r
-                               DataExecutionPrevention="0"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCodeSignTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-                       <DeploymentTool\r
-                               ForceDirty="-1"\r
-                               RemoteDirectory="%CSIDL_PROGRAM_FILES%\vbamsipua"\r
-                               RegisterOutput="0"\r
-                               AdditionalFiles=""\r
-                       />\r
-                       <DebuggerTool\r
-                       />\r
-               </Configuration>\r
-               <Configuration\r
-                       Name="Debug|Windows Mobile 6 Standard SDK (ARMV4I)"\r
-                       OutputDirectory="Windows Mobile 6 Standard SDK (ARMV4I)\$(ConfigurationName)"\r
-                       IntermediateDirectory="Windows Mobile 6 Standard SDK (ARMV4I)\$(ConfigurationName)"\r
-                       ConfigurationType="2"\r
-                       UseOfMFC="0"\r
-                       UseOfATL="0"\r
-                       CharacterSet="1"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                               PreprocessorDefinitions="_DEBUG"\r
-                               MkTypLibCompatible="false"\r
-                               TargetEnvironment="1"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               ExecutionBucket="7"\r
-                               Optimization="2"\r
-                               FavorSizeOrSpeed="1"\r
-                               AdditionalIncludeDirectories=".;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"\r
-                               PreprocessorDefinitions="__VIDEO_DISABLED__;AMD_HACK;HAVE_SPEEX_NOISE;ORTP_INET6;MEDIASTREAMER2_EXPORT;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_)"\r
-                               ExceptionHandling="1"\r
-                               RuntimeLibrary="3"\r
-                               TreatWChar_tAsBuiltInType="false"\r
-                               UsePrecompiledHeader="0"\r
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"\r
-                               WarningLevel="3"\r
-                               DebugInformationFormat="3"\r
-                               CompileAs="2"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                               PreprocessorDefinitions="_DEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"\r
-                               Culture="1033"\r
-                               AdditionalIncludeDirectories="$(IntDir)"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"\r
-                               AdditionalDependencies="atlsd.lib strmiids.lib dmoguids.lib strmbase.lib ws2.lib iphlpapi.lib mmtimer.lib libcmtd.lib"\r
-                               IgnoreAllDefaultLibraries="true"\r
-                               ModuleDefinitionFile="mediastreamer2.def"\r
-                               GenerateDebugInformation="true"\r
-                               RandomizedBaseAddress="1"\r
-                               DataExecutionPrevention="0"\r
-                               TargetMachine="0"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCodeSignTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-                       <DeploymentTool\r
-                               ForceDirty="-1"\r
-                               RemoteDirectory="%CSIDL_PROGRAM_FILES%\amsipua"\r
-                               RegisterOutput="0"\r
-                               AdditionalFiles=""\r
-                       />\r
-                       <DebuggerTool\r
-                       />\r
-               </Configuration>\r
-               <Configuration\r
-                       Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)"\r
-                       OutputDirectory="Windows Mobile 6 Professional SDK (ARMV4I)\$(ConfigurationName)"\r
-                       IntermediateDirectory="Windows Mobile 6 Professional SDK (ARMV4I)\$(ConfigurationName)"\r
-                       ConfigurationType="2"\r
-                       UseOfMFC="0"\r
-                       CharacterSet="1"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                               PreprocessorDefinitions="_DEBUG"\r
-                               MkTypLibCompatible="false"\r
-                               TargetEnvironment="1"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               ExecutionBucket="7"\r
-                               Optimization="2"\r
-                               FavorSizeOrSpeed="1"\r
-                               AdditionalIncludeDirectories=".;&quot;..\..\..\..\..\linphone-builder\speex\include&quot;;..\..;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"\r
-                               PreprocessorDefinitions="__VIDEO_DISABLED__;HAVE_SPEEX_NOISE;ORTP_INET6;MEDIASTREAMER2_EXPORT;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_)"\r
-                               RuntimeLibrary="3"\r
-                               TreatWChar_tAsBuiltInType="false"\r
-                               UsePrecompiledHeader="0"\r
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"\r
-                               WarningLevel="3"\r
-                               DebugInformationFormat="3"\r
-                               CompileAs="2"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                               PreprocessorDefinitions="_DEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"\r
-                               Culture="1033"\r
-                               AdditionalIncludeDirectories="$(IntDir)"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"\r
-                               AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmtd.lib dmoguids.lib strmiids.lib strmbase.lib atlsd.lib d3dmx.lib ortp.lib libspeex.lib libspeexdsp.lib"\r
-                               AdditionalLibraryDirectories="&quot;..\..\..\..\..\linphone-builder\speex\lib&quot;;&quot;..\..\..\oRTP\build\wince\$(PlatformName)\$(ConfigurationName)&quot;;&quot;..\..\..\..\..\linphone-builder\speex\win32\VS2008\libspeex\$(PlatformName)\Debug_RTL_dll&quot;"\r
-                               IgnoreAllDefaultLibraries="true"\r
-                               ModuleDefinitionFile="mediastreamer2.def"\r
-                               GenerateDebugInformation="true"\r
-                               RandomizedBaseAddress="1"\r
-                               DataExecutionPrevention="0"\r
-                               TargetMachine="0"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCodeSignTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-                       <DeploymentTool\r
-                               ForceDirty="-1"\r
-                               RemoteDirectory=""\r
-                               RegisterOutput="0"\r
-                               AdditionalFiles=""\r
-                       />\r
-                       <DebuggerTool\r
-                       />\r
-               </Configuration>\r
-               <Configuration\r
-                       Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"\r
-                       OutputDirectory="$(PlatformName)\Release"\r
-                       IntermediateDirectory="$(PlatformName)\Release"\r
-                       ConfigurationType="2"\r
-                       UseOfMFC="0"\r
-                       CharacterSet="1"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                               PreprocessorDefinitions="NDEBUG"\r
-                               MkTypLibCompatible="false"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               ExecutionBucket="7"\r
-                               AdditionalIncludeDirectories=".;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"\r
-                               PreprocessorDefinitions="__VIDEO_DISABLED__;AMD_HACK;HAVE_SPEEX_NOISE;ORTP_INET6;MEDIASTREAMER2_EXPORT;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);POCKETPC2003_UI_MODEL;POCKETPC2003_UI_MODEL"\r
-                               RuntimeLibrary="2"\r
-                               TreatWChar_tAsBuiltInType="false"\r
-                               UsePrecompiledHeader="0"\r
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"\r
-                               WarningLevel="3"\r
-                               DebugInformationFormat="3"\r
-                               CompileAs="2"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                               PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"\r
-                               Culture="1033"\r
-                               AdditionalIncludeDirectories="$(IntDir)"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"\r
-                               AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmt.lib dmoguids.lib strmiids.lib strmbase.lib atls.lib"\r
-                               IgnoreAllDefaultLibraries="true"\r
-                               ModuleDefinitionFile="mediastreamer2.def"\r
-                               RandomizedBaseAddress="1"\r
-                               DataExecutionPrevention="0"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCodeSignTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-                       <DeploymentTool\r
-                               ForceDirty="-1"\r
-                               RemoteDirectory="\amsip"\r
-                               RegisterOutput="0"\r
-                               AdditionalFiles=""\r
-                       />\r
-                       <DebuggerTool\r
-                       />\r
-               </Configuration>\r
-               <Configuration\r
-                       Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"\r
-                       OutputDirectory="$(PlatformName)\Release"\r
-                       IntermediateDirectory="$(PlatformName)\Release"\r
-                       ConfigurationType="2"\r
-                       UseOfMFC="0"\r
-                       CharacterSet="1"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                               PreprocessorDefinitions="NDEBUG"\r
-                               MkTypLibCompatible="false"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               ExecutionBucket="7"\r
-                               AdditionalIncludeDirectories=".;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"\r
-                               PreprocessorDefinitions="__VIDEO_DISABLED__;ORTP_INET6;MEDIASTREAMER2_EXPORT;AMD_HACK;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);SMARTPHONE2003_UI_MODEL;SMARTPHONE2003_UI_MODEL"\r
-                               RuntimeLibrary="2"\r
-                               TreatWChar_tAsBuiltInType="false"\r
-                               UsePrecompiledHeader="0"\r
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"\r
-                               WarningLevel="3"\r
-                               DebugInformationFormat="3"\r
-                               CompileAs="2"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                               PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"\r
-                               Culture="1033"\r
-                               AdditionalIncludeDirectories="$(IntDir)"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"\r
-                               AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmt.lib dmoguids.lib strmiids.lib strmbase.lib atls.lib"\r
-                               IgnoreAllDefaultLibraries="true"\r
-                               ModuleDefinitionFile="mediastreamer2.def"\r
-                               RandomizedBaseAddress="1"\r
-                               DataExecutionPrevention="0"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCodeSignTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-                       <DeploymentTool\r
-                               ForceDirty="-1"\r
-                               RemoteDirectory="%CSIDL_PROGRAM_FILES%\vbamsipua"\r
-                               RegisterOutput="0"\r
-                               AdditionalFiles=""\r
-                       />\r
-                       <DebuggerTool\r
-                       />\r
-               </Configuration>\r
-               <Configuration\r
-                       Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)"\r
-                       OutputDirectory="Windows Mobile 6 Standard SDK (ARMV4I)\$(ConfigurationName)"\r
-                       IntermediateDirectory="Windows Mobile 6 Standard SDK (ARMV4I)\$(ConfigurationName)"\r
-                       ConfigurationType="2"\r
-                       UseOfMFC="0"\r
-                       CharacterSet="1"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                               PreprocessorDefinitions="NDEBUG"\r
-                               MkTypLibCompatible="false"\r
-                               TargetEnvironment="1"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               ExecutionBucket="7"\r
-                               AdditionalIncludeDirectories=".;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"\r
-                               PreprocessorDefinitions="__VIDEO_DISABLED__;AMD_HACK;HAVE_SPEEX_NOISE;ORTP_INET6;MEDIASTREAMER2_EXPORT;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_)"\r
-                               RuntimeLibrary="2"\r
-                               TreatWChar_tAsBuiltInType="false"\r
-                               UsePrecompiledHeader="0"\r
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"\r
-                               WarningLevel="3"\r
-                               DebugInformationFormat="3"\r
-                               CompileAs="2"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                               PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"\r
-                               Culture="1033"\r
-                               AdditionalIncludeDirectories="$(IntDir)"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"\r
-                               AdditionalDependencies="atls.lib strmiids.lib dmoguids.lib strmbase.lib ws2.lib iphlpapi.lib mmtimer.lib libcmt.lib"\r
-                               IgnoreAllDefaultLibraries="true"\r
-                               ModuleDefinitionFile="mediastreamer2.def"\r
-                               RandomizedBaseAddress="1"\r
-                               DataExecutionPrevention="0"\r
-                               TargetMachine="0"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCodeSignTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-                       <DeploymentTool\r
-                               ForceDirty="-1"\r
-                               RemoteDirectory="%CSIDL_PROGRAM_FILES%\amsipua"\r
-                               RegisterOutput="0"\r
-                               AdditionalFiles=""\r
-                       />\r
-                       <DebuggerTool\r
-                       />\r
-               </Configuration>\r
-               <Configuration\r
-                       Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)"\r
-                       OutputDirectory="Windows Mobile 6 Professional SDK (ARMV4I)\$(ConfigurationName)"\r
-                       IntermediateDirectory="Windows Mobile 6 Professional SDK (ARMV4I)\$(ConfigurationName)"\r
-                       ConfigurationType="2"\r
-                       UseOfMFC="0"\r
-                       CharacterSet="1"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                               PreprocessorDefinitions="NDEBUG"\r
-                               MkTypLibCompatible="false"\r
-                               TargetEnvironment="1"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               ExecutionBucket="7"\r
-                               AdditionalIncludeDirectories=".;..\..\include;..\..\..\oRTP\include;..\..\..\codecs\speex\include"\r
-                               PreprocessorDefinitions="__VIDEO_DISABLED__;AMD_HACK;HAVE_SPEEX_NOISE;ORTP_INET6;MEDIASTREAMER2_EXPORT;_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);POCKETPC2003_UI_MODEL;POCKETPC2003_UI_MODEL"\r
-                               RuntimeLibrary="2"\r
-                               TreatWChar_tAsBuiltInType="false"\r
-                               UsePrecompiledHeader="0"\r
-                               ProgramDataBaseFileName="$(IntDir)/mediastreamer2.pdb"\r
-                               WarningLevel="3"\r
-                               DebugInformationFormat="3"\r
-                               CompileAs="2"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                               PreprocessorDefinitions="NDEBUG;_UNICODE;UNICODE;_WIN32_WCE;UNDER_CE"\r
-                               Culture="1033"\r
-                               AdditionalIncludeDirectories="$(IntDir)"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalOptions=" /SUBSYSTEM:WINDOWSCE,5.01 /MACHINE:THUMB"\r
-                               AdditionalDependencies="ws2.lib iphlpapi.lib mmtimer.lib libcmt.lib dmoguids.lib strmiids.lib strmbase.lib atls.lib"\r
-                               IgnoreAllDefaultLibraries="true"\r
-                               ModuleDefinitionFile="mediastreamer2.def"\r
-                               RandomizedBaseAddress="1"\r
-                               DataExecutionPrevention="0"\r
-                               TargetMachine="0"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCodeSignTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-                       <DeploymentTool\r
-                               ForceDirty="-1"\r
-                               RemoteDirectory=""\r
-                               RegisterOutput="0"\r
-                               AdditionalFiles=""\r
-                       />\r
-                       <DebuggerTool\r
-                       />\r
-               </Configuration>\r
-       </Configurations>\r
-       <References>\r
-       </References>\r
-       <Files>\r
-               <Filter\r
-                       Name="Source Files"\r
-                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
-                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
-                       >\r
-                       <File\r
-                               RelativePath="..\..\src\alaw.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\audiostream.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\dsptools.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\dtmfgen.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\dxfilter.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\equalizer.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\ice.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\kiss_fft.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\kiss_fftr.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\mscommon.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msconf.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msfileplayer_win.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msfilerec_win.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msfilter.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msjoin.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msqueue.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msrtp.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\mssndcard.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msspeex.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msticker.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\msvolume.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\mswebcam.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\mtu.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\speexec.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\tee.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\ulaw.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\wincevideods.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\winsnd3.c"\r
-                               >\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="Header Files"\r
-                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
-                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
-                       >\r
-                       <File\r
-                               RelativePath=".\alldescs.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\allfilters.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\dtmfgen.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\dxfilter.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\src\g711common.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\ice.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\mediastream.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\mscommon.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msfileplayer.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msfilerec.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msfilter.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msqueue.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msrtp.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\mssndcard.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\msticker.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\include\mediastreamer2\waveheader.h"\r
-                               >\r
-                       </File>\r
-               </Filter>\r
-       </Files>\r
-       <Globals>\r
-       </Globals>\r
-</VisualStudioProject>\r
diff --git a/linphone/mediastreamer2/configure.ac b/linphone/mediastreamer2/configure.ac
deleted file mode 100644 (file)
index a3affd4..0000000
+++ /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 (file)
index 8d4b209..0000000
+++ /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 (file)
index 1c7f5b4..0000000
+++ /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 (file)
index fdc5bb2..0000000
+++ /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 $(<D) && tar cf html.tar *
-
-$(top_builddir)/help/doc/html/index.html: $(SOURCES) Doxyfile Makefile.am
-       rm -rf doc
-       $(DOXYGEN) Doxyfile
-
-install-data-hook:
-       cd $(DESTDIR)$(doc_htmldir) && tar xf html.tar && rm -f html.tar
-
-uninstall-hook:
-       cd $(DESTDIR)$(doc_htmldir) && rm -f *
-
-endif
-
-clean-local:
-       rm -rf doc
\ No newline at end of file
diff --git a/linphone/mediastreamer2/help/doxygen.dox.in b/linphone/mediastreamer2/help/doxygen.dox.in
deleted file mode 100644 (file)
index 422876b..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-/**
- * @mainpage
- * Project Website: http://savannah.gnu.org/projects/linphone
- *
- * @verbinclude README
- *
- */
-
-/** 
- * @defgroup mediastreamer2 mediastreamer2 library - a modular sound and video processing and streaming
- * @brief mediastreamer2 Version @MEDIASTREAMER_VERSION@
- *
- * @see http://savannah.gnu.org/projects/linphone
- *
- * @section what_is_it What is mediastreamer2
- *
- * mediastreamer2 is a powerful engine to make audio and video streams.
- * mediastreamer2 is GPL (COPYING). Please understand the licencing details
- * before using it!
- * 
- * For any use of this library beyond the rights granted to you by the
- * GPL license, please contact antisip at <jack@atosc.org>.
- * 
- * @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:
- * <PRE>
- *   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.
- * </PRE>
- * 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:
- *
- * <PRE>
- *  AUDIO CAPTURE   -->   ENCODE  -->     RTP
- *      FILTER      -->   FILTER  -->    FILTER
- * </PRE>
- *
- *
- * 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.
- *
- * <PRE>
- * 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.
- * </PRE>
- *
- * @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 (file)
index 9acc3b0..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-/**
- * @defgroup howto0_samplegraph Howto 1: build a sample audio graph.
- * @ingroup mediastreamer2
-
-<H1>Initialize mediastreamer2</H1>
-
-When using mediastreamer2, your first task is to initialize the
-library:
-
-<PRE>
-       ##include <mediastreamer2/mscommon.h>
-
-       int i;
-
-       i=ms_init();
-       if (i!=0)
-         return -1;
-
-</PRE>
-
-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.
-
-<H1>Graph sample</H1>
-
-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.
-
-<PRE>
-             AUDIO    ->    ENCODER   ->   RTP
-            CAPTURE   ->              ->  SENDER
-</PRE>
-
- This second graph shows the filters needed to receive data from an RTP
-session  decode it and send it to the playback device.
-
-<PRE>
-        RTP      ->    DECODER   ->   DTMF       ->   AUDIO
-       RECEIVER  ->              ->  GENERATION  ->  PLAYBACK
-</PRE>
-
-<H1>Code to initiate the filters of the Graph sample</H1>
-
-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.
-
-<PRE>
-       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);
-</PRE>
-
-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:
-
-<PRE>
-        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);
-</PRE>
-
-
-<H1>Code to link the filters and run the graph sample</H1>
-
-<PRE>
-       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); 
-</PRE>
-
-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)
-
-<PRE>
-       /* create ticker */
-       MSTicker *ticker=ms_ticker_new();
-
-       ms_ticker_attach(ticker,soundread);
-       ms_ticker_attach(ticker,rtprecv);
-</PRE>
-
-<H1>Code to unlink the filters and stop the graph sample</H1>
-
-<PRE>
-       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);
-</PRE>
-
-*/
\ No newline at end of file
diff --git a/linphone/mediastreamer2/include/.gitignore b/linphone/mediastreamer2/include/.gitignore
deleted file mode 100644 (file)
index 3dda729..0000000
+++ /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 (file)
index c7b5d93..0000000
+++ /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 (file)
index 3dda729..0000000
+++ /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 (file)
index 74673ce..0000000
+++ /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 (file)
index eb64405..0000000
+++ /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 (file)
index 711e075..0000000
+++ /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 <mediastreamer2/mscommon.h>
-
-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 (file)
index 0ea4b93..0000000
+++ /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 (file)
index df986c8..0000000
+++ /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 (file)
index e0b971f..0000000
+++ /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 <time.h>
-
-#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 (file)
index 869feef..0000000
+++ /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 <ortp/ortp.h>
-
-#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
- * \<libraryname\>_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 (file)
index cebecaa..0000000
+++ /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 <mediastreamer2/msfilter.h>
-
-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 (file)
index 8e19314..0000000
+++ /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 (file)
index b46cb38..0000000
+++ /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 (file)
index 3828144..0000000
+++ /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.
- * <PRE>
- *     MS_FILTER_OTHER
- *     MS_FILTER_ENCODER
- *     MS_FILTER_DECODER
- * </PRE>
- * @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 (file)
index 98e776d..0000000
+++ /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 (file)
index 13ac30a..0000000
+++ /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 (file)
index ea19748..0000000
+++ /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.
- *
- * <PRE>
- *   MS_SND_CARD_CAP_CAPTURE
- *   MS_SND_CARD_CAP_PLAYBACK
- *   MS_SND_CARD_CAP_CAPTURE|MS_SND_CARD_CAP_PLAYBACK
- * </PRE>
- *
- * @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.
- *
- * <PRE>
- *   MS_SND_CARD_MASTER,
- *   MS_SND_CARD_PLAYBACK,
- *   MS_SND_CARD_CAPTURE
- * </PRE>
- * 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.
- *
- * <PRE>
- *   MS_SND_CARD_MASTER,
- *   MS_SND_CARD_PLAYBACK,
- *   MS_SND_CARD_CAPTURE
- * </PRE>
- * 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.
- *
- * <PRE>
- *   MS_SND_CARD_MIC,
- *   MS_SND_CARD_LINE
- * </PRE>
- * 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.
- *
- * <PRE>
- *   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
- * </PRE>
- * 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.
- *
- * <PRE>
- *   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
- * </PRE>
- * 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 (file)
index e9bc24d..0000000
+++ /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 <mediastreamer2/msfilter.h>
-
-/** 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 (file)
index dd418bf..0000000
+++ /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 (file)
index 12a430e..0000000
+++ /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 (file)
index 2d7056d..0000000
+++ /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 (file)
index f96129d..0000000
+++ /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 (file)
index 0384f6d..0000000
+++ /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 <mediastreamer2/msfilter.h>
-#include <mediastreamer2/msvideo.h>
-
-
-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 (file)
index cf2f02b..0000000
+++ /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 (file)
index f56f1f8..0000000
+++ /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 (file)
index aa9a451..0000000
+++ /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 (file)
index d929f5c..0000000
+++ /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 (file)
index 55a763e..0000000
+++ /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 (file)
index ff1e449..0000000
+++ /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 <fix@hp.com>
-- Add to mediastreamer2 distribution with "make rpm" target
diff --git a/linphone/mediastreamer2/pkg.list b/linphone/mediastreamer2/pkg.list
deleted file mode 100644 (file)
index cee1171..0000000
+++ /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 (file)
index 6cecb66..0000000
+++ /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 (file)
index e69de29..0000000
diff --git a/linphone/mediastreamer2/plugins/msilbc/COPYING b/linphone/mediastreamer2/plugins/msilbc/COPYING
deleted file mode 100644 (file)
index 623b625..0000000
+++ /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.
-\f
-                   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.)
-\f
-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.
-\f
-  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.
-\f
-  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
-\f
-           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.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    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.
-
-  <signature of Ty Coon>, 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 (file)
index e69de29..0000000
diff --git a/linphone/mediastreamer2/plugins/msilbc/INSTALL b/linphone/mediastreamer2/plugins/msilbc/INSTALL
deleted file mode 100644 (file)
index 23e5f25..0000000
+++ /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 (file)
index 34b360d..0000000
+++ /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 (file)
index e69de29..0000000
diff --git a/linphone/mediastreamer2/plugins/msilbc/README b/linphone/mediastreamer2/plugins/msilbc/README
deleted file mode 100644 (file)
index e18f0b0..0000000
+++ /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=<prefix of linphone/mediastreamer installation>
-       make 
-       make install
diff --git a/linphone/mediastreamer2/plugins/msilbc/configure.ac b/linphone/mediastreamer2/plugins/msilbc/configure.ac
deleted file mode 100644 (file)
index d8418f2..0000000
+++ /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 (file)
index e5160f4..0000000
Binary files a/linphone/mediastreamer2/plugins/msilbc/ilbc-rfc3951.tar.gz and /dev/null differ
diff --git a/linphone/mediastreamer2/plugins/msilbc/ilbc.c b/linphone/mediastreamer2/plugins/msilbc/ilbc.c
deleted file mode 100644 (file)
index 9a6b43e..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
-       NO LICENSE
-*/
-#include <ilbc/iLBC_encode.h>
-#include <ilbc/iLBC_decode.h>
-
-#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;k<frame_per_packet;k++)
-               {
-                       for (i=0;i<s->nsamples;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;k<frame_per_packet;k++)
-                       {
-                               om=allocb(s->nsamples*2,0);
-                               iLBC_decode(samples,(uint8_t*)im->b_rptr+(k*s->nbytes),&s->ilbc_dec,1);
-                               for (i=0;i<s->nsamples;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 (file)
index 16d2ea6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Simon Morlat <simon.morlat@linphone.org>
\ No newline at end of file
diff --git a/linphone/mediastreamer2/plugins/msx264/COPYING b/linphone/mediastreamer2/plugins/msx264/COPYING
deleted file mode 100644 (file)
index 623b625..0000000
+++ /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.
-\f
-                   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.)
-\f
-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.
-\f
-  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.
-\f
-  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
-\f
-           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.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    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.
-
-  <signature of Ty Coon>, 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 (file)
index e69de29..0000000
diff --git a/linphone/mediastreamer2/plugins/msx264/INSTALL b/linphone/mediastreamer2/plugins/msx264/INSTALL
deleted file mode 100644 (file)
index 2550dab..0000000
+++ /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 `<wchar.h>' 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 (file)
index 3ec7f9e..0000000
+++ /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 (file)
index a354cdf..0000000
+++ /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 (file)
index 291cab2..0000000
+++ /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 (executable)
index 829a5a0..0000000
+++ /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 (file)
index 191383a..0000000
+++ /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 (file)
index 94f282b..0000000
+++ /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 (file)
index c4c4236..0000000
+++ /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 (file)
index 3ad35f2..0000000
+++ /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 <x264.h>
-
-#ifdef HAVE_LIBAVCODEC_AVCODEC_H
-#include <libavcodec/avcodec.h>
-#include <libswscale/swscale.h>
-#else
-#include <ffmpeg/avcodec.h>
-#include <ffmpeg/swscale.h>
-#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(&params);
-       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(&params);
-       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;i<num_nals;++i){
-               m=allocb(xnals[i].i_payload+10,0);
-               
-               memcpy(m->b_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 (file)
index 9c4a34a..0000000
+++ /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 (file)
index d5bf394..0000000
+++ /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 (file)
index 02ad547..0000000
+++ /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 (x<SHL32(EXTEND32(1), 15))
-      {
-         return _ms_cos_pi_2(EXTRACT16(x));
-      } else {
-         return NEG32(_ms_cos_pi_2(EXTRACT16(65536-x)));
-      }
-   } else {
-      if (x&0x0000ffff)
-         return 0;
-      else if (x&0x0001ffff)
-         return -32767;
-      else
-         return 32767;
-   }
-}
-
-#else
-#define ms_cos_norm(x) (cos((.5f*M_PI)*(x)))
-#endif
-
-#define  kf_cexp2(x,phase) \
-               do{ \
-               (x)->r = 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 (file)
index 3ac08a2..0000000
+++ /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;i<size_of_pcm/2;i++){
-                       *o->b_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_rptr<m->b_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 (file)
index 65f0df7..0000000
+++ /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 <alsa/asoundlib.h>
-
-
-#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 (file)
index 0c7f06b..0000000
+++ /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 <organization> 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 <copyright holder> ``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 <copyright holder> 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 <AudioToolbox/AudioToolbox.h>
-#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 (file)
index e6fcec8..0000000
+++ /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 <kde/artsc/artsc.h>
-
-#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 (file)
index ac9222d..0000000
+++ /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 <sys/types.h>
-#ifndef WIN32
-       #include <sys/socket.h>
-       #include <netdb.h>
-#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 (file)
index 71ea227..0000000
+++ /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 <mediastreamer2/dsptools.h>
-
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#else
-#if !defined(__APPLE__)
-#include <malloc.h>
-#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<ord;i++)
-   {
-      numden[2*i] = num[i];
-      numden[2*i+1] = den[i];
-   }
-   __asm__ __volatile__
-   (
-   /* Register setup */
-   "R0 = %5;\n\t"      /*ord */
-   
-   "P0 = %3;\n\t"
-   "I0 = P0;\n\t"
-   "B0 = P0;\n\t" /* numden */
-   "L0 = 0;\n\t"
-      
-   "P2 = %0;\n\t" /* Fused xy */
-   "I2 = P2;\n\t"
-   "L2 = 0;\n\t"
-   
-   "P4 = %6;\n\t" /* mem */
-   "P0 = %1;\n\t" /* _x */
-   "P1 = %2;\n\t" /* _y */
-   
-   /* First sample */
-   "R1 = [P4++];\n\t"
-   "R1 <<= 3;\n\t" /* shift mem */
-   "R1.L = R1 (RND);\n\t"
-   "R2 = W[P0++];\n\t" /* load x[0] */
-   "R1.L = R1.L + R2.L;\n\t"
-   "W[P1++] = R1;\n\t" /* store y[0] */
-   "R2 = PACK(R1.L, R2.L);\n\t" /* pack x16 and y16 */
-   "[P2] = R2;\n\t"
-               
-   /* Samples 1 to ord-1 (using memory) */
-   "R0 += -1;\n\t"
-   "R3 = 0;\n\t"
-   "LC0 = R0;\n\t"
-   "LOOP filter_start%= LC0;\n\t"
-   "LOOP_BEGIN filter_start%=;\n\t"
-      "R3 += 1;\n\t"
-      "LC1 = R3;\n\t"
-      
-      "R1 = [P4++];\n\t"
-      "A1 = R1;\n\t"
-      "A0 = 0;\n\t"
-      "I0 = B0;\n\t"
-      "I2 = P2;\n\t"
-      "P2 += 4;\n\t"
-      "R4 = [I0++] || R5 = [I2--];\n\t"
-      "LOOP filter_start_inner%= LC1;\n\t"
-      "LOOP_BEGIN filter_start_inner%=;\n\t"
-         "A1 -= R4.H*R5.H, A0 += R4.L*R5.L (IS) || R4 = [I0++] || R5 = [I2--];\n\t"
-      "LOOP_END filter_start_inner%=;\n\t"
-      "A0 += A1;\n\t"
-      "R4 = A0;\n\t"
-      "R4 <<= 3;\n\t" /* shift mem */
-      "R4.L = R4 (RND);\n\t"
-      "R2 = W[P0++];\n\t" /* load x */
-      "R4.L = R4.L + R2.L;\n\t"
-      "W[P1++] = R4;\n\t" /* store y */
-      //"R4 <<= 2;\n\t"
-      //"R2 <<= 2;\n\t"
-      "R2 = PACK(R4.L, R2.L);\n\t" /* pack x16 and y16 */
-      "[P2] = R2;\n\t"
-
-   "LOOP_END filter_start%=;\n\t"
-
-   /* Samples ord to N*/   
-   "R0 = %5;\n\t"
-   "R0 <<= 1;\n\t"
-   "I0 = B0;\n\t" /* numden */
-   "R0 <<= 1;\n\t"   
-   "L0 = R0;\n\t"
-   
-   "R0 = %5;\n\t" /* org */
-   "R2 = %4;\n\t" /* N */
-   "R2 = R2 - R0;\n\t"
-   "R4 = [I0++];\n\t" /* numden */
-   "LC0 = R2;\n\t"
-   "P3 = R0;\n\t"
-   "R0 <<= 2;\n\t"
-   "R0 += 8;\n\t"
-   "I2 = P2;\n\t"
-   "M0 = R0;\n\t"
-   "A1 = A0 = 0;\n\t"
-   "R5 = [I2--];\n\t" /* load xy */
-   "LOOP filter_mid%= LC0;\n\t"
-   "LOOP_BEGIN filter_mid%=;\n\t"
-      "LOOP filter_mid_inner%= LC1=P3;\n\t"
-      "LOOP_BEGIN filter_mid_inner%=;\n\t"
-         "A1 -= R4.H*R5.H, A0 += R4.L*R5.L (IS) || R4 = [I0++] || R5 = [I2--];\n\t"
-      "LOOP_END filter_mid_inner%=;\n\t"
-      "R0 = (A0 += A1) || I2 += M0;\n\t"
-      "R0 = R0 << 3 || R5 = W[P0++];\n\t" /* load x */
-      "R0.L = R0 (RND);\n\t"
-      "R0.L = R0.L + R5.L;\n\t"
-      "R5 = PACK(R0.L, R5.L) || W[P1++] = R0;\n\t" /* shift y | store y */
-      "A1 = A0 = 0 || [I2--] = R5\n\t"
-      "LOOP_END filter_mid%=;\n\t"
-   "I2 += 4;\n\t"
-   "P2 = I2;\n\t"
-   /* Update memory */
-   "P4 = %6;\n\t"
-   "R0 = %5;\n\t"
-   "LC0 = R0;\n\t"
-   "P0 = B0;\n\t"
-   "A1 = A0 = 0;\n\t"
-   "LOOP mem_update%= LC0;\n\t"
-   "LOOP_BEGIN mem_update%=;\n\t"
-      "I2 = P2;\n\t"
-      "I0 = P0;\n\t"
-      "P0 += 4;\n\t"
-      "R0 = LC0;\n\t"
-      "LC1 = R0;\n\t"
-      "R5 = [I2--] || R4 = [I0++];\n\t"
-      "LOOP mem_accum%= LC1;\n\t"
-      "LOOP_BEGIN mem_accum%=;\n\t"
-         "A1 -= R4.H*R5.H, A0 += R4.L*R5.L (IS) || R4 = [I0++] || R5 = [I2--];\n\t"
-      "LOOP_END mem_accum%=;\n\t"
-      "R0 = (A0 += A1);\n\t"
-      "A1 = A0 = 0 || [P4++] = R0;\n\t"
-   "LOOP_END mem_update%=;\n\t"
-   "L0 = 0;\n\t"
-   : : "m" (xy), "m" (_x), "m" (_y), "m" (numden), "m" (N), "m" (ord), "m" (mem)
-   : "A0", "A1", "R0", "R1", "R2", "R3", "R4", "R5", "P0", "P1", "P2", "P3", "P4", "B0", "I0", "I2", "L0", "L2", "M0", "memory"
-   );
-
-}
-
-
-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;
-   ms_coef_t den2[12];
-   ms_coef_t *den;
-   den = (ms_coef_t*)((((int)den2)+4)&0xfffffffc);
-   for (i=0;i<10;i++)
-      den[i] = 0;
-   filter_mem16(x, num, den, y, N, ord, mem, stack);
-}
-
-
-#else
-#if 0
-/* this one comes from speex but unfortunately does not make the expected result, maybe it is mis-used.*/
-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,yi;
-
-   for (i=0;i<N;i++)
-   {
-      xi=x[i];
-      yi = EXTRACT16(SATURATE(ADD32(EXTEND32(xi),PSHR32(mem[0],LPC_SHIFT)),32767));
-      for (j=0;j<ord-1;j++)
-      {
-         mem[j] = MAC16_16(mem[j+1], num[j],xi);
-      }
-      mem[ord-1] = MULT16_16(num[ord-1],xi);
-      y[i] = yi;
-   }
-}
-#else
-
-#ifndef MS_FIXED_POINT
-
-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;
-       for(i=0;i<N;++i){
-               xi=x[i];
-               mem[0]=xi;
-               /* accumulate and shift within the same loop*/
-               acc=mem[ord-1]*num[ord-1];
-               for(j=ord-2;j>=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<N;++i){
-               xi=x[i];
-               mem[0]=xi;
-               /* accumulate and shift memories within the same loop*/
-               acc=(mem[ord-1]*(ms_word32_t)num[ord-1])>>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;i<len;i++)
-   {
-      if (in[i]>max_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;i<len;i++)
-   {
-      out[i] = SHL16(in[i], shift);
-   }   
-   return shift;
-}
-
-static void renorm_range(ms_word16_t *in, ms_word16_t *out, int shift, int len)
-{
-   int i;
-   for (i=0;i<len;i++)
-   {
-      out[i] = PSHR16(in[i], shift);
-   }
-}
-#endif
-
-#include "kiss_fftr.h"
-#include "kiss_fft.h"
-
-struct kiss_config {
-   kiss_fftr_cfg forward;
-   kiss_fftr_cfg backward;
-   int N;
-};
-
-void *ms_fft_init(int size)
-{
-       struct kiss_config *table;
-       table = (struct kiss_config*)ms_malloc(sizeof(struct kiss_config));
-       table->forward = 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;i<t->N;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 (file)
index 74cbeb1..0000000
+++ /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 <math.h>
-
-#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;i<nsamples && s->pos<s->dur;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 (file)
index 262d5fe..0000000
+++ /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 <streams.h>
-#include <initguid.h>
-
-#if !defined(_WIN32_WCE)
-EXTERN_C const CLSID CLSID_NullRenderer;\r
-#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 (file)
index cc63f0d..0000000
+++ /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 (file)
index 95a6064..0000000
+++ /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 <mediastreamer2/msequalizer.h>
-#include <mediastreamer2/dsptools.h>
-
-#include <math.h>
-
-#ifdef _MSC_VER
-#include <malloc.h>
-#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;i<s->nfft;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;i<len;i++)
-#ifdef MS_FIXED_POINT
-               ms_message("[%i]\t%i",i,t[i]);
-#else
-               ms_message("[%i]\t%f",i,t[i]);
-#endif
-}
-
-static void time_shift(ms_word16_t *s, int len){
-       int i;
-       int half=len/2;
-       ms_word16_t tmp;
-       for (i=0;i<half;++i){
-               tmp=s[i];
-               s[i]=s[i+half];
-               s[i+half]=tmp;
-       }
-}
-
-/*
- *hamming:
- * 0.54 - 0.46*cos(2*M_PI*t/T)
- *
- * blackman
- * 0.42 - 0.5*cos(2*M_PI*t/T) + 0.08*cos(4*M_PI*t/T)
-*/
-
-static void norm_and_apodize(ms_word16_t *s, int len){
-       int i;
-       float x;
-       float w;
-       for(i=0;i<len;++i){
-               x=(float)i*2*M_PI/(float)len;
-               w=0.54 - (0.46*cos(x));
-               //w=0.42 - (0.5*cos(x)) + (0.08*cos(2*x));
-               s[i]=w*(float)s[i];
-       }       
-}
-
-static void equalizer_state_compute_impulse_response(EqualizerState *s){
-       void *fft_handle=ms_fft_init(s->nfft);
-       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;i<l;++i){
-               w[i]=(ms_word16_t)is[i];
-       }
-}
-
-static void word16_to_int16(const ms_word16_t *w, int16_t *is, int l){
-       int i;
-       for (i=0;i<l;++i)
-               is[i]=(int16_t)w[i];
-}
-
-#define INT16_TO_WORD16(i,w,l) w=(ms_word16_t*)alloca(sizeof(ms_word16_t)*(l));int16_to_word16(i,w,l)
-#define WORD16_TO_INT16(w,i,l) word16_to_int16(w,i,l)
-#endif
-
-static void equalizer_state_run(EqualizerState *s, int16_t *samples, int nsamples){
-       if (s->needs_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;i<s->nfft;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 (file)
index 5aefaf6..0000000
+++ /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 <libavcodec/avcodec.h>
-# include <libavutil/avutil.h>
-#else
-/* old layout */
-# include <ffmpeg/avcodec.h>
-# include <ffmpeg/avutil.h>
-#endif
-
-#if defined(HAVE_LIBSWSCALE_SWSCALE_H)
-/* new layout */
-#  include <libswscale/swscale.h>
-# elif !defined(HAVE_LIBAVCODEC_AVCODEC_H)
-/* old layout */
-# include <ffmpeg/swscale.h>
-#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 (file)
index 3f2c9e3..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- *  PCM - A-Law conversion
- *  Copyright (c) 2000 by Abramo Bagnara <abramo@alsa-project.org>
- *
- *  Wrapper for linphone Codec class by Simon Morlat <simon.morlat@linphone.org>
- */
-
-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 (file)
index 6cc62ec..0000000
+++ /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 <gsm/gsm.h>
-
-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 (file)
index 4f26c42..0000000
+++ /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 <sys/types.h>
-#endif
-#include <sys/socket.h>
-#include <netdb.h>
-#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<pos && remote_candidates[pos2].remote_candidate.conn_addr[0]!='\0';pos2++)
-                       {
-                               /* same "base" address (origin of STUN connectivity check to the remote candidate */
-                               if (strcasecmp(remote_candidates[pos].local_candidate.rel_addr, /* base address for "reflexive" address */
-                                       remote_candidates[pos2].local_candidate.conn_addr)==0) /* base address for "host" address */
-                               {
-                                       /* if same target remote candidate: -> 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;pos2<pos && remote_candidates[pos2].remote_candidate.conn_addr[0]!='\0';pos2++)
-                               {
-                                       cand_pair2 = &remote_candidates[pos2];
-                                       if (cand_pair2->connectivity_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 (file)
index 27c1608..0000000
+++ /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;i<N;i++)
-       {
-          Fout = Fout_beg + i*mm;
-          Fout2 = Fout + m;
-          tw1 = st->twiddles;
-          for(j=0;j<m;j++)
-          {
-             /* Almost the same as the code path below, except that we divide the input by two
-              (while keeping the best accuracy possible) */
-             ms_word32_t tr, ti;
-             tr = SHR32(SUB32(MULT16_16(Fout2->r , 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;i<N;i++)
-       {
-          Fout = Fout_beg + i*mm;
-          Fout2 = Fout + m;
-          tw1 = st->twiddles;
-          for(j=0;j<m;j++)
-          {
-             C_MUL (t,  *Fout2 , *tw1);
-             tw1 += fstride;
-             C_SUB( *Fout2 ,  *Fout , t );
-             C_ADDTO( *Fout ,  t );
-             ++Fout2;
-             ++Fout;
-          }
-       }
-    }
-}
-
-static void kf_bfly4(
-        kiss_fft_cpx * Fout,
-        const size_t fstride,
-        const kiss_fft_cfg st,
-        int m,
-        int N,
-        int mm
-        )
-{
-    kiss_fft_cpx *tw1,*tw2,*tw3;
-    kiss_fft_cpx scratch[6];
-    const size_t m2=2*m;
-    const size_t m3=3*m;
-    int i, j;
-
-    if (st->inverse)
-    {
-       kiss_fft_cpx * Fout_beg = Fout;
-       for (i=0;i<N;i++)
-       {
-          Fout = Fout_beg + i*mm;
-          tw3 = tw2 = tw1 = st->twiddles;
-          for (j=0;j<m;j++)
-          {
-             C_MUL(scratch[0],Fout[m] , *tw1 );
-             C_MUL(scratch[1],Fout[m2] , *tw2 );
-             C_MUL(scratch[2],Fout[m3] , *tw3 );
-             
-             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] );
-             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;
-          }
-       }
-    } else
-    {
-       kiss_fft_cpx * Fout_beg = Fout;
-       for (i=0;i<N;i++)
-       {
-          Fout = Fout_beg + i*mm;
-          tw3 = tw2 = tw1 = st->twiddles;
-          for (j=0;j<m;j++)
-          {
-             C_MUL4(scratch[0],Fout[m] , *tw1 );
-             C_MUL4(scratch[1],Fout[m2] , *tw2 );
-             C_MUL4(scratch[2],Fout[m3] , *tw3 );
-             
-             Fout->r = 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; u<m; ++u ) {
-        if (!st->inverse) {
-        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; u<m; ++u ) {
-        k=u;
-        for ( q1=0 ; q1<p ; ++q1 ) {
-            scratchbuf[q1] = Fout[ k  ];
-        if (!st->inverse) {
-            C_FIXDIV(scratchbuf[q1],p);
-       }
-            k += m;
-        }
-
-        k=u;
-        for ( q1=0 ; q1<p ; ++q1 ) {
-            int twidx=0;
-            Fout[ k ] = scratchbuf[0];
-            for (q=1;q<p;++q ) {
-                twidx += fstride * k;
-                if (twidx>=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;j<p;j++)
-      {
-         Fout[j] = *f;
-         f += fstride*in_stride;
-      }
-   } else {
-      int j;
-      for (j=0;j<p;j++)
-      {
-         kf_shuffle( Fout , f, fstride*p, in_stride, factors,st);
-         f += fstride*in_stride;
-         Fout += m;
-      }
-   }
-}
-
-static
-void kf_work(
-        kiss_fft_cpx * Fout,
-        const kiss_fft_cpx * f,
-        const size_t fstride,
-        int in_stride,
-        int * factors,
-        const kiss_fft_cfg st,
-        int N,
-        int s2,
-        int m2
-        )
-{
-   int i;
-    kiss_fft_cpx * Fout_beg=Fout;
-    const int p=*factors++; /* the radix  */
-    const int m=*factors++; /* stage's fft length/p */
-#if 0
-    /*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;j<p;j++)
-       {
-          Fout[j] = *f;
-          f += fstride*in_stride;
-       }*/
-    } else {
-       int j;
-       for (j=0;j<p;j++)
-       {
-          kf_work( Fout , f, fstride*p, in_stride, factors,st, N*p, fstride*in_stride, m);
-          f += fstride*in_stride;
-          Fout += m;
-       }
-    }
-
-    Fout=Fout_beg;
-
-    switch (p) {
-        case 2: kf_bfly2(Fout,fstride,st,m); break;
-        case 3: kf_bfly3(Fout,fstride,st,m); break; 
-        case 4: kf_bfly4(Fout,fstride,st,m); break;
-        case 5: kf_bfly5(Fout,fstride,st,m); break; 
-        default: kf_bfly_generic(Fout,fstride,st,m,p); break;
-    }
-#else
-    /*printf ("fft %d %d %d %d %d %d %d\n", p*m, m, p, s2, fstride*in_stride, N, m2);*/
-    if (m==1) 
-    {
-       /*for (i=0;i<N;i++)
-       {
-          int j;
-          Fout = Fout_beg+i*m2;
-          const kiss_fft_cpx * f2 = f+i*s2;
-          for (j=0;j<p;j++)
-          {
-             *Fout++ = *f2;
-             f2 += fstride*in_stride;
-          }
-       }*/
-    }else{
-       kf_work( Fout , f, fstride*p, in_stride, factors,st, N*p, fstride*in_stride, m);
-    }
-
-    
-       
-       
-       switch (p) {
-          case 2: kf_bfly2(Fout,fstride,st,m, N, m2); break;
-          case 3: for (i=0;i<N;i++){Fout=Fout_beg+i*m2; kf_bfly3(Fout,fstride,st,m);} break; 
-          case 4: kf_bfly4(Fout,fstride,st,m, N, m2); break;
-          case 5: for (i=0;i<N;i++){Fout=Fout_beg+i*m2; kf_bfly5(Fout,fstride,st,m);} break; 
-          default: for (i=0;i<N;i++){Fout=Fout_beg+i*m2; kf_bfly_generic(Fout,fstride,st,m,p);} break;
-    }    
-#endif
-}
-
-/*  facbuf is populated by p1,m1,p2,m2, ...
-    where 
-    p[i] * m[i] = m[i-1]
-    m0 = n                  */
-static 
-void kf_factor(int n,int * facbuf)
-{
-    int p=4;
-
-    /*factor out powers of 4, powers of 2, then any remaining primes */
-    do {
-        while (n % p) {
-            switch (p) {
-                case 4: p = 2; break;
-                case 2: p = 3; break;
-                default: p += 2; break;
-            }
-            if (p>32000 || (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;i<nfft;++i) {
-            ms_word32_t phase = i;
-            if (!st->inverse)
-                phase = -phase;
-            kf_cexp2(st->twiddles+i, DIV32(SHL32(phase,17),nfft));
-        }
-#else
-        for (i=0;i<nfft;++i) {
-           const double pi=3.14159265358979323846264338327;
-           double phase = ( -2*pi /nfft ) * i;
-           if (st->inverse)
-              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 (file)
index 9db7494..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-#ifndef KISS_FFT_H
-#define KISS_FFT_H
-
-#include <stdlib.h>
-#include <math.h>
-#include <mediastreamer2/dsptools.h>
-
-#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 <xmmintrin.h>
-# 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 (file)
index a8ab42a..0000000
+++ /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<nfft;++i) {
-       ms_word32_t phase = i+(nfft>>1);
-       if (!inverse_fft)
-          phase = -phase;
-       kf_cexp2(st->super_twiddles+i, DIV32(SHL32(phase,16),nfft));
-    }
-#else
-    for (i=0;i<nfft;++i) {
-       const double pi=3.14159265358979323846264338327;
-       double phase = pi*(((double)i) /nfft + .5);
-       if (!inverse_fft)
-          phase = -phase;
-       kf_cexp(st->super_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 (file)
index 5f1650c..0000000
+++ /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 (file)
index 102a9f4..0000000
+++ /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 <organization> 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 <copyright holder> ``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 <copyright holder> 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 <CoreServices/CoreServices.h>
-#include <AudioUnit/AudioUnit.h>
-#include <AudioToolbox/AudioToolbox.h>
-
-#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,
-                                                       &param,
-                                                       sizeof(UInt32));
-       ms_message("AudioUnitSetProperty %i %x", result, result);
-       
-// Select the default input device
-       param = sizeof(AudioDeviceID);
-       result = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultInputDevice,
-                                                       &param,
-                                                       &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,
-                                                       &param);
-       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 (file)
index 27363ec..0000000
+++ /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;i<h;++i){
-               for(j=0;j<w;++j){
-                       p[j]= (( (i/50)*50 + (j/50)*50 + index ) & 0x1)*200;
-               }
-               p+=lsz;
-       }
-}
-
-void mire_draw(MireData *d){
-       plane_draw(d->pict.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 (file)
index 3138c35..0000000
+++ /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 <sys/types.h>
-#endif
-#ifndef WIN32
-#include <dirent.h>
-#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 <dlfcn.h>
-#endif
-
-#if defined(__APPLE__) && !defined(__GNUC__)
-#import <Cocoa/Cocoa.h>
-#include <Foundation/Foundation.h> 
-#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 (file)
index 46541fd..0000000
+++ /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 <math.h>
-
-#if defined(_WIN32_WCE)
-#define DISABLE_SPEEX
-#endif
-
-#ifndef HAVE_SPEEXDSP
-#define DISABLE_SPEEX
-#endif
-
-#ifndef DISABLE_SPEEX
-#include <speex/speex_preprocess.h>
-#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;i<CONF_MAX_PINS;i++)
-               channel_init(s, &s->channels[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;i<CONF_MAX_PINS;i++)
-               channel_uninit(&s->channels[i]);
-       ms_free(f->data);
-}
-
-static void conf_preprocess(MSFilter *f){
-       ConfState *s=(ConfState*)f->data;
-       int i;
-       for (i=0;i<CONF_MAX_PINS;i++)
-         {
-           s->channels[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;i<CONF_MAX_PINS;++i){
-               chan=&s->channels[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<float>(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);\r
-               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_gran<ms_bufferizer_get_avail(&chan->buff))
-       {
-               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;i<CONF_MAX_PINS;++i){
-               chan=&s->channels[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)<s->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;j<s->conf_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;j<s->conf_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_psd<s->vad_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;j<s->conf_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;i<s->conf_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;i<s->conf_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;i<CONF_MAX_PINS;++i){
-               if (f->outputs[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;i<CONF_MAX_PINS;++i){
-               if (f->inputs[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;i<CONF_MAX_PINS;i=i+2){
-                       if (f->inputs[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;i<CONF_MAX_PINS;i++)
-               channel_uninit(&s->channels[i]);
-    for (i=0;i<CONF_MAX_PINS;i++)
-               channel_init(s, &s->channels[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;i<CONF_MAX_PINS;i++)
-               channel_uninit(&s->channels[i]);
-    for (i=0;i<CONF_MAX_PINS;i++)
-               channel_init(s, &s->channels[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;i<CONF_MAX_PINS;i++)
-               channel_uninit(&s->channels[i]);
-    for (i=0;i<CONF_MAX_PINS;i++)
-               channel_init(s, &s->channels[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;i<CONF_MAX_PINS;i++)
-               channel_uninit(&s->channels[i]);
-    for (i=0;i<CONF_MAX_PINS;i++)
-               channel_init(s, &s->channels[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;i<CONF_MAX_PINS;i++)
-               channel_uninit(&s->channels[i]);
-    for (i=0;i<CONF_MAX_PINS;i++)
-               channel_init(s, &s->channels[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;i<CONF_MAX_PINS;i++)
-               channel_uninit(&s->channels[i]);
-    for (i=0;i<CONF_MAX_PINS;i++)
-               channel_init(s, &s->channels[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;i<CONF_MAX_PINS;i++)
-               channel_uninit(&s->channels[i]);
-    for (i=0;i<CONF_MAX_PINS;i++)
-               channel_init(s, &s->channels[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;i<CONF_MAX_PINS;i++)
-               channel_uninit(&s->channels[i]);
-    for (i=0;i<CONF_MAX_PINS;i++)
-               channel_init(s, &s->channels[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 (executable)
index 6744909..0000000
+++ /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 <http://www.gnu.org/licenses/>. 
-*/
-/* 
-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 <windows.h>
-#include <winnls.h>
-#include <errors.h>
-#include <initguid.h>
-#include <ocidl.h>
-
-
-#include <mediastreamer2/mswebcam.h>
-#include <mediastreamer2/msfilter.h>
-#include <mediastreamer2/msticker.h>
-#include <mediastreamer2/msvideo.h>
-
-template <typename _ComT>
-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<IAMStreamConfig> 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<IAMStreamConfig> 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; i<count; i++ ) {
-               VIDEO_STREAM_CONFIG_CAPS videoConfig;
-               AM_MEDIA_TYPE *mediaType;
-               if (streamConfig->GetStreamCaps( 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<IAMStreamConfig> 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<IPropertyBag> 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 (file)
index 3ae4676..0000000
+++ /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;i<len;i+=2){
-               tmp=bytes[i];
-               bytes[i]=bytes[i+1];
-               bytes[i+1]=tmp;
-       }
-}
-
-static void player_process(MSFilter *f){
-       PlayerData *d=(PlayerData*)f->data;
-       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 (err<bytes)
-                                       memset(om->b_wptr+err,0,bytes-err);
-                               om->b_wptr+=bytes;
-                               ms_queue_put(f->outputs[0],om);
-                       }else freemsg(om);
-                       if (err<bytes){
-                               ms_filter_notify_no_arg(f,MS_FILE_PLAYER_EOF);
-                               lseek(d->fd,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 (file)
index 0007b7a..0000000
+++ /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 (file)
index 7803549..0000000
+++ /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 <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-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 (file)
index b485d45..0000000
+++ /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 <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#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 (file)
index 4bbfaa5..0000000
+++ /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(pin1<f1->desc->noutputs, -1);
-       ms_return_val_if_fail(pin2<f2->desc->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(pin1<f1->desc->noutputs, -1);
-       ms_return_val_if_fail(pin2<f2->desc->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;i<f->desc->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;i<f->desc->ninputs;i++){
-               link=f->inputs[i];
-               if (link!=NULL) find_filters(filters,link->prev.filter);
-       }
-       /* go downstream */
-       for(i=0,found=0;i<f->desc->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 (file)
index 9d04b0c..0000000
+++ /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 (file)
index 66172a5..0000000
+++ /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 <string.h>
-
-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(sz<datalen){
-                       cplen=MIN(m->b_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 (file)
index 6347faa..0000000
+++ /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 <malloc.h>
-#endif
-
-#include <speex/speex_resampler.h>
-#include <math.h>
-
-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_rate<dt->output_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;idx<out_len;idx++)
-                 data_out[idx]=(short)floor(.5+out[idx]);
-               obl->b_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 (file)
index 79a4a3f..0000000
+++ /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 (file)
index 593e3ec..0000000
+++ /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 (file)
index 871db54..0000000
+++ /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 <speex/speex.h>
-
-#ifdef WIN32
-#include <malloc.h> /* 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;k<frame_per_packet;k++)
-               {
-                       speex_encode_int(s->state,(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 (file)
index 6e52656..0000000
+++ /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;i<f->desc->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;i<f->desc->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 <sys/types.h>
-#include <sys/timeb.h>
-#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(&param,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, &param))) {
-               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;i<f->desc->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 (file)
index 635f789..0000000
+++ /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 <fcntl.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <errno.h>
-#include <string.h>
-#include <sys/mman.h>
-
-#include <linux/videodev.h>
-#ifdef HAVE_LINUX_VIDEODEV2_H
-#include <linux/videodev2.h>
-#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; i<req.count; ++i) {
-               struct v4l2_buffer buf;
-               mblk_t *msg;
-               void *start;
-               memset(&buf,0,sizeof(buf));
-       
-               buf.type=V4L2_BUF_TYPE_VIDEO_CAPTURE;
-               buf.memory=V4L2_MEMORY_MMAP;
-               buf.index=i;
-       
-               if (ioctl (s->fd, 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;k<s->frame_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;i<s->frame_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;i<cap.channels;i++)
-       {
-               chan.channel=i;
-               err=ioctl(s->fd,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;i<dh-dstarty;++i){
-               memcpy(tmp1+(dstartx*bpp),tmp2+(sstartx*bpp),(sw-(2*sstartx))*bpp);
-               tmp1+=dlsize;
-               tmp2+=slsize;
-       }
-}
-
-static void pic_copy(uint8_t *dest, int dw, int dh, uint8_t *src, int sw, int sh, MSPixFmt fmt){
-       if (fmt==MS_YUV420P){
-               plane_copy(dest,dw,dh,src,sw,sh,1);
-               dest+=dw*dh;
-               src+=sw*sh;
-               plane_copy(dest,dw/2,dh/2,src,sw/2,sh/2,1);
-               dest+=dw*dh/4;
-               src+=sw*sh/4;
-               plane_copy(dest,dw/2,dh/2,src,sw/2,sh/2,1);
-       }else if (fmt==MS_RGB24){
-               plane_copy(dest,dw,dh,src,sw,sh,3);
-       }else if (fmt==MS_YUYV||fmt==MS_UYVY){
-               plane_copy(dest,dw,dh,src,sw,sh,4);
-       }
-}
-
-static mblk_t *crop_or_pad(V4lState *s, mblk_t *pic){
-       int size=s->vsize.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;i<s->vsize.height;++i){
-               line=i*s->vsize.width*3;
-               if ( ((i+s->frame_ind)/patternh) & 0x1) red=255;
-               else red= 0;
-               for (j=0;j<s->vsize.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;i<s->frame_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;i<s->frame_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 (file)
index 3771319..0000000
+++ /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 <fcntl.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <errno.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <poll.h>
-
-#include <linux/videodev2.h>
-
-#include "mediastreamer2/msvideo.h"
-#include "mediastreamer2/msticker.h"
-#include "mediastreamer2/mswebcam.h"
-
-#ifdef HAVE_LIBV4L2
-#include <libv4l2.h>
-#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; i<req.count; ++i) {
-               struct v4l2_buffer buf;
-               mblk_t *msg;
-               void *start;
-               memset(&buf,0,sizeof(buf));
-       
-               buf.type=V4L2_BUF_TYPE_VIDEO_CAPTURE;
-               buf.memory=V4L2_MEMORY_MMAP;
-               buf.index=i;
-       
-               if (v4l2_ioctl (s->fd, 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;k<s->frame_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;i<s->frame_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 (file)
index de52a46..0000000
+++ /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 <fcntl.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <errno.h>
-#include <string.h>
-
-#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 <Carbon/Carbon.h>
-  #include <QuicKTime/QuickTime.h>
-  #include <AppKit/AppKit.h>
-#else
-  #include <ConditionalMacros.h>
-  #include <QuickTimeComponents.h>
-  #include <TextUtils.h>
-  #include <AppKit/AppKit.h>
-  #include <stdio.h>
-#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;i<s->vsize.height;++i){
-               line=i*s->vsize.width*3;
-               if ( ((i+s->frame_ind)/patternh) & 0x1) red=255;
-               else red= 0;
-               for (j=0;j<s->vsize.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 (file)
index 7c1abeb..0000000
+++ /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;i<roi.height;++i){
-               memcpy(dst_plane,src_plane,roi.width);
-               src_plane+=src_stride;
-               dst_plane+=dst_stride;
-       }
-}
-
-void yuv_buf_copy(uint8_t *src_planes[], const int src_strides[], 
-               uint8_t *dst_planes[], const int dst_strides[3], MSVideoSize roi){
-       plane_copy(src_planes[0],src_strides[0],dst_planes[0],dst_strides[0],roi);
-       roi.width=roi.width/2;
-       roi.height=roi.height/2;
-       plane_copy(src_planes[1],src_strides[1],dst_planes[1],dst_strides[1],roi);
-       plane_copy(src_planes[2],src_strides[2],dst_planes[2],dst_strides[2],roi);
-}
-
-static void plane_mirror(uint8_t *p, int linesize, int w, int h){
-       int i,j;
-       uint8_t tmp;
-       for(j=0;j<h;++j){
-               for(i=0;i<w/2;++i){
-                       tmp=p[i];
-                       p[i]=p[w-1-i];
-                       p[w-1-i]=tmp;
-               }
-               p+=linesize;
-       }
-}
-
-/*in place mirroring*/
-void yuv_buf_mirror(YuvBuf *buf){
-       plane_mirror(buf->planes[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;i<h/2;++i){
-               for(j=0;j<w*3;++j){
-                       exch=p[i];
-                       p[i]=pe[-i];
-                       pe[-i]=exch;
-               }
-               p+=linesize;
-               pe-=linesize;
-       }       
-}
-
-void rgb24_copy_revert(uint8_t *dstbuf, int dstlsz,
-                               const uint8_t *srcbuf, int srclsz, MSVideoSize roi){
-       int i,j;
-       const uint8_t *psrc;
-       uint8_t *pdst;
-       psrc=srcbuf;
-       pdst=dstbuf+(dstlsz*(roi.height-1));
-       for(i=0;i<roi.height;++i){
-               for(j=0;j<roi.width*3;++j){
-                       pdst[(roi.width*3)-1-j]=psrc[j];
-               }
-               pdst-=dstlsz;
-               psrc+=srclsz;
-       }
-}
-
-static MSVideoSize _ordered_vsizes[]={
-       {MS_VIDEO_SIZE_QCIF_W,MS_VIDEO_SIZE_QCIF_H},
-       {MS_VIDEO_SIZE_QVGA_W,MS_VIDEO_SIZE_QVGA_H},
-       {MS_VIDEO_SIZE_CIF_W,MS_VIDEO_SIZE_CIF_H},
-       {MS_VIDEO_SIZE_VGA_W,MS_VIDEO_SIZE_VGA_H},
-       {MS_VIDEO_SIZE_4CIF_W,MS_VIDEO_SIZE_4CIF_H},
-       {MS_VIDEO_SIZE_720P_W,MS_VIDEO_SIZE_720P_H},
-       {0,0}
-};
-
-MSVideoSize ms_video_size_get_just_lower_than(MSVideoSize vs){
-       MSVideoSize *p;
-       MSVideoSize ret;
-       ret.width=0;
-       ret.height=0;
-       for(p=_ordered_vsizes;p->width!=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 (file)
index 8d1df08..0000000
+++ /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 <math.h>
-
-#ifdef HAVE_SPEEXDSP
-#include <speex/speex_preprocess.h>
-#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)<v->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)<v->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;i<numsamples;++i){
-               float s=(float)signal[i];
-               en=(s*s*coef) + (1.0-coef)*en;
-       }
-       return en;
-}
-
-static void apply_gain(Volume *v, mblk_t *m){
-       int16_t *sample;
-       float gain=v->target_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 (file)
index fa360ec..0000000
+++ /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 (file)
index baf242c..0000000
+++ /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 <sys/types.h>
-#include <sys/socket.h>
-#include <string.h>
-#include <errno.h>
-#include <netinet/in.h>
-#include <netinet/ip.h>
-#include <netdb.h>
-
-#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 (file)
index 4241dc1..0000000
+++ /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 <sys/stat.h>
-
-#ifdef WIN32
-#include <fcntl.h>
-#include <sys/types.h>
-#include <io.h>
-#include <stdio.h>
-#include <malloc.h>
-#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,0x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x87,0x19,0xE9,0x62,0xED,0x3B,0xC5,0x97,0x75,0x59,0x69,0xF7,0x2D
-,0x9F,0x35,0x7C,0xF9,0xAA,0x0A,0x80,0x52,0x4A,0x79,0x14,0x95,0x78,0xD9,0x48
-,0xCC,0x4E,0xA7,0x2A,0xC0,0x0C,0xF4,0xEB,0x9D,0x15,0xCB,0xD7,0xCF,0xB2,0x05
-,0x61,0x6A,0xD9,0xAD,0xB7,0x3D,0xB5,0x73,0x35,0x62,0x46,0xF3,0x6A,0xED,0xF5
-,0x34,0x73,0x42,0xCF,0x9E,0xB1,0xC7,0x0C,0xE2,0x10,0x41,0x39,0x55,0x28,0x10
-,0x60,0x0E,0x38,0xE9,0xAA,0xDF,0xC4,0x2F,0xB2,0xC6,0xE6,0xDB,0x56,0xF8,0xA5
-,0x85,0x84,0xDC,0x41,0x32,0xD5,0x43,0x50,0x6A,0xA3,0x20,0x95,0xEA,0xD1,0x2C
-,0x4B,0x2A,0x04,0x51,0x23,0x1F,0x2C,0x54,0x13,0xE9,0xE8,0xA0,0x16,0xD7,0x74
-,0xBD,0x63,0xDC,0x04,0x91,0x53,0x2A,0xDD,0x58,0x16,0x46,0x8E,0x17,0xF2,0xE9
-,0x23,0x61,0xC8,0x15,0x92,0x5E,0xA5,0xF0,0x54,0xA3,0x05,0x0D,0x8E,0x99,0x41
-,0xAC,0xDB,0x52,0xAB,0xC2,0xD4,0xCF,0x34,0x15,0x11,0xA0,0xF2,0xC4,0x74,0xD0
-,0xF0,0x82,0x25,0x04,0x80,0xA3,0xBE,0x58,0x60,0x03,0xD7,0xD8,0x7A,0x57,0x41
-,0xFC,0x84,0xB9,0x50,0xD5,0x5B,0xAB,0xA5,0xA2,0xAC,0x8C,0x47,0x34,0x64,0x64
-,0x06,0x0C,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,0x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,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,0xB4,0x84,0x84,0xF3,0x24,0x38,0x48,0xF3,0xC5
-,0xB0,0x58,0x81,0xE9,0x3F,0x23,0xA0,0xC2,0xD7,0xA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AF,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
-,0xCC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0xB1,0x9E,0x86,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
-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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,0x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39,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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,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 (file)
index b77ec50..0000000
+++ /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 (file)
index 2ab8bdc..0000000
Binary files a/linphone/mediastreamer2/src/nowebcamCIF.jpg and /dev/null differ
diff --git a/linphone/mediastreamer2/src/oss.c b/linphone/mediastreamer2/src/oss.c
deleted file mode 100644 (file)
index a4f67db..0000000
+++ /dev/null
@@ -1,605 +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/mssndcard.h"
-#include "mediastreamer2/msfilter.h"
-
-#include <sys/soundcard.h>
-
-#include <errno.h>
-#include <assert.h>
-#include <fcntl.h>
-#include <sys/time.h>
-#include <sys/ioctl.h>
-#include <unistd.h>
-
-#ifdef HAVE_ALLOCA_H /*FreeBSD does not have alloca.h*/
-#include <alloca.h>
-#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 (file)
index abba82a..0000000
+++ /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 <speex/speex_preprocess.h>
-
-#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; i<numDevices; i++ ) {
-      pdi = Pa_GetDeviceInfo( i );
-      if (pdi!=NULL)
-       {
-         MSSndCard *card;
-         snprintf(pcmdev,sizeof(pcmdev),"%s",pdi->name);
-         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 (file)
index 24fc1c4..0000000
+++ /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 (file)
index 414b2ea..0000000
+++ /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 (file)
index ffb2895..0000000
+++ /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;p<im->b_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 (file)
index 0288cb2..0000000
+++ /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 <SDL/SDL.h>
-#include <SDL/SDL_video.h>
-
-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;j<nh;j++,jd+=scale){
-               for (i=0,id=0;i<nw;i++,id+=scale){
-                       dptr[(j*nw) + i]=sptr[(jd*w)+id];
-               }
-       }
-       
-       nh=nh/2;
-       nw=nw/2;
-       w=w/2;
-       h=h/2;
-       dptr+=ydsize;
-       sptr+=ysize;
-       for (j=0,jd=0;j<nh;j++,jd+=scale){
-               for (i=0,id=0;i<nw;i++,id+=scale){
-                       dptr[(j*nw) + i]=sptr[(jd*w)+id];
-               }
-       }
-       dptr+=udsize;
-       sptr+=usize;
-       for (j=0,jd=0;j<nh;j++,jd+=scale){
-               for (i=0,id=0;i<nw;i++,id+=scale){
-                       dptr[(j*nw) + i]=sptr[(jd*w)+id];
-               }
-       }
-       
-       return smallb;
-}
-
-static void fill_overlay_at_pos(SDL_Overlay *lay, mblk_t *m, int x, int y, int w, int h){
-       unsigned char *data=m->b_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;j<jlim;j++){
-               off=j*lay->w;
-               for (i=x;i<ilim;i++){
-                       dptr[off + i]=*data;
-                       data++;
-               }
-       }
-       /*set U and V*/
-       ilim=ilim/2;
-       jlim=jlim/2;
-       dptr=lay->pixels[2];
-       for (j=y/2;j<jlim;j++){
-               off=j*(lay->w/2);
-               for (i=x/2;i<ilim;i++){
-                       dptr[off + i]=*data;
-                       data++;
-               }
-       }
-       dptr=lay->pixels[1];
-       for (j=y/2;j<jlim;j++){
-               off=j*(lay->w/2);
-               for (i=x/2;i<ilim;i++){
-                       dptr[off + i]=*data;
-                       data++;
-               }
-       }
-       SDL_UnlockYUVOverlay(lay);
-}
-
-static void fill_overlay(SDL_Overlay *lay,mblk_t *m){
-       
-       int w2,h2;
-       char *data=(char*)m->b_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 (file)
index 401f2ae..0000000
+++ /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 (file)
index 6e55faf..0000000
+++ /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 <speex/speex_echo.h>
-#include <speex/speex_preprocess.h>
-
-#ifdef HAVE_CONFIG_H
-#include "mediastreamer-config.h"
-#endif
-
-#ifdef WIN32
-#include <malloc.h> /* 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_delay<s->playback_delay){
-               while((m=ms_queue_get(f->inputs[0]))!=NULL && s->size_delay<s->playback_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 (file)
index a0c735b..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (C) 2001-2003 Michael Niedermayer <michaelni@gmx.at>
- *
- * 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 (file)
index 23c5be4..0000000
+++ /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;i<f->desc->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 && pin<MS_TEE_NOUTPUTS){
-               d->muted[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 && pin<MS_TEE_NOUTPUTS){
-               d->muted[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 (file)
index 4f04325..0000000
+++ /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 <theora/theora.h>
-
-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;i<yuv.y_height;++i){
-                               memcpy(om->b_wptr,yuv.y+yuv.y_stride*i,yuv.y_width);
-                               om->b_wptr+=yuv.y_width;
-                       }
-                       for(i=0;i<yuv.uv_height;++i){
-                               memcpy(om->b_wptr,yuv.u+yuv.uv_stride*i,yuv.uv_width);
-                               om->b_wptr+=yuv.uv_width;
-                       }
-                       for(i=0;i<yuv.uv_height;++i){
-                               memcpy(om->b_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 (file)
index 5d948f4..0000000
+++ /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;i<size_of_pcm/2;i++){
-                       *o->b_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_rptr<m->b_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 (executable)
index 0c9006c..0000000
+++ /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 (file)
index 1ea0b1f..0000000
+++ /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;i<max;i+=2,++j){
-                       octet[0]=config[i];
-                       octet[1]=config[i+1];
-                       s->dci[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 (file)
index 3cbf5f6..0000000
+++ /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 <libavcodec/avcodec.h>
-#else
-#include <ffmpeg/avcodec.h>
-#endif
-
-#include "mediastreamer2/msfilter.h"
-#include "mediastreamer2/msvideo.h"
-#include "mediastreamer2/msticker.h"
-
-#ifdef _WIN32
-#include <ws2tcpip.h>
-#else
-#include <netinet/in.h>                        /* 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_rptr<frame->b_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;rptr<frame->b_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;i<num;++i){
-                       mblk_t *header;
-                       packet=dupb(frame);
-                       packet->b_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<end && i<packet_size;++i,++p){
-               if (p[-1]==0 && p[0]==0){
-                       ret=p-1;
-               }
-               p++;/* to skip possible 0 after the PSC that would make a double detection */
-       }
-       return ret;
-}
-
-
-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;
-};
-
-#define RTP_JPEG_RESTART           0x40
-
-/* Procedure SendFrame:
- *
- *  Arguments:
- *    start_seq: The sequence number for the first packet of the current
- *               frame.
- *    ts: RTP timestamp for the current frame
- *    ssrc: RTP SSRC value
- *    jpeg_data: Huffman encoded JPEG scan data
- *    len: Length of the JPEG scan data
- *    type: The value the RTP/JPEG type field should be set to
- *    typespec: The value the RTP/JPEG type-specific field should be set
- *              to
- *    width: The width in pixels of the JPEG image
- *    height: The height in pixels of the JPEG image
- *    dri: The number of MCUs between restart markers (or 0 if there
- *         are no restart markers in the data
- *    q: The Q factor of the data, to be specified using the Independent
- *       JPEG group's algorithm if 1 <= q <= 99, specified explicitly
- *       with lqt and cqt if q >= 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 (file)
index 51e6a3e..0000000
+++ /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 <SDL/SDL.h>
-#include <SDL/SDL_video.h>
-
-static bool_t sdl_initialized=FALSE;
-
-static ms_mutex_t sdl_mutex;
-
-static SDL_Surface *sdl_screen=0;
-
-#ifdef HAVE_X11_XLIB_H
-
-#include <SDL/SDL_syswm.h>
-
-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 <Vfw.h>
-
-
-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 (file)
index 65b800c..0000000
+++ /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 (file)
index 3a38fb7..0000000
+++ /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 (file)
index 7160d60..0000000
+++ /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 <aygshell.h>
-#include "nowebcam.h"
-#if 0
-#include <ffmpeg/avcodec.h>
-#endif
-
-#include <dshow.h>
-#include <dmodshow.h>
-#include <dmoreg.h>
-
-#include <streams.h>
-//#include <initguid.h>
-#include "dxfilter.h"
-#if 0
-#include <qedit.h>
-#endif
-#include <atlbase.h>
-#include <atlcom.h>
-
-typedef struct V4wState{
-
-       char dev[512];
-       int devidx;
-
-       CComPtr<IGraphBuilder> m_pGraph;
-       CComPtr<ICaptureGraphBuilder2> m_pBuilder;
-       CComPtr<IMediaControl> m_pControl;
-       CDXFilter *m_pDXFilter;
-       CComPtr<IBaseFilter> m_pIDXFilter;      
-       CComPtr<IBaseFilter> m_pNullRenderer;
-       CComPtr<IBaseFilter> 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( ;pLine1<pLine2;pLine2-=(iLineLen*2))
-                       {
-                               for(iIndex=0;iIndex!=iLineLen;pLine1++,pLine2++,iIndex++)
-                               {
-                                       tmp=*pLine1;
-                                       *pLine1=*pLine2;
-                                       *pLine2=tmp;       
-                               }
-                       }
-               }
-               buf->b_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<IPropertyBag*>(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<IPersistPropertyBag>    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 (file)
index 74f21d6..0000000
+++ /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 <speex/speex_preprocess.h>
-#endif
-
-#include "mediastreamer2/mssndcard.h"
-#include "mediastreamer2/msfilter.h"
-#include "mediastreamer2/msticker.h"
-
-#ifdef WIN32
-#include <malloc.h> /* for alloca */
-#endif
-
-#include <mmsystem.h>
-#ifdef _MSC_VER
-#include <mmreg.h>
-#endif
-#include <msacm.h>
-
-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_playing<MAX_WAVEHDR)
-                               {
-                                       ms_mutex_lock(&d->mutex);
-                                   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 (executable)
index 56c8d40..0000000
+++ /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 <mmsystem.h>
-#ifdef _MSC_VER
-#include <mmreg.h>
-#endif
-#include <msacm.h>
-
-#if defined(_WIN32_WCE)
-/*#define DISABLE_SPEEX */
-/*#define WCE_OPTICON_WORKAROUND 1000 */
-#endif
-#ifndef DISABLE_SPEEX
-#include <speex/speex_preprocess.h>
-#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;i<WINSND_NBUFS;++i){
-               WAVEHDR *hdr=&d->hdrs_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;i<WINSND_NBUFS;++i){
-               WAVEHDR *hdr=&d->hdrs_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;i<WINSND_NBUFS;++i){
-               WAVEHDR *hdr=&d->hdrs_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;i<WINSND_OUT_NBUFS;++i){
-               WAVEHDR *hdr=&d->hdrs_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;i<WINSND_OUT_NBUFS;++i){
-               WAVEHDR *hdr=&d->hdrs_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;i<d->stat_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 (executable)
index a554a15..0000000
+++ /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 <mmsystem.h>
-#ifdef _MSC_VER
-#include <mmreg.h>
-#endif
-#include <msacm.h>
-
-#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;i<WINSND_NBUFS;++i){
-               WAVEHDR *hdr=&d->hdrs_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;i<WINSND_NBUFS;++i){
-               WAVEHDR *hdr=&d->hdrs_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;i<WINSND_NBUFS;++i){
-               WAVEHDR *hdr=&d->hdrs_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;i<WINSND_OUT_NBUFS;++i){
-               WAVEHDR *hdr=&d->hdrs_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;i<WINSND_OUT_NBUFS;++i){
-               WAVEHDR *hdr=&d->hdrs_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 (file)
index fe539fe..0000000
+++ /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 <mmsystem.h>
-#ifdef _MSC_VER
-#include <mmreg.h>
-#endif
-#include <msacm.h>
-
-#include <dsound.h>
-#include <dsconf.h>\r
-
-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}};\r
-const GUID DSPROPSETID_DirectSoundDevice = {0x84624f82, 0x25ec, 0x11d1, {0xa4, 0xd8, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca}};\r
-
-#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)\r
-{ \r
-    LPKSPROPERTYSET         pKsPropertySet = NULL; \r
-    LPCLASSFACTORY          pClassFactory  = NULL; \r
-    HRESULT                 hr;\r
-       BOOL                                    retval = FALSE;\r
-\r
-       PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA psDirectSoundDeviceDescription = NULL; \r
-       DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA sDirectSoundDeviceDescription;\r
-\r
-       memset(&sDirectSoundDeviceDescription,0,sizeof(sDirectSoundDeviceDescription)); \r
-\r
-    hr = ms_DllGetClassObject (CLSID_DirectSoundPrivate, IID_IClassFactory, (LPVOID *)&pClassFactory );\r
-\r
-    if(SUCCEEDED(hr)) \r
-    { \r
-        hr = pClassFactory->CreateInstance ( NULL, IID_IKsPropertySet, (LPVOID *)&pKsPropertySet ); \r
-    } \r
-\r
-    // Release the class factory \r
-    if(pClassFactory) \r
-    { \r
-        pClassFactory->Release(); \r
-    }\r
-\r
-    if(SUCCEEDED(hr)) \r
-       { \r
-               ULONG ulBytesReturned = 0;\r
-               sDirectSoundDeviceDescription.DeviceId = i_sGUID; \r
-\r
-               // On the first call the final size is unknown so pass the size of the struct in order to receive\r
-               // "Type" and "DataFlow" values, ulBytesReturned will be populated with bytes required for struct+strings.\r
-        hr = pKsPropertySet->Get(DSPROPSETID_DirectSoundDevice, \r
-                DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION, \r
-                NULL, \r
-                0, \r
-                &sDirectSoundDeviceDescription, \r
-                sizeof(sDirectSoundDeviceDescription), \r
-                &ulBytesReturned\r
-            ); \r
-\r
-               if (ulBytesReturned)\r
-               {\r
-                       // On the first call it notifies us of the required amount of memory in order to receive the strings.\r
-                       // Allocate the required memory, the strings will be pointed to the memory space directly after the struct.\r
-                       psDirectSoundDeviceDescription = (PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA)new BYTE[ulBytesReturned];\r
-                       *psDirectSoundDeviceDescription = sDirectSoundDeviceDescription;\r
-\r
-                       hr = pKsPropertySet->Get(DSPROPSETID_DirectSoundDevice, \r
-                                       DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION, \r
-                                       NULL, \r
-                                       0, \r
-                                       psDirectSoundDeviceDescription, \r
-                                       ulBytesReturned, \r
-                                       &ulBytesReturned\r
-                               ); \r
-\r
-                       *dwWaveID  = psDirectSoundDeviceDescription->WaveDeviceId;\r
-                       delete [] psDirectSoundDeviceDescription;\r
-                       retval = TRUE;\r
-               }\r
-\r
-               pKsPropertySet->Release(); \r
-       } \r
-\r
-       return retval; \r
-} \r
-
-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,
-               &current_playOffset, &currentWriteOffset );
-
-       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 (file)
index 91c123b..0000000
+++ /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 <winuser.h>
-#include <Windows.h>
-
-#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 (executable)
index eb64ae2..0000000
+++ /dev/null
@@ -1,505 +0,0 @@
-/*\r
-mediastreamer2 library - modular sound and video processing and streaming\r
-Copyright (C) 2006  Simon MORLAT (simon.morlat@linphone.org)\r
-\r
-This program is free software; you can redistribute it and/or\r
-modify it under the terms of the GNU General Public License\r
-as published by the Free Software Foundation; either version 2\r
-of the License, or (at your option) any later version.\r
-\r
-This program is distributed in the hope that it will be useful,\r
-but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-GNU General Public License for more details.\r
-\r
-You should have received a copy of the GNU General Public License\r
-along with this program; if not, write to the Free Software\r
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\r
-*/\r
-\r
-#include "mediastreamer2/msvideo.h"\r
-#include "mediastreamer2/msticker.h"\r
-#include "mediastreamer2/msv4l.h"\r
-#include "Vfw.h"\r
-#include <winuser.h>\r
-#include <Windows.h>\r
-\r
-#include "mediastreamer2/mswebcam.h"\r
-\r
-#ifndef AVSTREAMMASTER_NONE\r
-#define AVSTREAMMASTER_NONE 1\r
-#endif\r
-\r
-typedef void (*queue_msg_t)(void *, mblk_t *);\r
-\r
-typedef struct VfwEngine{\r
-       ms_thread_t thread;\r
-       char dev[512];\r
-       int devidx;\r
-       HWND capvideo;\r
-       MSVideoSize vsize;\r
-       MSPixFmt pix_fmt;\r
-       queue_msg_t cb;\r
-       void *cb_data;\r
-       bool_t started;\r
-       bool_t configured;\r
-       bool_t thread_running;\r
-}VfwEngine;\r
-\r
-#define VFW_ENGINE_MAX_INSTANCES 9\r
-\r
-static VfwEngine *engines[VFW_ENGINE_MAX_INSTANCES]={0};\r
-\r
-static bool_t try_format(VfwEngine *s, BITMAPINFO *videoformat, MSPixFmt pixfmt){\r
-       MSVideoSize tried_size=s->vsize;\r
-       bool_t ret;\r
-       do{\r
-               capGetVideoFormat(s->capvideo, videoformat, sizeof(BITMAPINFO));\r
-               videoformat->bmiHeader.biSizeImage = 0;\r
-               videoformat->bmiHeader.biWidth  = tried_size.width;\r
-               videoformat->bmiHeader.biHeight = tried_size.height;\r
-               switch(pixfmt){\r
-                       case MS_YUV420P:\r
-                               videoformat->bmiHeader.biBitCount = 12;\r
-                               videoformat->bmiHeader.biCompression=MAKEFOURCC('I','4','2','0');\r
-                       break;\r
-                       case MS_YUY2:\r
-                               videoformat->bmiHeader.biBitCount = 16;\r
-                               videoformat->bmiHeader.biCompression=MAKEFOURCC('Y','U','Y','2');\r
-                       break;\r
-                       case MS_RGB24:\r
-                               videoformat->bmiHeader.biBitCount = 24;\r
-                               videoformat->bmiHeader.biCompression=BI_RGB;\r
-                       break;\r
-                       default:\r
-                               return FALSE;\r
-               }\r
-               ms_message("Trying video size %ix%i",tried_size.width,tried_size.height);\r
-               ret=capSetVideoFormat(s->capvideo, videoformat, sizeof(BITMAPINFO));\r
-               tried_size=ms_video_size_get_just_lower_than(tried_size);\r
-       }while(ret==FALSE && tried_size.width!=0);\r
-       if (ret) {\r
-               /*recheck video format */\r
-               capGetVideoFormat(s->capvideo, videoformat, sizeof(BITMAPINFO));\r
-               s->vsize.width=videoformat->bmiHeader.biWidth;\r
-               s->vsize.height=videoformat->bmiHeader.biHeight;\r
-       }\r
-       return ret;\r
-}\r
-\r
-static int _vfw_engine_select_format(VfwEngine *obj){\r
-       BITMAPINFO videoformat;\r
-       MSPixFmt driver_last;\r
-       char compname[5];\r
-       \r
-       capGetVideoFormat(obj->capvideo, &videoformat, sizeof(BITMAPINFO));\r
-       memcpy(compname,&videoformat.bmiHeader.biCompression,4);\r
-       compname[4]='\0';\r
-       ms_message("vfw: camera's current format is '%s' at %ix%i", compname,\r
-                       videoformat.bmiHeader.biWidth,videoformat.bmiHeader.biHeight);\r
-       driver_last=ms_fourcc_to_pix_fmt(videoformat.bmiHeader.biCompression);\r
-       if (driver_last!=MS_PIX_FMT_UNKNOWN && try_format(obj,&videoformat,driver_last)){\r
-               ms_message("Using driver last setting");\r
-               obj->pix_fmt=driver_last;\r
-       }else if (try_format(obj,&videoformat,MS_YUV420P)){\r
-               obj->pix_fmt=MS_YUV420P;\r
-               ms_message("Using YUV420P");\r
-       }else if (try_format(obj,&videoformat,MS_RGB24)){\r
-               obj->pix_fmt=MS_RGB24;\r
-               ms_message("Using RGB24");\r
-       }else if (try_format(obj,&videoformat,MS_YUY2)){\r
-               obj->pix_fmt=MS_YUY2;\r
-               ms_message("Using YUY2");\r
-       }else{\r
-               ms_error("v4w: Failed to set any video format.");\r
-               return -1;\r
-       }\r
-       if (obj->pix_fmt==MS_RGB24){\r
-               if (videoformat.bmiHeader.biHeight>0){\r
-                       obj->pix_fmt=MS_RGB24_REV;\r
-               }\r
-       }\r
-       return 0;\r
-}\r
-\r
-static void dummy(void*p){\r
-}\r
-\r
-LRESULT CALLBACK vfw_engine_stream_callback(HWND hWnd, LPVIDEOHDR lpVHdr)\r
-{\r
-       VfwEngine *s;\r
-       mblk_t *buf;\r
-       int size;\r
-\r
-       s = (VfwEngine *)capGetUserData(hWnd);\r
-       if (s==NULL)\r
-               return FALSE;\r
-\r
-       size = lpVHdr->dwBufferLength;\r
-       if (size>0 && s->cb!=NULL && s->started){\r
-               buf = esballoc(lpVHdr->lpData,size,0,dummy);\r
-               buf->b_wptr+=size;\r
-               s->cb(s->cb_data,buf);\r
-       }\r
-       return TRUE ;\r
-}\r
-\r
-static void *\r
-vfw_engine_thread(void *arg)\r
-{\r
-       VfwEngine *s=(VfwEngine*)arg;\r
-    MSG msg;\r
-\r
-       while(s->thread_running)\r
-       {\r
-               BOOL fGotMessage;\r
-               while((fGotMessage = PeekMessage(&msg, (HWND) s->capvideo, 0, 0, PM_REMOVE)) != 0)\r
-               {\r
-                 TranslateMessage(&msg);\r
-                 DispatchMessage(&msg);\r
-               }\r
-               Sleep(10);\r
-       }\r
-       ms_thread_exit(NULL);\r
-       return NULL;\r
-}\r
-\r
-static void _vfw_engine_unconfigure(VfwEngine *obj){\r
-       if (!capCaptureStop(obj->capvideo)){\r
-               ms_error("vfw: fail to stop capture !");\r
-       }\r
-       obj->thread_running=FALSE;\r
-       ms_thread_join(obj->thread,NULL);\r
-       obj->configured=FALSE;\r
-}\r
-\r
-static void _vfw_engine_disconnect(VfwEngine *obj){\r
-       capDriverDisconnect(obj->capvideo);\r
-       DestroyWindow(obj->capvideo);\r
-       obj->capvideo=NULL;\r
-}\r
-\r
-static void vfw_engine_destroy(VfwEngine *obj){\r
-       if (obj->configured){\r
-               _vfw_engine_unconfigure(obj);\r
-       }\r
-       _vfw_engine_disconnect(obj);\r
-       ms_free(obj);\r
-}\r
-\r
-static int _vfw_engine_setup(VfwEngine *obj){\r
-       CAPTUREPARMS capparam ;\r
-       capCaptureGetSetup(obj->capvideo,&capparam,sizeof(capparam)) ;\r
-       capparam.dwRequestMicroSecPerFrame = 33000 ; /*makes around 30fps*/\r
-       // detach capture from application\r
-       capparam.fYield                    = TRUE ;\r
-       capparam.fMakeUserHitOKToCapture   = FALSE;\r
-       capparam.fAbortLeftMouse           = FALSE;\r
-       capparam.fAbortRightMouse          = FALSE;\r
-       capparam.wPercentDropForError      = 90 ;\r
-       capparam.fCaptureAudio             = FALSE ;\r
-       capparam.fAbortRightMouse       = FALSE;\r
-       capparam.fAbortLeftMouse        = FALSE;\r
-       capparam.AVStreamMaster            = AVSTREAMMASTER_NONE ;\r
-       if (!capCaptureSetSetup(obj->capvideo,&capparam,sizeof(capparam))){\r
-               ms_error("capCaptureSetSetup failed.");\r
-               return -1;\r
-       }\r
-       capSetUserData(obj->capvideo, obj);\r
-       return 0;\r
-}\r
-\r
-static int _vfw_engine_connect(VfwEngine *obj){\r
-       MSVideoSize sz;\r
-       sz.width=MS_VIDEO_SIZE_CIF_W;\r
-       sz.height=MS_VIDEO_SIZE_CIF_H;\r
-       HWND hwnd=capCreateCaptureWindow("Capture Window",WS_CHILD /* WS_OVERLAPPED */\r
-                       ,0,0,sz.width,sz.height,HWND_MESSAGE, 0) ;\r
-\r
-       if (hwnd==NULL) return -1;\r
-       if(!capDriverConnect(hwnd,obj->devidx)){\r
-               ms_warning("vfw: could not connect to capture driver, no webcam connected.");\r
-               DestroyWindow(hwnd);\r
-               return -1;\r
-       }\r
-       obj->capvideo=hwnd;\r
-       obj->vsize=sz;\r
-       return 0;\r
-}\r
-\r
-static VfwEngine * vfw_engine_new(int i){\r
-       char dev[512];\r
-       char ver[512];\r
-       VfwEngine *obj=(VfwEngine*)ms_new0(VfwEngine,1);\r
-       if (capGetDriverDescription(i, dev, sizeof (dev),\r
-               ver, sizeof (ver))){\r
-               obj->devidx=i;\r
-               if (_vfw_engine_connect(obj)==-1){\r
-                       ms_free(obj);\r
-                       return NULL;\r
-               }\r
-               strcpy(obj->dev,dev);\r
-               engines[i]=obj;\r
-               return obj;\r
-       }\r
-       return NULL;\r
-}\r
-\r
-static void _vfw_engine_configure(VfwEngine *obj){\r
-       if (_vfw_engine_setup(obj)==-1){\r
-               return;\r
-       }\r
-       if (_vfw_engine_select_format(obj)==-1){\r
-               return ;\r
-       }\r
-       capSetCallbackOnVideoStream(obj->capvideo, vfw_engine_stream_callback);\r
-       if (!capCaptureSequenceNoFile(obj->capvideo)){\r
-               ms_error("vfw: fail to start capture !");\r
-       }\r
-       ms_thread_create(&obj->thread,NULL,vfw_engine_thread,obj);\r
-       obj->configured=TRUE;\r
-}\r
-\r
-static MSPixFmt vfw_engine_get_pix_fmt(VfwEngine *obj){\r
-       if (!obj->configured)\r
-               _vfw_engine_configure(obj); \r
-       return obj->pix_fmt;\r
-}\r
-\r
-static MSVideoSize vfw_engine_get_video_size(VfwEngine *obj){\r
-       return obj->vsize;\r
-}\r
-\r
-static void vfw_engine_set_video_size(VfwEngine *obj, MSVideoSize vsize){\r
-       if (!obj->configured)\r
-               obj->vsize=vsize;\r
-       else if (ms_video_size_greater_than(vsize,obj->vsize) && !ms_video_size_equal(vsize,obj->vsize) ){\r
-               _vfw_engine_unconfigure(obj);\r
-               _vfw_engine_disconnect(obj);\r
-               _vfw_engine_connect(obj);\r
-               obj->vsize=vsize;\r
-               _vfw_engine_configure(obj);\r
-       }\r
-}\r
-\r
-static void vfw_engine_set_callback(VfwEngine* obj, queue_msg_t cb, void *cb_data){\r
-       obj->cb=cb;\r
-       obj->cb_data=cb_data;\r
-}\r
-\r
-static void vfw_engine_start_capture(VfwEngine *obj){\r
-       if (!obj->configured) _vfw_engine_configure(obj);\r
-       obj->started=TRUE;\r
-}\r
-\r
-static void vfw_engine_stop_capture(VfwEngine *obj){\r
-       obj->started=FALSE;\r
-}\r
-\r
-static void vfw_engines_free(void){\r
-       int i;\r
-       for(i=0;i<VFW_ENGINE_MAX_INSTANCES;++i){\r
-               if (engines[i])\r
-                       vfw_engine_destroy(engines[i]);\r
-       }\r
-}\r
-\r
-\r
-typedef struct VfwState{\r
-       MSVideoSize vsize;\r
-       queue_t rq;\r
-       ms_mutex_t mutex;\r
-       int frame_ind;\r
-       int frame_max;\r
-       float fps;\r
-       float start_time;\r
-       int frame_count;\r
-       VfwEngine *eng;\r
-} VfwState;\r
-\r
-\r
-static void vfw_init(MSFilter *f){\r
-       VfwState *s=(VfwState *)ms_new0(VfwState,1);\r
-       s->vsize.width=MS_VIDEO_SIZE_CIF_W;\r
-       s->vsize.height=MS_VIDEO_SIZE_CIF_H;\r
-       qinit(&s->rq);\r
-       ms_mutex_init(&s->mutex,NULL);\r
-       s->start_time=0;\r
-       s->frame_count=-1;\r
-       s->fps=15;\r
-       f->data=s;\r
-}\r
-\r
-\r
-\r
-static void vfw_uninit(MSFilter *f){\r
-       VfwState *s=(VfwState*)f->data;\r
-       flushq(&s->rq,0);\r
-       ms_mutex_destroy(&s->mutex);\r
-       ms_free(s);\r
-}\r
-\r
-static void vfw_callback(void *data, mblk_t *m){\r
-       VfwState *s=(VfwState*)data;\r
-       ms_mutex_lock(&s->mutex);\r
-       putq(&s->rq,m);\r
-       ms_mutex_unlock(&s->mutex);\r
-}\r
-\r
-static void vfw_preprocess(MSFilter * obj){\r
-       VfwState *s=(VfwState*)obj->data;\r
-       if (s->eng==NULL) s->eng=engines[0];\r
-       vfw_engine_set_callback(s->eng,vfw_callback,s);\r
-       vfw_engine_start_capture(s->eng);\r
-}\r
-\r
-static void vfw_postprocess(MSFilter * obj){\r
-       VfwState *s=(VfwState*)obj->data;\r
-       vfw_engine_stop_capture(s->eng);\r
-       flushq(&s->rq,0);\r
-}\r
-\r
-static void vfw_process(MSFilter * obj){\r
-       VfwState *s=(VfwState*)obj->data;\r
-       mblk_t *m;\r
-       uint32_t timestamp;\r
-       int cur_frame;\r
-\r
-       if (s->frame_count==-1){\r
-               s->start_time=(float)obj->ticker->time;\r
-               s->frame_count=0;\r
-       }\r
-\r
-       cur_frame=(int)((obj->ticker->time-s->start_time)*s->fps/1000.0);\r
-       if (cur_frame>s->frame_count){\r
-               mblk_t *om=NULL;\r
-               /*keep the most recent frame if several frames have been captured */\r
-               if (s->eng!=NULL){\r
-                       ms_mutex_lock(&s->mutex);\r
-                       while((m=getq(&s->rq))!=NULL){\r
-                               ms_mutex_unlock(&s->mutex);\r
-                               if (om!=NULL) freemsg(om);\r
-                               om=m;\r
-                               ms_mutex_lock(&s->mutex);\r
-                       }\r
-                       ms_mutex_unlock(&s->mutex);\r
-               }\r
-               if (om!=NULL){\r
-                       timestamp=(uint32_t)(obj->ticker->time*90);/* rtp uses a 90000 Hz clockrate for video*/\r
-                       mblk_set_timestamp_info(om,timestamp);\r
-                       ms_queue_put(obj->outputs[0],om);\r
-               }\r
-               s->frame_count++;\r
-       }\r
-}\r
-\r
-static int vfw_set_fps(MSFilter *f, void *arg){\r
-       VfwState *s=(VfwState*)f->data;\r
-       s->fps=*((float*)arg);\r
-       return 0;\r
-}\r
-\r
-static int vfw_get_pix_fmt(MSFilter *f,void *arg){\r
-       VfwState *s=(VfwState*)f->data;\r
-       MSPixFmt fmt=vfw_engine_get_pix_fmt(s->eng);\r
-       *((MSPixFmt*)arg)=fmt;\r
-       return 0;\r
-}\r
-\r
-static int vfw_set_vsize(MSFilter *f, void *arg){\r
-       VfwState *s=(VfwState*)f->data;\r
-       s->vsize=*((MSVideoSize*)arg);\r
-       vfw_engine_set_video_size(s->eng,s->vsize);\r
-       return 0;\r
-}\r
-\r
-static int vfw_get_vsize(MSFilter *f, void *arg){\r
-       VfwState *s=(VfwState*)f->data;\r
-       MSVideoSize *vs=(MSVideoSize*)arg;\r
-       *vs=vfw_engine_get_video_size(s->eng);\r
-       return 0;\r
-}\r
-\r
-static MSFilterMethod methods[]={\r
-       {       MS_FILTER_SET_FPS       ,       vfw_set_fps     },\r
-       {       MS_FILTER_GET_PIX_FMT   ,       vfw_get_pix_fmt },\r
-       {       MS_FILTER_SET_VIDEO_SIZE, vfw_set_vsize },\r
-       {       MS_FILTER_GET_VIDEO_SIZE, vfw_get_vsize },\r
-       {       0                                                               ,       NULL                    }\r
-};\r
-\r
-#ifdef _MSC_VER\r
-\r
-MSFilterDesc ms_vfw_desc={\r
-       MS_VFW_ID,\r
-       "MSVfw",\r
-       N_("A video for windows (vfw.h) based source filter to grab pictures."),\r
-       MS_FILTER_OTHER,\r
-       NULL,\r
-       0,\r
-       1,\r
-       vfw_init,\r
-       vfw_preprocess,\r
-       vfw_process,\r
-       vfw_postprocess,\r
-       vfw_uninit,\r
-       methods\r
-};\r
-\r
-#else\r
-\r
-MSFilterDesc ms_vfw_desc={\r
-       .id=MS_VFW_ID,\r
-       .name="MSVfw",\r
-       .text=N_("A video for windows (vfw.h) based source filter to grab pictures."),\r
-       .ninputs=0,\r
-       .noutputs=1,\r
-       .category=MS_FILTER_OTHER,\r
-       .init=vfw_init,\r
-       .preprocess=vfw_preprocess,\r
-       .process=vfw_process,\r
-       .postprocess=vfw_postprocess,\r
-       .uninit=vfw_uninit,\r
-       .methods=methods\r
-};\r
-\r
-#endif\r
-\r
-MS_FILTER_DESC_EXPORT(ms_vfw_desc)\r
-\r
-static void ms_vfw_detect(MSWebCamManager *obj);\r
-\r
-static void ms_vfw_cam_init(MSWebCam *cam){\r
-}\r
-\r
-\r
-static MSFilter *ms_vfw_create_reader(MSWebCam *obj){\r
-       MSFilter *f= ms_filter_new_from_desc(&ms_vfw_desc);\r
-       VfwState *s=(VfwState*)f->data;\r
-       s->eng=(VfwEngine*)obj->data;\r
-       return f;\r
-}\r
-\r
-MSWebCamDesc ms_vfw_cam_desc={\r
-       "VideoForWindows grabber",\r
-       &ms_vfw_detect,\r
-       &ms_vfw_cam_init,\r
-       &ms_vfw_create_reader,\r
-       NULL\r
-};\r
-\r
-static void ms_vfw_detect(MSWebCamManager *obj){\r
-       int i;\r
-       MSWebCam *cam;\r
-       for (i = 0; i < VFW_ENGINE_MAX_INSTANCES; i++){\r
-               VfwEngine *eng;\r
-               if ((eng=vfw_engine_new(i))!=NULL){\r
-                       cam=ms_web_cam_new(&ms_vfw_cam_desc);\r
-                       cam->data=(void*)eng;/*store the engine */\r
-                       cam->name=ms_strdup(eng->dev);\r
-                       ms_web_cam_manager_add_cam(obj,cam);\r
-               }\r
-       }\r
-       atexit(vfw_engines_free);\r
-}\r
-\r
diff --git a/linphone/mediastreamer2/src/winvideods.c b/linphone/mediastreamer2/src/winvideods.c
deleted file mode 100644 (file)
index bd442e3..0000000
+++ /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 <libavcodec/avcodec.h>
-#else
-#include <ffmpeg/avcodec.h>
-#endif
-
-#include <dshow.h>
-#include <dmodshow.h>
-#include <dmoreg.h>
-
-#include <streams.h>
-#include <initguid.h>
-
-#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( ;pLine1<pLine2;pLine2-=(iLineLen*2))
-                       {
-                               for(iIndex=0;iIndex!=iLineLen;pLine1++,pLine2++,iIndex++)
-                               {
-                                       tmp=*pLine1;
-                                       *pLine1=*pLine2;
-                                       *pLine2=tmp;       
-                               }
-                       }
-               }
-               buf->b_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 (file)
index eeece43..0000000
+++ /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 (file)
index 443b0ed..0000000
+++ /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 (file)
index a7c1272..0000000
+++ /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 <signal.h>
-
-#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;pos<bench->num_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 (file)
index ca2ddbf..0000000
+++ /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 <signal.h>
-#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 (file)
index c15362f..0000000
+++ /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 <math.h>
-
-#include "mediastreamer2/mediastream.h"
-#include "mediastreamer2/msequalizer.h"
-#include "mediastreamer2/msvolume.h"
-#ifdef VIDEO_ENABLED
-#include "mediastreamer2/msv4l.h"
-#endif
-
-#include <signal.h>
-#include <sys/types.h>
-#ifndef WIN32
-#include <unistd.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-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 <port> --remote <ip:port> --payload <payload type number>\n"
-                                                               "[ --fmtp <fmtpline>]\n"
-                                                               "[ --jitter <miliseconds>]\n"
-                                                               "[ --width <pixels>]\n"
-                                                               "[ --height <pixels> ]\n"
-                                                               "[ --bitrate <bits per seconds>]\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 <index>] \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;i<argc;i++){
-               if (strcmp(argv[i],"--local")==0){
-                       i++;
-                       localport=atoi(argv[i]);
-               }else if (strcmp(argv[i],"--remote")==0){
-                       i++;
-                       if (!parse_addr(argv[i],ip,sizeof(ip),&remoteport)) {
-                               printf(usage);
-                               return -1;
-                       }
-                       printf("Remote addr: ip=%s port=%i\n",ip,remoteport);
-               }else if (strcmp(argv[i],"--payload")==0){
-                       i++;
-                       payload=atoi(argv[i]);
-               }else if (strcmp(argv[i],"--fmtp")==0){
-                       i++;
-                       fmtp=argv[i];
-               }else if (strcmp(argv[i],"--jitter")==0){
-                       i++;
-                       jitter=atoi(argv[i]);
-               }else if (strcmp(argv[i],"--bitrate")==0){
-                       i++;
-                       bitrate=atoi(argv[i]);
-               }else if (strcmp(argv[i],"--width")==0){
-                       i++;
-                       vs.width=atoi(argv[i]);
-               }else if (strcmp(argv[i],"--height")==0){
-                       i++;
-                       vs.height=atoi(argv[i]);
-               }else if (strcmp(argv[i],"--capture-card")==0){
-                       i++;
-                       capture_card=argv[i];
-               }else if (strcmp(argv[i],"--ec")==0){
-                       ec=TRUE;
-               }else if (strcmp(argv[i],"--agc")==0){
-                       agc=TRUE;
-               }else if (strcmp(argv[i],"--eq")==0){
-                       eq=TRUE;
-               }else if (strcmp(argv[i],"--ng")==0){
-                       use_ng=1;
-               }else if (strcmp(argv[i],"--ng-threshold")==0){
-                       i++;
-                       ng_threshold=atof(argv[i]);
-               }
-       }
-
-       run_media_streams(localport,ip,remoteport,payload,fmtp,jitter,bitrate,vs,ec,agc,eq);
-       return 0;
-}
-
-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)
-{
-       AudioStream *audio=NULL;
-#ifdef VIDEO_ENABLED
-       VideoStream *video=NULL;
-#endif
-       RtpSession *session=NULL;
-       PayloadType *pt;
-       RtpProfile *profile=rtp_profile_clone_full(&av_profile);
-       OrtpEvQueue *q=ortp_ev_queue_new();     
-
-       ms_init();
-       signal(SIGINT,stop_handler);
-       pt=rtp_profile_get_payload(profile,payload);
-       if (pt==NULL){
-               printf("Error: no payload defined with number %i.",payload);
-               exit(-1);
-       }
-       if (fmtp!=NULL) payload_type_set_send_fmtp(pt,fmtp);
-       if (bitrate>0) 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 <delay ms> <tail_length ms'\n");
-    while(fgets(commands,sizeof(commands)-1,stdin)!=NULL){
-      int active,freq,freq_width;
-      int delay_ms, tail_ms;
-      float gain;
-      if (sscanf(commands,"eq active %i",&active)==1){
-        audio_stream_enable_equalizer(audio,active);
-        printf("OK\n");
-      }else if (sscanf(commands,"eq %i %f %i",&freq,&gain,&freq_width)==3){
-        audio_stream_equalizer_set_gain(audio,freq,gain,freq_width);
-        printf("OK\n");
-      }else if (sscanf(commands,"eq %i %f",&freq,&gain)==2){
-        audio_stream_equalizer_set_gain(audio,freq,gain,0);
-        printf("OK\n");
-      }else if (strstr(commands,"dump")){
-        int n=0,i;
-        float *t;
-        ms_filter_call_method(audio->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;i<n;++i){
-          if (fabs(t[i]-1)>0.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 (file)
index 92f2285..0000000
+++ /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 (file)
index 8751eff..0000000
+++ /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 (file)
index 843b4e0..0000000
+++ /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;
-}