pax_global_header00006660000000000000000000000064123344143230014511gustar00rootroot0000000000000052 comment=7e36704e1668c8b4b709e5b20f1482915b825bbf libmediastreamer-x264-1.4.2/000075500000000000000000000000001233441432300155255ustar00rootroot00000000000000libmediastreamer-x264-1.4.2/.empty000064400000000000000000000000001233441432300166520ustar00rootroot00000000000000libmediastreamer-x264-1.4.2/.gear/000075500000000000000000000000001233441432300165215ustar00rootroot00000000000000libmediastreamer-x264-1.4.2/.gear/rules000064400000000000000000000000631233441432300175750ustar00rootroot00000000000000tar: . name=@name@-@version@ base=@name@-@version@ libmediastreamer-x264-1.4.2/.gitignore000064400000000000000000000002541233441432300175160ustar00rootroot00000000000000Makefile Makefile.in aclocal.m4 autom4te.cache config.guess config.log config.status config.sub configure depcomp install-sh libtool ltmain.sh missing .deps *.lo *.o *.la libmediastreamer-x264-1.4.2/AUTHORS000064400000000000000000000000501233441432300165700ustar00rootroot00000000000000Simon Morlat libmediastreamer-x264-1.4.2/Android.mk000064400000000000000000000005171233441432300174410ustar00rootroot00000000000000LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libmsx264 LOCAL_SRC_FILES = src/msx264.c LOCAL_C_INCLUDES += \ $(LOCAL_PATH)/../linphone/oRTP/include \ $(LOCAL_PATH)/../linphone/mediastreamer2/include \ $(LOCAL_PATH)/../externals/x264 LOCAL_CFLAGS += -DVERSION=\"android\" include $(BUILD_STATIC_LIBRARY) libmediastreamer-x264-1.4.2/COPYING000064400000000000000000000431221233441432300165620ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. libmediastreamer-x264-1.4.2/ChangeLog000064400000000000000000000000001233441432300172650ustar00rootroot00000000000000libmediastreamer-x264-1.4.2/INSTALL000064400000000000000000000363321233441432300165650ustar00rootroot00000000000000Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. 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. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. 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, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. 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. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. 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 `..'. This is known as a "VPATH" build. 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', where PREFIX must be an absolute file name. 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. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= 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'. 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. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. libmediastreamer-x264-1.4.2/Makefile.am000064400000000000000000000026201233441432300175610ustar00rootroot00000000000000EXTRA_DIST=autogen.sh SUBDIRS=src build 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=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 libmediastreamer-x264-1.4.2/NEWS000064400000000000000000000012451233441432300162260ustar00rootroot00000000000000February 11, 2011 : 1.4.1 - add visual studio files and fix compilation problems for this platform - updated for recent x264 Tuesday February 9, 2010 : msx264-1.3.1 - important fix: force output stream to be baseline (became high profile with lastest x264 deliveries). 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 libmediastreamer-x264-1.4.2/README000064400000000000000000000004321233441432300164040ustar00rootroot00000000000000msx264 - 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 libmediastreamer-x264-1.4.2/autogen.sh000075500000000000000000000013171233441432300175300ustar00rootroot00000000000000#!/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 if test -d /share/aclocal ; then ACLOCAL_ARGS="-I /share/aclocal" fi echo "Generating build scripts in msx264..." set -x $LIBTOOLIZE --copy --force $ACLOCAL $ACLOCAL_ARGS #autoheader $AUTOMAKE --force-missing --add-missing --copy autoconf libmediastreamer-x264-1.4.2/build/000075500000000000000000000000001233441432300166245ustar00rootroot00000000000000libmediastreamer-x264-1.4.2/build/Makefile.am000064400000000000000000000000141233441432300206530ustar00rootroot00000000000000SUBDIRS=vs libmediastreamer-x264-1.4.2/build/vs/000075500000000000000000000000001233441432300172545ustar00rootroot00000000000000libmediastreamer-x264-1.4.2/build/vs/Makefile.am000064400000000000000000000000461233441432300213100ustar00rootroot00000000000000EXTRA_DIST= msx264.sln msx264.vcproj libmediastreamer-x264-1.4.2/build/vs/msx264.sln000064400000000000000000000015551233441432300210430ustar00rootroot00000000000000 Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msx264", "msx264.vcproj", "{8A4A1340-5B83-4698-8F2A-B8DCCA0C3285}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {8A4A1340-5B83-4698-8F2A-B8DCCA0C3285}.Debug|Win32.ActiveCfg = Debug|Win32 {8A4A1340-5B83-4698-8F2A-B8DCCA0C3285}.Debug|Win32.Build.0 = Debug|Win32 {8A4A1340-5B83-4698-8F2A-B8DCCA0C3285}.Release|Win32.ActiveCfg = Release|Win32 {8A4A1340-5B83-4698-8F2A-B8DCCA0C3285}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal libmediastreamer-x264-1.4.2/build/vs/msx264.vcproj000064400000000000000000000114611233441432300215470ustar00rootroot00000000000000 libmediastreamer-x264-1.4.2/configure.ac000064400000000000000000000052651233441432300200230ustar00rootroot00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT([msx264],[1.4.2]) 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.7.0) PKG_CHECK_MODULES(X264, x264 >= 0.67.0) 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 build/Makefile build/vs/Makefile src/Makefile msx264.iss ) libmediastreamer-x264-1.4.2/libmediastreamer-x264.spec000064400000000000000000000030131233441432300224100ustar00rootroot00000000000000Name: libmediastreamer-x264 Version: 1.4.2 Release: alt1.3 Group: System/Libraries Summary: A H264 codec mediastreamer plugin License: GPLv2+ Url: http://www.linphone.org/eng/download/git.html Packager: Alexei Takaseev Source: %name-%version.tar BuildPreReq: libortp-devel >= 0.16 BuildRequires: libmediastreamer-devel >= 2.8.0 BuildRequires: libx264-devel %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. This package contains a H264 codec mediastreamer plugin. %prep %setup %autoreconf %build %configure %make_build %install %makeinstall_std %files %_libdir/mediastreamer/plugins/* %changelog * Tue May 13 2014 Sergey Bolshakov 1.4.2-alt1.3 - rebuilt with recent x264, again * Wed Sep 11 2013 Sergey Bolshakov 1.4.2-alt1.2 - rebuilt with recent x264 * Fri Jun 14 2013 Alexei Takaseev 1.4.2-alt1.1 - Rebuild with new libmediastreamer * Mon Jan 30 2012 Sergey Bolshakov 1.4.2-alt1 - updated from git.6ba1b869 * Mon Aug 01 2011 Sergey Bolshakov 1.4.1-alt1.1 - rebuilt with recent libav/x264 * Sat Feb 12 2011 Egor Glukhov 1.4.1-alt1 - 1.4.1 * Fri Jan 14 2011 Egor Glukhov 1.4.0-alt2.git.37e5c9ba - Rebuilt against new libx264 * Wed Jul 28 2010 Egor Glukhov 1.4.0-alt1.git.37e5c9ba - Initial build for Sisyphus libmediastreamer-x264-1.4.2/msx264.iss.in000064400000000000000000000021231233441432300177130ustar00rootroot00000000000000; 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 libmediastreamer-x264-1.4.2/src/000075500000000000000000000000001233441432300163145ustar00rootroot00000000000000libmediastreamer-x264-1.4.2/src/Makefile.am000064400000000000000000000004071233441432300203510ustar00rootroot00000000000000pluginsdir=$(PACKAGE_PLUGINS_DIR) plugins_LTLIBRARIES=libmsx264.la libmsx264_la_SOURCES=msx264.c libmsx264_la_LIBADD=\ $(MEDIASTREAMER_LIBS) \ $(X264_LIBS) libmsx264_la_LDFLAGS=-module -no-undefined AM_CFLAGS= \ $(MEDIASTREAMER_CFLAGS)\ $(X264_CFLAGS) libmediastreamer-x264-1.4.2/src/msx264.c000064400000000000000000000236711233441432300175340ustar00rootroot00000000000000/* mediastreamer2 x264 plugin Copyright (C) 2006-2010 Belledonne Communications SARL (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" #ifdef _MSC_VER #include #endif #include #ifndef VERSION #define VERSION "1.4.1" #endif #define RC_MARGIN 10000 /*bits per sec*/ #define SPECIAL_HIGHRES_BUILD_CRF 28 /* the goal of this small object is to tell when to send I frames at startup: at 2 and 4 seconds*/ typedef struct VideoStarter{ uint64_t next_time; int i_frame_count; }VideoStarter; static void video_starter_init(VideoStarter *vs){ vs->next_time=0; vs->i_frame_count=0; } static void video_starter_first_frame(VideoStarter *vs, uint64_t curtime){ vs->next_time=curtime+2000; } static bool_t video_starter_need_i_frame(VideoStarter *vs, uint64_t curtime){ if (vs->next_time==0) return FALSE; if (curtime>=vs->next_time){ vs->i_frame_count++; if (vs->i_frame_count==1){ vs->next_time+=2000; }else{ vs->next_time=0; } return TRUE; } return FALSE; } typedef struct _EncData{ x264_t *enc; x264_param_t params; MSVideoSize vsize; int bitrate; float fps; int mode; uint64_t framenum; Rfc3984Context *packer; int keyframe_int; VideoStarter starter; bool_t generate_keyframe; }EncData; static void enc_init(MSFilter *f){ EncData *d=ms_new(EncData,1); d->enc=NULL; MS_VIDEO_SIZE_ASSIGN(d->vsize,CIF); d->bitrate=384000; d->fps=30; d->keyframe_int=10; /*10 seconds */ d->mode=0; d->framenum=0; d->generate_keyframe=FALSE; d->packer=NULL; f->data=d; } static void enc_uninit(MSFilter *f){ EncData *d=(EncData*)f->data; ms_free(d); } static void apply_bitrate(MSFilter *f, int target_bitrate){ EncData *d=(EncData*)f->data; x264_param_t *params=&d->params; float bitrate; d->bitrate=target_bitrate; bitrate=(float)d->bitrate*0.92; if (bitrate>RC_MARGIN) bitrate-=RC_MARGIN; params->rc.i_rc_method = X264_RC_ABR; params->rc.i_bitrate=(int)(bitrate/1000); params->rc.f_rate_tolerance=0.1; params->rc.i_vbv_max_bitrate=(int) ((bitrate+RC_MARGIN/2)/1000); params->rc.i_vbv_buffer_size=params->rc.i_vbv_max_bitrate; params->rc.f_vbv_buffer_init=0.5; } static void enc_preprocess(MSFilter *f){ EncData *d=(EncData*)f->data; x264_param_t *params=&d->params; d->packer=rfc3984_new(); rfc3984_set_mode(d->packer,d->mode); rfc3984_enable_stap_a(d->packer,FALSE); #ifdef __arm__ if (x264_param_default_preset(params,"superfast"/*"ultrafast"*/,"zerolatency")) { #else x264_param_default(params); { #endif ms_error("Cannot apply default x264 configuration"); }; 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=13; apply_bitrate(f,d->bitrate); 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_annexb=0; //these parameters must be set so that our stream is baseline params->analyse.b_transform_8x8 = 0; params->b_cabac = 0; params->i_cqm_preset = X264_CQM_FLAT; params->i_bframe = 0; params->analyse.i_weighted_pred = X264_WEIGHTP_NONE; d->enc=x264_encoder_open(params); if (d->enc==NULL) ms_error("Fail to create x264 encoder."); d->framenum=0; video_starter_init(&d->starter); } static void x264_nals_to_msgb(x264_nal_t *xnals, int num_nals, MSQueue * nalus){ int i; mblk_t *m; /*int bytes;*/ for (i=0;ib_wptr,xnals[i].p_payload+4,xnals[i].i_payload-4); m->b_wptr+=xnals[i].i_payload-4; if (xnals[i].i_type==7) { ms_message("A SPS is being sent."); }else if (xnals[i].i_type==8) { ms_message("A PPS is being sent."); } ms_queue_put(nalus,m); } } static void enc_process(MSFilter *f){ EncData *d=(EncData*)f->data; uint32_t ts=f->ticker->time*90LL; mblk_t *im; MSPicture pic; MSQueue nalus; ms_queue_init(&nalus); while((im=ms_queue_get(f->inputs[0]))!=NULL){ if (ms_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; memset(&xpic, 0, sizeof(xpic)); memset(&oxpic, 0, sizeof(oxpic)); /*send I frame 2 seconds and 4 seconds after the beginning */ if (video_starter_need_i_frame(&d->starter,f->ticker->time)) 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); /*if (num_nals == 0) ms_message("Delayed frames info: current=%d max=%d\n", x264_encoder_delayed_frames(d->enc), x264_encoder_maximum_delayed_frames(d->enc)); */ rfc3984_pack(d->packer,&nalus,f->outputs[0],ts); d->framenum++; if (d->framenum==0) video_starter_first_frame(&d->starter,f->ticker->time); }else{ ms_error("x264_encoder_encode() error."); } } freemsg(im); } } static void enc_postprocess(MSFilter *f){ EncData *d=(EncData*)f->data; rfc3984_destroy(d->packer); d->packer=NULL; if (d->enc!=NULL){ x264_encoder_close(d->enc); d->enc=NULL; } } static int enc_get_br(MSFilter *f, void*arg){ EncData *d=(EncData*)f->data; *(int*)arg=d->bitrate; return 0; } static int enc_set_br(MSFilter *f, void *arg){ EncData *d=(EncData*)f->data; d->bitrate=*(int*)arg; if (d->enc){ ms_filter_lock(f); apply_bitrate(f,d->bitrate); if (x264_encoder_reconfig(d->enc,&d->params)!=0){ ms_error("x264_encoder_reconfig() failed."); } ms_filter_unlock(f); return 0; } if (d->bitrate>=1024000){ d->vsize.width = MS_VIDEO_SIZE_SVGA_W; d->vsize.height = MS_VIDEO_SIZE_SVGA_H; d->fps=25; }else if (d->bitrate>=512000){ d->vsize.width = MS_VIDEO_SIZE_VGA_W; d->vsize.height = MS_VIDEO_SIZE_VGA_H; d->fps=25; } else if (d->bitrate>=256000){ d->vsize.width = MS_VIDEO_SIZE_VGA_W; d->vsize.height = MS_VIDEO_SIZE_VGA_H; d->fps=15; }else if (d->bitrate>=170000){ d->vsize.width=MS_VIDEO_SIZE_QVGA_W; d->vsize.height=MS_VIDEO_SIZE_QVGA_H; d->fps=15; }else if (d->bitrate>=128000){ d->vsize.width=MS_VIDEO_SIZE_QCIF_W; d->vsize.height=MS_VIDEO_SIZE_QCIF_H; d->fps=10; }else if (d->bitrate>=64000){ d->vsize.width=MS_VIDEO_SIZE_QCIF_W; d->vsize.height=MS_VIDEO_SIZE_QCIF_H; d->fps=7; }else{ d->vsize.width=MS_VIDEO_SIZE_QCIF_W; d->vsize.height=MS_VIDEO_SIZE_QCIF_H; d->fps=5; } #if defined (ANDROID) || TARGET_OS_IPHONE==1 d->vsize.width=MS_VIDEO_SIZE_QVGA_W; d->vsize.height=MS_VIDEO_SIZE_QVGA_H; d->fps=12; #endif ms_message("bitrate requested...: %d (%d x %d)\n", d->bitrate, d->vsize.width, d->vsize.height); 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_BITRATE , enc_get_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 } }; #ifndef _MSC_VER static MSFilterDesc x264_enc_desc={ .id=MS_FILTER_PLUGIN_ID, .name="MSX264Enc", .text="A H264 encoder based on x264 project", .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 }; #else static MSFilterDesc x264_enc_desc={ MS_FILTER_PLUGIN_ID, "MSX264Enc", "A H264 encoder based on x264 project", MS_FILTER_ENCODER, "H264", 1, 1, enc_init, enc_preprocess, enc_process, enc_postprocess, enc_uninit, enc_methods }; #endif void libmsx264_init(void){ ms_filter_register(&x264_enc_desc); ms_message("ms264-" VERSION " plugin registered."); }